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
C++
UTF-8
2,584
3.265625
3
[]
no_license
#include<iostream> #define MAX_INNING 50 #define PLAYER 9 using namespace std; int N; int inning[MAX_INNING][9]; int max_score = 0; enum {OUT, HIT1, HIT2, HIT3, HOMERUN}; void baseball(int order[]) { // 0번 선수를 4번 타자(인덱스 3)로 끼워 넣음 // order는 dfs에서 다시 사용되는 포인터이므로 // 새로운 배열 my_order가 필요 int my_order[9]; ...
Markdown
UTF-8
1,313
3.203125
3
[]
no_license
# javascript-beginners-projects ## hello world in this repo I'll work on some simple projects in range beginners-intermediate level, in every folder, you will find `index.html` for **html** file (wow, like you didn't know) **css** and **Js** files. in case you want to take the challenge and make it before you saw the c...
C#
UTF-8
1,536
3.25
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using PetManager.Managers; using PetManager.Models; namespace PetClient { class Program { static void Main(string[] args) { ModelManager mgr = new ModelManager(); ...
Java
UTF-8
5,377
2.90625
3
[ "BSD-3-Clause" ]
permissive
/** * @author Brennan Colberg * @since Dec 7, 2017 */ package bv.framework.state; import java.util.ArrayList; import bv.framework.core.Core; import bv.framework.core.GameStateManager; import bv.framework.graphics.Renderable; import bv.framework.graphics.Renderer; import bv.framework.math.CVector; import bv.framew...
Java
UTF-8
332
2.90625
3
[]
no_license
package people; public class Player { private int health; private String name; public void setHealth(int heal) { health = heal; } public int getHealth() { return health; } public void setName(String nam) { name = nam; } public String getName() { return nam...
C++
UTF-8
636
2.75
3
[]
no_license
/*! \brief file reader for HTML help pages * * \file filereader.cpp * \author Christopher Browne * \date 22.04.2016 */ #include "filereader.h" FileReader::FileReader(QString fileName) : fileName(fileName) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { throw QString("File cannot be...
Python
UTF-8
247
3.484375
3
[]
no_license
# CRIE UMA LISTA VAZIA E RECEBA UM INPUT DE TRES NUMEROS lista = [] lista.append(int(input('Digite o primeiro número: '))) lista.append(int(input('Digite o segundo número: '))) lista.append(int(input('Digite o terceiro número: '))) print(lista)
Python
UTF-8
1,086
2.96875
3
[]
no_license
import socket serverIP = '127.0.0.1' serverPort = 17000 BUFFER_SIZE = 1024 clintSocket = socket.socket(socket.AF_INET,socket.SOCK_DGRAM) while 1: shape = input( "select shape:" ) if not (shape in ['circle', 'sequare', 'rectangle', 'triangle']): print( 'please select valid sharpe!' ) c...
Markdown
UTF-8
4,032
2.890625
3
[]
no_license
data/workexperience.js ====================== The expected structure of workexperience.js is described below: ```javascript var _workexperience = { // Array with each object representing one work position "jobs": [ { // Name of the company (Compulsary field) "company": "Gene...
Python
UTF-8
1,528
3.125
3
[]
no_license
#!/usr/bin/env python # _*_ coding: utf-8 _*_ """ @author: caimengzhi @license: (C) Copyright 2013-2017. @contact: 610658552@qq.com @software: pycharm 2017.02 @project: cmz @file: 图形.py @time: 2018/7/16 17:34 @desc: test on python3.x """ # from PIL import Image, ImageFont, ImageDraw # text = "EwWIieAT" # im = Image.ne...
Python
UTF-8
189
3.5
4
[]
no_license
M = int(input()) position = 1 for _ in range(M): X, Y = map(int, input().split()) if X == position: position = Y elif Y == position: position = X print(position)
Java
UTF-8
3,095
2.28125
2
[]
no_license
package com.inspirenetz.api.test.core.builder; import com.inspirenetz.api.core.domain.CardNumberBatchInfo; import java.sql.Time; import java.sql.Date; /** * Created by ameen on 20/10/15. */ public class CardNumberBatchInfoBuilder { private Long cnbId; private Long cnbMerchantNo; private String cnbName;...
C#
UHC
1,274
2.859375
3
[]
no_license
using System.Collections; using System.Collections.Generic; using UnityEngine; public class Cell { protected CellType cellType; public CellType GetCellType { get { return cellType; } set { cellType = value; } } protected CellBehaviour cellBehaviour; public CellBehaviour Behavio...
Python
UTF-8
2,573
3.515625
4
[]
no_license
# !/usr/bin/python3 """ http://adventofcode.com/2017/day/8 autor: Martin Javorka """ class Day8: def __init__(self): self.input = list() self.registers = list() self.max = 0 self.read_file() self.init_registers() self.part1() def read_file(self): with...
C#
UTF-8
3,928
2.921875
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; using System.Text.RegularExpressions; namespace MegaDesk_3_BradRAllen { public part...
C
UTF-8
400
3.328125
3
[]
no_license
#include <stdio.h> #include <conio.h> float average(float marks[5]); int main(){ float avg,marks[5]={2.0,3.5,1.5,9.0,10.0}; int A[5]={1,2,3,4,5}; avg=average(marks); printf("\nThe Average = %.2f\n",avg); system("pause"); return 0; } float average(float marks[5]) { int i; float sum,average; for(i=0;i<5;i++) {...
C++
UTF-8
1,041
3.171875
3
[]
no_license
// Tyler R. Donaldson // tylerdonaldson@hotmail.com // 4/9/2012 // Definition of necessary templates for odd functions. //***************************************************** // Functionality: // 1. Input Validation - Added on 4/9/2012 //***************************************************** #ifndef TEMPLATES_...
JavaScript
UTF-8
1,682
2.5625
3
[]
no_license
import { SUBMENU_CLOSE, SUBMENU_CLOSE_ALL, SUBMENU_OPEN, SUBMENU_SUB_CLOSE, SUBMENU_SUB_CLOSE_ALL, SUBMENU_SUB_OPEN, } from "../constants/submenuConstants"; import { isActivesValues, subIsActivesValues } from "../data/submenu"; export const submenuReducer = ( state = { isActives: isActivesValues }, act...
Markdown
UTF-8
3,578
2.5625
3
[ "MIT" ]
permissive
# Install docker and docker-compose To install and configure Ambar you need an expertise in unix, Docker and Docker Compose. If you have any difficulties installing and running Ambar you can request a dedicated support session by mailing us on [hello@ambar.cloud](mailto:hello@ambar.cloud) Please refer to official [Do...
TypeScript
UTF-8
1,493
2.515625
3
[ "MIT" ]
permissive
import { DataSource } from './datasource'; import { MongoClient } from 'mongodb'; export class MongoDBSource implements DataSource { public client: MongoClient; private static _instance: MongoDBSource; private constructor() { } public async connect(): Promise<void> { console.log("connecting to mongo"); ...
Markdown
UTF-8
3,199
2.78125
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference", "CC-BY-4.0", "CC-BY-SA-3.0" ]
permissive
# Examples Many of the Flickr API services require an API key or user authentication. Before using these examples, sign up for an app here: https://www.flickr.com/services/apps/create/ These examples assume you have set the following environment variables: | Variable | Value ...
Java
UTF-8
3,068
2.25
2
[]
no_license
package com.bazzillion.ingrid.shelfie; import android.content.SharedPreferences; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.os.Bundle; import androidx.preference.CheckBoxPreference; import androidx.preference.EditTextPreference; import androidx.preference.ListPreference...
C++
UTF-8
701
2.859375
3
[]
no_license
class Solution { public: vector<vector<int>> binTreeSortedLevels(int arr[], int n) { vector<vector<int>> ans; int ju = 1; int co = 0; vector<int> temp; for (int i = 0; i < n; i++) { co++; temp.push_back(arr[i]); if (co == ju) ...
Python
UTF-8
494
3.6875
4
[]
no_license
"""----------Day20----------""" #repeated values can't be print set1 = { 'Hello' , 'Yes' , 5 , 1 , 'Yes' , 3 , 5 } print(set1) #Loop through the set and print the values set2 = { 'A' , 'B' , 'C' , 'D' } for x in set2: print(x) #Check if value is present in the set set3 = { 'Hello' , 'Yes' , 5 , 1 , 3 } print("Yes" ...
Java
UTF-8
3,832
2
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2020 Ingyu Hwang * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
C#
UTF-8
2,324
3.15625
3
[]
no_license
 namespace rt_2_the_next_week.raytrace.Mathematics { /// <summary> /// [Axis aligned bounding box](https://en.wikipedia.org/wiki/Bounding_volume) /// </summary> public class AABB { Vec3 _min; Vec3 _max; public Vec3 Min { get => _min; } public Vec3 Max { get => _max;...
Python
UTF-8
1,131
3.15625
3
[]
no_license
def Register(): hand=open("users.txt","a") print ("--------------") print ("Registration") print ("--------------") users=input("Enter your username : ") passes=input("Enter your password : ") hand.write(users+"\t"+passes+"\n") hand.close() def login(): print ("--------------") ...
Java
UTF-8
3,875
2.171875
2
[]
no_license
package com.gdibernardo.emailservice.pubsub.subscriber; import com.gdibernardo.emailservice.email.Email; import com.gdibernardo.emailservice.email.EmailStatus; import com.gdibernardo.emailservice.email.service.DatastoreEmailService; import com.gdibernardo.emailservice.email.service.EmailSenderService; import com.gdibe...
Python
UTF-8
198
3.53125
4
[]
no_license
print(True) print(False) print('True == 1', True == 1) print('False == 0', False == 0) print(True + False + 66) print(bool('I think, therefore I am')) print(bool('')) print(bool(-1)) print(bool(0))
C++
UTF-8
1,613
2.796875
3
[ "MIT" ]
permissive
#ifndef __sort_iterator_traits_HPP__ #define __sort_iterator_traits_HPP__ # include <iterator> namespace sort { template <class It> using It_traits = std::iterator_traits<It>; template <class It> using It_val = typename It_traits<It>::value_type; template <class It> using It_diff_t = typename It_traits<It>::differe...
Markdown
UTF-8
1,724
2.765625
3
[]
no_license
# 1.data_juggler Functions for converting and exchanging data ## Sql to JSON ### Example 1: #### Create next proc in your MSSQL database: ```sql CREATE PROC sp_data_juggler_test1 as select 'example' as [expamle], GETDATE() as [date], 123.45 [Num], null as [main:] select 'YT-12565' as DocNum, 1 [doc_id:], con...
Java
UTF-8
674
2.828125
3
[]
no_license
package controller; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; public class Textures { /** * the games background */ public static BufferedImage background; /** * loads all textures */ public static void load() { background = loadImage("/res/backgr...
C#
UTF-8
1,139
2.625
3
[ "MIT" ]
permissive
using System; using System.Windows.Forms; using System.Diagnostics; using System.IO; namespace CubeIconReverter { static class Program { public static string filename = "CubeIconReverter.exe"; /// <summary> /// The main entry point for the application. /// </summary> [S...
SQL
UTF-8
5,671
3.0625
3
[]
no_license
-- phpMyAdmin SQL Dump -- version 5.0.3 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost:3306 -- Tiempo de generación: 22-02-2021 a las 20:55:28 -- Versión del servidor: 10.1.48-MariaDB-0+deb9u1 -- Versión de PHP: 7.3.26 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!...
C++
UTF-8
1,958
2.671875
3
[]
no_license
// Copyright (c) 2012 The Foundry Visionmongers Ltd. All Rights Reserved. #include "KatanaAttrFileReader.h" #include "PTreeHelper.h" #include <iostream> extern "C" FileReader* createAttrFileReader() { return new KatanaAttrFileReader(); } AttrData KatanaAttrFileReader::read(std::string filepath) { AttrData ...
Go
UTF-8
792
2.515625
3
[]
no_license
package config import ( "github.com/ilyakaznacheev/cleanenv" ) type ( Config struct { Server `yaml:"server"` Postgres `yaml:"postgres"` CurrencyApi `yaml:"currency_api"` } Server struct { BindAddr string `yaml:"bind_addr"` } Postgres struct { Host string `yaml:"host" env:"DB_HOST"` Por...
Java
ISO-8859-1
1,425
3.78125
4
[]
no_license
package aa21; import java.util.HashMap; import java.util.InputMismatchException; import java.util.Map; import java.util.Scanner; public class MapaAlunoTeste { public static void main(String[] args) { Aluno a1 = new Aluno(1, "Matheus", "SP3030687", "Linguagem de programao"); Aluno a2 = new Aluno(2, "Thiago", "S...
Python
UTF-8
303
3.171875
3
[]
no_license
import io def main(ca): n = input() data = raw_input().split() r = 0 for i in range(n): if i+1 != int(data[i]): r += 1 print "Case #" + str(ca) + ": " + str(r) if __name__=="__main__": cas = input() for i in range(cas): main(i+1)
PHP
UTF-8
535
3.109375
3
[]
no_license
<?php namespace CSTruter\Service\Results; /** * Json Result Class * * This class outputs whatever gets passed to it as JSON, along with its * appropriate headers. * * @package CSTruter\Service\Results * @author Christoff Truter <christoff@cstruter.com> * @copyright 2005-2015 CS Truter * @version 0.1.0 */ cl...
Markdown
UTF-8
1,824
3.421875
3
[]
no_license
README ======== Overview --------- PhpBit is a little OOP library created to make work with Stream of Bits more easy There are 3 types of numbers: Byte, Word and Dword. Sizes are 8, 16 and 32 bits respectively Usage --------- #### Create number #### $byte = new Byte(0xF0); echo $byt...
Python
UTF-8
1,414
2.828125
3
[]
no_license
import math import os import sys from collections import deque # from fractions import gcd input = sys.stdin.readline sys.setrecursionlimit(2147483647) INF = float("inf") IINF = 10 ** 18 MOD = 10 ** 9 + 7 def main(): N = int(input()) graph = [[] for i in range(N+1)] colors = [-1] * (N + 1) init = -1 ...
Markdown
UTF-8
4,982
2.734375
3
[]
no_license
# Reproducible Research: Peer Assessment 1 ## Loading and preprocessing the data ```r data<-read.csv("activity/activity.csv") View(data) ``` ## What is mean total number of steps taken per day? ```r steps_per_day<-aggregate(steps ~ date, data, sum) head(st...
C++
UTF-8
2,121
2.625
3
[]
no_license
// test mpi.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "mpi.h" #include <stdio.h> #include <stdlib.h> #define N 1000 #define MASTER 0 #define NO_OF_ELEMENTS 25 int array[N]; int local_array[N]; int main(int argc, char* argv[]) { int proc_id, no_of_p...
Java
UTF-8
942
2.390625
2
[]
no_license
package pageObjects; import org.openqa.selenium.remote.RemoteWebDriver; import resource.webPage;; public class PageLogin extends webPage { RemoteWebDriver login = browser; public PageLogin() throws Exception{ Thread.sleep(2000); if(login.findElementById("username").isDisplayed()) System.out.println("Pagi...
C
UTF-8
509
3.109375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> int main() { int *A, n, i, up, down; scanf("%d", &n); A = (int *)calloc(n, sizeof(int)); for(i = 0;i < n;i++) scanf("%d", &A[i]); up = down = 0; for(i = 0;i < n - 1;i++) { if(A[i] > A[i + 1]) down++; else if(A[i] < A[i + 1]) up++; if((down != 0) && (up != 0))...
JavaScript
UTF-8
1,037
2.53125
3
[]
no_license
import { GET_STUDY_TODOS_BY_STUDY_ID, CREATE_STUDY_TODO_BY_STUDY_ID, UPDATE_STUDY_TODO_BY_STUDY_ID, DELETE_STUDY_TODO_BY_STUDY_ID, STUDY_TODO_ERROR, } from '../types'; const initialState = { todos: [], loading: true, error: null, }; export default (state = initialState, { type, payload }) => { switc...
Python
UTF-8
4,320
2.703125
3
[]
no_license
import sys import numpy import nltk import pandas from sklearn.feature_extraction.text import TfidfVectorizer from nltk import WordNetLemmatizer, pos_tag from nltk import wordnet from nltk.corpus import stopwords from nltk.tokenize import RegexpTokenizer def calculate_confusion(centers, correct_labels, labels, k): ...
TypeScript
UTF-8
187
2.546875
3
[ "MIT" ]
permissive
export const getEfficiency = ( nominator: number, denominator: number ): string => { const efficiency = (100 * nominator) / denominator return efficiency.toFixed(1) + '% eff.' }
Markdown
UTF-8
3,026
3
3
[]
no_license
--- title: Solutions for digital slug: solutions-for-digital date: SeoDesc: If you’re looking for a leaner, more dynamic approach to managing print, you’ll find that printIQ is a refreshing change from the “old style” of print MIS. With dedicated workflows and streamlined job management tools, printIQ is the perfect ma...
C
UTF-8
826
2.53125
3
[]
no_license
#pragma once #include "aex/klist.h" #include "aex/fs/fd.h" #include "aex/fs/fs.h" enum dev_type { DEV_TYPE_CHAR = 1, DEV_TYPE_BLOCK = 2, DEV_TYPE_NET = 3, }; struct dev_fd { void* data; }; typedef struct dev_fd dev_fd_t; struct dev_char_ops { int (*open) (int fd, dev_fd_t* dfd); int (*r...
Java
UTF-8
3,734
2.96875
3
[]
no_license
import junit.framework.TestCase; public class RationalTest extends TestCase { protected Rational HALF; protected void setUp() { HALF = new Rational( 1, 2 ); } // Create new test public RationalTest (String name) { super(name); } public void testEquality() { assertE...
Java
UTF-8
2,149
2.796875
3
[]
no_license
package helpers; import org.openqa.selenium.Cookie; import org.openqa.selenium.WebDriver; import pages.LoginPage; import pages.MainPage; import java.io.*; import java.util.Set; public class Helper { public static void writeCookiesInFile(WebDriver driver, String email) throws IOException { Set<Cookie> cook...
Java
UTF-8
617
3.609375
4
[]
no_license
package sorting_searching; import java.util.Arrays; /* * https://leetcode.com/problems/meeting-rooms/ * * Meeting Rooms: * Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],...] * (si < ei), determine if a person could attend all meetings. */ public class MeetingRooms...
PHP
UTF-8
638
2.75
3
[]
no_license
<?php class Company extends ActiveRecord\Model{ static $table_name = 'companies'; static $before_save = ['dup_check']; public function dup_check(){ if($this->id) $check = static::find(['conditions' => ['ticker LIKE ? AND id <> ?', $this->ticker, $this->id]]); else $check = static::find(['...
Java
UTF-8
235
1.601563
2
[]
no_license
package com.iiitb.services; import org.springframework.data.jpa.repository.JpaRepository; import com.iiitb.modal.user; public interface userlogindao extends JpaRepository<user, Integer> { user findByUname(String uname); }
JavaScript
UTF-8
2,337
3.59375
4
[]
no_license
// function to calculate the result of the survey $(document).ready( (score = () => { let adventurescore = 0; let comfortscore = 0; let countryscore = 0; // get a list of the radio inputs on the page let choices = document.getElementsByTagName("input"); // loop throu...
Java
UTF-8
346
1.789063
2
[]
no_license
package com.enterprise.resource.dao.redis; import java.util.List; public interface PurchaseItemDao<PurchaseItem> { public List<PurchaseItem> addItem(PurchaseItem item, String user); public List<PurchaseItem> removeItem(String user, Integer... itemIds); public void removeAll(String user); public List<PurchaseItem>...
Markdown
UTF-8
3,813
2.71875
3
[ "MIT" ]
permissive
##Config This page describes all of the options available in the kymera_config.yaml. The options are grouped by their relation to each of the different Kymera components. The config file can be manipulated by in two different ways, either directly by changing the contents of the kymera_config.yaml or programatically u...
Markdown
UTF-8
485
2.796875
3
[]
no_license
# churn-modelling A basic ANN model that predicts whether a person is gonna leave bank in future or not. Model is based on present condition of a individual like his salary, time with bank, etc., and predicts his/her future actions towards bank. As I trained it on 100 epochs, where we can see that while training after ...
PHP
UTF-8
1,517
2.640625
3
[ "MIT" ]
permissive
<?php App::uses('CakeCSFixerTest', 'CakeCSFixer.Test/Case/Lib/Fixer'); App::uses('PhpCloseTagFixer', 'CakeCSFixer.Lib/Fixer'); class PhpCloseTagFixerTest extends CakeCSFixerTest { public function setUp() { parent::setUp(); } public function testCloseTag() { $fixer = new PhpCloseTagFixer(); $wrong = <<<TEST...
C++
UTF-8
7,460
2.59375
3
[]
no_license
#include "stdafx.h" #include "hslUtilities.h" #include <algorithm> #include "ColorPin.h" #include "ColorContrast.h" namespace DxColor { namespace { RgbPart GetMaxComponent(ColorArgb rgb, bite minVal, bite maxVal) { if (maxVal == minVal) return RgbPart::total; if (rgb.R == maxVal) return RgbPart:...
Java
UTF-8
1,897
2.109375
2
[]
no_license
package usr.localcontroller.command; import java.io.IOException; import java.io.PrintStream; import java.util.List; import org.simpleframework.http.Request; import org.simpleframework.http.Response; import us.monoid.json.JSONException; import us.monoid.json.JSONObject; import usr.logging.Logger; import usr.logging.U...
Markdown
UTF-8
2,723
2.546875
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: イマーシブ リーダーを起動して HTML コンテンツを表示する titleSuffix: Azure Cognitive Services description: この記事では、イマーシブ リーダーを起動して HTML コンテンツを表示する方法について説明します。 author: metanMSFT manager: guillasi ms.service: cognitive-services ms.subservice: immersive-reader ms.topic: conceptual ms.date: 01/14/2020 ms.author: metan ms.openlocfilehash...
Java
UTF-8
2,720
2.25
2
[]
no_license
package com.example.controller; import com.example.model.Article; import com.example.model.Comment; import com.example.model.Pressman; import com.example.repository.ArticleRepo; import com.example.repository.CommentsRepo; import com.example.repository.SketchRepo; import org.springframework.beans.factory.annotation.Aut...
C#
UTF-8
1,152
2.734375
3
[]
no_license
using System; using System.Collections.Generic; using System.Text; using System.Xml; using VPleckaitis.Mobile.Warframe.Helpers; namespace VPleckaitis.Mobile.Warframe.Models.External { public static class RssFeedMapper { public static Alert Map<T>(this RssFeedModel entity) where T : Alert { ...
Java
UTF-8
617
1.695313
2
[]
no_license
package com.bestnet.hf; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplicat...
Java
UTF-8
1,067
2.59375
3
[]
no_license
package com.park; import com.park.entity.Ticket; import com.park.entity.Vehicle; import com.park.service.ParkingService; import com.park.service.ParkingServiceImpl; public class App { public static void main(String[] args) { ParkingService parkingService = new ParkingServiceImpl(); parkingService.init(100); ...
C#
UTF-8
475
2.921875
3
[]
no_license
using NUnit.Framework; namespace AlgoSolving.Task0560_Subarray_Sum_Equals_K { public class Tests { [Test] public void AcceptanceTest1() { Assert.That(new Solution().SubarraySum(new[] { 1, 1, 1 }, 2), Is.EqualTo(2)); } [Test] public void Last_element...
Swift
UTF-8
541
2.984375
3
[]
no_license
// // DateExtensions.swift // JustAHabit // // Created by Jaeson Booker on 11/16/18. // Copyright © 2018 Jaeson Booker. All rights reserved. // import Foundation extension Date { var stringValue: String { return DateFormatter.localizedString(from: self, dateStyle: .medium, timeStyle: .none) } ...
Markdown
UTF-8
21,292
3.859375
4
[]
no_license
## 第9章 类和模块 ### 1. 类和原型 + 在JavaScript中,类的所有实例对象都从同一个原型对象上继承属性,因此原型对象是类的核心。 ### 2. 类和构造函数 + 调用构造函数的一个重要特征是:构造函数的prototype属性都被用作新对象的原型,这意味着通过同一个构造函数创建的所有对象都继承自一个相同对象,因此他们是同一个类的成员。 (1)构造函数和类的标识 + 原型对象是类的唯一标识,当且晋档两个对象继承自同一个原型对象时,它们才属于同一个类的实例。 (2)constructor属性 + 任何JavaScript函数都可以用作构造函数,并且调用构造函数是需要用到一个prototype属性的,因此每个Java...
Python
UTF-8
473
3.609375
4
[]
no_license
def rec_preorder(node, result): if node: result.append(node.val) rec_preorder(node.left, result) rec_preorder(node.right, result) #Basically a DFS def iter_preorder(root): if not root: return result = [] stack = [root] while stack: node = stack.pop() result.append(node.val) ...
PHP
UTF-8
1,224
2.65625
3
[]
no_license
<?php class modelPagamento { private $id; private $pedido; private $pag; private $tPag; private $vPag; private $card; private $CNPJ; private $tBand; private $cAut; public function getId(){ return $this->id; } public function setId($id){ $this->id = $id; } public function get...
C#
UTF-8
2,699
2.921875
3
[ "Apache-2.0" ]
permissive
using System.Globalization; namespace EFIngresProvider.SqlGen { /// <summary> /// TopClause represents the a TOP expression in a SqlSelectStatement. /// It has a count property, which indicates how many TOP rows should be selected and a /// boolen WithTies property. /// </summary> class TopC...
C++
UTF-8
1,829
3.015625
3
[ "MIT" ]
permissive
#include "box.h" float Box::surface_area(){ return 2.*(side_length[0]*side_length[1] + side_length[1]*side_length[2] + side_length[2]*side_length[0] ); } Collision Box::next_collision_with(Particle* ptcl){ // record the collision event Collision collision; collision.colli...
Java
UTF-8
1,184
2.078125
2
[]
no_license
package com.Dao; import com.pojo.Comment; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; import java.util.List; @Repository public interface C...
Java
UTF-8
5,778
2.1875
2
[]
no_license
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package shapefileloader; import dao.GeoDao; import database.DBUtils; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Connection; import java.util.ArrayList; import ...
TypeScript
UTF-8
1,632
2.875
3
[ "MIT" ]
permissive
import { Action } from '@ngrx/store'; import { ActionType } from './action-type.enum'; export const displayableTypes = ['string', 'number', 'boolean', 'object']; export type MessageValueTypes = 'string' | 'number' | 'boolean' | 'object' | 'null' | 'array'; const MAX_MESSAGES = 500; export interface IAction extends A...
C
UTF-8
2,034
3.046875
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <time.h> #include <sys/time.h> #define ALLOC_MEM_SIZE (100 * 1024 * 1024) unsigned long *buf, *curr_pos; unsigned long func_call = 0; /* ackermann function */ unsigned long ack(unsigned long m, unsigned long n) { unsigned long val; unsigned long random_num = rand(); ...
PHP
UTF-8
506
3.859375
4
[]
no_license
<?php $isOk = false; ?> <!DOCTYPE html> <html lang="fr" dir="ltr"> <head> <meta charset="utf-8" /> <title>Exercice 8 partie 2 php</title> </head> <body> <p>Traduire ce code avec des if et des else :</p> <p>< ? php</p> <p>echo ($isOk) ? 'c'est ok !!' : 'c'est pas bon !!!';</p> <p>?></p> <!-- même exo que l...
Markdown
UTF-8
1,365
3.890625
4
[]
no_license
# BIG O Notation Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. ## Common Notations O(1) describes an algorithm that will always execute in the same time (or space) regardless of the size of the input data set. A process that doesn't involve a calculation being ...
C++
UTF-8
4,907
3.171875
3
[]
no_license
#pragma once #include <vector> #include <memory> #include <functional> #include <algorithm> #include <cassert> namespace tgvoiprate { class VectorOfColumns { public: using Iterator = std::vector<double>::iterator; VectorOfColumns(const std::vector<double>& data, size_t rowsCount) : mRowsCount{rowsC...
Markdown
UTF-8
700
2.578125
3
[ "MIT" ]
permissive
# ハンズオン: 相談員とAI、あなたはどちら このハンズオンでは、前のハンズオンで作成したフローをもとに __お悩み相談__ を変更し発信者の入力をもとにフローを分岐させる方法を学習します。 ## ハンズオンのゴール - 相談者の入力を取得する方法を学習する - フローを分岐する方法を学習する ## 手順 1. [相談者の入力を取得し、フローを分岐させる](01-Gather-Split-Flow.md) 2. [分岐したフローをそれぞれ設定する](02-Setting-Wdigets.md) ## 次のハンズオン [ハンズオン: 高度な機能の活用](/docs/03-Studio-Advanced-Features/0...
Markdown
UTF-8
738
3.34375
3
[ "CC-BY-4.0" ]
permissive
# sys.setrecursionlimit Published: 23 June 2020, 18:00 Python doesn't support [tail recursion](https://t.me/pythonetc/239). Hence, it's easy to face `RecursionError` when implementing recursive algorithms. You can get and change maximum recursion depth with [sys.getrecursionlimit](https://docs.python.org/3/library/sy...
Markdown
UTF-8
4,822
2.515625
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: Using Azure Stack HCI on a single server description: This article describes Azure Stack HCI OS on a single server author: ronmiab ms.author: robess ms.topic: overview ms.reviewer: kimlam ms.lastreviewed: 01/17/2023 ms.date: 01/17/2023 --- # Using Azure Stack HCI on a single server [!INCLUDE [applies-to](....
Java
UTF-8
1,991
2.40625
2
[]
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 com.walmart.ticketservice.service; import com.walmart.ticketservice.data.Seat; import java.util.Optional; import java.util.str...
Ruby
UTF-8
1,858
2.796875
3
[]
no_license
require 'sqlite3' require_relative 'questions_db' require_relative 'like' require_relative 'user' require_relative 'follow' require_relative 'question' class Reply attr_accessor :author_id, :parent_id, :id, :body def initialize(input = {}) @author_id = input['author_id'] @parent_id = input['parent_id'] ...
JavaScript
UTF-8
531
4.3125
4
[]
no_license
const basket = ["apples", "oranges", "grapes"]; //for for (let i = 0; i < basket.length; i++) { console.log(basket[i], " for"); } //forEach basket.forEach((item) => console.log(item, "forEach")); //for of for (item of basket) { console.log(item, "for of"); } // iterating -> we are able to go 1 by 1 through an a...
C++
UTF-8
2,294
2.609375
3
[]
no_license
#ifndef URLLINEEDIT_H #define URLLINEEDIT_H #include <QtCore/QUrl> #include <QtWidgets/QLineEdit> #include <QtWidgets/QAbstractButton> #include <QtWidgets/QPushButton> class QLineEdit; class WebView; class BrowserMainWindow; /* * Search icon on the left hand side of the search widget * When a menu is set a down ar...
Java
UTF-8
1,989
2.046875
2
[]
no_license
package com.yq.xcode.common.bean; import java.util.List; public class ContractFunctionView { /** * 第几个函数 */ private Integer ind; /** * functionCode = eleNumber */ private Long functionId; private String functionCode; /** * functionName = eleName */ private String functionName; private String descr...
Markdown
UTF-8
9,510
3.046875
3
[ "MIT" ]
permissive
--- layout: post title: "Following my SPA into the DOM Living Standard docs" date: 2020-09-21 13:50:32 -0400 permalink: following_my_spa_into_the_dom_living_standard_docs --- At the point that I imagined, wireframed and built the API and frontend for Writing Place, I had been in Flatiron’s Fullstack progr...
JavaScript
UTF-8
1,437
2.890625
3
[]
no_license
(function(){ var stickyContent; var posStickyContent; var scrollY; function stickyOnscroll() { stickyContent = document.querySelector('.js-sticky'); scrollY = window.pageYOffset; if(stickyContent) { posStickyContent = stickyContent.getBoundingClientRect().top + scrollY; setWidth(); ...
Markdown
UTF-8
781
2.625
3
[ "MIT" ]
permissive
# Web应用防火墙拦截上传文件的请求 {#concept_j4m_kfl_q2b .concept} ## 问题描述 {#section_qpw_kfl_q2b .section} 在浏览器中调用POST方法上传文件时,会有一定的概率出现405错误,提示被Web应用防火墙拦截。 ## 问题原因 {#section_rpw_kfl_q2b .section} 因为POST方法上传文件时,文件本身的内容也会被转码放到POST请求的body中一起上传,并且同样会被Web应用防火墙检测到。当转码后的文件中出现一些关键字时,就会被Web应用防火墙误认为含有恶意代码,从而拦截。 ## 解决方案 {#section_spw_kfl_q...
Shell
UTF-8
2,351
3.296875
3
[]
no_license
#!/bin/sh #author: minus42 version="Version: 0.4" if [[ $1 ]] then if [ $1 = "-v" ] then echo $version exit else echo "only -v or no parameter allowed" exit fi fi echo "Generating dump, please hold the line!" now1=$(date +"%d.%m.%Y") now2=$(date +"%H:%M") sys=`uname -s` if [ x$sys = xDarwin ] ; then nam...
Java
UTF-8
7,669
2
2
[]
no_license
package com.aumaid.bochihhott.PartnerModule; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle...
C++
WINDOWS-1252
1,729
2.71875
3
[]
no_license
/* * Config.h * * Author: JochenAlt */ #ifndef __ACTUATOR_CONFIG_H_ #define __ACTUATOR_CONFIG_H_ #include "Arduino.h" #include "core.h" #include "HerkuleX.h" #define NUMBER_OF_LEGS 5 // total number of legs #define HERKULEX_BAUD_RATE_DEFAULT 115200 // baud rate for connection to herkulex servos #define...
PHP
UTF-8
492
2.578125
3
[ "MIT" ]
permissive
<?php /** * Hours per week fieldset * * @author Alex Peshkov <alex.peshkov@valtech.co.uk> * @author Rob Caiger <rob@clocal.co.uk> */ namespace Common\Form\Elements\Types; use Laminas\Form\Fieldset; /** * Hours per week fieldset * * @author Alex Peshkov <alex.peshkov@valtech.co.uk> * @author Rob Caiger <rob@...
Python
UTF-8
990
3.28125
3
[]
no_license
import requests from bs4 import BeautifulSoup # scrape list of 100 space facts from: url = 'https://www.thefactsite.com/2012/01/100-random-facts-about-space.html' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36'} def ge...
Python
UTF-8
4,481
2.78125
3
[]
no_license
import sys,os import curses import math import redis ''' Init Redis ''' r = redis.StrictRedis(host='redis.hwanmoo.kr', port=6379, db=1) class Screen: def __init__(self): self.k = 0 self.cursor_x = 0 self.cursor_y = 0 def init_menu(stdscr): # Clear and refresh the scree...
JavaScript
UTF-8
925
2.84375
3
[]
no_license
import React from 'react'; function PokeList({cards, visibilityFilter, handleClick}) { console.log(`The visibility filter is: ${visibilityFilter}`); let filteredCards = cards; if (visibilityFilter === 'caught') { console.log('Caught Filter'); filteredCards = filteredCards.filter(card => ca...
PHP
UTF-8
1,279
2.71875
3
[]
no_license
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="keywords" content="CIS Restaurant, Lunch Menu"> <meta name="description" content="CIS Restaurant: Lunch Menu"> <title>CIS Restaurant Menu</title> <link rel="stylesheet" type="text/css" href="../style.css"> <link rel="stylesheet" type="text/css" hre...