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
820
2.609375
3
[]
no_license
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Computer_Era.Game.Objects { public class OperatingSystemProperties { public string Description { get; set; } public string Author ...
Python
UTF-8
3,091
2.609375
3
[]
no_license
import os import os, sys from shutil import rmtree from os import makedirs from os import remove import shutil # intérprete para operaciones de entrada y salida basadas en archivos from io import open # Hostname import socket # Json import json # Date Time import time from datetime import date from datetime import da...
PHP
UTF-8
213
2.578125
3
[]
no_license
<?php function generateCookie($user,$password,$checkbox){ if($checkbox == true) { setcookie("cuser",$user,time()+60*60*24*30); setcookie("cpass",$password,time()+60*60*24*30); } } ?>
Shell
UTF-8
238
2.703125
3
[]
no_license
#!/bin/bash # Set Flatfish's home path here FLATFISH_PATH="$HOME/workspace/flatfish" # Don't change these unless you know what you are doing USER="$(id -nu)" UUID="$(id -u)" UGID="$(id -g)" export FLATFISH_PATH export UUID export UGID
C++
UTF-8
348
2.8125
3
[]
no_license
#include<bits/stdc++.h> #define lld long long int using namespace std; int mobius(int n){ int p= 0; if(n%2==0){ n = n/2;p++; if(n%2==0)return 0; } for(int i=3;i<=sqrt(n);i+=2){ if(n%i==0){ n=n/i;p++; if(n%i==0)return 0; } } return (p%2==0)?-1:1; } int main(){ cout<<mobius(17...
C#
UTF-8
7,422
2.78125
3
[ "MIT" ]
permissive
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Collections.Generic; using Xunit; namespace System.Numerics.Matrices.Tests { /// <summary> /// Tests for the Matrix1x3 structure. /// </summ...
Java
UTF-8
853
3.578125
4
[]
no_license
package com.cei37.arrays_strings; import java.util.HashMap; import java.util.Map; public class ReplaceString { /** * */ public static void main(String[] args) { String original = "This is a String to test some options that I saw before."; String remove = "aeiou"; System.out.println(removeCh...
C++
UTF-8
21,167
2.703125
3
[]
no_license
// // Created by jhwangbo on 07/09/17. // #ifndef BENCHMARK_MATH_HPP #define BENCHMARK_MATH_HPP #include <Eigen/Core> #include <vector> #include <memory> #include <numeric> #include "math.h" #include <iostream> #include <stdlib.h> #include "float.h" #include "raiCommon/rai_utils.hpp" #include "immintrin.h" namespace...
Python
UTF-8
337
3.296875
3
[]
no_license
''' Sem erros Poderia acrescentar comentarios exemplo:#essse programa calcula o valor de pi usando numeros aleatorio, #importando variaveis, #calculando valorda funcao, #calculando o somantorio, etc Sandra: 3.5 ''' from math import sqrt, pi, exp m = 0 s = 2. x = 1. gaussiana = 1/(s*sqrt(2*pi))*exp(-1/2.*((x-m)/s)**2) ...
C++
UTF-8
1,438
2.625
3
[]
no_license
#include <iostream> #include <openctm.h> #include <jtflib/mesh/io.h> using namespace std; using namespace zjucad::matrix; int main(int argc, char *argv[]) { if ( argc != 3 ) { cerr << "#usage: ./test_ctm model.obj model.ctm\n"; return __LINE__; } matrix<size_t> tris; matrix<double> nods; jtf::mesh::...
Java
UTF-8
2,971
3.3125
3
[]
no_license
//This file creates the opening screen of the program. package starter; import java.awt.Color; import java.awt.event.MouseEvent; import java.awt.*; import acm.program.*; import acm.graphics.*; public class MenuPane extends GraphicsPane { private MainApplication program; // you will use program to get access to ...
PHP
UTF-8
659
3
3
[]
no_license
<?php namespace Battleship\Ship; class ShipFactory { public static function build($id) { switch ($id) { case Carrier::ID: return new Carrier(); break; case Battleship::ID: return new Battleship(); break; ...
Java
UTF-8
486
1.96875
2
[]
no_license
package com.ssm.service.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ssm.dao.ShopMapper; import com.ssm.pojo.Shop; import com.ssm.service.ShopService; @Service public class ShopServiceImpl i...
Python
UTF-8
303
3.34375
3
[ "MIT" ]
permissive
""" """ import subprocess import time start = time.time() sleep_procs = [] for _ in range(10): proc = subprocess.Popen(["sleep", "1"]) sleep_procs.append(proc) for proc in sleep_procs: proc.communicate() end = time.time() delta = end - start print(f"Finished in {delta:.3} seconds")
C++
UTF-8
584
3.3125
3
[]
no_license
#include "PriorityQueue.h" #include <iostream> using namespace std; int main() { priorityQueue myqueue; if (myqueue.empty()) cout << "My priority Queue is empty\n" << endl; myqueue.insert(59); myqueue.insert(41); myqueue.insert(25); myqueue.insert(12); myqueue.insert(91); myqueue.min(); myq...
PHP
UTF-8
1,392
2.609375
3
[ "MIT" ]
permissive
<?php use app\components\core\Selector; use app\components\form\Form; use app\models\Book; $model = $body['book'] ?? new Book(); $form = new Form('/library/book/add', Form::POST, $model, $errors ?? []); $isnbField = $form->field('ISBN', 'isbn'); $titleField = $form->field('Title', 'title'); $authorField = $form->fie...
Ruby
UTF-8
906
3.953125
4
[]
no_license
def create_array_of_bottles array_of_bottles = [] bottle_with_p = rand(1000) 1000.times do |i| temp_bottle = Bottle.new if i == bottle_with_p temp_bottle.is_poison = true; end array_of_bottles << temp_bottle end array_of_bottles end def find_poison(array_of_bottles) array_of_bottles...
Markdown
UTF-8
3,961
3.046875
3
[]
no_license
--- title: Capitalism has its flaws tags: - history - creating-art - blog - climate change date: "2019-03-18" --- ![capitalismhasitsflaws](capitalismhasitsflaws.jpg) <b>Again.. stress alert.. do not read this if you have significant depressive states.. you have been warned</b> Don'...
Markdown
UTF-8
5,197
2.984375
3
[]
no_license
--- id: 640 title: 'Twitter via IM. It isn&#039;t just about the track.' date: 2009-03-13T08:40:14+00:00 author: Tyler (Chacha) layout: post guid: http://chacha102.com/?p=640 permalink: /twitter-via-im-it-isnt-just-about-the-track-2/ jd_tweet_this: - yes wp_jd_clig: - http://cli.gs/MRRMdD categories: - Misc --- I...
Python
UTF-8
1,426
2.65625
3
[]
no_license
#-*- coding:utf-8 -*- import logging import logging.config ''' #1 logging.warning('watch out') logging.info('i told u') # 输出 loggin 只会打印输出比 warning 更高级别的日志 WARNING:root:watch out ''' ''' # 配置 logging # 存入文件名 # 存入的类型 logging.basicConfig(filename='example.log',level=logging.INFO) ...
C++
UTF-8
586
2.546875
3
[ "Apache-2.0" ]
permissive
#include<iostream> #include<string> using namespace std; int t; int x,y,l; string s; int c; bool map[101][101]; int main() { //freopen("in1656.txt","r",stdin); while(cin>>t) { memset(map,false,sizeof(map)); while(t--) { cin>>s>>x>>y>>l; c=0; for(int i=x;i<=x+l-1;++i) { for(int j=y;j<=y+l-1;...
Python
UTF-8
3,863
3.25
3
[]
no_license
#!/usr/bin/env python # coding: utf-8 # # Watttime Interview Assessment # In[22]: import pandas as pd # In[23]: data_gppd = pd.read_csv("gppd.csv") # In[24]: data_entso = pd.read_csv("entso.csv") # In[25]: data_platts = pd.read_csv("platts.csv") # In[ ]: # #### Function to clen the country names ...
TypeScript
UTF-8
1,012
2.625
3
[]
no_license
import {CoursesService} from './courses.service'; import {Course} from "../interfaces/course.inteface"; describe('CoursesService', () => { let coursesService: CoursesService; beforeEach(() => { coursesService = new CoursesService(); }); it('should create an instance', () => { expect(coursesService).t...
C#
UTF-8
1,475
3.5
4
[]
no_license
public class Solution { public int LadderLength(string beginWord, string endWord, IList<string> wordList) { if (wordList == null || !wordList.Contains(endWord)) { return 0; } var result = 1; var wordSet = new HashSet<string>(wordList); var queue = new Que...
Java
UTF-8
203
1.625
2
[]
no_license
package repository; import main.AdressClient; import org.springframework.data.jpa.repository.JpaRepository; public interface AdressClientRepository extends JpaRepository<AdressClient, Long> { }
Java
UTF-8
629
2.0625
2
[]
no_license
package com.example.olympia.implementations.service; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.example.olympia.abstractions.dao.ClientDAO; import com.example.olympia.a...
Python
UTF-8
1,155
3.53125
4
[]
no_license
# """ # This is BinaryMatrix's API interface. # You should not implement it, or speculate about its implementation # """ #class BinaryMatrix(object): # def get(self, row: int, col: int) -> int: # def dimensions(self) -> list[]: class Solution: def leftMostColumnWithOne(self, binaryMatrix: 'BinaryMatrix') -> ...
Java
UTF-8
436
2.203125
2
[]
no_license
package com.technicalsand.user; import org.hibernate.EmptyInterceptor; import org.springframework.stereotype.Service; @Service public class CustomInterceptor extends EmptyInterceptor { @Override public String onPrepareStatement(String sql) { System.err.println("Before Modifying SQL =" + sql); sql = sql.replace(...
PHP
UTF-8
3,167
2.53125
3
[]
no_license
<?php if (!isset($_COOKIE['name']) || !isset($_COOKIE['pass']) || $_COOKIE['name'] == "" || $_COOKIE['pass'] == "") { echo "notexist"; exit(); } $db = mysqli_connect("localhost", "risk_game", "", "riskdb"); $name = $_POST["name"]; $pass = $_POST["pass"]; $stmt = $db->prepare("SELECT `user_id` FROM players WHERE `...
Python
UTF-8
394
2.984375
3
[]
no_license
# # @lc app=leetcode.cn id=69 lang=python3 # # [69] x 的平方根 # class Solution: def mySqrt(self, x: int) -> int: if x<=1: return x left=0 right=x while left<right: mid=left+(right-left)//2 s=mid*mid if s<=x: left=mid+1 ...
Java
UTF-8
1,421
2.734375
3
[]
no_license
package vn.edu.techkids.controllers.enemyplanes; import vn.edu.techkids.controllers.ControllerManager; import vn.edu.techkids.models.GameConfig; /** * Created by qhuydtvt on 5/6/2016. */ public class EnemyPlaneControllerManager extends ControllerManager { private int count = 0; private int planeType = 0; ...
SQL
UTF-8
6,718
3.21875
3
[]
no_license
DROP TABLE transacao_empresa; DROP TABLE transacao; DROP TABLE funcao_func; DROP TABLE funcionario; DROP TABLE tipo_funcao; DROP TABLE tipo_setor; DROP TABLE socio; DROP TABLE aluno; DROP TABLE telefone_empresa; DROP TABLE endereco_empresa; DROP TABLE empresa; DROP TABLE telefone; DROP TABLE end...
Ruby
UTF-8
820
2.71875
3
[ "MIT" ]
permissive
class LeTitle < ActiveRecord::Base validates_length_of :name, :within => 0..20 validates_uniqueness_of :name, :message => :already_exists validates_length_of :description, :maximum => 80 #----------------------------------------------------------------------------- # Base methods: #----------------------...
Python
UTF-8
1,523
3.984375
4
[]
no_license
# Reorder LinkedLists in Python # Author: Pavan kumar Paluri # LeetCode-Medium # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reorderList(self, head: ListNode) -> None: """ D...
Python
UTF-8
3,755
2.734375
3
[]
no_license
#! /usr/bin/env python3 import sys import unittest # from wherever import deco class Tests(unittest.TestCase): def assert2ring(self, seed, tape, reps, pats, out): result = deco.run([str(seed), tape, str(reps), *pats]) output = '\n'.join(out) + '\n' self.assertEqual(result.returncode, 0)...
C++
UTF-8
1,197
2.9375
3
[]
no_license
class Solution { public: void merge(int A[], int m, int B[], int n) { if (m == 0){ for(int i = 0; i < n; i++) A[i] = B[i]; return; } int indexA = m - 1; int indexB = n - 1; int indexNew = m + n - 1; while (inde...
Markdown
UTF-8
1,644
3.109375
3
[]
no_license
CS370-Project Term project for Operating Systems course (CS 370, Spring 2020) consisting of a group of 4. Overview: Our project’s objective is to develop an intelligent music player that recognizes human emotions. It will take an image from a camera when a sensor is triggered. Then, a song will play corresponding to th...
C++
UTF-8
2,422
3.515625
4
[ "Apache-2.0", "LLVM-exception", "NCSA" ]
permissive
// RUN: %clang_cc1 -std=c++20 -verify %s // RUN: %clang_cc1 -std=c++17 -verify %s namespace One { char (&b(int(&&)[1]))[1]; // #1 expected-note{{too many initializers}} char (&b(int(&&)[2]))[2]; // #2 expected-note{{too many initializers}} void f() { static_assert(sizeof(b({1})) == 1); // #1 static_assert(size...
C++
UTF-8
1,376
3.53125
4
[]
no_license
// Implement the Calculator class #include "calculator.h" #include <math.h> #include <iostream> #include <regex> #include <string> #include <vector> Calculator::Calculator(std::string input) { std::regex decimalRegex("([-0-9\\.]+)"); std::smatch match; while (std::regex_search(input, match, decimalRegex)) { ...
JavaScript
UTF-8
1,799
2.84375
3
[]
no_license
import React, { useState } from 'react' import {TextField, Button} from '@material-ui/core' import './form.css' const Form = () => { const addLocationHandler = () => { setFormInputs([...formInputs, `Location ${count}`]) setCount(count + 1) } const deleteLocationHandler = () => { ...
Markdown
UTF-8
2,366
3.125
3
[]
no_license
# thrift 使用手册 ## thrift介绍 RPC框架:简单的说,RPC就是从一台机器(客户端)上通过参数传递的方式调用另一台机器(服务器)上的一个函数或方法(可以统称为服务)并得到返回的结果。 用户通过Thrift的IDL(接口定义语言)来描述接口函数及数据类型,然后通过Thrift的编译环境生成各种语言类型的接口文件,用户可以根据自己的需要采用不同的语言开发客户端代码和服务器端代码。 使用thrift框架,可以屏蔽传输等一大堆中间事务,我们只需要: 1. 定义(约定)一个接口(.thrift)文件,然后用thrift生成Java类。这个类由客户端和服务端共同拥有并使用。 2. 服务端根据文件中定义的接口,做出具体...
Java
UTF-8
300
2.046875
2
[]
no_license
package es.uam.eps.ads.p4.Exceptions; public class UsuarioNoRelevante extends Exception { private static final long serialVersionUID = 919937515513416439L; public UsuarioNoRelevante() { } @Override public String toString() { return "Relevant items cannot be empty"; } }
Python
UTF-8
466
3.234375
3
[]
no_license
from Crypto.Cipher import AES pad = b" " print(pad) obj = AES.new("This is a key123", AES.MODE_CBC, "This is an IV456") message = input("Enter a message to encrypt: ") plaintext = message.encode("utf-8") print(plaintext) length = 16 - (len(plaintext)%16) print(length) plaintext += length*pad print(plaintext) ciphertex...
Java
UTF-8
831
2.0625
2
[]
no_license
package com.praksa.musicexplorer.model; import javax.persistence.EmbeddedId; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.MapsId; import javax.persistence.Table; import lombok.Getter; import lombo...
PHP
UTF-8
4,245
2.71875
3
[]
no_license
<!DOCTYPE html> <?php session_start(); function swap(&$x,&$y) { $tmp=$x; $x=$y; $y=$tmp; } if(!isset($_SESSION['loadCounter'])){ $_SESSION['loadCounter'] = 1; } if(isset($_POST['checkoff'])){ if(count($_SESSION['actions']) == 1) { ...
Markdown
UTF-8
3,133
3.25
3
[ "MIT" ]
permissive
# Pimple IoC Class resolver for the [Pimple](http://pimple.sensiolabs.org/) container. This project is heavily inspired by how [Laravel](http://laravel.com/) resolve it's classes out of their IoC container. In fact most of the code is taken directly from their ```Container``` class. ## Installation Add the IoC contai...
Java
UTF-8
164
1.882813
2
[]
no_license
package com.cg.eis.service; import com.cg.eis.beans.Employee; public interface EmployeeServiceInterface { abstract String schemeGenerator(int salary); }
TypeScript
UTF-8
1,389
2.75
3
[]
no_license
import { Component, OnInit } from '@angular/core'; import { ValidatorFn, FormControl } from 'reactive-forms-module2-proposal'; // regex from https://www.regextester.com/96683 const dateRegex = /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/; const dateValidatorFn: ValidatorFn = control => { if (!dateRegex.tes...
Swift
UTF-8
1,123
2.6875
3
[]
no_license
// // ViewController.swift // DemoTelCall // // Created by zj-db0465 on 15/10/10. // Copyright © 2015年 icetime17. All rights reserved. // import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, ...
Java
UTF-8
6,720
2.859375
3
[]
no_license
package abd; import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.stream.Collectors; import java.util.stream.IntStream; public class Workload { /** Instance variables **/ private final Random rand; private static final int populate_size = 5000; ...
Markdown
UTF-8
650
2.734375
3
[ "Apache-2.0" ]
permissive
[leakcanary-android-core](../index.md) / [leakcanary](index.md) / [&lt;no name provided&gt;](./-no name provided-.md) # &lt;no name provided&gt; `fun <no name provided>(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) Listener set in [LeakCanary.Config](-leak-canary/-config/index.md...
C
UTF-8
243
3.40625
3
[]
no_license
#include<stdio.h> void swap(int *, int *); void swap(int *x,int *y) { *x=*x^*y; *y=*x^*y; *x=*x^*y; } int main() { int x=10,y=20; printf("\nbefore swap x=%d,y=%d",x,y); swap(&x,&y); printf("\nafter swap x=%d,y=%d",x,y); return 0; }
C++
UTF-8
1,649
3.359375
3
[]
no_license
#include <bits/stdc++.h> using namespace std; void dfs(vector<vector<int> > &adj_list, int node, vector<bool> &visited,unordered_set<int>* single_component) { if(visited[node]) return; visited[node] = true; single_component->insert(node); vector<int> adj_nodes = adj_list[node]; for (int neighbour : adj_nodes) { ...
Ruby
UTF-8
605
3.59375
4
[]
no_license
class Rotor # initialiser les rotor avec un row def initialize(row) @row = row end ALPHABET = ('a'..'z').to_a def rotor_combination Hash[ ALPHABET.zip(permutator)] end def permutator generated_alphabet = [] ALPHABET.each do |letter| if (letter.ord + @row) < 123 && (letter.ord + @...
C++
UTF-8
415
2.796875
3
[]
no_license
#define LEXER_H #include <stdio.h> #include <iostream> #include <vector> #include <stdlib.h> #include "Token.h" class Lexer { char c; // Wrapper that checks sigle character tokens // ( '+', '-', '('... etc ) Token checkToken(char tok); public: // Initialize c as NULL Lexer () : c('\0') { }; ...
C++
UTF-8
1,509
2.671875
3
[]
permissive
// This file is part of CAF, the C++ Actor Framework. See the file LICENSE in // the main distribution directory for license terms and copyright or visit // https://github.com/actor-framework/actor-framework/blob/master/LICENSE. #pragma once #include "caf/detail/comparable.hpp" #include <string> namespace caf { //...
Markdown
UTF-8
642
2.625
3
[]
no_license
# finalportfolio2021spring This is the final for my visual argument which I turned into a series. Attached in this file is the feedback from people from that workshop day in class. I have also provided screenshots of the work that was made before for the website. I have also linked the sources in here for the visua...
PHP
UTF-8
1,202
2.84375
3
[ "MIT" ]
permissive
<?php require('../includes/header.inc.php'); ?> <?php $this->renderBegin(); ?> <div id="instructions"> <h1>The Four-Function Calculator: Our First Simple Application</h1> <p>We can combine this understanding of statefulness and events to make our first simple QCubed Forms application.</p> <p>This calculator is ...
Python
UTF-8
10,413
2.8125
3
[]
no_license
from ..methods import BaseMethod class sendSticker(BaseMethod): """Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned. Parameters ---------- chat_id : Integer or String Unique identifier for the target chat or username of the tar...
Java
UTF-8
869
2.234375
2
[]
no_license
import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import org.junit.Test; import org.junit.rules.TemporaryFolder; public class JUnit extends User{ private String testname; @Test public void testSetname() { User test=new User(); test.userName="abc"; assertEquals("abc",te...
Java
UTF-8
576
3.890625
4
[]
no_license
public class Main { public static void main(String[] args) { int result = 10 + 20; // ' // ' is a single line comment // ' = ' is a assignment operator System.out.println("The result of 10 + 20 :"+result); result *= 10; System.out.println("result of ( 10+20 )*10 :"+...
C
UTF-8
356
3.390625
3
[]
no_license
#include<stdio.h> int main() { int n,y = 0,m = 0,d = 0; scanf("%d",&n); if(n >= 365) { y = y + n /365; n = n % 365; } if(n >= 30) { m = m+ n/30; n = n % 30; } if(n >= 0) { d = d +n; } printf("%d years\n%d months\n...
PHP
UTF-8
2,051
2.9375
3
[]
no_license
<?php class Ampersand_BinPack_Output { protected $_bins; /** * @param Ampersand_BinPack_State $state * @return Ampersand_BinPack_Output * @author Josh Di Fabio <josh.difabio@ampersandcommerce.com> */ public static function factory(Ampersand_BinPack_State $state) { $outp...
C++
UTF-8
1,211
2.734375
3
[]
no_license
#include "Methods.h" #include <iostream> #include <jni.h> #include <string.h> JNIEXPORT void JNICALL Java_Methods_accessConstructor(JNIEnv* env, jobject obj) { jmethodID mid; jclass cls = env->GetObjectClass(obj); mid = env->GetMethodID(cls, "<init>", "(Ljava/lang/String;)V"); if (mid ==NULL){ ...
Java
UTF-8
2,134
2.21875
2
[]
no_license
package com.ndrmf.complaint.model; import java.time.LocalDateTime; import java.util.UUID; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; imp...
Java
GB18030
1,324
2.453125
2
[]
no_license
package taobao; import java.util.Date; import com.yueqian.cn.dao.IUserDao; import com.yueqian.cn.dao.entity.User; import com.yueqian.cn.dao.impl.StudentDao; import com.yueqian.cn.dao.impl.StudentDaoImpl; import com.yueqian.cn.dao.impl.UserDaoImpl; public class TsetStudenDaoImpl { public static void main(...
C#
UTF-8
1,945
3.765625
4
[]
no_license
namespace Exam_Maslan { using System; using System.Numerics; using System.Text; public class Maslan { private const int MaxTransformationsCount = 10; private const int DesiredSumLength = 1; public static void Main() { StringBuilder input = new StringBui...
Java
UTF-8
3,215
2.03125
2
[ "Apache-2.0" ]
permissive
/* * Copyright 2014 JBoss Inc * * 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 to i...
Python
UTF-8
368
3.09375
3
[]
no_license
#!/usr/bin/env python3 """ converts a label vector into a one-hot matrix. """ import tensorflow.keras as K def one_hot(labels, classes=None): """ - Converts a label vector into a one-hot matrix. - last dimension of the one-hot matrix must be the number of classes. """ cat = K.utils.to_categori...
Java
UTF-8
1,057
3.09375
3
[]
no_license
import java.io.*; class Main{ static long shl(long x,int n){ int i=0; for(;i!=n;i++)x*=2; return x; } static long shr(long x,int n){ int i=0; for(;i!=n;i++)x/=2; return x; } public static void main(String[]args){ String t=String.valueOf(new char[]{ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76...
C++
UTF-8
647
2.90625
3
[]
no_license
//3406726 2013-08-19 00:58:38 Accepted 1016 C++ 0 188 花花的表世界 #include<iostream> #include<vector> using namespace std; int main(){ int t,n,p; cin>>t; while(t--){ int l = 0; vector<char> v; cin>>n; for(int i=0;i<n;i++){ cin>>p; for(int j=l;j<p;j++) v.push_back('('); v.push_back(')'); l = p; ...
PHP
UTF-8
246
2.5625
3
[]
no_license
<?php namespace Gini\ORM\Bank; use \Gini\ORM\Object; class Company extends Object { public $name = 'string:40'; public $code = 'string:40'; protected static $db_index = [ 'unique:name', 'unique:code', ]; }
Python
UTF-8
4,448
2.546875
3
[]
no_license
from django import forms class Work01Form(forms.Form) : name = forms.CharField(label = "名前") mail = forms.EmailField(label = "メール") age = forms.IntegerField(label = "年齢") class Work02Form (forms.Form): name = forms.CharField( label = "名前", initial = "", widget=forms.TextInput...
Java
UTF-8
3,058
2.59375
3
[]
no_license
package domain; import javax.persistence.*; import static javax.persistence.GenerationType.IDENTITY; /** * Tested: True * * @author Tiron Andreea-Ecaterina & Alexandru Stoica * @version 1.0 */ @Entity @Table(name = "SESSION_MEMBER") @SuppressWarnings("unused") public class SessionMemberEntity implements Idabl...
Java
UTF-8
4,224
2.296875
2
[]
no_license
package ie.cognate.sng; import ie.cognate.Stitcher; import java.awt.Frame; import java.awt.Insets; import java.util.ArrayList; import processing.core.PShape; import processing.core.PApplet; import processing.data.JSONArray; import processing.data.JSONObject; public class Loader implements Runnable { Sng3 p5; bo...
JavaScript
UTF-8
16,115
3.140625
3
[]
no_license
// Function for finding index of a character from an array. Array.prototype.reIndexOf = function (character) { if (this.length !== 0) { for (let i in this) { if (this[i].toString().match(character)) { return parseInt(i); } } } return -1; }; /** * whe...
C
UTF-8
3,086
3.984375
4
[]
no_license
#include <errno.h> // errno #include <math.h> // HUGE_VAL #include <stdio.h> // printf #include <stdlib.h> // strtod #include <string.h> // strerror #define MINARGS 2 // Helper functions int convert_argument(const char* arg, double* convertedArg); int swap(double* numbers, int length); int ma...
Markdown
UTF-8
1,632
2.515625
3
[]
no_license
# smApps-G2 ECC3303 Embedded Systems Designs Project Group 2 Unplanned and unsecure parking become the main issues that require a parking management system for several places such as shopping mall, resident area, educational area and many more. Even though there are some place that has been installed with this more ...
Python
UTF-8
320
3.140625
3
[]
no_license
import matplotlib.pyplot as plt languages = ["Python", "Java", "C++", "Dart", "JavaScript"] jobs = [70, 80, 88, 12, 90] plt.pie(jobs, labels=languages) plt.legend() plt.show() chinese = ["Noddels", "Burger", "Manchurian", "Chilly Potato"] persons = [60, 10, 20, 10] plt.pie(persons, labels=chinese) plt.legend() plt.s...
Markdown
UTF-8
3,724
3.265625
3
[ "BSD-3-Clause", "CC0-1.0" ]
permissive
# fhirpatch ## What's this? This is a Javascript implementation of the FHIRPatch specification as described at https://www.hl7.org/fhir/fhirpatch.html. For FHIR Path parsing, it uses the excellent fhirpath.js library. ## Usage Please refer to `test/fhirpatch.test.js` for more examples. ``` const {FhirPatch} = re...
C#
UTF-8
3,647
2.59375
3
[ "MIT" ]
permissive
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Xml; namespace CoreWCF.IdentityModel { internal struct XmlAttributeHolder { public static XmlAttributeHolder[] emptyArray = Array.Empty<Xm...
Java
UTF-8
431
1.65625
2
[]
no_license
package atm; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; @SpringBootApplication public class AtmApplication { public static void main(String[] args) { SpringApplication.run(AtmApplicatio...
Go
UTF-8
352
2.53125
3
[]
no_license
package main import ( "github.com/gorilla/mux" "net/http" "os" "io" "github.com/NYTimes/gziphandler" ) func main() { m := mux.NewRouter() m.HandleFunc("/", func(w http.ResponseWriter,r *http.Request) { file, _ := os.Open("/tmp/dataBasic.jpg") io.Copy(w, file) file.Close() }) http.ListenAndServe(":3000"...
Markdown
UTF-8
982
3.765625
4
[]
no_license
# 342. Power of Four [Link to Question](https://leetcode.com/problems/power-of-four/) ## Description Given an integer (signed 32 bits), write a function to check whether it is a power of 4. **Example 1:** ``` Input: 16 Output: true ``` **Example 2:** ``` Input: 5 Output: false ``` **Follow up**: Could you solve...
Python
UTF-8
814
3.578125
4
[]
no_license
# sys is a module. It lets us access command line arguments, which are # stored in sys.argv. import sys import random if len(sys.argv) < 2: print("Please supply a flash card file.") exit(1) flashcard_filename = sys.argv[1] f = open(flashcard_filename, "r") que_ans = {} for line in f: entry = line.strip(...
Markdown
UTF-8
3,655
2.625
3
[]
no_license
--- layout: post status: publish published: true title: Open Source Documentation author: Colin Ramsay author_login: colinramsay author_email: colinramsay@gmail.com author_url: http://colinramsay.co.uk wordpress_id: 465 wordpress_url: http://colinramsay.co.uk/?p=465 date: !binary |- MjAwOC0xMS0yNCAwMDoyMTowNyArMDAwMA...
JavaScript
UTF-8
1,886
2.53125
3
[]
no_license
class Menu extends React.Component{ constructor (props){ super(props); this.buttonClick = this.buttonClick.bind(this); this.state = { counter: 0, } } buttonClick(){ this.setState({counter: ++this.state.counter}) }; render (){ let x = ...
Markdown
UTF-8
2,939
2.9375
3
[]
no_license
# USNX Boilerplate This is some boilerplate for developing web apps. It makes use of modern developments tools such as [Bower](http://bower.io/) and [Grunt](http://gruntjs.com/), which in turn make use of the [NodeJS](http://nodejs.org) engine. ## Dependencies * [Git](http://git-scm.com/downloads) * [Node JS](http...
Markdown
UTF-8
11,068
3.390625
3
[]
no_license
# Class ## const メンバ関数とmutable **`const` メンバ関数** ... インスタンスが `const` でも呼び出し可能なメンバ関数のこと。 ```cpp class ClassName { public: ReturnType member_func(params, ...) const; }; ReturnType member_func(params, ...) const { body... } ``` ### const/非constメンバ関数のオーバーロード `const` がついているかどうかでも、**オーバーロード** ができる。 ``...
Python
UTF-8
234
2.734375
3
[]
no_license
import os import time flag = "" for i in range(0,30): os.system("git reset --hard HEAD~1") time.sleep(0.3) f = open("./flag.txt") time.sleep(0.3) flag = f.read().strip() + flag time.sleep(0.3) print(flag)
Python
UTF-8
3,504
3
3
[]
no_license
import asyncio import curses import itertools import random import time from curses_tools import draw_frame, get_frame_size, read_controls def read_frame(path): with open(path, 'r') as frame_file: frame = frame_file.read() return frame async def blink(canvas, row, column, symbol, offset_tics): ...
JavaScript
UTF-8
3,596
2.796875
3
[]
no_license
/** * [launchFunction description] * @param {[type]} mExec [description] * @param {[type]} currentObj [description] * @param {[type]} oScope [description] * @return {[type]} [description] */ function launchFunction( mExec, currentObj, oScope){ var result = null, sActionName, mArgs = []; ...
Java
UTF-8
622
3.046875
3
[]
no_license
class Solution { public boolean isAnagram(String s, String t) { int[] s_count = new int[26]; int[] t_count = new int[26]; if(s.length() != t.length()){ return false; } for(char c : s.toCharArray()){ s_count[c-'a'] = s_count[c-'a'] + 1; ...
Python
UTF-8
2,091
2.953125
3
[]
no_license
from datetime import datetime from DataModule.Data import Data from Backtest.Action import Action from DataModule.DataManager import DataManager from Backtest.Strategies.Strategy import Strategy from Backtest.Signals.MovingAverage import MovingAverage from Backtest.Signals.RecentHigh import RecentHigh from Backtest.Si...
C++
UTF-8
173
2.578125
3
[ "MIT" ]
permissive
#include <thread> void new_thread() { while (true) { std::thread *th = new std::thread(new_thread); } } int main() { new_thread(); return 0; }
Java
UTF-8
486
3.8125
4
[]
no_license
package Day3; public class Multiple_Conditions_Statement { public static void main(String[] args) { int a = 1; int b = 3; int c = 5; if (a+b > c) { System.out.println("a & b is greater than c"); } else if(a+b < c) { System.out.println("a & b is less t...
Java
UTF-8
219
2.734375
3
[]
no_license
package com.app.fruits; public class Orange extends Fruits{ public Orange(String nm) { super(nm); } @Override public void taste() { System.out.println( super.getName() + "is Sweet n Sour in taste"); } }
Python
UTF-8
4,531
2.625
3
[ "Apache-2.0", "CC0-1.0", "LicenseRef-scancode-public-domain", "CC-BY-4.0" ]
permissive
# -*- coding: utf-8 -*- # Copyright (C) 2016-2023 PyThaiNLP Project # # 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 a...
Go
UTF-8
3,273
2.6875
3
[ "MIT" ]
permissive
package config import ( "fmt" "regexp" "strings" "github.com/go-kratos/kratos/v2/encoding" "github.com/go-kratos/kratos/v2/log" ) // Decoder is config decoder. type Decoder func(*KeyValue, map[string]interface{}) error // Resolver resolve placeholder in config. type Resolver func(map[string]interface{}) error ...
Markdown
UTF-8
1,812
2.984375
3
[ "CC-BY-4.0", "MIT", "LicenseRef-scancode-generic-cla" ]
permissive
--- title: "Disconnecting from a Data Source or Driver" description: "Disconnecting from a Data Source or Driver" author: David-Engel ms.author: v-davidengel ms.date: "01/19/2017" ms.service: sql ms.subservice: connectivity ms.topic: conceptual helpviewer_keywords: - "disconnecting from driver [ODBC]" - "data sourc...