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
6,101
2.78125
3
[ "MIT" ]
permissive
/** Simple test class for uart communication * (and to crate a library for that (interrupt driven)) * * The uC is a ATMega8-16PU operating on 9.83040MHz * TODO add ISR for External Interrupt 1 for handling RTS * XXX if done remove defines for flow control (FLOW_PORT,FLOW_DDR(,CTS,RTS)) **/ //#define F_CPU 98304...
Java
UHC
1,300
2.125
2
[]
no_license
package net.nigne.kkt.service; import java.util.List; import java.util.Map; import javax.inject.Inject; import org.springframework.stereotype.Service; import net.nigne.kkt.domain.ProductImageVO; import net.nigne.kkt.domain.TradeVO; import net.nigne.kkt.persistence.ProductImageDAO; import net.nigne.kkt.persistence.T...
Go
UTF-8
1,547
2.53125
3
[ "MIT", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
package thorchain import ( "github.com/blang/semver" sdk "github.com/cosmos/cosmos-sdk/types" "gitlab.com/thorchain/thornode/constants" . "gopkg.in/check.v1" ) type HandlerIPAddressSuite struct{} type TestIPAddresslKeeper struct { KVStoreDummy na NodeAccount } func (k *TestIPAddresslKeeper) GetNodeAccount(_ s...
JavaScript
UTF-8
4,674
2.921875
3
[]
no_license
// pages/goods-detail/goods-detail.js /* 1.点击轮播图 预览大图 1 给轮播图绑定点击事件 2 调用小程序的api previewImage 2.点击加入购物车 1 先绑定点击事件 2 获取缓存中的购物车数据 数组格式 3 先判断当前商品是否已经存在于购物车 4 已经存在 修改商品数据 执行购物车数量++ 重新把购物车数组 填充回缓存中 5 不存在于购物车的数组中 直接给购物车数组添加一个新元素 带上 购买数量属性num 重新把购物车数组 填充回缓存中 6 弹出提示 3.商品收藏 1 页面onShow的时候 加载缓存中的商品收藏数据...
Java
UTF-8
2,384
2.96875
3
[]
no_license
/** */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.regex.Matcher; import java.util.regex.Pattern; public class PageChecker { HttpURLConnection urlConnection; String contentStr; pub...
Java
UTF-8
1,606
3.46875
3
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.fruitsalad; /** * * @author Kenny */ import java.util.ArrayList; public class FruitSalad { public static...
Python
UTF-8
2,833
3.578125
4
[]
permissive
import tkinter import math import random import sys # Window dimensions window_width=1360 window_height=768 # Constants max_depth = 10 min_width = 2 min_length = 5 leaf_threshold = max_depth / 2.2 trunk_width = 40 trunk_height = window_height / 5 trunk_angle = math.pi * 1 / 2 # Only used for random rule generation n...
Rust
UTF-8
14,077
2.703125
3
[]
no_license
use chrono::prelude::*; use postgres::{ error::EXCLUSION_VIOLATION, rows::{Row, Rows}, transaction::Transaction, }; use slog::Logger; use uuid::Uuid; use db::TSTZRange; use errors::{DBError, MeetingError, MyError}; #[derive(Debug, Clone)] pub struct User { pub id: i64, pub ext_id: Uuid, pub ...
C++
UTF-8
2,365
2.578125
3
[]
no_license
#include <iostream> #include <fstream> #include <sstream> #include <math.h> #include <algorithm> #include <string> #include <map> #include <set> #include <vector> #include <stdlib.h> #include <stdio.h> #include <queue> #include <stack> #include <cstring> #include <ctype.h> using namespace std; typedef long long int l...
Java
UTF-8
318
1.742188
2
[]
no_license
package com.jyl.yxczspringboot.icom.user.mapper; import com.jyl.yxczspringboot.icom.base.mapper.BaseMapper; import com.jyl.yxczspringboot.icom.user.entity.LoginUser; import org.apache.ibatis.annotations.Mapper; @Mapper public interface LoginUserMapper extends BaseMapper{ LoginUser login(LoginUser record); }
JavaScript
UTF-8
3,468
2.546875
3
[]
no_license
let token = localStorage.getItem('USER_TOKEN'); let url_str = window.location.href; let url = new URL(url_str); let id = url.searchParams.get('id'); function loadCourseDetail() { axios({ url: `http://localhost:8082/api/admin/course-detail/by-course/${id}`, method: 'get', headers: { ...
JavaScript
UTF-8
1,480
2.625
3
[]
no_license
document.addEventListener("turbolinks:load",()=>{ const cartBtn=document.getElementById('cart-btn') if(window.location.pathname.match(/^\/items\/\d+$/) && cartBtn!=null){ const item_id=Number(cartBtn.getAttribute("data-item-id")) const loader=document.getElementById('overlay') cartBtn.addEventList...
Shell
UTF-8
528
3.328125
3
[]
no_license
#!/bin/bash readarray -t lines < $1 username=${lines[0]} password=${lines[1]} echo "USERNAME:" echo $username # Replace your own authentication mechanism here if [[ $username == "user" ]]; then if [[ $password == "userpassword" ]]; then echo "ok" exit 0 fi fi if [[ $username == "user2" ]]; then if ...
TypeScript
UTF-8
713
2.515625
3
[]
no_license
import { Request, Response, NextFunction } from 'express'; import pino from 'pino'; declare module 'express-serve-static-core' { interface Request { logger: pino.Logger; } } let cachedLogger: pino.Logger | null = null; export function getLogger() { if (cachedLogger) { // console.log('cached logger retr...
Java
UTF-8
529
2.5625
3
[]
no_license
package br.gov.cgsus.gerenciamentocontrato.enums; public enum FatorDiasEnum { HORAS_12(12,"12 Horas"), HORAS_24(24,"24 Horas"); private Integer cod; private String descricao; FatorDiasEnum(Integer id, String descricao) { this.cod = id; this.descricao = descricao; } public Integer getCod() { retur...
Java
UTF-8
242
1.617188
2
[]
no_license
package com.aquarius.aquariusapi.repository; import com.aquarius.aquariusapi.models.Pagamento; import org.springframework.data.jpa.repository.JpaRepository; public interface PagamentoRepository extends JpaRepository<Pagamento, Integer> { }
Markdown
UTF-8
1,315
3.15625
3
[]
no_license
# Expectation-Maximization-Machine-Learning-Algorithm This is our original photo before applying our Expectation Maximization Algorithm: ![Alt text](im.jpg) We test our algorithm using a variety of <strong> K values (1,2,4,8,16,32,64) </strong>. The total runtime for the rendering and for the algorithm to complete ...
C#
UTF-8
786
2.609375
3
[ "MIT" ]
permissive
using System; using System.Collections.Generic; using System.Collections; namespace Orleans.Indexing { /// <summary> /// This class represents the whole result of a query. /// </summary> /// <typeparam name="TIGrain">type of grain for query result</typeparam> [Serializable] public class Orleans...
Shell
UTF-8
3,123
2.859375
3
[]
no_license
#! /bin/bash cd helper # get the official tor executable from www.torproject.org cd os/mac wget -O TorBrowser.dmg https://www.torproject.org/dist/torbrowser/10.0.8/TorBrowser-10.0.8-osx64_en-US.dmg dmg2img TorBrowser.dmg TorBrowser.img 7z e TorBrowser.img tor.real -r mv tor.real tor chmod +x tor cd ../.. cd os/win w...
PHP
UTF-8
636
2.734375
3
[]
no_license
<?php if (FILEGEN != 1) die; class pmod_arrays { ////////////// pmod class to read in variables and arrays for options ////////// function __construct($lines) { global $qqu; $this->v=array(); $arrayEnd=''; foreach ($lines as $line) { echo htmlentities($line)."<br />"; $ln=trim($line); if ($ln == "" || subst...
Java
UTF-8
340
1.640625
2
[]
no_license
package com.tbc.slackanalyser; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class SlackanalyserApplication { public static void main(String[] args) { SpringApplication.run(SlackanalyserApplication.cla...
Markdown
UTF-8
7,391
2.90625
3
[ "Apache-2.0" ]
permissive
@page gpioc_driver_development GPIO控制器设备驱动程序开发指南 **[更正文档](https://gitee.com/alios-things/documentation/edit/rel_3.3.0/manual/driver_development/gpioc_driver_development.md)** &emsp;&emsp;&emsp;&emsp; **[贡献说明](https://help.aliyun.com/document_detail/302301.html)** # 1. 前言 本文介绍如何编写符合AliOS Things标准的GPIO控制器设备驱动程序。 # 2. ...
Shell
UTF-8
1,357
3.703125
4
[]
no_license
#! /bin/sh OS="$(uname)" if [ "x${OS}" = "xDarwin" ] ; then OSEXT="osx" else # TODO we should check more/complain if not likely to work, etc... OSEXT="linux" fi ISTIO_VERSION="1.0.1" NAME="istio-$ISTIO_VERSION" ls $NAME > /dev/null 2>&1 # if istio data is not download yet if [ $? != 0 ]; then URL="https://gi...
Python
UTF-8
2,182
3.25
3
[]
no_license
import matplotlib.pyplot as plt #%% Write your data time = [0, 1, 2, 3] # days temperature = [28.05, 29.00, 28.65, 27.04] # dC agitation = [400, 397, 402, 430] # rpm DO = [71, 5, 5.5, 2] # % pH = [5.5, 5.2, 4.9, 4.75] # pH gas_flow = [1, 1.02, 1.01, 1.05] #vvm #%% Set up the plot fig, host = plt.subplot...
C#
UTF-8
1,369
2.59375
3
[]
no_license
using NetStandardCommon; using System; using System.IO; namespace NetCoreConsoleApp { class Program { static void Main(string[] args) { LoadNetCoreModule(); LoadAspNetCoreModule(); } static void LoadNetCoreModule() { ...
Python
UTF-8
3,343
3.078125
3
[]
no_license
''' Nome: Tester dei classificatori prescelti Obiettivo: Testare la validità dei 3 classificatori prescelti per selezionare il migliore da applicare Passaggi: Collegarsi al database Ottenere gli articoli Effettuare il training con l'insieme di articoli ottenuto, un classificare per volta Testare l'abilità ...
Markdown
UTF-8
3,339
3.484375
3
[]
permissive
--- layout: post title: The contextual keyword 'var' may only appear within a local variable declaration. | c# author: Casey date: 2022-10-19 categories: Snippets tags: c# --- ## 錯誤訊息 > The contextual keyword 'var' may only appear within a local variable declaration. ```csharp using System; using System.Collections...
C#
UTF-8
1,552
2.546875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Web; using WebServices.Factories; using WebServices.Repository; using projek_WebService.Models; using projek_WebService.Handlers; namespace WebServices.Handlers { public class TransactionHandler { private static object jso...
Java
UTF-8
1,432
1.570313
2
[]
no_license
package com.xiaodou.oms.vo.input.message; /** * Date: 2014/12/23 * Time: 14:25 * * @author Tian.Dong */ public class InitQQUrlPojo { private String groupList; private String discusList; private String sendGroupMsg; private String sendDiscusMsg; private String sendBuddyMsg; private String...
Python
UTF-8
361
2.609375
3
[ "Apache-2.0" ]
permissive
import sqlite3 ver = sqlite3.sqlite_version con = sqlite3.connect(':memory:', 1, sqlite3.PARSE_DECLTYPES, None) cur = con.cursor() cur.execute('CREATE TABLE test (id INT, txt TEXT)') cur.execute('INSERT INTO test VALUES (?, ?)', (42, 'wut')) cur.execute('SELECT * FROM test') assert(cur.fetchall() == [(42, 'wut')]) cu...
Java
UTF-8
808
2.28125
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 tour.pojo; /** * * @author lucky borasi */ public class GetCity { int city_id; String city_name; String state; publi...
JavaScript
UTF-8
2,844
2.71875
3
[]
no_license
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.vec4 = void 0; var vec4 = /** @class */ (function () { function vec4(x, y, z, w) { if (x === void 0) { x = 0; } if (y === void 0) { y = 0; } if (z === void 0) { z = 0; } if (w === void 0) { w = 0; } ...
Java
UTF-8
1,679
2.15625
2
[ "Apache-2.0" ]
permissive
/******************************************************************************* * Copyright 2013 AppGlu, 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...
Python
UTF-8
180
3.21875
3
[]
no_license
# encoding:utf-8 input = map(int, raw_input().split()) W, H, x, y, r = input if x - r < 0 or x + r > W: print("No") elif y - r < 0 or y + r > H: print("No") else: print("Yes")
Shell
UTF-8
672
3.75
4
[]
no_license
#!/bin/bash show(){ local x=$1 local y=$2 local txt="$3" # Set cursor position on screen tput cup $x $y echo "$txt" } while [ : ] do clear # Get the system time now="$(date +"%r")" now_hour="$(date +"%H")" now_min="$(date +"%M")" now_day="$(date +"%u")" # Show main - menu, server name and time show 10 10...
Ruby
UTF-8
3,999
2.671875
3
[ "Apache-2.0" ]
permissive
require 'rubygems' require 'json' class Site < ActiveRecord::Base has_many :images has_many :participants validates_presence_of :name validates_uniqueness_of :name # reads sites directory to find all sites, whether they have records or not def self.all sitepaths = [] dirs = Dir.new('public/sites') dirs.e...
Markdown
UTF-8
2,201
3.53125
4
[]
no_license
# 4.4 Python创建模块 - 芝麻软件工作室的专栏 - CSDN博客 2016年07月01日 07:42:33[seven-soft](https://me.csdn.net/softn)阅读数:203 创建自己的模块是很容易的,你一直在这样做,始终都是!这是因为每个Python程序就是一个模块。你只需要确保它有一个.py扩展名。下面的例子会让你明白。 例子(保存为mymodule.py):defsayhi(): print('嗨,这是我的模块在讲话。') __version__='0.1' 上面的是模块的一个示例。正如您可以看到的,和我们通过的Python程序相比,没有什么特别的。接下来我们要看如何在我们的其...
C#
UTF-8
12,129
3.421875
3
[]
no_license
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ifttt { /// <summary> /// Node (subtree, really) in an abstract syntax tree. /// These trees might be fully instantiated, or they may contain v...
TypeScript
UTF-8
789
2.859375
3
[]
no_license
import { Array } from './Array'; import { Codec } from './Codec'; import { CodecError } from './CodecError'; import { Ok, Err } from './Result'; export function NonEmptyArray<C extends Codec.Any>(codec: C) { const array = Array(codec); type I = typeof array['I']; type O = typeof array['O']; type P = ty...
C++
UTF-8
1,006
3.1875
3
[ "MIT" ]
permissive
#pragma once #include <memory> #include <cstdint> #include <iostream> class Screen { public: Screen() = delete; Screen( uint32_t height, uint32_t width ); uint32_t getHeight(); void setHeight( uint32_t ); uint32_t getWidth(); void setWidth( uint32_t ); double getRatio(); ...
C++
UTF-8
149
2.703125
3
[ "MIT" ]
permissive
template<typename T> void printArray(const vector<T>& v) { for(int i = 0 ; i < v.size(); ++i) { cout << v[i] << endl; } }
Java
UTF-8
251
1.851563
2
[]
no_license
package com.wizeline.nflxpipoll.service; import com.wizeline.nflxpipoll.dto.AccountDto; import java.util.List; public interface AccountService { AccountDto save(AccountDto account); AccountDto getOne(Long id); List<AccountDto> findAll(); }
C#
UTF-8
847
2.84375
3
[]
no_license
using System; using LogCollectorLibrary; namespace CollectorLogConsole { /// <summary> /// запускает LogReader - библиотеку /// в первый параметр передать путь к папке - ресурсу /// </summary> class Program { static void Main(string[] args) { //string source = @"\\d...
Python
UTF-8
879
2.953125
3
[]
no_license
import requests from xml.etree import ElementTree def getToreadIsbnList(key, user_id): key = key user_id = user_id review_list_URL = "https://www.goodreads.com/review/list/" r = requests.get(review_list_URL + user_id + ".xml?key="+ key + "&shelf=to-read&per_page=200&page=1") tree = ElementTree....
Java
UTF-8
1,367
2.40625
2
[]
no_license
package sse; import io.quarkus.scheduler.Scheduled; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.sse.OutboundSseEvent; import javax.ws.rs.sse.Sse; import javax.ws.rs.sse.SseBroadcaster; import javax....
Markdown
UTF-8
1,672
2.796875
3
[ "MIT" ]
permissive
# Dijkstra's Algorithm ### Contenido * [Implementación](#) * [Contenido](#contenido) * [Problemas](#problemas) * [Bibliografia](#bibliografia) ### Problemas [![Generic badge](https://img.shields.io/badge/LeetCode-Medium-yellow.svg)](https://leetcode.com/problemset/algorithms/) * [[1] 743. Network Delay Time - Leet...
C#
UTF-8
1,917
2.5625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using BackEnd.DAL; using BackEnd.Entities; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace TestBackEnd { [TestClass] public class TestMarcaDAL { private UnidadDeTrabajo<Marcas> unidad; ...
Go
UTF-8
1,131
2.828125
3
[]
no_license
package db import ( "fmt" "iceforg/pkg/config" "reflect" "strings" ) const ( mysqlType = "mysql" mongoType = "mongo" redisType = "redis" etcdType = "etcd" ) type initer interface { initer() } var initMap = map[string]initer{} func registerDB(dbType string, value reflect.Value) { switch strings.ToLower(d...
Python
UTF-8
2,289
4.125
4
[]
no_license
""" 1. Accept Character from user and check whether it is alphabet or not (A-Z a-z). Input : F Output : TRUE Input : & Output : FALSE 2. Accept Character from user and check whether it is capital or not (A-Z). Input : F Output : TRUE Input : d Output : FALSE 3. Accept Character from user and check whet...
Java
ISO-8859-1
6,401
3.078125
3
[]
no_license
package server; import java.net.Inet4Address; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; import interfaces.*; import model.*; public class ServerMain implements Server { private ServerSocket server; private int serverPort; private boolean statusServer; private ArrayList<S...
C++
UTF-8
578
2.75
3
[]
no_license
#include <iostream> using namespace std; int main(){ int a[]={3,4,3,2,2}; int n=5; //n is size of array; for(int i=1;i<n;i++){ //right hand se card select karo int hand =a[i]; //card in hand; int j=i-1; //sorted ka end while(j>=0 && a[j]>hand){ //sahi position find kar rahe h...
Shell
UTF-8
3,184
4.15625
4
[]
no_license
#!/bin/bash # ----------------------------------------- # functions # {{{1 echo_help() { # {{{5 cat <<EOT $MY_NAME (version $MY_VERSION) this shell-script is for Git. display the list of uncommitted Git project paths found by \`find\` and \`git status\` commands. USAGE=> $MY_NAME [options] PATH PATH parameter is...
Python
UTF-8
935
3.15625
3
[]
no_license
""" Implements a simple socket server """ import socket # Define socket host and port SERVER_HOST = '0.0.0.0' SERVER_PORT = 8000 # Create socket server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) server_socket.bind((SERVER_HOST, SER...
Markdown
UTF-8
2,640
2.984375
3
[]
no_license
# GIT FLOW ### ***git-flow*** 란 소프트웨어의 소스코드를 관리하고 출시하기 위한 ‘브랜치 관리 전략(branch management strategy)’ 중 하나이다. 링크 : https://woowabros.github.io/experience/2017/10/30/baemin-mobile-git-branch-strategy.html </br></br> > 대략적인 흐름은 다음과 같다 - 처음 git 을 만들면 master 브랜치가 생긴다 - master 브랜치는 배포가 가능한 버전들만 올리는 브랜치라고 보면된다 - 따라서 실제 개발...
Java
UTF-8
775
1.851563
2
[]
no_license
package com.mljr.heil.mapper; import com.lyqc.base.page.PageForm; import com.mljr.heil.base.mapper.BaseMapper; import com.mljr.heil.entity.RateRule; import com.mljr.heil.form.DealerRuleSetForm; import com.mljr.heil.form.RateRuleForm; import java.util.List; public interface RateRuleMapper extends BaseMapper...
Shell
UTF-8
1,380
3.15625
3
[ "MIT" ]
permissive
#!/bin/sh if ! type "gpio" > /dev/null then echo "WiringPi was not found!" echo "Please run the build script to install your OPL2 Audio Board first." echo "" exit fi PIN_LATCH=$(gpio readall | awk -F\| '{if ($3==1) print $7} {if ($13==1) print $9}') PIN_A0=$(gpio readall | awk -F\| '{if ($3==4) print $7} {if ($13...
Java
UTF-8
2,362
2.71875
3
[]
no_license
package com.project.rural.market; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Random; import com.project.rural.DBUtil; public class Dummy { public static void main(String[] args) { String[] id = {"hong","test","admin"}; String[] subject = {"게시판 테스트입니다.", "HTML5 웹 프로...
JavaScript
UTF-8
914
2.671875
3
[]
no_license
//const logger = require('./logger'); const os = require('os'); const fs = require('fs'); const Logger = require('./logger'); const path = require('path'); function sayHello(name) { console.log(`my name is: ${ name }`); } const logger = new Logger(); //register event logger.on('user_logged', function() { co...
Python
UTF-8
106
2.78125
3
[]
no_license
def lucky_sum(a, b, c): i = 4 if 13 in (a, b, c): i = [a, b, c].index(13) return sum([a, b, c][:i])
JavaScript
UTF-8
5,728
2.640625
3
[]
no_license
var chai = require("chai"); var should = chai.should(); var assert = chai.assert; var nfaGenerator = require("../nfaGenerator.js").nfaGenerator; var _ = require("lodash") var tuple1 = { states : ["q1","q2","q3","q4"], alphabets : ["0","1"], initialState : "q1", finalStates : ["q4"], transtion : { "q1" : ...
Python
UTF-8
404
2.953125
3
[]
no_license
class Solution(object): def lengthOfLongestSubstring(self, s): dic={} ans,i,t=0,0,0 while i < len(s): if s[i] not in dic: dic[s[i]]=1 ans=max(ans,len(dic)) else: while s[i] in dic: del dic[s[t]] ...
C
UTF-8
406
3.5625
4
[]
no_license
#include "holberton.h" /** * flip_bits - return the number of bits you need to flip number * @n: a given number to change * @m: number expected after the change * Return: number of bits */ unsigned int flip_bits(unsigned long int n, unsigned long int m) { unsigned long int bits = 0; unsigned long int xor; for...
Markdown
UTF-8
24,215
2.609375
3
[ "Apache-2.0" ]
permissive
<!--- Generated by to-integrations-repo script in Smart Agent repo, DO NOT MODIFY HERE ---> ### INSTALLATION This integration is part of the [SignalFx Smart Agent](https://github.com/signalfx/integrations/tree/master/signalfx-agent)[](sfx_link:signalfx-agent) as the `collectd/mysql` monitor. You should first deploy ...
C++
UTF-8
813
3.25
3
[]
no_license
#include <iostream> #include <cmath> struct EGCDResult { long long x, y, g; EGCDResult(long long _x, long long _y, long long _g) { x = _x; y = _y; g = _g; } }; EGCDResult egcd(long long a, long long b) { if (b == 0) return EGCDResult(1, 0, a); EGCDResult rec = egcd(b, a % b); return EGCDResult(rec...
Python
UTF-8
4,439
2.5625
3
[]
no_license
# Universidad del Valle de Guatemala # Grafica por Computadora - CC3044 # Julio Herrera 19402 # Lab2: Shaders import functools from src.shaders import * from src.objLoader import Texture, TextureBMP from src.glTypes import V3, newColor from src.gl import Renderer width = 1920 height = 1080 rend = Renderer(width, heig...
C#
UTF-8
14,837
2.90625
3
[]
no_license
using DAL; using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace Worker { public class WordExtractor { private string FolderPath; public Sort...
PHP
UTF-8
505
2.609375
3
[]
no_license
<?php include('comunes/cabecera.php'); ?> <?php if(isset($_GET['nimagen'])){ $nimagen = $_GET['nimagen']; }else{ $nimagen = false; } ?> <?php if($nimagen != false){ ?> <h1>Página detalle de la imagen <?php print $nimagen; ?></h1> <p><img src="img/<?php print $nimagen; ...
C++
UTF-8
3,703
3.6875
4
[]
no_license
#ifndef VEC #define VEC #include <iostream> #include <string> #include <initializer_list> using std::string; using std::allocator; using std::pair; using std::initializer_list; using std::size_t; //some restriction on type T: //1. the pointer of type T must can be applied to subtraction. (as size() and capacity()) ...
Rust
UTF-8
2,213
3.4375
3
[ "WTFPL" ]
permissive
extern crate rand; extern crate colored; extern crate meval; use std::io::*; use std::cmp::Ordering; use std::thread; use std::time; use rand::Rng; use colored::*; static GREETING: &str = "Welcome to autoguess!"; static FIRST_PROMPT: &str = "Please choose the range for the random number the computer will try to guess...
Java
UTF-8
867
2.15625
2
[]
no_license
package try_git.test.services; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.Spr...
Java
UTF-8
459
2.03125
2
[]
no_license
package com.example.hieuphong_vu_comp304_003_test02.Dao; import androidx.lifecycle.LiveData; import androidx.room.Dao; import androidx.room.Insert; import androidx.room.Query; import com.example.hieuphong_vu_comp304_003_test02.Entity.Organizer; import java.util.List; @Dao public interface OrganizerDao { @Insert...
Markdown
UTF-8
3,623
2.703125
3
[]
no_license
# Article PROGRAMME DE LA FORMATION D'ADAPTATION À L'EMPLOI DES TECHNICIENS ET TECHNICIENS SUPÉRIEURS HOSPITALIERS Module 1. ― Connaître le cadre d'exercice des techniciens et techniciens supérieurs hospitaliers (35 heures ou une semaine) Ce module a pour but d'approfondir les connaissances du stagiaire sur le fo...
JavaScript
UTF-8
1,186
2.53125
3
[]
no_license
import React, { useState, useEffect } from "react"; import Player from "./components/Player"; function App() { const [songs] = useState([ { title: "Run Away", artist: "EXO", img_src: "./images/EXO-Runaway.jpeg", src: "./music/EXO-Runaway.mp3", }, { title: "Run Away", a...
Java
UTF-8
4,779
3.15625
3
[]
no_license
import java.util.Random; import components.map.Map; /** * Implementation class for the tic-tac-toe model. * * @author Katie Heym * */ public final class TicTacToeModel1 implements TicTacToeModel { /** * Model variable game board. */ private TicTacToeBoard<Integer> board; ...
Go
UTF-8
1,577
3.203125
3
[]
no_license
package client import ( "bufio" "log" "net" "github.com/VanBur/tcp-chat/internal/message" ) func New(connection net.Conn) *Client { client := &Client{ Register: make(chan string), Leave: make(chan string), Broadcast: make(chan *message.Message), Outgoing: make(chan *message.Message), reader: ...
C++
UTF-8
1,648
2.90625
3
[]
no_license
#include <stdio.h> #include <iostream> #include <fstream> #include <string> #include "Encryption.h" #include "Hash.h" #define PRINT_KEYS Encryption crypto; Encryption crypto2; int main() { std::string key1 = crypto.printKey(); std::string iv1 = crypto.printIV(); std::string key2 = crypto2.printKey(); std::st...
Java
UTF-8
380
3.078125
3
[]
no_license
package com.basics; import java.util.Scanner; public class Rectangle { public static void main(String[] args) { Scanner s1=new Scanner(System.in); System.out.println("enter the breadth value: "); int breadth=s1.nextInt(); System.out.println("enter the length: "); int length=s1.nextInt(); int...
Ruby
UTF-8
83
2.65625
3
[]
no_license
def divide(num1,num2) if num2 == 0 'silly_head' else num1 / num2 end end
Java
UTF-8
5,087
2.171875
2
[]
no_license
package hadrian.config; import org.springframework.aop.framework.ProxyFactory; import org.springframework.web.client.RestTemplate; import hadrian.cache.CacheEntryMeta; import hadrian.meta.API; import hadrian.meta.Cache; import hadrian.meta.http.Body; import hadrian.meta.http.Param; import hadrian.meta.http.Path; impor...
C++
GB18030
9,066
3.296875
3
[ "MIT" ]
permissive
#include "Sudoku.h" /************************************************************************ * : ĬϹ졣 * : ޡ * : ޡ ************************************************************************/ Sudoku::Sudoku() { srand((unsigned int)time(NULL)); for (int i = 0; i < RC_COUNT; ++i) { for (int j = 0; j <...
TypeScript
UTF-8
13,833
2.5625
3
[]
no_license
import * as Bannockburn from "bannockburn"; import _ from "lodash"; interface Location { start: LocPos; end: LocPos; } interface Span { value: string; p: number; } interface LocPos { line: number; col: number; } interface Token { type: string; value: string; range: [number, numbe...
C++
UTF-8
1,960
3.1875
3
[]
no_license
#include "ScopeLayer.h" ScopeLayer::ScopeLayer() : parent_(nullptr) { } void ScopeLayer::SetType(const Symbol& symbol, const std::shared_ptr<BaseType>& obj) { ScopeLayer* layer_with_variable = FindLayerWithSymbol(symbol); if (layer_with_variable == nullptr) { throw std::runtime_error...
Python
UTF-8
3,256
2.78125
3
[ "MIT" ]
permissive
"""Tokenization utilities.""" import os import six import shutil import pyonmttok def build_tokenizer(args): """Builds a tokenizer based on user arguments.""" local_args = {} for k, v in six.iteritems(args): if isinstance(v, six.string_types): local_args[k] = v.encode('utf-8') ...
PHP
UTF-8
1,274
2.78125
3
[]
no_license
<?php /* SITE_ID=nankai php import_brand.php csv.file csv 格式 品牌名称 别名 ps 别名如果是多个,使用";"来分割 */ require 'base.php'; $csv_file = $argv[1]; if (!is_file($csv_file)) { fecho(T('CSV文件 %csv_file 不存在!', array('%csv_file'=>$csv_file))); return; } function fecho($msg) { Upgrader::echo_fail($msg. "\n"...
Java
UTF-8
2,691
3.34375
3
[]
no_license
package model.expressions; import model.adt.IDictionary; import model.adt.IHeap; import model.exceptions.DivisionByZeroException; import model.exceptions.InterpretorException; import model.exceptions.OperandMustBeIntegerException; import model.exceptions.OperandTypeMismatchException; import model.types.IntType; import...
C#
UTF-8
391
3.046875
3
[]
no_license
using System; namespace Curso_de_.NET_Udemy { class Program { static void Main(string[] args) { var data = 3; var result = data switch { 1 => "Alex", 2 => "Jhon", 3 => "Arthur" }; Console.WriteLi...
Markdown
UTF-8
9,536
3.0625
3
[]
no_license
--- layout: post title: "100 Days Of Writing (Round 1)" date: 2018-03-23 tags: - 100 Days Challenge - writing categories: - [100 Days Challenge, Data Science] - Data Science permalink: 100-Days-Of-Writing-Round-1 --- Main Commitment: I will write every day for the next 100 days. Start Date: 2018-03-23 <!-- more -...
JavaScript
UTF-8
1,999
2.8125
3
[]
no_license
import React, { Component } from 'react'; import GetImageButton from '../components/GetImageButton' import ImageDisplay from '../components/ImageDisplay' import API_KEY from './apiKey' class GetImageForm extends Component { constructor(props){ super(props) this.fetchroverimage=this.fetchroverimage.bind(this) this.h...
JavaScript
UTF-8
6,078
2.875
3
[]
no_license
/*require('blanket')({ pattern: ["../*.js"] function (filename) { return !/node_modules/.test(filename); } });*/ /*var blanket = require("blanket")({ "pattern": "../pl0node.js" });*/ var expect = require('chai').expect; const PEG = require("../pl0node.js"); const semantic = require("../se...
Java
UTF-8
3,500
2.984375
3
[]
no_license
package me.rahul.input.search.impl; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; import me.rahul.input.data.impl.Node; import me.rahul.input.data.impl.TrieDictionaryImpl; import me.rahul.input.search.SearchStrategy; public...
Shell
UTF-8
3,137
3.640625
4
[ "BSD-3-Clause" ]
permissive
#!/bin/bash # ################################################## # Copyright (c) 2019-2022, Intel Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of sou...
Java
UTF-8
785
2.890625
3
[]
no_license
package gabrielnsdin.factoryMethod.arquivo; import java.awt.Desktop; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class ArquivoConfidencial extends Arquivo{ public void escreverArquivo() { try { String message = "Estas informações são con...
Python
UTF-8
1,262
2.5625
3
[ "MIT" ]
permissive
from . import _simplecoremidi as cfuncs class MIDISource(object): def __init__(self, source_name=None): if not source_name: source_name = "unnamed source" self._source = cfuncs.create_source(source_name) def send(self, midi_data): assert isinstance(midi_data, tuple) or isi...
PHP
UTF-8
1,818
2.515625
3
[ "Apache-2.0" ]
permissive
<?php /** * File containing the ezcTemplateFetchCacheInformation class * * 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 ...
Python
UTF-8
3,571
2.578125
3
[ "MIT" ]
permissive
############################################################################## # Copyright (c) 2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # Written by Emilio Castillo <ecastill@bsc.es>. # LLNL-CODE-745958. All rights reserved. # # This file is part of Lo...
Java
UTF-8
3,373
2.09375
2
[]
no_license
package com.recycup.recycup; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import android.webkit.WebSettings; import androi...
PHP
UTF-8
176
3.1875
3
[]
no_license
<?php function do_maths($expression) { eval('$o = ' . preg_replace('/[^0-9\+\-\*\/\(\)\.]/', '', $expression) . ';'); return $o; } echo do_maths('(10*5)+5+(10*5)'); ?>
PHP
UTF-8
515
2.609375
3
[]
no_license
<?php require 'functions.php'; require_once '../Input.php'; function pageController(){ if (!Input::has('count')){ $count = 0; } else { $count = Input::get('count'); } return ['count' => $count]; } extract(pageController()); ?> <!DOCTYPE html> <html> <head> <title></title> </h...
Java
UTF-8
4,637
1.984375
2
[]
no_license
package com.steam.odwek; import java.io.File; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.io.Writer; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import javax.servlet.ServletContext; import javax.servlet.http.HttpSession; import j...
PHP
UTF-8
1,191
2.578125
3
[]
no_license
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateInstructorPlanTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { if(!Schema::hasTable('in...