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
TypeScript
UTF-8
407
2.71875
3
[]
no_license
export function getFileNameExtension(fileName: string): string | null { const fileNameParts: string[] = fileName.split('.'); const fileExtension: string = fileNameParts[fileNameParts.length - 1]; return fileExtension || null; } export function getBase64ImageType(base64String: string): string | null { return ba...
Java
UTF-8
790
2.109375
2
[]
no_license
package com.xlcxx.services; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.context.annotation.Bean; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; /** * Description: nocos_test * Created by yhsh on 2020/3/14...
Python
UTF-8
421
2.515625
3
[]
no_license
# Get audio files from midi import pretty_midi import scipy.io.wavfile from glob import glob inDir = '../Pipeline/MIDI/' outDir = '../Pipeline/audio/' def write_audio(mid): midi = pretty_midi.PrettyMIDI(mid) audio = midi.synthesize() out_name = mid.split('/')[-1].replace('.mid','.wav') scipy.io.wavfile.write(outD...
Java
UTF-8
844
2.640625
3
[]
no_license
import com.test.*; import javafx.application.*; import javafx.stage.Stage; import java.util.List; import java.util.ArrayList; public class Main { // @Override // public void start(Stage primaryStage) { // } // public static void main() { launch(args); } public static void main(String []...
Python
UTF-8
423
3.25
3
[]
no_license
class Solution(object): def nextGreatestLetter(self, letters, target): """ :type letters: List[str] :type target: str :rtype: str """ tnum = ord(target) - 96 for l in letters: if (ord(l)-96) > tnum: return l ...
Markdown
UTF-8
2,142
2.59375
3
[]
no_license
# booking-tables Aplicativo para realizar reservas de mesas em restaurantes. Primeiramente o usuário poderá ver o menu do restaurante, algumas reviews e um mapa geral do local disponibilizado pelo restaurante, com marcações para mesas e o usuário poderá visualizar as mesas disponíveis para reservas. ## Principais Cla...
PHP
WINDOWS-1252
8,870
2.703125
3
[]
no_license
<ul> <li><a href="<?php echo $article->url; ?>#intro">Introducci&oacute;n</a></li> <li><a href="<?php echo $article->url; ?>#solucion">Soluci&oacute;n</a></li> <li><a href="<?php echo $article->url; ?>#notas">Notas finales</a></li> <li><a href="<?php echo $article->url; ?>#enlaces">Enlaces</a></li> </ul> <a n...
Java
UTF-8
1,419
2.453125
2
[]
no_license
package com.example.exchangetoysback.ExchangeToysBack.controller.DTOmodels; import lombok.Data; import lombok.NoArgsConstructor; @Data @NoArgsConstructor public class FilterDTO { private String mainCategory;//null if any category private String age;//null if each age private String tags;//null if any cate...
Markdown
UTF-8
4,015
3
3
[]
no_license
<h1>Extend VdoCipher plugin</h1> <p>Using this plugin you can extend the VdoCipher WordPress plugin. This plugin requires the VdoCipher WordPress plugin version 1.26 or more to be installed.</p> <p>We have implemented the child theme - theme framework architecture, so that you can freely extend the VdoCipher plugin wi...
Python
UTF-8
903
2.78125
3
[ "MIT" ]
permissive
from .conv_to_str import conv_to_str class WriteBase: use_colons = False def sort_key(self, i): if isinstance(i, str): return i.lower() return i def write_D(self, path, D): with open(path, 'w', encoding='utf-8') as f: for key, sub_D in list(D.items()): ...
Java
UTF-8
1,018
2.15625
2
[]
no_license
package com.driftdirect.service.round; import com.driftdirect.service.gcm.GCMService; import com.driftdirect.service.gcm.TopicBuilder; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.IOException; /** * Created by Paul on 2/20/2016. */ @Se...
Markdown
UTF-8
3,641
2.875
3
[]
no_license
# Active Directory Bundle - [Installation](#using-the-configuration) - [Configuration](#configuration) - [Definitions](#definitions) - [Account Suffix (required)](#account-suffix-required) - [Domain Controllers (required)](#domain-controllers-required) - [Base Distinguished Name (required)](#base-distingui...
JavaScript
UTF-8
3,840
3.390625
3
[]
no_license
//if the quiz has ended then display score otherwise display question, display choices and display progress var QuizUI = { displayNext: function () { if (quiz.hasEnded()) { this.displayScore(); countDown(); } else { this.displayQuestion(); this.display...
Python
UTF-8
167
3.140625
3
[ "MIT" ]
permissive
from datetime import timedelta def add(moment): """Calculate the moment when someone has lived for 10^9 seconds.""" return moment + timedelta(seconds=10**9)
JavaScript
UTF-8
6,472
2.546875
3
[ "MIT" ]
permissive
/** * Created by Divinemaniac on 3/13/2016. */ ImageIndex = { selectToggleClass: "img-list-thumbnail", selectableContainerClass: "selectable", selectedItemClass: "selected", selectText : " Select Multiple", //The text to display in the switch button when multiple selection is on deselectText : " M...
Ruby
UTF-8
283
2.59375
3
[]
no_license
# Learned during process: # "gem list" (in termial) lists all local gems # "ls -lah" (in terminal) lists permissions for file # --> "chmod +x filename" would give that filename executable permissions # "ls | grep read" basically a search for keyword of "read" within that ls
JavaScript
UTF-8
1,302
3.1875
3
[]
no_license
"use strict"; const outputDiv = document.getElementById("output"); const domBuilder = (sandwichOption) => { let domString = ""; domString += `<div class="caption" id="item-container">`; domString += `<label class="form-check-label">`; domString += `<input class="form-check-input" type="checkbox" value=...
Python
UTF-8
9,704
3.171875
3
[ "MIT" ]
permissive
from scoring import * import twl #for auto blank resolution import configs class Board: SIZE = 15 def __init__(self): self.board = [None for x in range(0,Board.SIZE**2)] def set(self, x,y,c): if x < 0 or x > Board.SIZE-1 or y < 0 or y > Board.SIZE-1: raise ValueError ...
Java
UTF-8
1,624
3.015625
3
[]
no_license
package com.jc02.wjm; import java.util.Scanner; /** *        \\\|/// *         \\ .-.- // *        (  .@.@ ) * +-------oOOo-----( _ )-----oOOo--------------------------------------------+ * | @author 万家明       | * | @author 江西财经大学 ...
PHP
UTF-8
4,241
2.53125
3
[]
no_license
<?php include(__DIR__ . '/Big52003.php'); ini_set('memory_limit', '2048m'); class Updater { public function getInfoFromURL($url) { $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_URL, $url); $content = curl_exec($curl); ...
Shell
UTF-8
860
3.859375
4
[ "BSD-2-Clause" ]
permissive
#!/bin/bash # # Simple script to fetch journald logs while keeping state. # Requires the 'jq' package to be installed. # PATH=/bin:/usr/bin:/sbin:/usr/sbin CUR_DIR=$(dirname $0) STATE_DIR="${CUR_DIR}/../state" STATE_FILE="${STATE_DIR}/journald.state" STATE_LOGFILE="${STATE_DIR}/journald.log" update_state () { if [ ...
Java
UTF-8
1,934
2.34375
2
[]
no_license
package com.minhui.vpn.parser; public class ShowDataType { public static final int ALL=0; public static final int TEXT=1; public static final int IMAGE=2; public static final int AUDIO=3; public static final int VIDEO =4; public static final int UDP =5; public static final int OTHER =6; ...
Python
UTF-8
1,544
2.640625
3
[]
no_license
import requests from bs4 import BeautifulSoup from colorama import Fore, Back, Style sites = [ { 'name': 'Spotify - IL', 'url': 'https://www.spotify.com/il/premium/', 'selector': ["p", {"class": "subhead bellow-headline"}], 'expectation': 'Try Premium free for 30 days. Only ₪19.90/month after.*' }, { 'nam...
Java
UTF-8
321
1.625
2
[]
no_license
package com.intentfilter.profileservice.repositories; import com.intentfilter.profileservice.models.Profile; import org.springframework.data.mongodb.repository.MongoRepository; import org.springframework.stereotype.Repository; @Repository public interface ProfileRepository extends MongoRepository<Profile, String> { }...
C++
UTF-8
901
2.90625
3
[]
no_license
#include "ctranspiler.h" #include "iremitter.h" #include "parser.h" #include <fstream> #include <iostream> using namespace std; int main(int argc, char const* argv[]) { if (argc < 3) { cout << "scc llvm|c file|-" << endl; cout << "* llvm ir or c output" << endl; cout << "* file or stdin" ...
Python
UTF-8
2,264
3.40625
3
[ "Apache-2.0" ]
permissive
""" Policy Gradient, Reinforcement Learning. The cart pole example View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: Tensorflow: 1.0 gym: 0.8.0 """ import gym from RL_brain import PolicyGradient import matplotlib.pyplot as plt DISPLAY_REWARD_THRESHOLD = 400 # 当回合总reward大于400的时候显示模拟窗口 REND...
Markdown
UTF-8
1,683
2.671875
3
[]
no_license
### 项目的CI/CD流程 此项目中的ci文件夹包含了ci脚本,其可用于测试阶段的每一个步骤。ci系统确保了对项目所提交的PR能够在 Windows, Linux, and macOS等系统环境下进行单元测试,并可以实现测试的自动运行。 ci的很多操作在docker容器中执行。并且为了测试环境的多样性,也为了某些情况得以复现,测试阶段需要docker。测试环境的容器化保证了不同测试环境之间的隔离性以及保证了测试环境的轻量级启动、使用。 在ci阶段的测试过程中,项目会在不同环境下进行测试。如下图琐事我们是可以看到多种类型的环境。 <img src="https://xlab-video.oss-cn-shanghai.aliyun...
PHP
UTF-8
2,339
3.171875
3
[]
no_license
<?php /** * File PathBasedParser.php * * @package Poppins * @license http://www.gnu.org/licenses/gpl-3.0.en.html GNU Public License * @author Bruno Dooms, Frank Van Damme */ //require parent class require_once dirname(__FILE__) . '/Parser.php'; /** * Class PathBasedParser */ class PathBasedParser e...
C#
UTF-8
2,220
3
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.IO; using System.Globalization; namespace Round1BProblemA { class R1B_ProblemA { static void Main(string[] args) { //const string fileName = "t...
JavaScript
UTF-8
478
3.984375
4
[]
no_license
// The rest parameter allows us to pass an indefinite number of parameters to a function and access them in an array. // ...rest(any name can be placed on the place of rest) let fun1 = function(msg, y, ...colors){ console.log(msg); console.log(y); for(let i in colors){ console.log(colors[i]); } ...
Java
UTF-8
3,946
2.828125
3
[]
no_license
package com.example.orbital_layoutfrontend; import android.os.Build; import androidx.annotation.RequiresApi; import java.security.InvalidParameterException; import java.util.ArrayList; import java.io.Serializable; import java.util.Objects; public class OldPlayer implements Serializable { private String name; ...
Python
UTF-8
2,744
3.328125
3
[]
no_license
import src.utils as utils from src.bubble import Bubble from src.bubble_types import BubbleTypes class TestUtils: def test_create_empty_board(self): board = utils.create_empty_board(6,5) bubble = Bubble(BubbleTypes.Empty) for i in range(len(board)): for j in range(len(board[i])): asser...
Java
UTF-8
3,171
2.96875
3
[]
no_license
package active_record; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class UserAdmMenu { static String[] menuLines = {"Wybierz jedną z opcji:", "* add - dodanie użytkownika", "* edit - edycja użytkownika", "* delete - usunięcie użytkownika", "* quit - zakończenie...
Python
UTF-8
3,009
2.75
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Thu Nov 26 09:39:08 2015 @author: tanfan.zjh """ import cPickle import numpy #import theano def prepare_data(seqs, labels): """ Create the matrices from the datasets. This pad each sequence to the same lenght: the lenght of the longuest sequence or maxlen. ...
C
UTF-8
2,412
3.671875
4
[]
no_license
/* reverseFileHeader.h : Operating System Assignment 1 : Reversing the contents of a text file * * Author : Arpit Bhayani * E-mail : arpit.bhayani@students.iiit.ac.in * Roll no.: 201305515 */ #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <sys/types.h> #include <sys/stat....
TypeScript
UTF-8
2,566
2.625
3
[]
no_license
import got from 'got'; import async from 'async'; import express from 'express'; import { RequestHandler } from 'express'; import { maxSatisfying } from 'semver'; import { NPMPackage, RemotePackageRoot } from '../types'; import { Logger } from 'pino'; let queue: async.QueueObject<RemotePackageRoot>; let dependencyTre...
JavaScript
UTF-8
1,091
2.796875
3
[]
no_license
import React, { Component } from 'react'; class ShelfControl extends Component { initialBook = this.props.book state = { bookShelf: this.initialBook.shelf } handleChange = (event) => { // setState keeps the control button up to date according to changed value this.setState({bookShelf: event.target....
C++
UTF-8
1,375
2.796875
3
[]
no_license
#include "police.h" #include <iostream> #include <time.h> #include <string> using namespace std; Police::Police() { _stressAnalysis = random(10); _resistanceBribe = random(25); _catching = random(25); _searchDrug = random(15); _posture = random(10); } int Police::getResistanceBribe() {return _resistanceBribe;} ...
JavaScript
UTF-8
318
3.296875
3
[]
no_license
class Animal{ constructor(name = 'noname', age = 0, weight = 0){ this.name = name; this.age = age; this.weight = weight; } info(){ return `${this.name} is ${this.age} old and weight = ${this.weight} kg`; } } const name = 'Тот кого нельзя называть'; export {Animal, name};
C#
UTF-8
1,225
3.65625
4
[ "MIT" ]
permissive
namespace _10.Explicit_Interfaces { using Interfaces; using Models; using System; public class StartUp { public static void Main() { // PrintNamesAsDifferentInterfaces(); // Both variants work PrintNamesWithTypeCasting(); // Both variants work } ...
Java
UTF-8
810
1.835938
2
[ "Apache-2.0" ]
permissive
package com.gzxant.service; import com.gzxant.base.service.IBaseService; import com.gzxant.base.vo.DataTable; import com.gzxant.entity.SysUser; import com.gzxant.entity.SysUserOffice; /** * * @author chen * @date 2017/11/16 * <p> * Email 122741482@qq.com * <p> * Describe: */ public interface ISysUserOfficeSer...
C#
UTF-8
1,661
3
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using N_Shared = NameSorter.Shared; namespace NameSorter.Process { /// <summary> /// <code>Sort by Surname Then Given Name Assistant</code> assists <code>Back Office</code> admin to sort names by surname. /// --- Function: Adds capability ...
Java
UTF-8
2,808
2.03125
2
[]
no_license
package com.sneaker.mall.api.model; /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License...
Java
UTF-8
1,208
3.046875
3
[]
no_license
import java.awt.EventQueue; import javax.swing.JFrame; import java.awt.BorderLayout; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public class Main { private JFrame frame; /** * Launch the application. */ public static void main(String[] args) { Event...
C#
UTF-8
520
3.21875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace fibonacci_series { class Program { static void Main(string[] args) { int f1 = 0, f2 = 1, f3 = 0; Console.Write(f1); Console.Write(f2...
Markdown
UTF-8
10,159
3.734375
4
[]
no_license
##Unit 1 名词、冠词## ###名词的作用:当 主词、补语、受词### >- 目录 - <a href="#A1">名词的种类</a> - 普通名词 - 集合名词 - 专有名词 - 物质名词 - 抽象名词 - <a href="#B1">名词的数</a> - 规则变化的复数名词 - 不规则变化的复数名词 - <a href="#C1">名词的所有格</a> - <a href="#D1">冠词</a> - 不定冠词 a / an - 定冠词 the <a id="A1"></a> ###一. 名词的种类### >- **单数 / 复数 名词** <br/>...
PHP
UTF-8
1,268
2.625
3
[ "MIT" ]
permissive
<?php namespace App\Http\Controllers\UserAddress; use App\Http\Controllers\Controller; use App\Http\Requests\Address; use App\Users; use Illuminate\Http\Request; class AddAddressController extends Controller { /** * Where to redirect users after login. * * @var string */ protected $redir...
Java
UTF-8
839
3.203125
3
[]
no_license
/* Christos Perchanidis AEM: 3194 pmchrist@csd.auth.gr Aristotle University of Thessaloniki May 2019 */ import java.util.ArrayList; import java.util.TreeSet; /** * * This class creates graph that we use in the whole project later * */ class allEdges{ /** * * Finding graph that connects a...
Java
UTF-8
29,905
2.390625
2
[]
no_license
package com.lwxf.newstore.webapp.common.utils; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.nio.charset.Charset; import java.sql.*; import java.util.*; import java.util.Date; import com.lwxf.commons.constant.CommonConstant; import com.lwxf.commons.utils.DateUtil; impor...
TypeScript
UTF-8
838
2.515625
3
[]
no_license
import { HttpClient, HttpRequestParamsInterface } from '@/models/http-client'; import { PaletteApiClientUrlsInterface } from './PaletteApiClientUrls.interface'; import { PaletteApiClientInterface } from './PaletteApiClient.interface'; import { PaletteType } from '@/models/palette'; /** * @Name PaletteApiClientModel ...
Java
UTF-8
7,413
2
2
[]
no_license
package com.tcd.waggon.ui; import com.tcd.waggon.Constants; import com.tcd.waggon.R; import com.tcd.waggon.WaggonApplication; import com.tcd.waggon.data.Session; import com.tcd.waggon.service.Connector; import com.tcd.waggon.util.Utils; import android.app.Activity; import android.app.ProgressDialog; import android.co...
Java
UTF-8
1,600
3.53125
4
[]
no_license
/** * Write a description of class Serie1 here. * * @author (your name) * @version (a version number or a date) */ public class SerieDeNumeros{ public long serie1(int parametro){ //ejercicio1 long a = 1; long b; int ct = 1;; System.out.println(" "); System.out.print(...
Markdown
UTF-8
698
2.78125
3
[]
no_license
# Examen 2 * 1.Cual es la diferencia entre sin() y sind() * 2.Que hace linspace(0,100,1)? * 3.Que hace [0:1:100]? * 4.Sea: A=[1 2 3; 4 5 6; 7 8 9]; Que imprime?: A(:,2) * 5.Escribe el codigo para crear una cuadricula que contiene 9 plots, usa subplot * 6.Como harias esta grafica?, considera que es una cuadricula de ...
PHP
UTF-8
1,297
2.78125
3
[]
no_license
<?php require_once(dirname(__DIR__) . "/classes/autoload.php"); require_once("/etc/apache2/mysql/encrypted-config.php"); require_once(dirname(__DIR__) . "/lib/xsrf.php"); try { //ensures that the fields are filled out if(@isset($_POST["loginEmail"]) === false || @isset($_POST["loginPassword"]) === false) { throw(n...
Python
UTF-8
2,733
3.0625
3
[]
no_license
from ai.logic.sub_logic import SubLogic class MoneyCalculator(SubLogic): MONTE_CARLO_ITER = 10 simulation = False def __init__(self, logic): super().__init__(logic) self.prices = [] def load_game(self, graph=None): game_copy = self.logic.game.copy() if graph: ...
Java
UTF-8
1,238
2.421875
2
[]
no_license
package com.disablerouting.network; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class NetworkChangeReceiver extends BroadcastReceiver { private ConnectionChangeListener mCon...
JavaScript
UTF-8
588
2.609375
3
[ "MIT" ]
permissive
function init() { $('a.del').click(function (event) { event.stopImmediatePropagation(); // console.log(event.target.id); removeUser(event.target.id); return false; }); } function removeUser(id) { var url = "/testsApplication/User/removeUser/?id=" + id; $.ajax({ ...
C++
UTF-8
430
3
3
[]
no_license
#include "Stack.h" #include <iostream> using namespace std; int main(){ Stack st; st.initialize(); double d; double* dd; for (int i = 0 ; i < 25 ; i++){ double* temp = new double(1/static_cast<double>(i)); st.push(temp); } for (int i = 0 ; i <25 ; i++){ dd = reinter...
Markdown
UTF-8
2,772
2.875
3
[]
no_license
--- nav_order: 4 published: true --- # FAQs ### Q: What is Parsec? A: Parsec is a desktop capturing application primarily used for cloud-based gaming through video streaming. ### Q: Is Parsec free? A: Yes, it is free to download [here](https://parsecgaming.com/downloads/) ### Q: Any settings I need to set in Pa...
JavaScript
UTF-8
851
3.53125
4
[ "MIT" ]
permissive
/** * @param {number[]} nums * @return {number} */ var longestSubarray = function(nums) { const numbers = []; const counts = []; let index = 0; while(index<nums.length){ const digit = nums[index++]; let count = 1; while(index<nums.length && nums[index] === digit){ ...
Python
UTF-8
620
3.171875
3
[]
no_license
import bs4 def soup_text(soup_elem): try: # text = soup_elem.get_text(',,,', strip=True).decode('utf-8') # text = self.newline_re.sub(" ", text) # text = re.sub(r',,,', '\n', text) text = soup_elem.get_text('\n', strip=True).encode('utf8') return text except AttributeE...
JavaScript
UTF-8
5,660
2.703125
3
[]
no_license
import React, { Component } from "react"; import "./AddStocks.css"; import Modal from "../Modal/Modal"; import Axios from "axios"; class AddStocks extends Component { constructor() { super(); this.state = { stocks: [], modal: false, myStocks: [] }; } componentDidMount() { A...
Markdown
UTF-8
1,283
3.609375
4
[]
no_license
--- layout: post title: LeetCode之螺旋矩阵II --- # 1. 题目描述 https://leetcode-cn.com/problems/spiral-matrix-ii/ # 2. 示例代码 ``` class Solution { public int[][] generateMatrix(int n) { int[][] res = new int[n][n]; int above_row = 0; int below_row = n-1; int left_col = 0; int rig...
C++
UTF-8
1,740
2.859375
3
[]
no_license
#ifndef ANIMATION_H #define ANIMATION_H using namespace DirectX; struct Keyframe{ Keyframe() : TimePos(0.0f), Translation(0.0f, 0.0f, 0.0f), Scale(1.0f, 1.0f, 1.0f), RotationQuat(0.0f, 0.0f, 0.0f, 1.0f) {} float TimePos; XMFLOAT3 Translation; XMFLOAT3 Scale; XMFLOAT4 RotationQuat; }; struct BoneAnimation { floa...
Java
UTF-8
1,542
3.140625
3
[]
no_license
package mazeProblem; import java.util.Scanner; import java.io.FileInputStream; import java.util.Queue; import java.util.LinkedList; class SWEA1227 { public static void main(String args[]) throws Exception { System.setIn(new FileInputStream("queue/res/input3.txt")); Scanner sc = new Scanner(System.i...
PHP
UTF-8
513
2.6875
3
[]
no_license
<?php $servidor = "localhost1"; //também pode ser web(um site como o banco online ) $dbname = "umnomequalquer"; //Nome do banco de dados a ser colocada a informação. Criado antes no MySQL $dbusuario ="root11"; //usuário do banco EXEMPLO. $dbsenha = "***"; //Senha do usuário EXEMPLO //Método de conexão com o Banco...
Python
UTF-8
2,156
3.125
3
[ "MIT" ]
permissive
#!/usr/bin/python import time import math import Adafruit_CharLCD as LCD # Raspberry Pi configuration: lcd_rs = 27 # Change this to pin 21 on older revision Raspberry Pi's lcd_en = 22 lcd_d4 = 25 lcd_d5 = 24 lcd_d6 = 23 lcd_d7 = 18 lcd_red = 4 lcd_green = 17 lcd_blue = 7 # Pin 7 is CE1 # Alternatively specify a 20...
PHP
UTF-8
4,436
2.53125
3
[]
no_license
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Album; use App\Photo; class GallaryController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { // $album=Album::al...
JavaScript
UTF-8
4,289
2.578125
3
[ "MIT" ]
permissive
(function($, window){ var ChartVis = function(csvRequestPath){ var self = this; this.init = function(){ var margin = {top: 20, right: 20, bottom: 30, left: 50}, width = ($(window).width() - 15) - margin.left - margin.right, height = 400 - margin.top - margin.bottom; ...
PHP
UTF-8
1,042
2.515625
3
[]
no_license
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePricingItemsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('pricing_it...
PHP
UTF-8
2,955
2.875
3
[ "MIT" ]
permissive
<?php class FileHandler { private $config = []; private $videos_ext = ".{avi,mp4,flv,mkv}"; private $musics_ext = ".{mp3,ogg,m4a}"; public function __construct() { $this->config = require dirname(__DIR__).'/config/config.php'; } public function listVideos() { $videos = []; if(!$this->outuput_folder_ex...
Java
UTF-8
685
2.96875
3
[]
no_license
package com.junhua.design.pattern.mediator; import java.util.Random; /** * @author Junhua E-mail:xjhclks@163.com * @version create time:2018/11/18 7:52 AM */ public class Sale extends AbstractColleague{ public Sale(AbstractMediator mediator) { super(mediator); } /** * 获取销售状况 * @return */ pub...
C++
UTF-8
4,337
3.0625
3
[]
no_license
// problem source: https://www.hackerrank.com/challenges/swap-nodes-algo/problem #include <bits/stdc++.h> using namespace std; /* * Complete the swapNodes function below. */ class treeNode{ public: treeNode* left = nullptr; treeNode* right = nullptr; int data; int depth; tr...
C++
UTF-8
20,323
3.140625
3
[]
no_license
#include "D_tree.h" using namespace d_tree; struct d_tree::State{ Label symbol; Label condition; }; struct d_tree::IdLabel{ Label label; Label id; Label idlabel; }; struct d_tree::Elem{ State state; IdLabel infoLabel; }; struct d_tree::treeNode { Elem infoEdge; Tree firstChild; ...
Java
UTF-8
115,211
1.648438
2
[]
no_license
package mx.babel.bansefi.banksystem.cuentas.webservices.aprobacionplazo; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind....
Python
UTF-8
2,663
2.6875
3
[ "Apache-2.0" ]
permissive
from tornado import web, websocket, httpserver, ioloop import os, datetime, json import redis class Log(object): def __init__(self, text): super(Log, self).__init__() utc_datetime = datetime.datetime.utcnow() self.timestamp = utc_datetime.strftime("%Y-%m-%d %H:%M:%S") self.text = te...
C++
UTF-8
1,715
3.40625
3
[]
no_license
/** * @file Lab3.cpp * @author your name (you@domain.com) * @brief Area of Eclipse * @version 0.1 * @date 2020-04-09 * * @copyright Copyright (c) 2020 * */ #include <iomanip> #include <iostream> using namespace std; bool isInside(long double x, long double y, double a, double b) { return (x * x) / (a * ...
Ruby
UTF-8
674
3.921875
4
[]
no_license
name = "Felicia Torres" def test(name) name_chars = name.chars new_arr = [] all_letters = ('a'..'z').to_a vowels, consonants = all_letters.partition { |a| vowels.include?(a) } name_chars.each do |name_char| lower_name_char = name_char.downcase if consonants.include?(lower_name_char) new_arr <...
C++
UTF-8
943
3.375
3
[]
no_license
// Kadane's algorithm #include <iostream> using namespace std; int start = 0, end_ = 0; int maxSubarraySum(int a[], int n){ int max_eh = 0; int max_sf = -10000001; for(int i=0; i<n; i++) { max_eh = max_eh + a[i]; if(a[i] > max_eh) { ...
PHP
UTF-8
1,969
2.828125
3
[ "MIT" ]
permissive
<?php namespace Chef\Project\Path; use Chef\Project\ProjectPathProviderInterface; use Chef\Utils\Github\RepositoryManager; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; /** * Class GitHubRepositoryProjectPathProvider * * @package Chef\Project\Path */ class GitHubRepositoryProjectPathProvider implements Pr...
JavaScript
UTF-8
2,815
3
3
[]
no_license
var app = new Vue({ el: '#app', data: { totalText1: "Joker Öncesi", totalText2: "Jokerli Tutar", beforeTotal: 0, afterTotal: 0, prices: [{ beforePrice: 0, afterPrice: 0, piece: 1 } ] }, methods: { addBtn:...
Markdown
UTF-8
780
2.515625
3
[ "Apache-2.0" ]
permissive
# angular2-stackdriver-typescript Angular 2-6 stackdriver reporting class written in TypeScript Based on: https://github.com/GoogleCloudPlatform/stackdriver-errors-js This class can be used with Angular Error handler to report errors to Google Stackdriver. At first in ErrorHandler create instance of class ```javascr...
Python
UTF-8
441
2.890625
3
[]
no_license
def we_have_house(hh, hw, hd, rh): if hh + rh > 20: return 'No permission.' if hw < 15 or hd < 11: return 'House too small.' if hw > 44 or hd > 44: return 'House too big.' ​ y = 2 * (hw * hh + .5 * hw * rh) + 2 * (hd * hh) y -= 117 + 2 * hw + 2 * (hw-3) + 4 * hd ​ g = 2 ...
Python
UTF-8
12,748
2.859375
3
[]
no_license
import re import random import operator from nltk import pos_tag, word_tokenize import random, re, sys, pronouncing import keras from keras.models import Sequential, model_from_json from keras.layers import Activation,LSTM,Dense,Embedding from keras.optimizers import Adam from scipy.sparse import csr_matrix import pi...
Markdown
UTF-8
279
2.546875
3
[]
no_license
## Scrapper for Linkedin # Before running below commands, create config.py and add following details: linkedin = dict( username = your_linkedin_mail_id, password = your_linkedin_password, ) # Steps to Install and run: 1. pip install -r requirements.txt 2. python index.py
Markdown
UTF-8
20,531
3.953125
4
[]
no_license
# 解谜计算机科学 教人们编程,该教什么。我一开始想以一个语言开始,教人们写出第一个程序,让程序打印出Hello World。然而当我看了王垠的文章《解谜计算机科学》之后,我改变了想法。这才是真正的编程第一课。此篇文章是我看了那篇文章后的复述。来,一起来理解计算机科学的基本概念。 ## 手指算术 到底什么是计算。从手指算术开始讲起。小时候,当妈妈问,`2+5`等于什么的时候。我们紧握手指头,开始数数。拿出左手,伸出2根。接着拿出右手,伸出5根。接着,看有多少根手指头伸出来了。开始数数,1、2、3、4、5、6、7。嗯,有7根。所以答案是7。 这背后到底发生什么呢。计算机如何来实现这个过程呢。在这过程中,我们其实...
Python
UTF-8
719
2.671875
3
[]
no_license
import subprocess import sys # needs ffmpeg and ffprobe on path of the machine class SoundCloudDownloader(object): def download(self, url, path, debug=False): # --exec \'move {} ' + path + '\' ' c = subprocess.Popen( r'youtube-dl.exe --restrict-filenames -x --audio-quality 320K --au...
C
UTF-8
283
3.59375
4
[]
no_license
#include<stdio.h> #include<math.h> int check(long num) { for(long i=2;i<=sqrt(num);i++) { if(num%i == 0) return 0; } return 1; } int main() { long sum=0; for(long i=2;i<=2000000;i++) { if(check(i)) { sum+=i; } } printf("%ld\n", sum); }
C#
UTF-8
139
2.8125
3
[]
no_license
using System; public class Cockroach { public static int CockroachSpeed(double x) { return (int)(x * 1000 / 36); } }
C++
UTF-8
30,416
3.203125
3
[]
no_license
#include "matrix.h" using namespace std; int matrix::permutation_count = 0; int gcd(int num1, int num2) { if(num1 <= 0 && num2 <= 0) throw "error occurs in 'gcd(int num1, int num2)'.\nnum1 and num2 must be positive."; int tmp; while (num2 != 0) { tmp = num1 % num2; num1 = num2; num2 = tmp; } return nu...
Python
UTF-8
1,165
2.78125
3
[ "BSD-3-Clause" ]
permissive
import numpy as np import csv from PIL import Image from matplotlib import cm import seaborn as sns import matplotlib.pylab as plt if __name__ == "__main__": filename = "dump.csv" f = open(filename) reader = csv.reader(f) data=[r for r in reader] arr = np.array(data, dtype=np.float) new_arr = (...
SQL
UTF-8
286
3.375
3
[]
no_license
SELECT usuario.username, persona.nombre, billetera.billetera_id, cuenta.cuenta_id, cuenta.saldo FROM usuario JOIN persona ON usuario.persona_id = persona.persona_id JOIN billetera ON persona.persona_id = billetera.persona_id JOIN cuenta ON billetera.billetera_id = cuenta.billetera_id;
TypeScript
UTF-8
3,061
2.609375
3
[]
no_license
import { BaseDB } from "./baseDB"; import { VideoGatweay } from "../business/gateways/videoGateway"; import { Video } from "../business/entities/video"; import { BadRequestError } from "../business/errors/badRequestError"; export class VideoDB extends BaseDB implements VideoGatweay{ private videoCollection = "videos...
C++
UTF-8
1,956
2.71875
3
[]
no_license
#include <uC++.h> #include "student.h" #include "MPRNG.h" #include "vendingMachine.h" #include <iostream> using namespace std; extern MPRNG rng; void Student::main() { int purchases = rng(1, maxPurchases); // number of puchases the student will make VendingMachine::Flavours fav = static_cast<VendingMachin...
Markdown
UTF-8
12,034
2.578125
3
[ "CC-BY-4.0", "MIT" ]
permissive
--- title: Aktivera disk kryptering för Linux-kluster description: I den här artikeln beskrivs hur du aktiverar disk kryptering för Azure Service Fabric klusternoder i Linux med Azure Resource Manager och Azure Key Vault. ms.topic: article ms.date: 03/22/2019 ms.openlocfilehash: c600d822d20b0e5a0ca613935b1dfa4be838fcec...
Shell
UTF-8
1,085
3.28125
3
[ "Apache-2.0" ]
permissive
#!/bin/bash set -ex # redirect stderr to stdout exec 2>&1 JOB_DIR=/var/vcap/jobs/registry-broker PACKAGES_DIR=/var/vcap/packages PATH=$PACKAGES_DIR/cf/bin:$PATH PATH=$PACKAGES_DIR/jq/bin:$PATH CF_ADMIN_USERNAME=<%= p("cf.admin_username") %> CF_ADMIN_PASSWORD=<%= p("cf.admin_password") %> CF_API_URL=<%= p("cf.syste...
Python
UTF-8
412
3.3125
3
[]
no_license
a1 = eval(input()) d = eval(input()) n = eval(input()) t = (2*a1 + d*(n-1))*n/2 for i in range(1,n+1): an = a1 + (i-1)*d if i == n: if an < 0: print('(%s) = '%(an),end='') else: print('%s = '%(an),end='') else: if an < 0: print('(%s) + '%(an),end...
C++
UTF-8
3,184
2.828125
3
[ "BSD-3-Clause" ]
permissive
/** @file PythonUtilities.h @author M. Kerr This file collects routines for sending/receiving data to/from the Python interpreter. */ #ifndef skymaps_PythonUtilities_h #define skymaps_PythonUtilities_h #include <vector> #include "skymaps/WeightedSkyDir.h" #include "astro/SkyDir.h" #include "astro/SkyFun...
Java
UTF-8
1,967
1.882813
2
[]
no_license
package world; public class GameIDs { public static enum Zone{ RESIDENTIAL, POLICE, FIRE, COMMERCIAL, INDUSTRIAL, NUCLEAR, COAL, AIRPORT, SEAPORT, STADIUM, GIFT, COALREFINERY } public static enum Block{ DIRT, ROAD, RAIL, POWERLINE, FOREST, COALMINER, ...
C++
UTF-8
1,300
2.625
3
[ "LGPL-3.0-only" ]
permissive
#pragma once #include "software/backend/backend.h" #include "software/backend/input/network/networking/network_client.h" #include "software/backend/output/radio/radio_output.h" class RadioBackend : public Backend { public: static const std::string name; RadioBackend(); private: static const int DE...