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
Markdown
UTF-8
3,149
2.9375
3
[]
no_license
--- title: "My Snowboarding Hotel" date: 2025-09-12T02:22:12-08:00 description: "Text Tips for Web Success" featured_image: "/images/Text.jpg" tags: ["Text"] --- My Snowboarding Hotel I always loved snowboarding for as long as I can remember. I love the way that snow boarding is a sport that is filled with excitement...
C#
UTF-8
2,158
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Wi...
C#
UTF-8
9,727
2.734375
3
[ "MIT" ]
permissive
using System; using System.Reflection; using Polaroider.Mapping; using Polaroider.Mapping.Formatters; namespace Polaroider { /// <summary> /// the options for the snapshots /// </summary> public class SnapshotOptions { private ILineParser _parser; /// <summary> /// setup the default options...
Java
UTF-8
2,265
3.265625
3
[]
no_license
// Joseph Shaffer // shaffer.567 // CSE 6431 // Programming Assignment // Orders class for orders object import java.util.concurrent.*; import java.util.*; public class Orders { public BlockingQueue<Order> queueOrders; public int orders; public ArrayList<Order> finished = new ArrayList<Order>(); ...
Java
UTF-8
8,031
3.640625
4
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package lab_3; import java.io.*; import java.util.*; import java.lang.*; /** * Represents a library of books * * @au...
C#
UTF-8
530
3.078125
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; namespace DesignPatternSharp.FlyWeight { public class Main { public static void Run(string[] args) { if (args.Length == 0) { Console.WriteLine("Usage: DesignPatternSharp.exe <digits>"); ...
Shell
UTF-8
605
3.171875
3
[]
no_license
#!/bin/bash dir="$1" #echo "Create playlist for $1 ..." if [[ $2 ]]; then list="$2"; else list="$1"; fi pushd "$dir" 2>&1 >/dev/null find . -type f \ -not -name "*.m3u" \ -and -not -name "*.asx" \ -and -not -name "done" \ -and -not -name "errors" \ -and -not -name "*.html" \ -and -not -name "*.js" \ -and -not ...
Python
UTF-8
1,517
3.734375
4
[]
no_license
# Descision Tree Classification # Importing Libraries import pandas as pd import numpy as np import matplotlib.pyplot as plt # Getting the Dataset dataset = pd.read_csv('breast-cancer-wisconsin.csv') X = dataset.iloc[:, 1:-1].values y = dataset.iloc[:, 10].values # Handling Missing Data from sklearn.pre...
C#
UTF-8
1,530
3.84375
4
[]
no_license
using System; namespace auto_ImplProperties { //Creating a new class class Cars { //Auto-implemented properties for get and set public string Colour {get; set; } public string Make {get; set; } public string Gearbox {get; set; } //Constructor public Cars(st...
Python
UTF-8
1,158
3.375
3
[ "Apache-2.0" ]
permissive
import logging import os import tempfile import traceback logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class FileHelper: """ A helper class to work with local file system. The class methods offer methods to create a temporary files and delete the files on local file system. ...
C++
UTF-8
1,678
3.09375
3
[]
no_license
#include <iostream> #include <cstring> #include <map> #include <utility> #include <vector> using namespace std; struct Item { Item() {}; Item(int a, int b) : w(a), p(b) {}; int w, p; }; Item items[30]; map<pair<int, int>, vector<int> > dp; map<pair<int, int>, int> dpVal; vector<int> knapsack(int i, int j) { ...
Java
ISO-8859-1
21,874
2.40625
2
[]
no_license
/* * ProjectSubGUI.java * * Created on 17. November 2006, 13:41 */ package pzm.subgui; import pzm.dbcon.DB_projektzeit_Connect; import java.sql.*; /** * * @author hertel */ public class ProjectSubGUI extends javax.swing.JFrame { private static int status; private static String projectName; pr...
C
UTF-8
236
3.65625
4
[]
no_license
/*Evaluate the area of the circle Area = Pi * R^2*/ #include<stdio.h> int main() { float pi=3.1415, r, area; printf("Enter radius: "); scanf("%f",&r); area = pi*r*r; printf("\nThe area is %.2f square units.\n",area); return 0; }
Markdown
UTF-8
5,992
3.359375
3
[]
no_license
# 21-DAYS-PROGRAMMING-CHALLENGE-ACES ## Object Oriented Programming * DAY 01 * [Class](https://github.com/Shantanu003/21-DAYS-PROGRAMMING-CHALLENGE-ACES/blob/main/DAY_01/Class.cpp) * [Program to check Binary Number](https://github.com/Shantanu003/21-DAYS-PROGRAMMING-CHALLENGE-ACES/blob/main/DAY_01/check_bin...
Python
UTF-8
599
3.484375
3
[]
no_license
def solve1(a, b, c): if a == b == 0: if c == 0: print("Rownanie nieokreslone!") return else: print("Rownanie sprzeczne") return if b == 0: x = float(-c)/float(a) print ("Rozwiazaniem jest prosta: x = %s, y e R") % (x) return if a == 0: y = float(-c)/float(b) print ("Rozwiazani...
C++
UTF-8
1,126
2.703125
3
[ "MIT" ]
permissive
#pragma once #include "GraphicsResource.h" #include <vector> // Simple upload batch system based on temporary commited resources. // Inspired by https://github.com/microsoft/DirectXTK12/wiki/ResourceUploadBatch // (works a bit differently though) class ResourceUploadBatch { public: ResourceUploadBatch(ID3D12Graph...
JavaScript
UTF-8
983
4.03125
4
[]
no_license
var a =1; var b =2; function *foo(){ a++; yield; b = b*a; a=(yield b)+3; } function *bar(){ b--; yield; a = (yield 8) + b; b = a * (yield 2); } //初始化一个生成器创建迭代器 function step(gen){ var it = gen(); var last; return function(){ //不管yield出来的是啥,下一次都把它原样传回去; last = it.next(last).value; }; } var s1 = step(fo...
Java
UTF-8
2,256
2.703125
3
[]
no_license
package main.methods; import main.Settings; import main.Statistics; import others.FileHandle; import java.util.List; public class Mat extends Method { { methodPath = rootPath + "mat/"; } //"todo", "hack", "fixme", "xxx" "workaround","tbd", "dms", "revisit", "notused" public static String[]...
JavaScript
UTF-8
1,386
3.109375
3
[]
no_license
/* Profile Alerts - Alert & Bell indicator */ /* hide: Alert Notifications after initial page load */ ( function() { /* ======================================== Global Scope ======================================== */ var alertMessage = document.getElementById("alerts"); // ...
Python
UTF-8
654
3.515625
4
[]
no_license
#encoding=utf-8 import unittest #创建一个继承于unittest.TestCase类的测试类TC01 class TC01(unittest.TestCase): def setUp(self): print("start") def tearDown(self): print("end") def test_01(self): self.assertEqual("1","1","不相等") #判断实际值【2】是否与预期值【1】相等,如果不等,抛出自定义的异常信息 #assertEqual(预期值,实际值,不相等时...
C++
UTF-8
2,966
2.71875
3
[ "Apache-2.0", "MIT", "CC-BY-NC-SA-4.0" ]
permissive
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ /** * Before running this C++ code example, set up your development environment, including your credentials. * * For more information, see the following documentation topic: * https://docs.aws.amazon....
PHP
UTF-8
2,547
2.90625
3
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-khronos", "MIT", "Apache-2.0" ]
permissive
<?php namespace PHPGlfwAdjustments; use ExtArgument; use ExtFunction; use ExtGenerator; use ExtType; class GLGetShaderInfoLogAdjustment implements AdjustmentInterface { /** * Recieves an instance of the extension generator before beeing built to * make changes / adjustments for the extension to handl...
Markdown
UTF-8
3,551
2.6875
3
[]
no_license
## 扬州繁华以盐胜 + 这是看电视剧[《大清盐商》](https://movie.douban.com/subject/10527210/)和CCTV的纪录片[《扬州盐商》](http://tv.cctv.com/2012/12/15/VIDA1355571671335345.shtml)后,想记录一下的。 + 电视剧只是2017-12-05杭州出差的时候,晚上到酒店看了不到3集,项目有点折腾,后面基本上一到酒店就睡,可看性不大是一方面,也没时间追,其它的就搜了看了下。 + 纪录片倒是2017-12-14中午吃饭的时候看完了,用时25min*4。 ### 《大清盐商》的剧情 + 乾隆年间,因为两...
Java
UTF-8
1,137
1.6875
2
[]
no_license
package com.tencent.mm.plugin.voip.model; import com.tencent.mm.sdk.platformtools.x; import java.util.TimerTask; class b$a extends TimerTask { final /* synthetic */ b sjt; b$a(b bVar) { this.sjt = bVar; } public final void run() { System.currentTimeMillis(); if (b.a(this.sjt)...
Java
UTF-8
314
1.59375
2
[]
no_license
package com.betvictor.test.messaging.actionmonitor.dao; import com.betvictor.test.messaging.actionmonitor.model.Message; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; @Repository public interface MessageDao extends CrudRepository<Message, Long> { }
JavaScript
UTF-8
4,695
3.21875
3
[]
no_license
var triesLeftReset = 15; var triesLeft = triesLeftReset; var wins = 0; var blanks = []; var chosenWord = []; var guessedLetters = []; var restart = true; var checkGuess = function(keyInput) { if (chosenWord.indexOf(keyInput) >= 0) { return true; } else { return false; } }; var guessedWord = function() {...
C++
UTF-8
1,758
2.953125
3
[]
no_license
#include <bits/stdc++.h> #include <string> #include <cstdlib> #include <sstream> using namespace std; string count(int n) { string st = ""; ostringstream tip; int arr[10]; for (int i = 0; i < 10; i++) { arr[i] = 0; } for (int i = 1; i <= n; i++) { if (st == "") ...
PHP
UTF-8
4,305
2.953125
3
[]
no_license
<?php // ($local == TRUE) => lien sur chaque nombre // ($local == FALSE) => Style différent ( class distant) function dateExamenFoad($cnx, $date, $local=TRUE) { $req = "SELECT examens.*, atelier.intitule, session.annee, session.id_session," ; if ( isset($_SESSION["filtres"]["examens"]["lieu"]) AND ($_SESSION["filtr...
Java
UTF-8
332
2.890625
3
[]
no_license
package com.example.observer; /** * @author liubin * @date 2021/08/13 */ public class ConcreteSubject extends Subject { @Override public void notifyObserver() { System.out.println("目标状态发生改变:"); for (Observer observer : observerList) { observer.response(); } } }
C#
UTF-8
1,536
2.5625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Infrastructure.Crosscutting.Declaration { /// <summary> /// 枚举,生成缩略图模式 /// </summary> public enum ThumbnailMod : byte { /// <summary> /// HW /// </summary> HW, /...
Python
UTF-8
1,270
2.640625
3
[]
no_license
import matplotlib.pyplot as plt import numpy as np from sklearn.datasets.samples_generator import make_blobs from processKML import parseKMLforKmeans from sklearn.cluster import KMeans def kmeansKML(nameList,comList,showPlot=False): # X, y_true = make_blobs(n_samples=50, centers=4,cluster_std=0.60, random_state=0...
Shell
UTF-8
1,008
3.171875
3
[]
no_license
#!/usr/bin/env bash USER='cn=nagios,ou=sa,o=services' PASS='n0v3ll' # with heartbeat monitoring #CHECKS='--caw 300 --cac 1800 --csw 500000 --csc 100000 --hbw 300 --hbc 600 --tjw 300 --tjc 600' # only driver state and cache #CHECKS='--caw 300 --cac 1800 --csw 500000 --csc 10000000' CHECKS='--caw 300 --cac 1800' LOGF...
Markdown
UTF-8
618
2.828125
3
[ "MIT" ]
permissive
--- layout: post title: 三种车间类型 category: 智能制造 keywords: typora-root-url: ../../_posts --- ## 正文 flow shop:如果每个作业需要在每个处理机上加工,而且每个作业的工序也相同,即在处理机上加工的顺序相同,则这种多类机的环境称为同顺序作业或流水作业。 job shop:如果每个作业需要在每个处理机上加工,每个作业有自己的加工顺序,称之为异顺序作业。 open shop:如果每个作业需要在每个处理机上加工,每个作业可按任意顺序加工,称之为自由顺序作业或开放作业
Java
UTF-8
2,250
2.171875
2
[ "MIT" ]
permissive
package jp.chang.myclinic.server.db.myclinic; import javax.persistence.*; import java.math.BigDecimal; @Entity @Table(name="visit_conduct_drug") public class ConductDrug { @Id @GeneratedValue(strategy= GenerationType.IDENTITY) @Column(name="id") private Integer conductDrugId; public Integer getConductDrugId(){...
Markdown
UTF-8
515
3.015625
3
[]
no_license
# MazeSolver Data Structure Final Project in 2020 Fall ## Description - Input the size of the maze and it can automatically generate the picture of the maze. - Click on the picture of the maze to choose the start point and the end point, then it will show the shortest path from the start to the end. <img src="assest...
Java
UTF-8
2,164
2.671875
3
[]
no_license
package net.todd.games.boardgame; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import java.util.Arrays; import java.util.List; import java.util.UUID; import javax.vecmath.Vector3f; i...
C++
UTF-8
509
3.09375
3
[]
no_license
#include <queue\array.h> class element { private: public: double g; double h; double f; int x; int y; bool closed; bool obstructed; array<bool>* WPAcess; element() {} element(double G, double H, double F, int X, int Y, bool Ob) :g(G), h(H), f(F), x(X), y(Y), obstructed(Ob) { closed = 0; ...
Markdown
UTF-8
2,162
2.75
3
[]
no_license
--- layout: post title: Increasing Your Market Share in a Hot Market date: 2018-05-10 15:38:00 tags: excerpt: >- On this episode, we talk about what it takes to grow your business when the market is up. enclosure: >- https://s3.amazonaws.com/vyralmarketing/Greg+Harrelson/Recruiting/Increasing+Your+Market.mp4 pull...
Go
UTF-8
988
2.6875
3
[]
no_license
package main import ( "fmt" "log" "time" "net" "strings" "context" pb "github.com/chukmunnlee/grpc/echo/messages" grpc "google.golang.org/grpc" ptypes "github.com/golang/protobuf/ptypes" ) type server struct{ } func (*server) Echo(ctx context.Context, req *pb.EchoRequest) (*pb.EchoResponse, error) { ech...
C++
UTF-8
697
2.671875
3
[]
no_license
#include <bits/stdc++.h> using namespace std; int powmod (int a, int b, int m) { int res = 1; while (b > 0) if (b & 1) { res = (res * a) % m; --b; } else { a = (a * a) % m; b >>= 1; } return res % m; } int solve (int a, int b, int m) { int n = (int) sqrt (m + .0) + 1; map<int,int> vals; fo...
JavaScript
UTF-8
1,704
2.9375
3
[]
no_license
(function () { var e = getDomElements(); e.searchInput.addEventListener('keydown', doSearch); function doSearch(event) { var keycode = event.keyCode || event.which; if (e.searchInput.value && keycode === 13) { getGithubUser(e.searchInput.value); } } function g...
Java
UTF-8
1,685
2.46875
2
[]
no_license
package org.yesworkflow.annotations; import org.yesworkflow.YesWorkflowTestCase; import org.yesworkflow.annotations.In; public class TestInWithUri extends YesWorkflowTestCase { @Override public void setUp() throws Exception { super.setUp(); } public void testInComment_NoUri() throws ...
C++
UTF-8
10,775
2.703125
3
[]
no_license
// $Header$ /* ---------------------------------------------------------------------------- treetmpl.C mbwall 25feb95 Copyright 1995 Massachusetts Institute of Technology DESCRIPTION: This defines the templatized tree objects. TO DO: Make insert work better with size and depth so not so many recalcs neede...
JavaScript
UTF-8
840
3.234375
3
[]
no_license
var fs = require('fs') function pReadFile(filePath) { return new Promise(function(resolve,reject) { //console.log(2) fs.readFile(filePath,'utf8',function(err,data) { if(err){ //失败了,承诺容器中的任务失败了 //把容器的Pending状态改变为rejected //调用了reject就相当于调用了then方法的第二个参数 reject(err) }else{ //console.log(3) //承诺容器中...
PHP
UTF-8
12,563
2.640625
3
[ "Apache-2.0" ]
permissive
<?php require_once 'init.php'; require_once CLASSES . 'ResourcePolicy.php'; require_once CLASSES . 'Item.php'; require_once CLASSES . 'ItemMetadata.php'; require_once CLASSES . 'Bitstream.php'; /** * Get all items with last_modified yesterday or today and in_archive=yes * For each item: * check if it has a date.e...
Python
UTF-8
303
4.25
4
[]
no_license
# 1.在控制台获取输入的月份 显示对应的季度 或提示月份错误 month = int(input('请输入月份:')) if month<1 or month>12: print('月份错误') elif month<4: print('春季') elif month<7: print('夏季') elif month<10: print('秋季') else: print('冬季')
Java
UTF-8
537
3.3125
3
[]
no_license
import java.util.Scanner; public class Exercise20_3 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter first number: "); int firstN = input.nextInt(); System.out.print("Enter second number: "); int secondN = input.nextInt(); ...
C++
UTF-8
563
2.6875
3
[]
no_license
#pragma once #include"../MapObjectBase/MapObjectBase.h" /** * @brief 位置などを予約しておく仮想空白ブロッククラス */ class ClearBlock : public MapObjectBase { public: ClearBlock() : MapObjectBase() { // 無しにしておく m_object_tag = Object3DTag::NONE; // オブジェクトとしては使わない m_is_active = false; }; ClearBlock(const MapTag&tag,MapData&d...
Python
UTF-8
899
3.40625
3
[]
no_license
def caiquan(): import random pc=random.randint(1,3) print('我们来玩个猜拳游戏把') a='石头' b='剪刀' c='布' user=input('请输入石头/剪刀/布:') if user=='石头': print('你出了:石头') elif user=='剪刀': print('你出了:剪刀') elif user =='布': print('你出了:布') else: print('输入有误') if pc=...
Python
UTF-8
3,530
2.8125
3
[]
no_license
#!/usr/bin/python # -*- coding: utf-8 -*- import cv2, os import numpy as np from PIL import Image import matplotlib.pyplot as plt import argparse # トレーニング画像 train_path = '/Users/hirto/Desktop/Advanced_SE/implementation/eigenface/train' # テスト画像 test_path = '/Users/hirto/Desktop/Advanced_SE/implementation/eigenface/te...
Swift
UTF-8
3,648
2.609375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// // TransitionNavigationSlideVerticalAnimator.swift // FormsTransitions // // Created by Konrad on 4/15/20. // Copyright © 2020 Limbo. All rights reserved. // import UIKit // MARK: TransitionNavigationSlideVerticalAnimator open class TransitionNavigationSlideVerticalAnimator: TransitionNavigationAnimator { ...
C++
UTF-8
1,672
2.578125
3
[]
no_license
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> #include <vector> #include <queue> #include <cmath> #include <map> #include <stack> #include <unordered_map> #include <set> #include <algorithm> using namespace std; int a[65][1300][130]={0}; bool vis[65][1300][130]={false}; int ...
JavaScript
UTF-8
815
3.375
3
[]
no_license
const musicians = ["John Lennon", "Paul McCartney", "George Harrison", "Ringo Starr"]; const instruments = ["Guitar", "Bass Guitar", "Lead Guitar", "Drums"]; function theBeatlesPlay(musicians, instruments) { var result = [] for (var i = 0; i < musicians.length; i++){ result.push(musicians[i] + ' ' + "pla...
Markdown
UTF-8
1,020
2.828125
3
[]
no_license
# Writing Homework 2 ### Due date: 3/14/2016 ### Length: 500 words or less ### Topic: What YUHSG students should know about Zika Virus. This is a monthly short writing assignment. You should attempt to write a scientific news article at a level of understanding. Though the topic is listed, you can come up with...
Java
UTF-8
4,815
2.796875
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package rmi; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.rmi.registry.LocateRegistry...
JavaScript
UTF-8
143
3.328125
3
[]
no_license
let array = "1 2 3 4 5".split(" "); let splicedArray = array.splice(0, 3); // idempotent operation; factory method console.log(splicedArray);
JavaScript
UTF-8
7,524
2.765625
3
[]
no_license
import React, { Component } from 'react'; import { Link, Redirect } from 'react-router-dom'; import { getGameById, updateGameHistory, updateGameStatus } from '../../http/game'; import './gameboard.css'; function calculateWinner(squares) { const lines = [ [0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], ...
C#
UTF-8
544
2.65625
3
[ "Apache-2.0" ]
permissive
using BenchmarkDotNet.Attributes; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProcessTimeBenchmarking.Benchmarks { public class ArraySortBenchmark { private ArrayTests<long> tests; [GlobalSetup] public v...
C++
UTF-8
560
3.5625
4
[]
no_license
#include <iostream> using namespace std; class Solution { public: int searchInsert(int A[], int n, int target) { if (A == NULL || n == 0) { return 0; } int low = 0, high = n-1; while(low <= high) { int mid = (low+high) / 2; if (A[mid] == target) { return mid; } else if (A[mid] >...
JavaScript
UTF-8
685
2.640625
3
[]
no_license
$(document).ready(function(){ var returnedData = tumblr_api_read; $.each(returnedData.posts, function(i, item){ var activityId = "activity-" + item.id; var activitySelector = "#" + activityId; $("<p/>").attr("id", activityId).appendTo("#activity"); switch(item.type) { case "link"...
C++
UTF-8
6,121
2.703125
3
[]
no_license
#include "logic_thread.h" #include "log.h" #include <string.h> #include <stdlib.h> #include <unistd.h> /************************************* logic event queue *************************************/ #define STACK_ALLOC_THRESHOLD 24 typedef struct logic_event_item LE_ITEM; struct logic_event_item { LE_ITEM *next...
Shell
UTF-8
969
3.5625
4
[]
no_license
#!/bin/sh # bin/compile <build-dir> <cache-dir> set -e BUILD_DIR=$1 CACHE_DIR=$2 # s3 packages PIXMAN_NAME="pixman-0.26.tgz" CAIRO_NAME="cairo-1.12.2.tgz" BUILDPACK_PIXMAN_PACKAGE="https://s3.amazonaws.com/heroku-buildpack-fontforge/pixman-0.26.tgz" BUILDPACK_CAIRO_PACKAGE="https://s3.amazonaws.com/heroku-buildpack...
Java
UTF-8
393
1.53125
2
[]
no_license
package cn.com.struts2.action; import com.opensymphony.xwork2.ActionSupport; public class ForwardAction extends ActionSupport { public String left(){ return "left"; } public String right(){ return "right"; } public String top(){ return "top"; } public String bottom(){ return ...
Markdown
UTF-8
1,768
3.125
3
[]
no_license
# Observer ## 1. 动机 - ### 在软件构建过程中,我们需要为某些对象建立一种“通知依赖关系”---一个对象(目标对象)的状态发生改变,所有的依赖对象(观察者对象)都将得到通知。如果这样的依赖关系过于紧密,将使软件不能很好地抵御变化。 - ### 使用面向对象技术,可以将这种依赖关系弱化,并形成一种稳定的依赖关系。从而实现软件体系结构的松耦合。 --- ## 2. 违背的设计原则 - ### 依赖倒置原则(DIP) - #### 高层模块(稳定)不应该依赖于低层模块(变化),二者都应该依赖于抽象(稳定). - #### 抽象(稳定)不应该依赖于实现细节(变化) ,实现细节应该依赖于抽象(稳定)。 >...
C++
UTF-8
1,001
3.28125
3
[]
no_license
#ifndef EXEMPLAIRE_H #define EXEMPLAIRE_H /* * Classe représentant un exemplaire du problème */ #include <vector> class Exemplaire { public: Exemplaire(int nbPoints); Exemplaire(int nbPoints, std::vector<int>& types, std::vector<int>& maxSentiers, std::vector<std::vector<int> >& couts); ~Exemplaire(); ...
Java
GB18030
6,046
2.09375
2
[]
no_license
package com.main; import java.io.File; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import tool.FileTool; import tool.XMLRead; import com.example.xdownload.R; import android.app.Activity; import android.app.ListActivity; import android....
Markdown
UTF-8
974
3.515625
4
[]
no_license
##### 4.1 a. Which node is the root? A b. Which nodes are leaves? G,H,I,L,M,k --- ##### 4.2 node|parent|children|siblings|depth|height ----|------|--------|--------|-----|------ A|NULL|B,C|NULL|0|4 B|A|D,E|C|1|3 C|A|F|b|1|2 D|B|G,H|E|2|1 E|B|I,J|D|2|2 F|C|K|NULL|2|1 G|D|NULL|H|3|0 H|D|NULL|G|3|0 I|E|NULL|J|3|0 J|E...
C
UTF-8
455
3.109375
3
[]
no_license
/* Function have two categories Library functions predefined libraries User defined functions developed by user Every program in C can be designed using a collection of these black boxes known as functions. */ #include <stdio.h> void printline(void); main() { printline(); printf("this is a function ...
Python
UTF-8
3,554
2.75
3
[]
no_license
from os.path import dirname, join import numpy as np import pandas as pd from bokeh.plotting import figure from bokeh.layouts import layout, widgetbox from bokeh.models import ColumnDataSource, Div, HoverTool from bokeh.models.widgets import Slider, Select, TextInput from bokeh.io import curdoc bgg = pd.read_csv(joi...
Java
UTF-8
213
1.859375
2
[]
no_license
package com.manas.core.oops; public class FirstClass { public static void main(String args[]){ //******************** // Freshers //******************** //What is platform independence } }
Shell
UTF-8
706
3.90625
4
[ "Apache-2.0" ]
permissive
#!/usr/bin/env bash set -e echo "Desired namespaces: $@" for cluster_namespace in "$@" ; do target="${cluster_namespace%/*}" ns="${cluster_namespace##*/}" if [[ -r /etc/k8s-kubeconfig/kubeconfig-${target} ]] ; then export KUBECONFIG="/etc/k8s-kubeconfig/kubeconfig-${target}" echo "Setting KUBECONFIG=$KUB...
C++
UTF-8
817
2.546875
3
[]
no_license
#ifndef RT_LAMBERTIAN_H #define RT_LAMBERTIAN_H #include <rt/brdf/brdf.h> namespace RT { class Lambertian : public IBRDF { public: Lambertian(ISampler* sampler, const glm::vec3& diffuseColor, float diffuseCoefficient); ~Lambertian() override; [[nodiscard]] glm::vec3 ...
C
UTF-8
2,593
2.984375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <errno.h> #include <limits.h> #include "WAV.h" static inline int eswap_s32(int n) { return ((n>>24)&0x000000FF) | ((n>>8)&0x0000FF00) | ((n<<8)&0x00FF0000) | ((n<<24)&0xFF000000); } static inline short eswap_s16(short n) { return (n>>8) | (...
Java
UTF-8
652
2.0625
2
[]
no_license
package com.ljw.spring.mybits.bean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; import com.ljw.spring.mybits.lo...
Java
UTF-8
569
3.0625
3
[]
no_license
package blu3.asteroids.math; import java.awt.*; public class StringListEntry { public final String text; public final int x, y; public final Color colour; public StringListEntry(String text, int x, int y, Color colour) { // ... this.text = text; this.x = x; this.y = y; ...
Markdown
UTF-8
971
2.515625
3
[]
no_license
# Squeak [Squeak](http://squeak.org/) es un creador de "mundos virtuales". Dicho así parece una película de ciencia ficción. En realidad, se trata de una forma metafórica de definir un lenguaje de programación orientado a objetos. Es un desarrollo [open-source](http://es.wikipedia.org/wiki/C%C3%B3digo_abierto), que ...
C++
UTF-8
7,288
2.546875
3
[]
no_license
#include <iostream> #include <string> #include <fstream> #include <conio.h> #include <vector> #include <stdio.h> #include <iomanip> void SeekInfo(); int main() { setlocale(LC_ALL, "Russian"); SeekInfo(); std::cout << "\nПрограмма завершила работу\n"; } void SeekInfo() { std::string inpDiscFile; std::string...
Java
UTF-8
587
2.96875
3
[]
no_license
import java.io.Serializable; /** * Project 4 - SongDataMessage.java * * A message encapsulating the byte data of a song. Multiple of these messages should be sent for each song * because songs should be broken up into segments of 1000 bytes or less. * * @author Emelie Coleman - colem109, sec. L17 * @author Jas...
JavaScript
UTF-8
3,001
2.984375
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ function coordenadas() { var map = new google.maps.Map(document.getElementById('map'), { center: {lat: 3.4516467, lng: -7...
C++
UTF-8
2,757
2.828125
3
[ "MIT" ]
permissive
/// @file /// @brief Contains Switch::System::Threading::RegisteredWaitHandle class. #pragma once #include "../Object.hpp" /// @brief The Switch namespace contains all fundamental classes to access Hardware, Os, System, and more. namespace Switch { /// @brief The System namespace contains fundamental classes and ba...
C++
UTF-8
631
3.359375
3
[ "MIT" ]
permissive
#ifndef ARROW_H #define ARROW_H #include <iostream> void arrow(int, int); void arrow(int actual_pos, int arrow_pos) // Function used for arrow menu // Compares the menu position // If menu position is equal to the arrow position it prints the arrow { if (actual_pos==arrow_pos) std::cout<<" ---->> "; ...
Java
UTF-8
1,418
2.125
2
[]
no_license
package com.example.administrator.myapplication; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.ImageView; /** * Created by cai.jia on...
Java
UTF-8
2,000
2.265625
2
[]
no_license
package com.mybatis.demos.qo; import com.mybatis.demos.domain.User; import java.util.Date; import java.util.List; /** * <p>Title: OrderParam </p> * <p>Description: </p> * <p>Github: https://github.com/lxrocco/ </p> * <p>Gitee: https://gitee.com/LXRocco/ </p> * @author lx * @date 2019/10/13 16:16 * @version 1...
Markdown
UTF-8
4,281
2.984375
3
[]
no_license
# \<currency-converter> Currency converter exercise. Component not published to npm atm. I took the challenge to have 100% test coverage for this. [See it live](http://currency-converter-joren.surge.sh/) This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendations. ## Run demo ```sh...
C
UTF-8
960
3.375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> /* ACCEPTED 0.355s */ /* m, n coprime and m - n odd a = m^2-n^2 b = 2mn c = m^2+n^2 c <= N */ int gcd(int a, int b){ while (b != 0){ int temp = a; a = b; b = temp % b; } return a; } int main() { int ...
Python
UTF-8
5,241
2.8125
3
[ "Apache-2.0" ]
permissive
""" Builds map using Wave Function Collapse. """ from typing import List, Optional, Tuple import numpy as np from ..constants import TILE_SIZE from .wfc_utils import generate_seed from .wfc_wrapping import apply_wfc def generate_2d_map( width: int, height: int, periodic_output: bool = True, N: int ...
SQL
UTF-8
2,583
3.046875
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jun 14, 2017 at 08:03 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE...
C#
UTF-8
1,793
3.296875
3
[ "MIT" ]
permissive
using System.Collections.ObjectModel; using System.Collections.Generic; using System.Linq; using UnityEngine; using System; namespace FelipeUtils.Lambda { public static class ListUtils { static System.Random rng = new System.Random(); /// <summary> /// Randomizes the collection items or...
C#
UTF-8
1,506
2.859375
3
[]
no_license
using System; using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; namespace DotOrg.Libs.ImageProcessing { abstract class CalculateSizeHandler : ImageHandler { protected override bool ProcessInternal(ImageDescriptor descriptor) { var image = (Image)descrip...
Java
UTF-8
3,602
2.859375
3
[]
no_license
package ru.nsu.gordin; import ru.nsu.gordin.controller.*; import ru.nsu.gordin.controller.actions.*; import ru.nsu.gordin.view.DrawPanel; import javax.swing.*; import java.awt.*; import java.awt.event.KeyEvent; public class MainPanel extends JPanel{ protected Action aboutAction, exitAction; public MainPanel...
Shell
UTF-8
2,932
4.15625
4
[ "Apache-2.0" ]
permissive
#!/bin/bash set -euo pipefail function usage() { set +x echo "USAGE: ${0##*/} [--log-level N] [--debug]" echo "Run the Kraan Addon Manager on local machine" echo "options:" echo "'--log-level' N, where N is 1 for debug message or 2 for trace level debugging" echo "'--debug' for verbose output" ...
Java
UTF-8
4,872
1.765625
2
[]
no_license
/* * Decompiled with CFR 0.150. */ package com.mysql.cj.protocol; import com.mysql.cj.MessageBuilder; import com.mysql.cj.Messages; import com.mysql.cj.Session; import com.mysql.cj.TransactionEventHandler; import com.mysql.cj.conf.PropertyKey; import com.mysql.cj.conf.PropertySet; import com.mysql.cj.exceptions.Exce...
TypeScript
UTF-8
237
2.828125
3
[]
no_license
export class Filter { property: string; value: string; operator: string; constructor(property: string, value: string, operator: string) { this.operator = operator; this.property = property; this.value = value; } }
Python
UTF-8
1,466
3.03125
3
[ "MIT" ]
permissive
import requests from bs4 import BeautifulSoup import pickle import re import os # from prog import * # u = user()[1] def scrape_art(art_name): "returns all text in <p> tags in a wikipedia page" rootdir = 'https://en.wikipedia.org/wiki/{}'.format(art_name) headers = {'User-Agent': 'Mozilla/5.0'} page_...
Java
UTF-8
4,070
3.21875
3
[]
no_license
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.HashMap; public class AccountManager { public AccountManager() { accountNo = 0; } static HashMap<Integer, Account> Accounts = new HashMap...
Java
UTF-8
1,135
1.867188
2
[]
no_license
package introduccion; import java.util.Arrays; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation...
C#
UTF-8
2,735
3.03125
3
[]
no_license
using System; using System.Text.RegularExpressions; namespace DynamicReport.Report { public class ReportColumn : IReportColumn { public string Title { get; set; } public string SqlValueExpression { get; set; } public string SqlAlias { get { ...
C#
UTF-8
9,072
2.921875
3
[]
no_license
using RAMS.Data.Infrastructure; using RAMS.Enums; using RAMS.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RAMS.Data.Repositories { /// <summary> /// Candidate repository implements Candidate specific repositor...
C#
UTF-8
1,223
3.078125
3
[]
no_license
using GameSite.Data; using GameSite.Data.Entities; using GameSite.Repository.Interface; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace GameSite.Repository { public class GenreRepository : IGenreRepository { private readonly DataContext _conte...
Java
UTF-8
1,152
2.703125
3
[]
no_license
package otus.java.ageeev.domain; import otus.java.ageeev.exeption.OutOfMaxCapacityInCassette; import static otus.java.ageeev.constatns.AppConstance.MAX_CAPACITY_CASSETTE; public class AtmCassette { private Denomination denomination; private Integer currentCapacity; public AtmCassette(Denomination denomin...