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 | 4,837 | 3.203125 | 3 | [
"MIT"
] | permissive | ## 스프링 REST Client
### RestTemplate
- Blocking I/O 기반의 Synchronous API
- RestTemplateAutoConfiguration
- 프로젝트에 spring-web 모듈이 있다면 RestTemplateBuilder를 빈으로 등록해 줍니다.
- [공식문서 참고](https://docs.spring.io/spring/docs/current/spring-framework-reference/integration.html#rest-client-access)
**예제 코드**
```java
@RestController... |
JavaScript | UTF-8 | 5,632 | 3.265625 | 3 | [] | no_license | import '../../globalTest';
import Set from '../../../src/data-structures/sets/Set';
const set = new Set();
describe('@Set', () => {
describe('#add', () => {
it('should be a function', () => {
assert.typeOf(set.add, 'function', 'add should be a function');
});
it('should add new element(s)', () =>... |
PHP | UTF-8 | 1,109 | 2.5625 | 3 | [] | no_license | <?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept');
//var_dump($_POST);
//获取applicatin-json的数据类型 然后解析对象 插入到数据库中使用
//获取JSON的输入流对象
// 判断Header头是 appliction-json 对象类型 才执行下面的代码
$array = getallheaders();
$cont... |
Python | UTF-8 | 11,719 | 2.546875 | 3 | [] | no_license | import json, csv, sys, getopt, os, math, operator, random, scipy, nltk
import numpy as np
from nltk.tokenize import TweetTokenizer
from collections import defaultdict
from sklearn.svm import SVC
from sklearn.naive_bayes import MultinomialNB
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble impo... |
C++ | UTF-8 | 2,181 | 2.71875 | 3 | [
"MIT"
] | permissive |
#include <functional>
#include "requests/request_factory.h"
#include "requests/request.h"
#include "requests/write_logs_request.h"
#include "requests/new_logger_request.h"
#include "requests/configuration_update_request.h"
#include "requests/flags_update_request.h"
Request* RequestFactory::buildRequest(JsonPacket* js... |
TypeScript | UTF-8 | 1,068 | 2.515625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class SharedService {
constructor() {}
getErrorMessageFormInput(form, input: string): string | null {
console.log(form, input);
if (form.hasError('required', [input])) {
return 'You must enter a value';
}
... |
Python | UTF-8 | 929 | 2.765625 | 3 | [] | no_license | import logging
import boto3
import config
def obj_last_modified(myobj):
"""
Gets the last modified date of the file
:param myobj:
:return: Last Modified timestamp of file
"""
return myobj['LastModified']
def fileWithLeastTimestamp():
"""
Gets the file with the least timestamp
:... |
Go | UTF-8 | 1,874 | 2.765625 | 3 | [] | no_license | package api
import (
"FRSC-Project/error"
"FRSC-Project/model"
"encoding/json"
"fmt"
"log"
"net/http"
)
func setupResponse(w *http.ResponseWriter, req *http.Request) {
(*w).Header().Set("Access-Control-Allow-Origin", "*")
(*w).Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
}
... |
Rust | UTF-8 | 4,212 | 2.953125 | 3 | [
"MIT"
] | permissive | use super::{Board};
use constants::{Rank, File, PieceType, FILE_COUNT, RANK_COUNT, BLACK, WHITE};
use util::{piece_list_to_string};
use board::{parse_fen_pieces};
use board::mailbox::{Mailbox};
pub struct PieceIter<'a> {
board: &'a Board,
current_rank: Rank,
current_file: File,
}
impl<'a> PieceIter<'a> {
... |
Markdown | UTF-8 | 19,004 | 2.734375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | ---
layout: post
title: What I'm Playing - No. 52
author: bsinky
description: "I played through Luigi's Mansion Dark Moon, and started The Legend of Zelda: Breath of the Wild!"
date: 2019-12-30
modified: 2019-12-30
categories: [Weekly]
tags: [What I'm Playing,Weekly,Casual]
image:
feature: feature-3ds-and-switch-1.... |
PHP | UTF-8 | 881 | 2.53125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php namespace Rikki\Heroeslounge\classes\Discord;
use Rikki\Heroeslounge\classes\Discord\AuthCode;
use Log;
class Webhook
{
public static function sendMatchReschedule($message = "", $embed)
{
$url = 'https://discordapp.com/api/webhooks/' . Authcode::getCasterWebhookId() . '/' . Authcode::getCasterWe... |
C# | UTF-8 | 2,037 | 3.28125 | 3 | [] | no_license | using CommonStuff;
using System;
namespace M6_Classes
{
public static class SetAccessorLab
{
private static void SetWithProperty()
{
ConsoleHelper ch = new ConsoleHelper();
Address address = new Address
{
Street = "Långa gatan",
... |
Java | UTF-8 | 570 | 2.953125 | 3 | [] | no_license | package question4_b;
public class matrice {
public static void main(String[] args) {
// TODO Auto-generated method stub
Integer matrice[][] = new Integer[9][9];
for (int i = 0; i < matrice.length; i++) {
for (int j = 0; j <= i; j++) {
if (j == 0 || (i == j)) {
matrice[i][j] = 1;
}
els... |
Python | UTF-8 | 987 | 2.625 | 3 | [
"MIT"
] | permissive | import dense_flow_cv as df
from pathlib import Path
import argparse
# run on specific files instead of an entire directory
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Process videos and analyze motility.")
parser.add_argument('vidlist', nargs='+', type=str,
... |
Python | UTF-8 | 2,532 | 3.234375 | 3 | [
"MIT"
] | permissive | import numpy as np
from collections import defaultdict
from enum import Enum, auto
class AlgorithmType(Enum):
MonteCarlo = auto()
Sarsa = auto()
QLearning = auto()
ExpectedSarsa = auto()
class Agent:
def __init__(self,
na=6,
algorithm_type=AlgorithmType.ExpectedS... |
JavaScript | UTF-8 | 709 | 2.6875 | 3 | [] | no_license | import React, {useEffect, useState} from 'react';
export const ForecastContaxt = React.createContext({
forecasts: [],
setForecast: () => {},
});
export default function ForecastProvider({children}){
const [forecasts, setForecast] = useState([]);
useEffect(() => { // fetch as default TLV 5 daily for... |
Java | UTF-8 | 2,997 | 2.71875 | 3 | [] | no_license | package com.cwl.generator.file;
import com.cwl.tool.util.Util;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
/**
* <li>文件名称: FileUtil.java</li>
* <li>版权所有: 陈文龙(C)2015-2020</li>
* <li>修改记录: ...</li>
* <li>内容摘要: ...</li>
* <li>其他说明: ...</li>
*
* @versio... |
C++ | UTF-8 | 570 | 2.765625 | 3 | [] | no_license | #include<SoftwareSerial.h>
const int RX_PIN = 8;
const int TX_PIN = 9;
SoftwareSerial xbee(RX_PIN, TX_PIN);
void setup() {
Serial.begin(115200);
pinMode(RX_PIN, INPUT);
pinMode(TX_PIN, OUTPUT);
xbee.begin(9600);
}
byte buf[7];
int x, y;
void loop() {
if (xbee.available() >= 9) {
if (xbee.read() =... |
PHP | UTF-8 | 2,812 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Project name: OpenNote
* Author: Jacob Liscom
* Version: 13.10.0
**/
//Notice no include here. We need this here because we want to include this without the rest of the include tree
abstract class Config{
/**
* Database details
*/
public static function dbConfig(){
if(... |
C# | UTF-8 | 1,934 | 3.1875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AppDoWhile
{
class Program
{
static void Main(string[] args)
{
int contador=0;
float promedio = 0, numero = 0, suma=0;
Console.Writ... |
C# | UTF-8 | 4,164 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
public float movementSpeed;
//Subscribe to this in controller if you want to act based on movement/direction
public delegate void MovementUpdateHandler(Vector2 direction);
... |
Markdown | UTF-8 | 3,983 | 2.546875 | 3 | [
"MIT"
] | permissive | [@hqoss/monads](../README.md) › [Globals](../globals.md) › [ResOk](resok.md)
# Interface: ResOk ‹**T, E**›
## Type parameters
▪ **T**
▪ **E**
## Hierarchy
* [Result](result.md)‹T, E›
↳ **ResOk**
## Index
### Properties
* [type](resok.md#type)
### Methods
* [andThen](resok.md#andthen)
* [err](resok.md#err)... |
C# | UTF-8 | 3,451 | 2.890625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace CITI.EVO.Tools.Collections.Lookups
{
public class LookupDictionary<TKey, TValue> : IDictionary<TKey, TValue>
{
private readonly EntityLookup<TKey, TValue> _lookup;
public LookupDictionary() : this(7, Equa... |
Markdown | UTF-8 | 5,416 | 2.75 | 3 | [
"MIT"
] | permissive | **You're viewing a file in the SMAPI mod dump, which contains a copy of every open-source SMAPI mod
for queries and analysis.**
**This is _not_ the original file, and not necessarily the latest version.**
**Source repository: https://github.com/Esca-MMC/CustomNPCExclusions**
----
# Custom NPC Exclusions
A mod for... |
Shell | UTF-8 | 296 | 3.375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env sh
for dir in $(echo "$PATH" | tr ":" "\n" | grep -Fxv "$(dirname $0)"); do
if [ -x "$dir/$(basename $0)" ]; then
exec "$dir/$(basename $0)" --rcfile "${XDG_CONFIG_HOME:-$HOME/.config}/bash/bashrc" "$@"
fi
done
echo "$0: error: Wrapped command does not exist" >&2
|
Python | UTF-8 | 1,477 | 3.515625 | 4 | [] | no_license | #!/usr/local/bin/python3
from random import randint
class Node(object):
def __init__(self, data=None, next=None):
self.data = data
self.next = next
def print(self):
curr = self
while curr is not None:
print(curr.data,end=" ")
curr = curr.next
pri... |
Markdown | UTF-8 | 732 | 2.75 | 3 | [] | no_license | # sherl: Make Erlang talk to subprocesses like a boss
Erlang's built-in subprocess management facilities are good enough to run a
well behaved port, but aren't going to do you much good for running arbitrary
processes.
## Project goals
The goal for sherl is to be more or less on par with the capabilities of the
subp... |
Java | UTF-8 | 604 | 3.09375 | 3 | [] | no_license | package com.sample.util;
public class CaptchaUtil {
public static String generateCaptchaText(int captchaLength) {
// Characters to show in captcha A-Z & 1-9.
String saltChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789";
StringBuffer captchaStrBuffer = new StringBuffer();
java.util.Random rnd = new java.util.Ran... |
C++ | UTF-8 | 298 | 2.875 | 3 | [] | no_license | class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int lt = 0, rt = nums.size();
while(lt < rt) {
int mid = lt + (rt - lt) / 2;
if(nums[mid] < target) lt = mid + 1;
else rt = mid;
}
return lt;
}
};
|
C | UTF-8 | 2,604 | 2.828125 | 3 | [] | no_license | #include "TTree.h"
#include "TFile.h"
#include "TH1D.h"
#include "TCanvas.h"
double background(double *x, double *par) {
return par[0] + par[1]*x[0] + par[2]*x[0]*x[0];
}
// Lorentzian Peak function
double lorentzianPeak(double *x, double *par) {
//return (0.5*par[0]*par[1]/TMath::Pi()) / TMath::Max(1.e-10, (x[0]-pa... |
PHP | UTF-8 | 5,916 | 2.96875 | 3 | [] | no_license | <?php
/**
* System V shared memory wrapper.
*
* @link http://php.net/sem
*
* @uses sysvshm
*
* @project Anizoptera CMF
* @package system.ipc
*/
class CIpcSharedMemory
{
const MEMORY_SIZE = 524288;
const PERMISSIONS = 0777;
/**
* A numeric shared memory segment ID
*
* @var int
*/
protected $key;
... |
Markdown | UTF-8 | 12,157 | 2.859375 | 3 | [
"MIT"
] | permissive | # Gloss → Codable Migration Guide
Adopters of Gloss are urged to migrate to Swift's first-class JSON parsing framwork, [Codable](https://developer.apple.com/documentation/foundation/archives_and_serialization/encoding_and_decoding_custom_types). Gloss is no longer maintainined as of September 2020, unless in support o... |
JavaScript | UTF-8 | 2,320 | 2.640625 | 3 | [] | no_license | const events = require('events');
const scheduler = require('node-schedule');
class GoogleCalendarScheduler extends events.EventEmitter {
constructor(calendar, args = {}) {
super();
this.calendar = calendar;
this.opts = {
calendarId: '',
interval: 3600,
notifyBefore: 60,
debug: ... |
Python | UTF-8 | 7,582 | 3.09375 | 3 | [] | no_license | # Jackie's Universal Cartographics System Code Decoder
# Kay Johnston
# Now with added elegance. And fixed the silly muppet bug I introduced merging things. :)
# Reference
# High points, below plane
# KF-D C29, PG-D C29
# QW-F C, VX-F C
# Low points, above plane
# UI-X C28, ZJ-X C28
# AA-A C, FB-A C
# Hig... |
Python | UTF-8 | 1,450 | 3.125 | 3 | [] | no_license | import errno
import socket
from typing import Tuple, Union
class Socket:
def __init__(self, HOST: str, DEFAULT_SOCKET_PORT: Tuple[int]):
self.HOST = HOST
self.DEFAULT_SOCKET_PORT = DEFAULT_SOCKET_PORT
self.PORT: Union[int, None] = None
# super().__init__()
def checkAndBindSock... |
Shell | UTF-8 | 2,881 | 2.890625 | 3 | [] | no_license | # Path to your oh-my-zsh installation
export ZSH=$HOME/.oh-my-zsh
export LANG=en_US.UTF-8
# Theme
ZSH_THEME="spaceship"
# Command auto-correction.
ENABLE_CORRECTION="false"
# Display red dots whilst waiting for completion.
COMPLETION_WAITING_DOTS="true"
# Which plugins would you like to load? (plugins can be found ... |
JavaScript | UTF-8 | 7,043 | 2.875 | 3 | [
"MIT"
] | permissive | $('.button-collapse').sideNav({
draggable: true // Choose whether you can drag to open on touch screens
}
);
var user_name = "";
var wordReadyAdd = "";
var explanation = "";
(function($){
$(function(){
$('.button-collapse').sideNav();
var token = window.location.href.split('?');
if(token.length > 1... |
Java | UTF-8 | 560 | 3.140625 | 3 | [] | no_license | class ImitateJavaLangStringTest
{
public static void charAtIndex(String a, int b)
{
System.out.print(a.charAt(b));
}
public static void concat(String a, String b)
{
System.out.print(a.concat(b));
}
public static void replace(String a, String b, String c)
{
Syste... |
JavaScript | UTF-8 | 549 | 2.515625 | 3 | [] | no_license | "use strict";
var chai_1 = require("chai");
var kata_1 = require("../src/kata");
describe('kata test', function () {
it('should pass this canary test', function () {
chai_1.expect(true).to.eql(true);
});
it('should return right result', function () {
chai_1.expect(kata_1.kata("din")).to.eql(... |
C# | UTF-8 | 2,947 | 2.8125 | 3 | [] | no_license |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TrainStation.Model
{
public class TrainModel
{
private string name { get; set; }
private string placeDeparture { get; set; }
private string placeArrival { get;... |
Python | UTF-8 | 537 | 3.625 | 4 | [] | no_license | my_name = "Zed A Shaw"
my_age = 38 #not a lie
my_height = 74 #inches
my_weight = 180 #lbs
my_eyes = "Blue"
my_hair = "Blond"
my_teeth = "White"
print "Let's talk about %s." % my_name
print "He's %d inches tall." % my_height
print "He's %d pounds heavy." % my_weight
print "Actually that is not too heavy."
print "He's g... |
C++ | UTF-8 | 1,507 | 2.703125 | 3 | [] | no_license | /*
Problem: 797C. Minimal string
Solution: strings, stack, greedy, O(n)
Author: Dmitry Kozyrev, github: dmkz, e-mail: dmkozyrev@rambler.ru
*/
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <cassert>
#include <numeric>
#include <cmath>
#de... |
C++ | UTF-8 | 6,224 | 2.625 | 3 | [] | no_license | /**
* @file sancu_adder.cpp
*
* @date Mar 17, 2014
* @author norethel
*
* @{
*/
#include "sancu_adder.hh"
#include <fstream>
#include <sstream>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sndfile.hh>
#include <sancu_signal.hh>
#include <sancu_sample.hh>
SancuAdder::SancuAdder(const std::s... |
JavaScript | UTF-8 | 1,174 | 2.671875 | 3 | [] | no_license | const fb = require("./fb.js");
const database = fb.database;
function Create(item, callback) {
let id = database.ref('items/').push().key;
// item.name = item.name.replace(/\s/g, '');
database.ref('items/' + item.name).set({
"uname": item.uname,
"category": item.category,
"currentQ... |
PHP | UTF-8 | 802 | 3.640625 | 4 | [] | no_license | <?php
class A {
protected $name;
public function start(){
echo 'Starting: '.$this->name.'<br/>';
}
public function setName($n){
$this->name = $n;
}
}
class B extends A {
public function end(){
echo 'Ending: '.$this->name.'<br/>';
}
}
// $b = new B;
// $b->setName('Janko');
// $b->start();
// $b->... |
Java | UTF-8 | 184 | 3.109375 | 3 | [] | no_license | // 21. write a java program to print the reverce of digits of numbers.
class Twentyone{
public static void main(String[] k){
for(int i=5;i>=0;i--){
System.out.print(i);
}
}
} |
C++ | UTF-8 | 1,672 | 3.984375 | 4 | [] | no_license |
#include "card.h"
//constructor that takes a card's face value (an integer) and its suit
// card face example: Ace=0, 2=1, 3=2, ... Q=11, K=12
Card::Card (int face, suit st)
{
cardFace = face;
cardSuit = st;
if (face == 0)
pointValue = 15;
if (face >= 1 && face <= 9)
pointValue = fa... |
JavaScript | UTF-8 | 366 | 4.125 | 4 | [] | no_license | //The function is supposed to return a new array made up of 'num' copies of 'arr'
// modify it using spread syntax so that is works
function copyMachine(arr, num){
let newArr = [];
// iteration
while(num >= 1) {
let spreadArg = [...arr];
newArr.push(spreadArg);
num--;
}
return newArr... |
PHP | UTF-8 | 355 | 2.5625 | 3 | [] | no_license | <?php
namespace ProjxIO\Token;
use ProjxIO\Token\Encoder;
class Base64Encoder implements Encoder
{
/**
* @inheritDoc
*/
public function encodeToken($value)
{
return base64_encode($value);
}
/**
* @inheritDoc
*/
public function decodeToken($value)
{
ret... |
C | UTF-8 | 1,345 | 2.84375 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /*
* pcshutwindown.c : (Not so) Lua module 'pcshutwindown'
*/
#include <stdio.h>
#include <windows.h>
/* No Lua things :-) */
/*
* Initiates system shutdown.
* Returns a bool showing whether the job succeeded.
*/
static BOOL shutdown_system (void) {
HANDLE TokenHandle;
TOKEN_PRIVILEGES Privil... |
Python | UTF-8 | 138 | 3 | 3 | [] | no_license | def som(getal1, getal2, getal3):
return getal1 + getal2 + getal3
getal1 = 1
getal2 = 2
getal3 = 5
print(som(getal1, getal2, getal3)) |
C# | UTF-8 | 3,125 | 2.71875 | 3 | [] | no_license | using MovieWeb.Data;
using MovieWeb.Data.Entities;
using MovieWeb.Repository.IRepository;
using MovieWeb.Services.IServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace MovieWeb.Repository
{
public class MoviesApiRepository : IMoviesApiRepository
... |
Java | UTF-8 | 2,720 | 2.5 | 2 | [] | no_license | package com.jmj.common.util.store;
import java.nio.ByteBuffer;
import java.util.Deque;
import java.util.concurrent.ConcurrentLinkedDeque;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sun.nio.ch.DirectBuffer;
import com.jmj.common.LoggerName;
import com.jmj.common.util.store.config.MessageStoreCon... |
JavaScript | UTF-8 | 7,554 | 2.515625 | 3 | [] | no_license | import React, { useState } from 'react';
import { useEffect } from 'react';
import './App.css';
import Header from './components/Header/Header';
import Card from './components/Card/Card';
import axios from 'axios';
import {Route} from 'react-router-dom';
import Modal from './utils/Modal';
function App() {
const... |
Markdown | UTF-8 | 1,371 | 2.515625 | 3 | [] | no_license | ## Thumb joystick
<table border="0" width="100%"><tr><td colspan=2 width="60%">seeed studio Grove </td>
<td rowspan=9 width="40%" align="right"><img src="../../.img/thumb.jpg" width="200px" /></td></tr>
<tr><td>Voltage range</td><td><b>4.75V - 5.25V</b></td></tr>
<tr><td>Input type</td><td><b>Digital</b></td></tr... |
PHP | UTF-8 | 740 | 2.546875 | 3 | [] | no_license | <?php
/*
* 精英贷数据
*/
class EliteloanDataModel extends Model{
//添加数据
public function addData($data){
$rules = array('name'=>'姓名','phone'=>'手机号码','email'=>'邮箱');
foreach($rules as $k=>$v){
if($data[$k] == ''){
$this->error = $v.'不能为空';
return false;
... |
Python | UTF-8 | 634 | 3.890625 | 4 | [] | no_license | # coding=utf-8
# Triangle, pentagonal, and hexagonal numbers are generated by the following formulae:
# Triangle Tn=n(n+1)/2 1, 3, 6, 10, 15, ...
# Pentagonal Pn=n(3n−1)/2 1, 5, 12, 22, 35, ...
# Hexagonal Hn=n(2n−1) 1, 6, 15, 28, 45, ...
# It can be verified that T285 = P165 = H143 = 40755.
# Find the next... |
C++ | UTF-8 | 370 | 2.734375 | 3 | [] | no_license | #pragma once
#include <cmath>
/// @defgroup util
/// @{
namespace ax {
namespace util {
namespace Interpole {
template <typename T> T Lineair(const T& y1, const T& y2, const T& mu)
{
return y1 + mu * (y2 - y1);
}
template <typename T> T Logarithmic(const T& y1, const T& y2, const T& mu)
{
return po... |
C++ | UTF-8 | 3,330 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | #include <fstream>
#include "bstree.hpp"
#include <string>
#include <iostream>
using namespace std;
using namespace BSTree;
Tree::Tree() {
root = nullptr;
}
Node* Tree::insert(int var, Node *&node) { //Фукция добавления звена в дерево
if (nullptr == node) { // Если дерева нет, то ложим семечко
node = new Node{var... |
C++ | UTF-8 | 1,138 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
string dogam1[100000];
pair<string,int> dogam2[100000];
int main(){
ios::sync_with_stdio(0);cin.tie(0);
int N,M;
string s;
cin>>N>>M;
for(int i=0;i<N;i++){
cin>>dogam1[i];
dogam2[i]={dogam1[i],i+1};
... |
Python | UTF-8 | 8,149 | 2.96875 | 3 | [] | no_license | import sys
import pygame
from pygame.display import update
from time import sleep
from settings import Settings
from ships import Ship
from bullet import Bullet
from alien import Alien
from game_start import GameStats
from button import Buttom
from scoreboard import Scoreboard
class AlienInvasion:
"""管理游戏资源和行为的类"... |
Shell | UTF-8 | 1,773 | 3.484375 | 3 | [] | no_license | #!/bin/bash
# https://raspberrypi.stackexchange.com/questions/60593/how-raspbian-detects-under-voltage
font_size=11500
icon_size=13000
medicon_size=15000
largeicon_size=20000
RED_SPAN="<span color=\"red\">"
NORMAL_SPAN="<span font-size=\"$font_size\">"
ICON_SPAN="<span font-size=\"$icon_size\">"
MEDICON_SPAN="<span f... |
Java | UTF-8 | 1,132 | 2.296875 | 2 | [] | no_license | package com.sony.model.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
@Entity
@Table(name = "... |
Java | UTF-8 | 1,776 | 2.03125 | 2 | [] | no_license | package com.fisincorporated.exercisetracker.ui.media.mediagrid;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.GridView;
import com.bumptech.glide.Glide;
import com.fisincorporated.exe... |
Markdown | UTF-8 | 3,278 | 3 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: xml 이란?
subtitle:
gh-repo:
gh-badge: [star, fork, follow]
tags: [java]
categories : [Other]
---
### xml 이란?
Extensible Markup Language
마크업 언어를 정의하기 위한 언어, 확장이 가능한 언어이다.
HTML 이 데이터를 표현하는 마크업 언어라면, XML 은 Tag를 정의할 수 있고 데이터를 기술하는 마크업 언어
* 텍스트 기반이며 간결한 데이터형
* 마크업언어(HTML)가 아니라 마크업언어를 정의하기 ... |
JavaScript | UTF-8 | 2,083 | 3.984375 | 4 | [] | no_license | `
한 반에 30명인 학생, 총 7개의 반 점수가 '국어, 영어, 수학, 사회, 과학' 순서로 있는 다중 리스트를 랜덤 한 값으로 만들어주시고 아래 값을 모두 출력하세요.
1. 반 점수 모두가 담긴 전교 점수 다중 리스트를 만들어주세요.
2. 반 평균을 구하세요.
3. 반 1등 점수를 구하세요.
4. 전교 평균을 구하세요.
(출력 형식은 상관없습니다.)
`
let student_score = [];
let class_score = [];
let total_score = [];
for (let k = 0; k < 7; k++) {
class_score = [... |
Java | UTF-8 | 7,093 | 2.171875 | 2 | [] | no_license | package com.example.gymfit.system.conf.recycleview;
import android.graphics.Canvas;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.ItemTouchHelper;
import androidx.recyclerview.widget.Re... |
Python | UTF-8 | 674 | 3.765625 | 4 | [] | no_license | """For Want of a Nail."""
import itertools
def proverb(words, qualifier=None):
"""Return "For Want of a Nail"."""
phrases = (
"For want of a {} the {} was lost.".format(want, lost)
for want, lost in pairwise(words)
)
qualifier = "" if qualifier is None else qualifier + " "
phrase... |
Java | UTF-8 | 286 | 1.742188 | 2 | [] | no_license | package com.blackfat.springboot.druid.dao;
import com.blackfat.springboot.druid.entity.Stock;
/**
* @author wangfeiyang
* @desc
* @create 2018/10/23-14:37
*/
public interface StockMapper {
Stock selectByPrimaryKey(Integer id);
int updateByOptimistic(Stock stock);
}
|
Markdown | UTF-8 | 6,551 | 2.96875 | 3 | [
"Unlicense"
] | permissive | # DLE Registration Code Generator
This program can generate registration codes for the Deluxe LORD Editor
(DLE), a 16-bit DOS program I wrote in 1995.
Since the source was lost, I have taken it upon myself to hack the
registration key algorithm and now provide keys freely to all those who
wish to have them.
... |
Python | UTF-8 | 6,016 | 2.828125 | 3 | [] | no_license | class AuctionSystem(object):
def __init__(self):
self._users = []
self._items = []
def register_user(self, user_id, name):
self._users.append(User(user_id, name))
def post_item(self, item):
self._items.append(item)
for user in self._users:
i... |
Java | UTF-8 | 163 | 1.820313 | 2 | [] | no_license | package com.example.myapplication.db;
final class BaseDatosConstantes {
public static String BaseDatosName= "Petagram";
public static int Version=1;
}
|
Python | UTF-8 | 2,526 | 2.875 | 3 | [] | no_license | import influxdb as db
import talib
import zmq
from tradex.strategy.indicators import Indicator
# import time
class Strategy1:
"""This class implements the basic strategy
of SMA and MACD oscillators"""
timeframes = ['M1', 'M5', 'M15', 'H1', 'H4']
def __init__(self, other, timeframe=None):
s... |
Java | UTF-8 | 688 | 2.578125 | 3 | [] | no_license | package com.ioc;
import org.jetbrains.annotations.Nullable;
import javax.lang.model.element.Element;
/**
* Created by sergeygolishnikov on 08/08/2017.
*/
public class ProcessorException extends RuntimeException {
@Nullable
public Element element;
public ProcessorException(String message, Object... ar... |
Java | UTF-8 | 2,050 | 2.75 | 3 | [] | no_license | package queries;
import datos.Profesor;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author Daniel
*/
public class QueriePractica extends Querie{
private Prep... |
Shell | UTF-8 | 183 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/bin/bash
DIR="$(cd "$(dirname "$0")" && pwd)"
PARENTDIR="$(dirname "$DIR")"
export GOOS=darwin
export GOARCH=amd64
go build -o ${DIR}/dirk_${GOOS}_${GOARCH} ${PARENTDIR}/main.go
|
Markdown | UTF-8 | 1,389 | 3.296875 | 3 | [
"MIT"
] | permissive | ---
title: UIColor.xyz - Converting HEX & RGB colours to UIColor
slug: ui-color-convert-hex-rgb
keywords: uicolor,programming,ios,objective-c,swift,convert,hex,rgb,xcode
cover: ui-color.png
date: 2015-02-15
---
Have you ever developed an iOS mobile application in Objective C or in Swift? Then I guess at some point you... |
Swift | UTF-8 | 1,008 | 3.203125 | 3 | [
"MIT"
] | permissive | import VectorMath
import RaytracerLib
public struct InfinitePlane: Surface {
let anchor: Vector4
let normal: Vector4
let material: Material
public init(anchor: Vector4, normal: Vector4, material: Material) {
self.anchor = anchor
self.normal = normal.normalized()
self.material = material
}
... |
Java | UTF-8 | 1,391 | 2.09375 | 2 | [] | no_license | package aiyiqi.bwf.com.yiqizhuangxiu.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import aiyiqi.bwf.com.yiqizhuangxiu.R;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Created by Y... |
Java | UTF-8 | 2,756 | 2.140625 | 2 | [] | no_license | package me.fdawei.picker.loader;
import android.content.Context;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import me... |
C++ | UHC | 2,388 | 3.421875 | 3 | [] | no_license | // https://www.acmicpc.net/problem/10451
// BFS or DFS
/*
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
#define MAX 1001
using namespace std;
int map[MAX][MAX];
int visited[MAX];
queue<int> q;
int T, N, M, answer = 0;
void bfs(int root) {
visited[root] = 1;
q.push(ro... |
Java | UTF-8 | 1,010 | 2.015625 | 2 | [] | no_license | package com.ateamforce.coffeenow.service.impl;
import com.ateamforce.coffeenow.model.StorePaymenttype;
import com.ateamforce.coffeenow.model.repository.StorePaymentTypeRepository;
import com.ateamforce.coffeenow.service.StorePaymentTypeService;
import java.util.List;
import org.springframework.beans.factory.annotation... |
Shell | UTF-8 | 785 | 3.65625 | 4 | [
"Apache-2.0"
] | permissive | #!/bin/bash
set -e
# Run MongoDB backup
python $WORKSPACE/utils/test/testapi/update/templates/backup_mongodb.py -o $WORKSPACE/
# Compressing the dump
now=$(date +"%m_%d_%Y_%H_%M_%S")
echo $now
file_name="testapi_mongodb_"$now".tar.gz"
echo $file_name
tar cvfz "$file_name" test_results_collection*
rm -rf test_resu... |
Python | UTF-8 | 1,237 | 3.859375 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding_ utf-8 -*-
## we want to apply a discrete integral
"""
Based on the Trapezoid method to integrate defined functions:
https://www.geeksforgeeks.org/trapezoidal-rule-for-approximate-value-of-definite-integral/
"""
# area down this function
def main_function(x):
#f_de_x = (1.0 ... |
Markdown | UTF-8 | 2,673 | 3.625 | 4 | [] | no_license | # 享元模式
享元模式的定义与特点
----------
享元(Flyweight)模式的定义:运用共享技术来有效地支持大量细粒度对象的复用。它通过共享已经存在的对象来大幅度减少需要创建的对象数量、避免大量相似类的开销,从而提高系统资源的利用率。
享元模式的主要优点是:相同对象只要保存一份,这降低了系统中对象的数量,从而降低了系统中细粒度对象给内存带来的压力。
其主要缺点是:
1. 为了使对象可以共享,需要将一些不能共享的状态外部化,这将增加程序的复杂性。
2. 读取享元模式的外部状态会使得运行时间稍微变长。
享元模式的结构与实现
----------
享元模式中存在以下两种状态:
1. 内部状态,即不会随着环境的改... |
Markdown | UTF-8 | 4,575 | 3.203125 | 3 | [] | no_license | # PG - Protobuf Generate
一个从protobuf定义文件自动生产代码的脚本
## 约定
* 目前默认消息ID为 Int16, 也就是2Bytes
## protobuf定义文件要求
在这里假设你的 定义文件 a.proto, b.proto 等等都位于 目录A中
* 定义文件中不要加 package, 生成的csharp会自动添加namespace
* 确保message, enum 的名字全局唯一
* message 的名字 建议是首字母大写的驼峰命名法。比如 `message PlayerAction {...}`
* 目录A中需要有 `pg` 用的配置文件 `pg.co... |
C# | UTF-8 | 1,018 | 2.6875 | 3 | [
"MIT"
] | permissive | using Semver.Ranges;
namespace Semver.Test.TestCases
{
public class NpmRangeParsingTestCase
{
public static NpmRangeParsingTestCase Valid(
string range,
bool includeAllPrerelease,
SemVersionRange expected)
=> new NpmRangeParsingTestCase(range, ... |
Java | UTF-8 | 340 | 1.820313 | 2 | [] | no_license | package com.hayagou.dao;
import com.hayagou.domain.UserVO;
public interface UserDAO {
public void signUp(UserVO vo);
public UserVO login(UserVO vo);
public void userUpdate(UserVO vo)throws Exception;
public void userDelete(UserVO vo)throws Exception;
// 패스워드 체크
public int passChk(UserVO vo) throws Excep... |
Java | UTF-8 | 1,439 | 2.421875 | 2 | [
"MIT"
] | permissive | package mage.cards.v;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.CreaturesYouControlCount;
import mage.abilities.effects.common.continuous.SetBasePowerToughnessSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
im... |
Java | UTF-8 | 2,610 | 2.5 | 2 | [] | no_license | package com.besttravelproject.command;
import com.besttravelproject.command.flightCommands.*;
import com.besttravelproject.command.orderCommands.*;
import com.besttravelproject.command.userCommands.*;
import javax.servlet.http.*;
import java.util.*;
/**
* Created by А on 08.01.15.
*/
public class CommandFactory {
... |
Python | UTF-8 | 215 | 2.78125 | 3 | [] | no_license |
# load the url content
# https://stackoverflow.com/questions/17178483/how-do-you-send-an-http-get-web-request-in-python
from urllib.request import urlopen
html = urlopen("http://www.google.com/").read()
print(html) |
PHP | UTF-8 | 554 | 2.671875 | 3 | [] | no_license | <?php
use Illuminate\Database\Seeder;
class CourseExerciseTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$course_ids = App\Course::all('id')->pluck('id')->toArray();
$exercise_ids = App\Exercise::all('id')->pluck('... |
C++ | UTF-8 | 6,299 | 3.3125 | 3 | [] | no_license | //Bowling game calculator
//Uses either string input or file input
//Created by Claycot, 2017-2018
#include <iostream> //User input
#include <stdio.h> //This was quicker than <iomanip> for outputting score
#include <string> //Used for manipulating string input, as a result of notation
#include <fstream> //Used... |
Java | UTF-8 | 6,175 | 1.859375 | 2 | [] | no_license | package com.xr.happyFamily.le.adapter;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import a... |
C# | UTF-8 | 1,488 | 2.9375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PerformanceApp
{
public class Module
{
private String code;
private String name;
private int credits;
private List<Assessment> assessments;
pu... |
Java | UTF-8 | 22,794 | 1.90625 | 2 | [] | no_license | /* */ package com.google.gson.internal;
/* */
/* */ import java.io.Serializable;
/* */ import java.lang.reflect.Array;
/* */ import java.lang.reflect.GenericArrayType;
/* */ import java.lang.reflect.GenericDeclaration;
/* */ import java.lang.reflect.Modifier;
/* */ import java.lang.refl... |
PHP | UTF-8 | 257 | 2.84375 | 3 | [] | no_license | <?php
/*
* Request class.
*/
namespace Request;
class Request
{
/**
* @method handle
* @return pointer to array();
*/
function &handle()
{
$this->_request = &$_REQUEST;
return $this->_request;
}
} |
Markdown | UTF-8 | 3,493 | 3.09375 | 3 | [
"MIT"
] | permissive | # N5 Web Application
N5 is a web application that displays the next five races that can be bet on, sorted by the closing date.
When a race is closed, you can no longer bet or view that race.
To view the details of the race, click on the race number and a new page will load displaying the race type, time, competitors ... |
C | UTF-8 | 2,431 | 2.515625 | 3 | [] | no_license | #include "xparameters.h"
#include "xgpio.h"
#include "RLC_decoder_IP.h"
/**************************** user definitions ********************************/
#define CHANNEL 1
//RLC coder base address redefinition
#define RLC_DECODER_IP_BASE_ADDR XPAR_RLC_DECODER_IP_0_S00_AXI_BASEADDR
//RLC coder registers' offset redef... |
Java | UTF-8 | 283 | 2.265625 | 2 | [] | no_license | package leetcode.leetcode23xx.leetcode2357;
import java.util.HashSet;
public class Solution {
public int minimumOperations(int[] nums) {
HashSet<Integer> set = new HashSet<>();
for (int num : nums) if (num != 0) set.add(num);
return set.size();
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.