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
1,428
3.171875
3
[]
no_license
# Immutable state vs Mutable state 우선 concurrency(동시성) 과 paralelism(병렬) 차이점에 대해 알아 볼 필요가 있다.. 이 둘은 비슷한 것 같지만 서로 다르다. 옛날에 concurrent 에 대해 두 가지 모델이 있었다. - 1. Shared state concurrency - 2. Message passing concurrency 그 당시 "Message passing concurrency"를 따랐던 언어는 거의 없었고 거의 대부분 엔지니어들은 shared state 쪽이었다. message passing...
Python
UTF-8
3,985
3.046875
3
[ "MIT" ]
permissive
import sqlite3 from utils.store import create_sugg_table, insert, countSuggestionsInDB, getMaxID, getNameOfLastRow, deleteExtraFakeRecord # noqa: E501 from utils.setup import selectshopbyname, selectshops, selectshopbyid, updateshopbyname, updateshopbyservice # noqa: E501 conn = sqlite3.connect('./data/suggestedShop...
Python
UTF-8
351
3.875
4
[]
no_license
sayi1 = float(input("birinci sayı: ")) sayi2 = float(input("ikinci sayı: ")) print("\n") print("========================================") print("toplama sonucu :",sayi1+sayi2) print("çıkarma sonucu :",sayi1-sayi2) print("çarpma sonucu :",sayi1*sayi2) print("bölüm sonucu :",sayi1/sayi2) print("==================...
Java
UTF-8
358
1.585938
2
[]
no_license
package org.archer.archermq.protocol.persistence.domain; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class MsgContent { @Id private String msgId; @Column private String msgKey; @Column private byte[] msgContent; @Column ...
Swift
UTF-8
1,007
3.484375
3
[ "MIT" ]
permissive
// // SelectSort.swift // Interview // // Created by jackfrow on 2019/6/1. // Copyright © 2019 jackfrow. All rights reserved. // import Foundation //选择排序 //选择排序(Selection-sort)是一种简单直观的排序算法。它的工作原理:首先在未排序序列中找到最小(大)元素,存放到排序序列的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序序列的末尾。以此类推,直到所有元素均排序完毕。 func selectionSort(sortArray:...
PHP
WINDOWS-1250
585
2.703125
3
[]
no_license
<?php session_start(); date_default_timezone_set("America/Santiago"); class Conectar { public static function con() { $server = "localhost"; $username = "root"; $password = "sergio81"; $database = "DB_Daincar_V3"; $con = mysqli_connect($server,$username,$password,$database); mysqli_query($con,"SET NAMES 'ut...
Python
UTF-8
224
2.96875
3
[]
no_license
def sum_of_cubes_odd_number(n): if n <= 0: return-1 n = (2*int(n)-1) ans = 0 while n > 0: ans += pow(n, 3) n -= 2 print(ans % 1000000007) return sum_of_cubes_odd_number(567)
Java
UTF-8
579
2.9375
3
[]
no_license
package com.twx.eot; public class ScoreBoard { private int playerOneScore; private int playerTwoScore; public ScoreBoard(int playerOneScore, int playerTwoScore) { this.playerOneScore = playerOneScore; this.playerTwoScore = playerTwoScore; } public int getPlayerOneScore() { ...
Java
UTF-8
591
2.046875
2
[]
no_license
package com.golubev.testtask.service; import com.golubev.testtask.entity.Role; import com.golubev.testtask.entity.User; import com.golubev.testtask.exception.valid.UserStorageServiceException; import java.util.List; public interface UserStorageService { void add(User user) throws UserStorageServiceException; ...
Markdown
UTF-8
516
3.734375
4
[ "Apache-2.0" ]
permissive
# Remap Array Takes an input array and iterates through each object in the the array, creates a new object with only the matching keys from the Values property, and outputs an array of the new objects. For example, given this input array of objects: `[{"URL": "https://magick.com/", "Title": "Magick"}, {"URL": "https...
PHP
UTF-8
9,726
2.515625
3
[]
no_license
<?php namespace app\modules\front\models; use Yii; use Thunder\Shortcode\ShortcodeFacade; use Thunder\Shortcode\Shortcode\ShortcodeInterface; /** * This is the model class for table "EnglishHadithTable". * * The followings are the available columns in table 'EnglishHadithTable': * @property string $collection *...
C++
UTF-8
5,266
3.046875
3
[]
no_license
#include <iostream> #include <iomanip> #include <string> #include "base.h" namespace Base { /// �������� ������������ base::base() : base(0) { } base::base(size_t rnc) : base(rnc, rnc) { } base::base(size_t Row, size_t Col) : row(Row), col(Col) { if (Row == 0 || Col == 0) { mass = nullptr; row = 0; col = 0...
Markdown
UTF-8
1,611
2.921875
3
[]
no_license
--- title: 魔女 BLOG 初中級日麻講座 笔记 date: 2019/2/28 14:35 tags: --- 针对自己打牌的一些不良习惯的记录 <!-- more --> 1. 配牌不佳的情况下,役牌多留一下 2. 4445 形的搭子在早巡价值不大 3. 有效牌重复的搭子要注意 4. 常见复合搭子 >兩\三間搭兩\三間搭指的是類似 468, 或 2468 等連續卡窿的牌形.不少初學者都會覺得卡窿是惡形, 不太喜歡此等牌形. 不過我們要留意: 一個246 的兩間搭, 跟一個兩面搭的入章牌數是一樣的, 分別是前者要 3 隻牌, 後者只需兩隻, 前者的效率稍低.雖然它稱不上是好牌形, 不過在序盤搭子仍不夠時, 兩間...
Rust
UTF-8
7,902
3.046875
3
[ "MIT" ]
permissive
//-------------------------------------------------------------------- // polygon.rs //-------------------------------------------------------------------- // Provides various utilitiy functions for polygons //-------------------------------------------------------------------- use crate::geometry::*; fn inside_segm...
Java
UTF-8
1,249
3.75
4
[]
no_license
/* Ex 7-5: Random Permutation Objective: Write Java and C programs that 1. Generates a random permutation of 1...n where n is given 2. Your program should use a boolean (or int in C) array to check if the number is generated or not 3. All the arrays should by dynamically-sized (use "new" in Java, and "mall...
JavaScript
UTF-8
1,236
3.25
3
[]
no_license
function getDate() { var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var today = new Date(); var year = today.getFullYea...
PHP
UTF-8
1,178
2.640625
3
[ "MIT" ]
permissive
<?php /** * Project: Veemo * User: ddedic * Email: dedic.d@gmail.com * Date: 16/03/15 * Time: 23:46 */ namespace Veemo\Themes\Adapters; /** * Interface ThemeManagerAdapterInterface * @package Veemo\Themes\Adapters */ interface ThemeManagerAdapterInterface { /** * @param $slug * @return bool ...
Markdown
UTF-8
2,395
3.34375
3
[]
no_license
--- layout: post comments: false title: "Math of Intelligence : Temporal Difference Learning" date: 2019-03-09 tags: math-of-intelligence, reinforcement-learning, artificial-intelligence --- # Math Of Intelligence : Temporal Difference Learning #### Monte Carlo: $$ \begin{equation} V(S_{t}) \leftarrow V(S_{t}) + \al...
Python
UTF-8
2,844
2.9375
3
[ "BSD-3-Clause" ]
permissive
#!/usr/bin/env python # encoding: utf-8 r"""Calculate refinement resolutions given ratios provided""" from __future__ import absolute_import from __future__ import print_function import argparse import numpy as np from . import topotools from six.moves import range def calculate_resolution(ratios, base_resolutions...
Python
UTF-8
254
2.9375
3
[]
no_license
pessoa = { 'nome': 'Fulano', 'idade': 43, 'cursos': ['React', 'Python'] } print(pessoa) pessoa.pop('idade') print(pessoa) pessoa.update({ 'cargo': 'Analista Desemvolvedor', 'sexo': 'M' }) print(pessoa) pessoa.clear() print(pessoa)
Java
UTF-8
247
1.742188
2
[]
no_license
/** * */ package org.forumj.checkip.connector; /** * @author andrew * */ public interface SourceConnector { public String getSourceName(); public Boolean isListedAsSpammer(String ip) throws ConnectorException; }
TypeScript
UTF-8
314
2.65625
3
[]
no_license
import { Messages } from '../enums/messages.enum'; export class ResolvedResult<T> { Result: T; ResultMessage: Messages; Message: string; constructor(result: T, resultMessage: Messages, message: string) { this.Result = result; this.ResultMessage = resultMessage; this.Message = message; } }
Java
UTF-8
2,782
2.5625
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 Iso14496.Boxes; import Iso14496.Box; import Iso14496.IsoReader; import java.io.ByteArrayOutputStream; import java.io.IOExcepti...
Java
UTF-8
967
2.90625
3
[]
no_license
package com.buaa.texaspoker.network; /** * 在客户端和服务端直接字节数据的包装接口 * 所有实现<code>IPacket</code>的子类可通过{@link PacketBuffer}实现数据的序列化和反序列化 * @param <T> 特定的数据处理类 * @author CPunisher * @see PacketBuffer * @see INetHandler */ public interface IPacket<T extends INetHandler> { /** * 将数据从{@link PacketBuffer}字节缓冲中读取,也...
JavaScript
UTF-8
688
2.5625
3
[]
no_license
import React, { useContext } from 'react'; import { TyperContext } from '../contexts/TyperContext'; const TyperForm = () => { const { type: { text, setText, checkKeyword, nextKeyword } } = useContext(TyperContext); React.useEffect(() => checkKeyword(), [checkKeyword, text]) const changeHandler = e => { ...
Python
UTF-8
7,986
2.578125
3
[]
no_license
from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, WebDriverException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from openpyxl import load_workbook from Py...
C++
UTF-8
3,079
2.765625
3
[]
no_license
#ifndef EVENT_H #define EVENT_H class Core; class My_viewer; class Screen; class Event { public: Event(Core & core, My_viewer & viewer, Screen & calling_screen) : _core(core), _viewer(viewer), _calling_screen(calling_screen) { } virtual bool trigger() = 0; protected: Core & _...
C++
UTF-8
1,763
2.828125
3
[]
no_license
#ifndef MOTIONPLANNER_HPP_ #define MOTIONPLANNER_HPP_ #include "GoalQueueHandler.hpp" #include <ros/ros.h> #include <ros/time.h> #include <actionlib/client/simple_action_client.h> #include <actionlib/client/terminal_state.h> #include <string> #include <map> /** The motionplanner interface contains test code that us...
Ruby
UTF-8
546
4.59375
5
[]
no_license
#In this project, we’ll write a program that takes a user’s input, then builds a hash from that input. #Each key in the hash will be a word from the user; each value will be the number of times that word occurs. puts "here is your statement:" text = gets.chomp words = text.split #creates an array of the text frequ...
Markdown
UTF-8
1,653
3.609375
4
[ "MIT" ]
permissive
# equals compare values of any complexity for equivalence ## Getting Started _With component_ $ component install jkroso/equals _With npm_ $ npm install jkroso/equals --save then in your app: ```js var equals = require('equals') ``` ## API - [equals()](#equals) ### equals(...) equals takes as man...
Java
UTF-8
1,844
2.875
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 csheets.ext.networkgame; import csheets.ext.connection.Server; import java.net.InetAddress; import java.net.Unknown...
Java
UTF-8
6,622
2.671875
3
[]
no_license
package com.cg.miniproject.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import com.cg.miniproject.exception.LAPException; import com.cg.minipr...
C++
UTF-8
1,734
3.296875
3
[ "MIT" ]
permissive
#include<iostream> #include <pthread.h> #include <string> using namespace std; #define NUM_THREADS 5 #define BLACK "\033[0m" #define RED "\033[1;31m" #define GREEN "\033[1;32m" #define YELLOW "\033[1;33m" #define BLUE "\033[1;34m" #define CYAN "\033[1;36m" static pthread_mutex_t mutex; void * Pr...
Python
UTF-8
10,292
3
3
[ "MIT" ]
permissive
import numpy as np import networkx as nx from networkx.algorithms.flow import maximum_flow from algorith.graphs.graph_utils import min_edge_cover import re import random import collections def min_cover_trigraph_edge_covers_heuristic(edges1,edges2): c1=min_edge_cover(edges1) c2=min_edge_cover(edges2) vert...
Java
UTF-8
8,432
1.898438
2
[]
no_license
package kingroup_v2.ucm.import_sample; import kingroup_v2.KinGroupV2MainUI; import kingroup_v2.KinGroupV2Project; import kingroup_v2.Kingroup; import kingroup_v2.KingroupFrame; import kingroup_v2.cervus.CervusFileFormat; import kingroup_v2.cervus.CervusFileReader; import kingroup_v2.cervus.view.CervusFileFormatV...
JavaScript
UTF-8
9,996
2.65625
3
[ "ISC" ]
permissive
import React, { Component } from 'react'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Field, reduxForm, reset } from 'redux-form'; import { getEmployeeById, updateEmployee, getEmployeeViewData } from '../../actions'; class UpdateEmployeeForm extends Component{ constr...
TypeScript
UTF-8
3,129
2.625
3
[ "MIT" ]
permissive
import type { StrategyOptions as OAuth2StrategyOptions } from 'passport-oauth2'; import type passport from 'passport'; import type express from 'express'; import type { SignOptions, Algorithm } from 'jsonwebtoken'; export interface Profile extends Pick<passport.Profile, 'provider'> { expiresIn: number; } export int...
C++
UTF-8
1,273
2.515625
3
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
// Copyright 2021 Garena Online Private Limited // // 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 l...
Python
UTF-8
2,175
3.265625
3
[]
no_license
import pandas as pd import os import sqlite3 data = {'type': ['book', 'magazine', 'magazine', None, None, 'book', 'book', 'magazine'], 'author': ['peter', 'peter', 'peter', 'peter', 'mary', 'mary', 'mary', 'mary'], 'age': [1, 2, 3, 4, 5, 6, 7, 8]} df = pd.DataFrame(data) # Read and write pickle file p...
C++
UTF-8
1,639
3.765625
4
[]
no_license
/** * The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two * queens attack each other. * [one solution to the eight queens puzzle](https://assets.leetcode.com/uploads/2018/10/12/8-queens.png) * * Given an integer n, return the number of distinct solutions to the n-queens puz...
Markdown
UTF-8
2,372
3.1875
3
[ "MIT" ]
permissive
--- title: "[백준] 3109번 빵집" author: steadev date: 2019-08-19 16:01:00 +0900 categories: [Algorithm] tags: [Baekjoon, algorithm] --- <img src="https://steadev.github.io/assets/images/bj/bj-3109-1.png" /> <img src="https://steadev.github.io/assets/images/bj/bj-3109-2.png" /> # 풀이 이 문제는 DFS를 활용해서 Greedy 하게 풀 수 있는 문제입니다...
Python
UTF-8
4,527
3.84375
4
[]
no_license
import matplotlib.pyplot as plt import sys ########################################################################################## # Name: parse # # Assumptions: None # # Purpose: parse takes a text file and separates all of the entries in the line. # An entry is a string of text in between two delimiters, the ...
C++
UTF-8
5,191
2.625
3
[ "ISC", "BSD-2-Clause" ]
permissive
/* * THiNX Sigfox/WiFi Example * * This sample can be used for dual-network reporting like home security backup: * - system is expected to be backed up with a battery (sample sends voltage only) * - system can report WiFi and power outages incl. security alerts using Sigfox * - system can report important events ...
Java
UTF-8
460
2.078125
2
[ "Apache-2.0" ]
permissive
package camel.simple.processors; import org.apache.camel.Exchange; import org.apache.camel.Processor; public class FileNamePrependerProcessor implements Processor { @Override public void process(Exchange exchange) throws Exception { String file = exchange.getIn().getHeader(Exchange.FILE_NAME,String...
C++
UTF-8
1,433
3.484375
3
[]
no_license
输入: "pwwkew" 输出: 3 解释: 因为无重复字符的最长子串是 "wke",所以其长度为 3。   请注意,你的答案必须是 子串 的长度,"pwke" 是一个子序列,不是子串。 --- class Solution { public: int lengthOfLongestSubstring(string s) { // int freq[256] = {0}; // int l = 0, r = -1; //滑动窗口为s[l...r] // int res = 0; // // 整个循环从 l == 0; r == -1 这个空窗口开始 /...
C#
UTF-8
3,780
2.71875
3
[ "MIT" ]
permissive
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Phoesion.Glow.SDK; using Phoesion.Glow.SDK.Firefly; using System; namespace Foompany.Services.HelloWorld.Modules { public class Logging : Phoesion.Glow.SDK.Firefly.FireflyModule { //-------------------------------------------...
Java
UTF-8
1,212
2.265625
2
[]
no_license
package com.sa3rha.android.sa3rha.Controller; import android.content.Context; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.sa3rha.android.sa3rha.R; import butterknife.ButterKnife; public class SerachAdapter ext...
Markdown
UTF-8
3,628
3.3125
3
[]
no_license
# A DFA-based Regular Expression Library for C++ ## Run All the Tests Input the following commands in the terminal to run all the tests. ```bash mkdir build cd build cmake .. cmake --build . ./RegularExpression ``` ## API ### Regular Expression Notations The followings are the functions used for constructing regu...
JavaScript
UTF-8
1,843
2.578125
3
[]
no_license
import React, { useState } from 'react'; import './FilterModal.scss'; import OptionsItem from './OptionsItem'; const initialCategories = [ { title: 'cheap', ifSelected: false }, { title: 'healthy', ifSelected: false }, { title: 'vege', ifSelected: false }, { title: 'takeaway', ifSelected: false }, { title: ...
Java
UTF-8
2,131
2.28125
2
[]
no_license
package com.bw.movie.adapter.cinema; import android.content.Context; import android.support.annotation.NonNull; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; import com.bumptech.glide.Glide; impo...
Markdown
UTF-8
2,267
2.5625
3
[]
no_license
# Curso React Native Esto es un curso básico de React Native # Clases ## [Preparar el entorno](https://github.com/zariweyo/curso-react-native/tree/hola_mundo) * Hola mundo * Ejecutar aplicación en emulador Android * Ejecutar aplicación en emulador iOS ## [Componentes 1](https://github.com/zariweyo/curso-react-native/tr...
Java
UTF-8
301
1.734375
2
[]
no_license
package com.codetc.common.model; import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; /** * Redis 锁 * Created by anvin on 1/15/2021. */ @Data @AllArgsConstructor public class RedisLock implements Serializable { private String key; private String value; }
C#
UTF-8
3,399
2.625
3
[]
no_license
using BowlingApp; using Shouldly; using System; using System.Collections.Generic; using System.Linq; using BowlingApp.Calculators; using BowlingApp.Events; using Xunit; namespace Tests { public class GameEventTests { private readonly Game _game; private readonly Queue<NewFrameEvent> _observedNe...
Python
UTF-8
823
2.890625
3
[ "Apache-2.0" ]
permissive
from urllib import request from bs4 import BeautifulSoup as BS def main(dict): # Handling previous errors for sequence if dict['err']: return dict try: # Call page and parse HTML page = request.urlopen(dict['url']) soup = BS(page, 'html.parser') # Scrap...
PHP
UTF-8
1,161
2.5625
3
[ "MIT" ]
permissive
<?php namespace Tests; use PHPUnit\Framework\TestCase; use Prometheus\Storage\APC; use Prometheus\Storage\InMemory; use Prometheus\Storage\Redis; use Superbalist\LaravelPrometheusExporter\StorageAdapterFactory; class StorageAdapterFactoryTest extends TestCase { public function testMakeMemoryAdapter() { ...
Markdown
UTF-8
1,914
2.515625
3
[]
no_license
--- draft: false date: 2018-01-01 kind: "journal" tags: ["whiley"] title: "On Declarative Rewriting for Sound and Complete Union, Intersection and Negation Types" authors: "David J. Pearce" booktitle: "Journal of Visual Languages & Computing" volume: "50" pages: "84--101" year: "2018" copyright: "Elsevier" DOI: "10.101...
Python
UTF-8
3,403
4.3125
4
[]
no_license
""" Haniyyah Sardar Date Due: 2/15/2017 Section: 05 """ #make available the random module import random #store a random secret number (int) secret = random.randint(1,10) #output intro to user print("I'm thinking of a number between 1 and 10!") #ask the user to guess a first number first_guess = int(input("What's yo...
Python
UTF-8
2,425
2.578125
3
[]
no_license
import time import telepot from telepot.loop import MessageLoop import logging.config import requests from queue import Queue import threading logging.config.fileConfig('logconfig.ini') IMG_PATH = 'pic/' url_classify = 'http://127.0.0.1:81/classify' url_classify_url = 'http://127.0.0.1:81/classify_url' # Thread 1 ­...
Java
UTF-8
1,734
3.078125
3
[]
no_license
package by.epam_training.java_online.module4.composition_and_aggregation.task3_state.entity; import java.io.Serializable; import java.util.List; public class Area implements Comparable<Area>, Serializable { private static final long serialVersionUID = 1L; private String name; private List<City> cities; ...
Python
UTF-8
4,832
2.546875
3
[ "MIT" ]
permissive
import datetime import logging import random from bs4 import BeautifulSoup import re import urllib2 def getMenu(): return digipolis def getSearchParameter(): return search logger = logging.getLogger(__name__) class Messenger(object): def __init__(self, slack_clients): self.clients = slack_cl...
JavaScript
UTF-8
1,577
2.703125
3
[]
no_license
import { useMutation, gql } from "@apollo/client"; import { useState } from "react"; export default function MutationPage() { const [writer, setWriter] = useState(""); const [password, setPassword] = useState(""); const [title, setTitle] = useState(""); const [contents, setContents] = useState(""); const CREATE_B...
PHP
UTF-8
1,895
2.671875
3
[ "MIT" ]
permissive
<?php namespace AppBundle\Document; use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB; use FOS\UserBundle\Model\User as FOSUser; /** * Class Client * @package AppBundle\Document * * @MongoDB\Document */ class User { /** @MongoDB\Id */ protected $id; /** @MongoDB\Field(type="string") */ p...
Python
UTF-8
1,325
2.921875
3
[]
no_license
import imageio from skimage.color import rgb2gray from skimage import feature import matplotlib.pyplot as plt from matplotlib import cm import numpy as np from skimage.transform import hough_line, hough_line_peaks im = imageio.imread('airport.tif') im = rgb2gray(im) edges = feature.canny(im, sigma=2, low_t...
C++
UTF-8
671
3.453125
3
[]
no_license
using namespace std; #include<bits/stdc++.h> void fib(int n, int *ans) { if (n < 2) { *ans = n; return; } int a,b; fib(n - 1, &a); fib(n - 2, &b); *ans = a + b; } int main() { int n; chrono::time_point<chrono::system_clock> start, end; chrono::duration<double> elapsed; cout << "Ingrese u...
C++
UTF-8
1,456
3.203125
3
[]
no_license
/* ============================================================================ * 25. テンプレートの抽出 * 記事中に含まれる「基礎情報」テンプレートのフィールド名と値を抽出し, * 辞書オブジェクトとして格納せよ. * ========================================================================= */ #include <iostream> #include <fstream> #include <string> #include <map> #include "pic...
Markdown
UTF-8
5,427
2.640625
3
[ "LicenseRef-scancode-unknown-license-reference", "CC-BY-4.0" ]
permissive
**_Journal of Cheminformatics_ will only publish research or software that is entirely reproducible by third parties. This means that any datasets, software and algorithms that are required to reach the conclusions stated in the paper must be provided as supplemental materials, or be otherwise accessible without the ne...
PHP
UTF-8
933
2.578125
3
[ "MIT" ]
permissive
<?php /** * Plugin Name: Simply Static Deploy * Plugin URI: https://github.com/grrr-amsterdam/simply-static-deploy/ * Description: Deploy static sites easily to an AWS S3 bucket. * Version: 2.3.0 * Author: GRRR * Author URI: https://grrr.nl */ use Grrr\SimplyStaticDeploy\SimplyStaticDeploy; // Global...
Python
UTF-8
248
3.640625
4
[]
no_license
import turtle t = turtle.Turtle() t.shape('turtle') radius = 50 length = 30 t.circle(radius) t.up() t.forward(length) t.down() t.circle(radius) t.up() t.forward(length) t.down() t.circle(radius) t.up() t.forward(length) t.down() turtle.done()
C++
UTF-8
440
3.59375
4
[]
no_license
#include <circle.h> Circle::Circle() { centro = Point(0.0, 0.0); r = 0.0; } Circle::Circle(double x, double y, double r) { centro = Point(x, y); this->r = r; } double Circle::getRaio() { return r; } Point Circle::getCentro() { return centro; } double Circle::area() { return PI * r * r;...
Python
UTF-8
937
2.671875
3
[]
no_license
from flask_restful import reqparse, abort, Api, Resource from flask import jsonify from db_manager import create_session from models.genre import Genre def abort_if_genre_not_found(genre_id): session = create_session() genre = session.query(Genre).get(genre_id) if not genre: abort(404, message=f"Ж...
Java
UTF-8
4,242
2.78125
3
[]
no_license
package ru.ssau.daria; import javax.annotation.Resource; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; import ja...
C
UTF-8
2,311
3.703125
4
[]
no_license
#include <stdio.h> void getNDays(int* nDays); int main() { int nDays; int avgDay; double avg; int lastAvg = 0; double cSum; printf("---=== IPC Temperature Analyzer V2.0 ===---\n\n"); getNDays(&nDays); int daysHi[nDays]; int daysLow[nDays]; for (int i = 0; i < nDays; i++) { //i+1을 ...
Python
UTF-8
1,274
2.71875
3
[]
no_license
import tensorflow as tf import json import numpy as np import requests class MNISTLoader(): def __init__(self): mnist = tf.keras.datasets.mnist (self.train_data, self.train_label), (self.test_data, self.test_label) = mnist.load_data() self.train_data = np.expand_dims(self.train_data.astype(...
JavaScript
UTF-8
1,011
2.875
3
[]
no_license
export async function getStaticPaths() { // Call an external API endpoint to get posts const res = await fetch('https://rickandmortyapi.com/api/character') const data = await res.json(); // Get the paths we want to pre-render based on posts const paths = data.results.map((character) => ({ p...
Java
UTF-8
2,341
2.296875
2
[]
no_license
package com.QuasarFireOperationMS.web.controller; import com.QuasarFireOperationMS.service.LocationService; import com.QuasarFireOperationMS.web.error.NoSatelliteFoundException; import com.QuasarFireOperationMS.web.model.LocationInfoDto; import com.QuasarFireOperationMS.web.model.SatellitesDto; import com.QuasarFireOp...
Java
UTF-8
814
2.28125
2
[]
no_license
package com.candystudio.android.dxzs.teacher.database; //import android.R; import android.database.sqlite.SQLiteDatabase; import com.candystudio.android.dxzs.teacher.app.R; public class DataBaseManager { private static DatabaseHelper databaseHelper = null; private static SQLiteDatabase db = null; priv...
Python
UTF-8
911
3.703125
4
[]
no_license
def dot_product(x, y): total = 0 for a, b in zip(x, y): total += a * b return total def project(v, s): """ project v onto the line spanned by s """ factor = float(dot_product(v, s)) / float(dot_product(s, s)) output = [s[0] * factor, s[1] * factor] return output def reflect...
Java
UTF-8
1,832
1.90625
2
[]
no_license
package cn.xports.qd2.campaign; import cn.xports.baselib.bean.Response; import cn.xports.baselib.http.ProcessObserver; import cn.xports.baselib.mvp.IView; import cn.xports.qd2.entity.MemberInfo; import java.util.ArrayList; import kotlin.Metadata; import org.jetbrains.annotations.Nullable; @Metadata(bv = {1, 0, 3}, d1...
JavaScript
UTF-8
1,383
3.796875
4
[]
no_license
// 最长上升子序列 // https://www.zhihu.com/question/23995189 // const arr = [1,2,1,5,3,1,4,6,1,9,7,8,1]; const arr = [1,2,1,5,4,6]; const result = {} arr.forEach((v,index) => { result[index] = 1; }) const message = {} const route = { 0: [arr[0]] } function lis(arr) { for(let i = 1; i< arr.length; i++) { let route...
Java
UTF-8
1,292
3.859375
4
[]
no_license
/* * Project Name: SecretNumber * Author: G Murie * Date: 21/10/14 */ import java.io.* ; public class SecretNumber { private static int userInput; private static String entString; private static BufferedReader bufRead; int total = 1; public static void main(String[] args) { //Declare the local variab...
Java
UTF-8
592
2.6875
3
[]
no_license
package ecs_bank.random_generator; import java.security.SecureRandom; import java.util.ArrayList; import java.util.concurrent.ThreadLocalRandom; public class SurnameSource { private ArrayList<String> cachedSurnames; private SecureRandom random = new SecureRandom(); private static final String SURNAMES_P...
C++
UTF-8
683
2.5625
3
[]
no_license
#ifndef APUI_WIDGETS_TABLES_ROW_HPP #define APUI_WIDGETS_TABLES_ROW_HPP #include <ApUI/Widgets/Layout/Group.hpp> #include <ApUI/Widgets/Texts/TextColored.hpp> #include <map> namespace ApUI::Widgets::Tables { class Table; class Row : public Layout::Group { public: explicit Row(const std::string& row_id, Ta...
C++
UTF-8
511
2.796875
3
[]
no_license
#pragma once #include "CreatureStat.h" class CreatureStatEffect { public: CreatureStatEffect(CreatureStat::E lStat, int lAmount, int lLength); ~CreatureStatEffect(void); CreatureStat::E getAffectedStat(void) const; int getAmount(void) const; int getTimeRemaining(void) const; void setAffectedStat(C...
Markdown
UTF-8
1,086
3.0625
3
[ "MIT" ]
permissive
# How to contribute This is an open source library for [CodeIgniter](https://github.com/bcit-ci/CodeIgniter), all contributions (Issues, suggestions and Pull requests) are welcome. If you find a bug or have a suggestion, please: 1. Make sure there is no already open Issue. 2. Make sure the issue hasn't been fixed (l...
Shell
UTF-8
2,526
3.078125
3
[]
no_license
#! /usr/bin/env bash echo "Adding a proxy for apt." cat << EOF | sudo tee -a /etc/apt/apt.conf.d/01proxy Acquire::http::Proxy "http://dockerhost.local:3142/"; Acquire::https::Proxy "http://dockerhost.local:3142/"; EOF echo "Updating apt and doing a full upgrade. This gets the latest version of raspi-config." apt-get...
C#
UTF-8
1,870
2.515625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GDAL { public class FTrans { #region Variables DB db = new DB(); #endregion #region Proprties public int ID { get; set; } public int UserID { get; se...
Python
UTF-8
1,057
2.96875
3
[]
no_license
import time import socket from collections import defaultdict # a print_lock is what is used to prevent "double" modification of shared variables. # this is used so while one thread is using a variable, others cannot access # it. Once done, the thread releases the print_lock. # to use it, you want to specify a print_l...
Java
UTF-8
1,792
2.40625
2
[]
no_license
//@author A0099903R package goku.autocomplete; import org.junit.Test; public class CommandAutoCompleteTest extends WordAutoCompleteTest { CommandAutoComplete auto = new CommandAutoComplete(); @Test public void complete_a_success() { String[] expecteds = { "add" }; String[] actuals = listToAr...
Java
UTF-8
1,033
2.171875
2
[]
no_license
package com.lynxspa.sdm.dictionaries.domains.values; import com.lynxspa.entities.application.domains.adapters.DomainValueDictAdapter; public enum CADomainREGIONRETENTIONSClusterRETENCIONValue implements DomainValueDictAdapter { VALUE1("DK","28"), VALUE2("AU","30"), VALUE3("AT","25"), VALUE4("BE","25"), VALUE5("...
Python
UTF-8
2,086
2.828125
3
[]
no_license
import numpy as np import pandas as pd import openai engine = "text-davinci-002" def act(text): openai.api_key = "YOURKEY" response = openai.Completion.create( engine = engine, prompt = text, max_tokens = 1, temperature = 0.0, logprobs=2, ) return response.choic...
Markdown
UTF-8
15,569
3.828125
4
[]
no_license
# 组件 ## 使用组件 ### 全局注册 确保在初始化根实例之前注册组件: ```js Vue.component('my-component', { // 选项对象 }) ``` ### 局部注册 通过实例选项注册仅在单个实例中可用的组件: ```js var Child = { template: '<div>A custom component!</div>', } new Vue({ components: { 'my-component': Child, }, }) ``` ### data必须是函数 防止组件之间共享数据,导致不可复用: ```js data: function () { ...
Java
UTF-8
569
2.421875
2
[]
no_license
package ch.kusar.contraceptivetimer.wrapper; import android.util.Log; public class LoggerWrapper { private static final String TAG = "ch.kusar.contraceptiveTimer"; public static void LogError(String msg){ Log.e(LoggerWrapper.TAG, msg); } public static void LogWarn(String msg){ Log.w(LoggerWrapper.TAG, msg...
Java
UTF-8
530
2.25
2
[]
no_license
package com.jumio.bookstore.data.dtos; import lombok.*; import java.time.*; @EqualsAndHashCode @Getter public abstract class BaseDto<T extends BaseDto<T>> { private String uuid; private Instant dtUpdate; private Instant dtCreation; public T setUuid(String uuid) { this.uuid = uuid; return (T) this; ...
Markdown
UTF-8
43,239
3.0625
3
[]
no_license
# Linux系统基础 > 本份材料对本学期内容覆盖并不足够充分,因而仍建议看回课件! > > 本课程对应的教材是於岳的《Linux实用教程》(第三版),人民邮电出版社。 > > 以下内容基本上整理于`重点.docx`和`Shell编程.pdf`,根据2020年实际教学情况进行修订。 ## **Ch1 认识Linux系统** **内核的版本,怎么命名的,什么是发行版,有哪些常见的发行版** Linux的版本号分为两部分,即内核版本与发行版本。 ![img](https://oss.ydjsir.com.cn/img/clip_image082.gif) > 内核版本号由3个数字组成:r.x.y。 > > r:目前发布...
Java
UTF-8
1,740
2.3125
2
[ "Apache-2.0" ]
permissive
package org.hy.common.xml.plugins.analyse; import java.util.ArrayList; import java.util.List; import org.hy.common.Help; import org.hy.common.app.Param; import org.hy.common.net.ClientSocket; import org.hy.common.xml.XJava; /** * 集群操作 * * @author ZhengWei(HY) * @createDate 2017-01-25 * @version v1...
C++
UTF-8
505
2.953125
3
[]
no_license
#include <iostream> #include <vector> using std::cin; using std::cout; using std::endl; using std::vector; int main() { vector<int> v; const int N = 50; for(int i = 0; i < N; ++ i) { v.push_back(i); cout << v.capacity() << ' '; } cout << endl; // 1 2 4 4 8 8 8 8 16 16...
SQL
UTF-8
819
4.09375
4
[]
no_license
/* QUESTION :: Find the name and height of the shortest player in the database. How many games did he play in? What is the name of the team for which he played? SOURCES :: * People, appearances, teams DIMENSIONS :: * namefirst, namelast, namegiven, height, g_all, name FACTS...
Java
UTF-8
1,659
2.0625
2
[]
no_license
package com.boguenon.migration.discoverer.business_model; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class BusinessObject extends ModelBase { private static final Logger logger = LoggerFactory.getLogger(BusinessObject.class); public Strin...
C
UTF-8
506
3.71875
4
[]
no_license
/* * q4.c * * Created on: 20/11/2014 * Author: MASC */ #include <stdio.h> #include <stdlib.h> int soma_divisores(int n) { int s = 0, i; for (i = 1; i <= n; ++i) { if (n % i == 0) s += i; } return s; } int main(void) { int n, num; freopen("e4.txt", "r", stdin); freopen("...
Shell
UTF-8
289
2.59375
3
[ "MIT" ]
permissive
#!/bin/bash # Get your API key from CPanel USERNAME="" API_KEY="" CPANEL_DOMAIN="" # Strip only the top domain to get the zone domain DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)') # Get the txt record name that will be created CREATE_DOMAIN="_acme-challenge.$CERTBOT_DOMAIN."