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
SQL
UTF-8
1,252
4.15625
4
[]
no_license
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. -- -- You can write comments in this file by starting them with two dashes, like -- these lines here. DROP DATABASE IF EXISTS tournament; CREATE...
Swift
UTF-8
269
2.578125
3
[]
no_license
// // NewsSource.swift // NewsApp // // Created by Mohammad Azam on 6/30/21. // import Foundation struct NewsSourceResponse: Decodable { let sources: [NewsSource] } struct NewsSource: Decodable { let id: String let name: String let description: String }
JavaScript
UTF-8
4,556
2.59375
3
[]
no_license
var express = require("express"); var router = express.Router(); var Campground = require("../models/campground"); var middleware = require("../middleware"); // INDEX - show all campgrounds. router.get("/", function(req, res){ var perPage = 8; var pageQuery = parseInt(req.query.page); var pageNumber = pageQuery...
TypeScript
UTF-8
152
2.578125
3
[]
no_license
export type ITopic = 'Biologia' | 'Administração de Empresas' | 'Marketing Digital' export interface ICard { question: string; answer: string; }
JavaScript
UTF-8
3,465
3.15625
3
[]
no_license
$(document).ready(function () { $("#userBtn").click(function (e) { e.preventDefault(); var formError = false; var $oldPass = $("#oldPass"); var $newPass = $("#newPass"); var $reNewPass = $("#reNewPass"); $oldPass.removeClass('error').parent().attr('data-content', ''...
C++
UTF-8
1,492
3.4375
3
[]
no_license
#include <iostream> #include <string> using namespace std; namespace ece309 { class Object{ public: virtual void print(){ printf("object!\n"); }; }; //Integer Object class Integer: public Object { public: int data; Integer(int x):data(x){} void print(){ printf("%d\n", data); } }; //Doubles Object clas...
Python
UTF-8
443
3.015625
3
[]
no_license
# -*- coding: UTF-8 -*- __author__ = 'zy' __time__ = '2019/8/31 16:55' import matplotlib.pyplot as plt from matplotlib import cm from numpy import linspace start = 0.0 stop = 1.0 number_of_lines= 7 cm_subsection = linspace(start, stop, number_of_lines) print(cm_subsection) colors = [ cm.jet(x) for x in cm_subsectio...
C++
UTF-8
2,221
3.09375
3
[]
no_license
#include <iostream> #include <SDL2/SDL.h> #include "sdl_screen.hpp" sdl_screen::sdl_screen() { width = 160; height = 144; window_title = ""; fps_limit = 60; window = nullptr; renderer = nullptr; texture = nullptr; current_frame = 0; quit = false; } sdl_screen::~sdl_screen() { SDL_DestroyTexture(texture); S...
Swift
UTF-8
2,995
2.546875
3
[]
no_license
// // TopOfertasViewController.swift // YourMall // // Created by Juan Munhoes Junior on 7/19/16. // Copyright © 2016 Hackatruck. All rights reserved. // import UIKit class TopOfertasViewController: UIViewController,UITableViewDelegate,UITableViewDataSource { @IBOutlet weak var tableView:UITableView! ...
Java
UTF-8
452
1.921875
2
[]
no_license
package com.edaisong.entity.req; /* * 骑士月账单请求参数 * */ public class AccountBillCReq { private String monthInfo;//月信息 2015-08 private Integer clienterId;//商户ID public String getMonthInfo() { return monthInfo; } public void setMonthInfo(String monthInfo) { this.monthInfo = monthInfo; } public Integer getClienterId() { ...
SQL
UTF-8
1,561
2.921875
3
[ "MIT" ]
permissive
INSERT INTO Banks (BankName, City, NoAccounts, Security) VALUES ('Loanshark Bank', 'Evanston', 100, 'very good'::SecurityLevel); INSERT INTO Banks (BankName, City, NoAccounts, Security) VALUES ('Loanshark Bank', 'Evanston', -5, 'excellent'::SecurityLevel); INSERT INTO Banks (BankName, City, NoAccounts, Securi...
Swift
UTF-8
766
3.546875
4
[]
no_license
//: [Previous](@previous) /* Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. */ class Solution { func deleteDuplicates(_ head: ListNode?) -> ListNode? { let dummy = ListNode(0) dummy.next = head var prev: ListN...
Java
UTF-8
4,460
2.578125
3
[]
no_license
package com.java.springbootresth2basics.controllers; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import java.net.URI; import java.util.List; import java.util.Optional; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org...
Java
UTF-8
1,860
2.765625
3
[]
no_license
package events; import java.util.ArrayList; import java.util.Arrays; import game.GameData; import main.Common; import map.MapManager; import powerstruggle.PowerStruggle; public class SocialDemocraticPlatform extends Card { private static ArrayList<Integer> doable; public static int target; @Override public void...
Python
UTF-8
3,091
2.640625
3
[]
no_license
import psycopg2 import json import requests from time import sleep from backend.database import get_cursor, base_url def create_dummy_prediction_fixtures(): cur = get_cursor() #get list of stops cur.execute("SELECT stopId FROM stops;") stop_ids_tuples = cur.fetchall() # THERE HAS GOT TO BE A B...
C
GB18030
1,115
2.734375
3
[]
no_license
#pragma once #include "data_structure.h" //һʱ int set_timer(int* flag, int needed_time) { static int timer_end; static int timer_start; //̬ if (*flag) { timer_end = clock(); } else { timer_end = clock(); timer_start = clock(); (*flag)++; //־λ++ } return(needed_time - (int)(double)((timer_end - t...
Java
UTF-8
4,757
2.484375
2
[]
no_license
package com.example.firstwebapplication.generator.triple; import com.example.firstwebapplication.generator.constraints.Constraint; import com.example.firstwebapplication.generator.constraints.ConstraintCollection; import com.example.firstwebapplication.generator.constraints.Mutation; import org.junit.jupiter.api.After...
C#
UTF-8
10,361
2.59375
3
[]
no_license
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using MySql.Data.MySqlClient; namespace EIMS1 { public partial class frmCourse : Form { ...
Java
UTF-8
752
2.28125
2
[ "Apache-2.0" ]
permissive
package me.zhehua.firerooster.pipeline; /** * Created by Zhehua on 2017/3/21. */ public class ReadTask extends InTask { @Override public Message process(Message inputMessage) { if (((Counter) sharedObj).num >= 300) { Message endMsg = new Message(Message.STOP_TASK); endMsg.set...
Java
UTF-8
230
2.390625
2
[]
no_license
package ArrayListSerializationDemo; import java.io.Serializable; public class Emp implements Serializable{ int eid; String ename; public Emp(int eid, String ename) { super(); this.eid = eid; this.ename = ename; } }
Python
UTF-8
1,746
3.28125
3
[ "BSD-3-Clause" ]
permissive
from .shell import Shell __copyright__ = 'Copyright (C) 2019, Nokia' class AutoCompletableShell(Shell): """ Several shells support *tab autocompletion*. Any custom shell implementation can inherit from this class in order to provide such functionality. Args: cmd: part of a command. ...
Python
UTF-8
1,986
2.765625
3
[]
no_license
import socket import threading import time import bluetooth bind_ip = "192.168.1.114" bind_port = 46000 bluetooth_MAC = '98:D3:31:30:77:53' server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip, bind_port)) #listen on port 46000 with max connection baglog = 5 server.listen(30) print "...
Java
UTF-8
2,108
2.28125
2
[]
no_license
package no.kantega.forum.search; import no.kantega.forum.dao.ForumDao; import no.kantega.forum.model.Post; import no.kantega.search.api.IndexableDocument; import no.kantega.search.api.index.ProgressReporter; import no.kantega.search.api.provider.IndexableDocumentProvider; import org.slf4j.Logger; import org.slf4j.Logg...
C++
UTF-8
563
3.375
3
[]
no_license
#include "ex14.StrBlob.hpp" #include <iostream> using std::cout; using std::endl; int main() { StrBlob strs{"one", "two", "three", "four"}; StrBlobPtr ptr(strs); ConstStrBlobPtr cptr = strs.cbegin(); cout << "Test for *ptr ,which should be one" << endl; cout << *ptr << endl; cout << "T...
C++
UTF-8
2,302
2.6875
3
[ "Apache-2.0" ]
permissive
#include<iostream> using namespace std; //#include<conio.h> #include<map> struct nodes { // long long int clic; // long long int len; map<long long int,long long int> m; struct nodes* next; }; typedef struct nodes* list; list insert(list l,long long int c,long long int le) { list temp=l; int c1=0; ...
JavaScript
UTF-8
1,212
2.515625
3
[]
no_license
export default class Song { constructor(song) { this.title = song.trackName //Change 250x250 if you want a larger image this.albumArt = song.artworkUrl60.replace(/60x60/g, "250x250") this.artist = song.artistName this.collection = song.collectionName this.price = song...
Java
UTF-8
3,179
2.59375
3
[]
no_license
package com.ctco.testSchool; import static org.hamcrest.core.Is.is; import java.util.Arrays; import com.ctco.testSchool.Member.type; import org.junit.Assert; import org.junit.Test; public class WhiteBoxTesting { Team myTeam = new Team(); @Test public void testCanDeliverQualityPositiveHappyPath() { ...
Python
UTF-8
1,403
3.609375
4
[]
no_license
""" Written by: S Divakar Bhat Roll No: 18307R004 Title: CS763-Lab1-numpy-row_manipulation """ import argparse import numpy as np def permute_matrix(N): eye = np.identity(N) P = np.zeros((N,N)) if N%2==0: idx = N//2 else: idx = N//2+1 P[0::2] = eye[:idx] P[1::2] = eye[idx:] ...
C#
UTF-8
1,290
3.78125
4
[]
no_license
using System; using System.Collections.Generic; using System.Linq; namespace _04_GenericSwapMethodInteger { class GenericSwapMethodIntegerStartUp { static void Main(string[] args) { List<Box<int>> listOfBoxes = new List<Box<int>>(); int numberOfLines = int....
Markdown
UTF-8
23,813
3.59375
4
[ "Apache-2.0" ]
permissive
# Basics, algorithms Welcome to the first jupyter notebook! In this session, we won't go into too many minute details yet, but will cover the basics of machine learning. We've tried to keep it as simple as possible, also because many might only have little experience with python and/or programming a 'learning machine'...
Shell
UTF-8
366
2.609375
3
[]
no_license
#!/bin/bash #Change Timezone in Linux sudo mv /etc/localtime /etc/localtime.bk sudo cp /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime #Change Date and Time in Linux #date MMDDhhmmYYYY # Sync your system time and date with ntp (Network Time Protocol) over internet sudo yum install -y ntp sudo chkconfig ntpd on sud...
Java
UTF-8
14,295
2.34375
2
[ "Apache-2.0" ]
permissive
package info.mornlight.gw2s.android.app; import android.app.ActionBar; import android.os.Bundle; import android.support.v4.widget.DrawerLayout; import android.view.*; import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; import butterknife.ButterKnife; import butterknife.In...
Java
UTF-8
338
1.78125
2
[]
no_license
package com.cognitive.newswizard.service.repository; import java.util.List; import com.cognitive.newswizard.service.repository.projection.CountRawFeedEntryByPeriodProjection; public interface RawFeedEntryAggregationRepository { List<CountRawFeedEntryByPeriodProjection> countRawFeedEntryByPeriod(final Long start, f...
Swift
UTF-8
1,833
2.90625
3
[]
no_license
// // DetailView.swift // Movie App // // Created by  protodimbo on 12.05.2021. // import UIKit protocol DetailViewDelegate: AnyObject { func setupTableViewDelegate() -> UITableViewDelegate func setupTableViewDataSource() -> UITableViewDataSource } final class DetailView: UIView { // MARK: - Public pr...
Python
UTF-8
4,967
2.890625
3
[ "MIT" ]
permissive
# -*- coding: utf-8 -*- from unittest import TestCase from rest_orm import errors, fields, models class FieldsTestCase(TestCase): def test_deserialize_deeply_nested_field(self): """Test deserializing a heavily nested field.""" field = fields.AdaptedField('[x][y][z]') value = field.deseri...
PHP
UTF-8
7,647
2.609375
3
[ "Apache-2.0" ]
permissive
<?php namespace App\Models\Entity; use Swoft\Db\Model; use Swoft\Db\Bean\Annotation\Column; use Swoft\Db\Bean\Annotation\Entity; use Swoft\Db\Bean\Annotation\Id; use Swoft\Db\Bean\Annotation\Required; use Swoft\Db\Bean\Annotation\Table; use Swoft\Db\Types; /** * 动态信息表 * @Entity() * @Table(name="mallbuilder_sns") ...
Python
UTF-8
309
3.28125
3
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Aug 5 14:18:30 2017 @author: lenovo """ """ 五角星的绘制。绘制一个红色的五角星图形 """ from turtle import* fillcolor("red") begin_fill() while True: forward(200) right(144) if abs(pos())<1: break end_fill()
Python
UTF-8
68
3.015625
3
[]
no_license
import cmath z = -17 z = z ** (1 / 2) cmath.sqrt(z) print(z)
Java
UTF-8
1,036
2.296875
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 glucosabajocontrol; import java.io.IOException; import java.sql.Date; import java.sql.SQLException; /** * * @author W10USER...
C#
UTF-8
770
3.125
3
[]
no_license
using System; using System.Reflection; using CarsPro; namespace DoReflection { class Program { static void Main(string[] args) { Type mtype = typeof(Car); Type mytype2 = Type.GetType("CarsPro.LadaSedan,Cars", false, true); Car...
PHP
UTF-8
2,039
2.59375
3
[]
no_license
<?php declare(strict_types = 1); namespace Tests\Importers; use PHPUnit\Framework\TestCase; /** * @covers Email */ final class FactoryTest extends TestCase { public function providergetImporter() { return [ ['\\Importers\\CSV', false, 'data.csv'], ['\\Importers\\CSV', false, '...
JavaScript
UTF-8
2,421
2.8125
3
[ "Apache-2.0" ]
permissive
const express = require('express') const app = express() const port = 3001 app.use(express.json()); treeInfo = { heap: 31496, ssid: "", ap_address: "192.168.4.1", pin: 2, leds: 10, current: 10, current_index: 10, current_name: "Multiple Falling Stars", random: true, override_index: -1, "sequence...
Python
UTF-8
1,350
3.359375
3
[]
no_license
import copy with open("inputs/input11.txt", "r") as f: layout = [list(x) for x in f.read().splitlines()] def neighbours(x,y,layout): n = [] for i in range(max(0, x - 1), min(len(layout), x + 2)): for j in range(max(0, y - 1), min(len(layout[0]), y + 2)): if not (i == x and j == y): ...
JavaScript
UTF-8
346
3.21875
3
[ "MIT" ]
permissive
const input=require("readline-sync") const time=input.questionInt("enter time:-") if (time >= 5 && time <= 6) { console.log("sleep well"); } else if (time >=6 && time <= 7) { console.log("Morning Exercise"); } else if(time > 7 && time < 8.30){ console.log("Break+Breakfast"); } else if ( time > 8.30 && time < 12){ ...
Go
UTF-8
665
2.90625
3
[]
no_license
package register import ( "actor" ) // register Actor implementation type RegisterActor struct { *actor.Actor } //Start register instance func Start() *RegisterActor { r := &RegisterActor{actor.NewActor()} st := &Register{ index: make(map[actor.Pid]*actor.Actor), } r.Spawn(st) return r } //Set Actor on Re...
C++
UTF-8
973
2.59375
3
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
/** * Copyright (c) 2017 Darius Rückert * Licensed under the MIT License. * See LICENSE file for more information. */ #pragma once #include <saiga/config.h> #include "saiga/util/glm.h" #include "saiga/geometry/aabb.h" #include "saiga/geometry/sphere.h" #include "saiga/geometry/triangle.h" #include "saiga/geometry...
Java
UTF-8
985
2.15625
2
[]
no_license
package com.fram.codingassignment.mvp.portfoliochart.model; import com.fram.codingassignment.mvp.base.usecase.RequestValues; import com.fram.codingassignment.mvp.portfoliochart.domain.UcFilterPortfolioData; import java.util.List; /** * Created by thaile on 6/4/17. */ public class FilterPortfolioRequest implements...
C++
UTF-8
3,159
2.875
3
[]
no_license
#include "coins.h" #include "main.h" Coins::Coins(float x, float y, color_t color) { this->position = glm::vec3(x, y, 0); this->rotation = 0; this->radius = 0.2; this->d=0; this->status=0; // this->speed = speed; // yspeed = 0; GLfloat vertex_buffer_data[500]; int sides = 50; ...
Java
UTF-8
5,909
2.3125
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 workloadgenerator; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFact...
C#
UTF-8
516
2.625
3
[ "MIT" ]
permissive
using System.Collections.Generic; namespace Discord { /// <summary> /// Represents a component object used in <see cref="Modal"/>s. /// </summary> public class ModalComponent { /// <summary> /// Gets the components to be used in a modal. /// </summary> public...
Java
UTF-8
2,602
1.851563
2
[ "Apache-2.0", "MIT" ]
permissive
/* * Copyright 2016 Goldman Sachs. * * 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 ...
Markdown
UTF-8
878
2.90625
3
[]
no_license
--- layout: post-layout.njk title: Played around with event emitters date: 2020-07-14 tags: ['100days'] --- <!-- Excerpt Start --> This is another one of those things that I use *all* the time and took for granted. Turns out they're pretty cool. <!-- Excerpt End --> Events listeners are pretty common is JS, whether it...
PHP
UTF-8
6,913
2.75
3
[]
no_license
--TEST-- s60_calendar repeat test. --FILE-- <?php function my_assert_handler($file, $line, $code) { $lines = file($file); echo "\nFailure:".trim($lines[$line-1])."\n"; } assert_options(ASSERT_CALLBACK, 'my_assert_handler'); define('HOUR', 3600); define('DAY', HOUR*24); define('WEEK', DAY*7); define('NOW', time());...
Java
UTF-8
2,374
2.296875
2
[]
no_license
package backend.ServiceImpl; import backend.Dao.BookDao; import backend.Dao.CartDao; import backend.Dao.OrderDao; import backend.Dao.OrderItemDao; import backend.Entity.Cart; import backend.Entity.Order; import backend.Entity.OrderItem; import backend.Service.OrderService; import org.springframework.beans.factory.anno...
C#
UTF-8
4,630
2.9375
3
[ "MIT" ]
permissive
using System; using System.Globalization; using System.IO; using System.Linq; namespace Memento.Helpers { class BackupPath { private string _base; private string _month; private string _day; private string _time; private string _customLabel; private DateTime _ti...
Markdown
UTF-8
4,482
2.9375
3
[]
no_license
# ApiClient A C# .NET Core API Client library for connecting to and consuming data from APIs. ![.NET Core](https://github.com/jboyer87/ApiClient/workflows/.NET%20Core/badge.svg?branch=master) ![Nuget](https://img.shields.io/nuget/v/ApiClient.Common) # Installation Add the `ApiClient.Common` package to your project ...
C#
UTF-8
339
3.1875
3
[]
no_license
public static T SafeProcessing<T>(Action<T> action, Action<T> onFail) where T: new() { var t = Activator.CreateInstance<T>(); try { a(t); } catch (Exception e) { //Log e onFail(t); } ...
Python
UTF-8
149
3.59375
4
[]
no_license
name="john" print "Hello %s!" % name age=25 print "Hello %s, you are %d years old" %(name, age) list2=[1,2,3] print 'this is a list: %s' % list2
Markdown
UTF-8
2,253
2.53125
3
[ "CC-BY-4.0", "MIT" ]
permissive
# <a name="response-compression-sample-application-aspnet-core-1x"></a>响应压缩示例应用程序 (ASP.NET Core 1.x) 此示例演示如何使用 ASP.NET Core 1.x 响应的压缩中间件来压缩 HTTP 响应中的。 此示例演示 Gzip 和自定义压缩的文本和图像响应的提供程序,并演示如何添加压缩的 MIME 类型。 有关 ASP.NET Core 2.x 示例,请参阅[响应压缩示例应用程序 (ASP.NET Core 2.x)](https://github.com/aspnet/Docs/tree/master/aspnetcore/perfo...
Java
UTF-8
2,605
2.421875
2
[]
no_license
package ec.com.jnegocios.api; import java.security.Principal; import java.util.Collection; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.anno...
Java
UTF-8
4,934
2.484375
2
[]
no_license
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.cestarcollege.beans; import com.cestar.dBUtil.ConnectionManager; import java.io.Serializable; import java.sql.Con...
C#
UTF-8
13,985
2.703125
3
[]
no_license
//=============================================================== // Copyright (C) 2010-2013 皖仪科技研发中心 // 文件名: CurveFitting.cs // 日期:2013/10/10 // 描述:曲线拟合算法 // 版本:1.00 // 修改历史纪录 // 版本 修改时间 修改人 修改内容 //============================================================== using System; using System.Coll...
SQL
UTF-8
5,564
3.21875
3
[]
no_license
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 80012 Source Host : localhost:3306 Source Database : eat Target Server Type : MYSQL Target Server Version : 80012 File Encoding : 65001 Date: 2019-01-28 13:20:15 */ SET FOREIGN_KEY_CHEC...
Java
UTF-8
988
2.421875
2
[]
no_license
package org.courseapi.course; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.ManyToOne; import org.hibernate.*; import com.fasterxml.jackson.annotation.JsonIgnore; import org.courseapi.topic.Topic; @Entity public class Course { public...
C
UTF-8
1,488
3.4375
3
[]
no_license
/* Shows how to write a simple command-line interpreter. The parent accepts user comands and * forks a child process to execute those commands. * * Author: Naga Kandasamy * Date created: 1/4/2009 * Date modified: 6/23/2018 * * Compile the code as follows: gcc simple_interpreter.c -o simple_interpreter -std=c99...
Python
UTF-8
579
3.390625
3
[ "MIT" ]
permissive
import threading class StoppableThread(threading.Thread): """Basic Stoppable Thread Wrapper Adds event for stopping the execution loop and exiting cleanly.""" def __init__(self, *args, **kwargs): threading.Thread.__init__(self, *args, **kwargs) self.stop_event = threading.Event() ...
Java
UTF-8
1,749
2.109375
2
[]
no_license
package com.target.pages; import org.junit.Assert; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedConditions; import com.target.domainObject.User; import com.target.pages.identifiers.TargetListGiftGiver...
C++
UTF-8
424
2.921875
3
[]
no_license
#include<future> #include<iostream> #include<chrono> #include<thread> int test() { int n=100; std::this_thread::sleep_for(std::chrono::seconds(5)); return n; } int test1() { int n = 200; std::this_thread::sleep_for(std::chrono::seconds(5)); return n; } int main1() { { using namespace std;...
TypeScript
UTF-8
478
2.53125
3
[ "MIT" ]
permissive
import { ReducerDictionary, handleSimpleReducerUpdates, createReducer, } from "../state/ReduxUtils"; import { ShopActionTypes } from "./ShopActions"; export interface ShopState { shopOrigin: string; } export const shopInitialState: ShopState = { shopOrigin: undefined }; const reducers: ReducerDictionary<Shop...
C++
UTF-8
2,764
2.546875
3
[]
no_license
#ifndef QMCCONVCHECKER_HH_ #define QMCCONVCHECKER_HH_ #include <vector> #include <cmath> #include <cfloat> #include <cassert> #include "mcuncert/QMCUncertaintyCalculator.hh" #include "AbsConvergenceChecker.hh" class QMCConvChecker : public AbsConvergenceChecker { public: // This class constructor has the follow...
Shell
UTF-8
15,464
3.703125
4
[]
no_license
#!/bin/bash # Git Pushy Simple Build Deployment Framework # # @link http://gitpushy.com # @author Micon Frink & Friends <frink@frinknet.com> # @copyright (c) 2013 - FRINKnet and the Expatriated Lemurs of Borneo # Licenced under the MIT license see - http://lemurs.mit-license.org/ gitpushy-branch-name() { local br...
Java
UTF-8
908
2.375
2
[]
no_license
package com.screendemo; import android.os.Bundle; import android.app.Activity; import android.view.Menu; import android.view.ViewGroup.LayoutParams; import android.widget.EditText; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInst...
C#
UTF-8
1,708
3.09375
3
[ "MIT" ]
permissive
using System; using System.IO; using System.Linq; using System.Text; namespace HermaFx.IO { public class TempFile : IDisposable { public string FullPath { get; private set; } public TempFile() { this.FullPath = Path.GetTempFileName(); } public TempFile(Stream data) : this() { CopyStreamToFull...
C++
UTF-8
1,178
3.046875
3
[]
no_license
#include "ColaDeSerializacion.h" #include "../../common/Excepcion.h" #include <utility> ColaSerializacion::ColaSerializacion() : conditionVariable(), cola(), mutex(), colaCerrada(false){} SerializacionCliente ColaSeria...
Java
UTF-8
1,520
2.21875
2
[]
no_license
package vn.com.hiringviet.service.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import vn.com.hiringviet.dao.EndorseDAO; import vn.com.hiringviet.dao.SkillResumeDAO; import vn.com.hiringviet.dto.EndorseDTO; import vn.com.hiringviet.model.Endorse; i...
C#
UTF-8
2,489
2.671875
3
[]
no_license
using Mojio.Client.OBDDevice; using Mojio.Client.OBDDevice.Contracts; using Mojio.Client.OBDDevice.InTheHandBluetooth; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TestConsole { internal class Program { private static voi...
JavaScript
UTF-8
3,475
2.78125
3
[ "BSD-2-Clause" ]
permissive
var RingOffset = klass.create(); _.extend(RingOffset.prototype, { initialize: function() { this.speed = 0; this.currentOffset = 0.0; this.nextDecision = 0; this.maxOffset = (Math.PI) / 8; }, setWanderState: function() { this.speed = randbound(-0.003, 0.003); }, ...
C++
UTF-8
2,409
3.453125
3
[]
no_license
/* cohenSutherland.h * * Algoritmo de clipping de linhas; implementa LineClipper. */ #ifndef COHEN_SUTHERLAND_H #define COHEN_SUTHERLAND_H #include "render/clipping/lineClipper.h" #include "render/clipping/clippingArea.h" #include "math/point.h" class CohenSutherland : public LineClipper<2> { private: Clippin...
C++
UTF-8
8,477
3.546875
4
[]
no_license
// Member-function definitions for class HugeInteger #include <iostream> using namespace std; #include "HugeInteger.h" // include definition of class HugeInteger // default constructor; construct a zero HugeInteger with size 1 HugeInteger::HugeInteger() : integer( 1 ) { } // constructor; construct a zero HugeInteg...
C
UTF-8
1,499
3.515625
4
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "fonction.h" char lireCaractere() { char caractere = 0; caractere = getchar(); /*L'utilisateur entre une lettre, cette fonction getchar() est une fonction de stdio elle revient au même que d'écrire: scanf("%c", &lettreEn...
C++
UTF-8
1,809
2.84375
3
[]
no_license
/************************************************************ * (C) Voxel Farm Inc. 2015 */ #pragma once #include <stdint.h> namespace HyVoxel { /**************************** * * * Union Find * * (Fast Classification) * * * ****************************/ template <typename idxType> class CUni...
C#
UTF-8
1,634
2.609375
3
[]
no_license
using System; using System.Diagnostics; using System.Threading; using System.Reflection; namespace BA.Examples.ServiceProcess.Services.Core { public abstract class PublishService<T> where T : class { protected static void FireEvent(params object[] args) { StackFrame stackFrame = ne...
PHP
UTF-8
1,292
3.25
3
[ "MIT" ]
permissive
<?php namespace ModuleBZ\YandexTurbo\Element; use ModuleBZ\YandexTurbo; class Rating { /** @var float $value значение рейтинга */ protected $value; /** @var float $best из скольки максимальных */ protected $best; /** * Rating constructor. * @param float $value * @param float $bes...
Markdown
UTF-8
5,673
3
3
[]
no_license
Scala version used: 10.4.2 I have encountered what I am fairly sure is broken behavior in case classes when members are declared using backquotes. I have the following minimized test case: ```scala object HelloScalaBug { case class wrong(`a b`: Int, a: Int) case class right(a: Int, `a b`: Int) def main(args: ...
Python
UTF-8
549
2.84375
3
[]
no_license
import json class DB: def query_db(self, file_name): with open(file_name) as json_file: try: rows = json.load(json_file) except ValueError: rows = [] return rows def update_db(self, file_name, rows): with open(file_name, 'w')...
Java
UTF-8
1,927
1.984375
2
[]
no_license
package com.linkwee.web.model; import java.io.Serializable; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.serializer.SerializerFeature; /** * * @描述: 实体Bean * * @创建人: liqimoon * * @创建时间:2016年11月10日 10:29:41 * * Copyright (c) 深圳领会科技有限公司-版权所有 */ public class SysGrayRelease i...
Python
UTF-8
1,972
2.84375
3
[ "Apache-2.0" ]
permissive
""" Component """ import json from websocket import create_connection from core.observer import Observable class BaseComponent(object): """ Class for components """ config = dict() def __init__(self): with open('./config.json') as file: BaseComponent.config = json.loads(file.re...
Java
UTF-8
377
3.90625
4
[]
no_license
package com.bvan.javastart.lesson4.loop; /** * @author bvanchuhov */ public class SalaryWhile { public static void main(String[] args) { long salary = 600; // (1) while (salary < 10000) { // (2) System.out.println("Work. My salary is " + salary); salary += 1000; // (3) ...
Markdown
UTF-8
1,196
3.28125
3
[ "MIT" ]
permissive
# Tooltip A Tooltip component is UI component that provides the user with additional context when engaged. ## Example ```jsx <Tooltip title="You're my boy!!!">Blue</Tooltip> ``` ## Props | Prop | Type | Description | | ------------- | --...
Java
UTF-8
2,447
2.5
2
[]
no_license
package com.newline.simple; import android.app.Activity; import android.os.Bundle; import android.os.Handler; import android.util.Log; import android.widget.TextView; import com.hht.simple.R; import com.newline.simple.model.SerialPortModel; import com.newline.simple.model.SerialPortModel; import android_serialport_a...
Java
UTF-8
16,870
2.09375
2
[ "BSD-3-Clause", "Apache-2.0", "MIT", "CC-BY-2.5" ]
permissive
/* * 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, Version 2.0 (the * "License")...
Java
UTF-8
670
2.046875
2
[]
no_license
package com.pengfei.intern.dao.impl; import com.pengfei.intern.dao.JobDao; import com.pengfei.intern.domain.Intern; import com.pengfei.intern.domain.Job; import com.pengfei.intern.domain.Task; import org.springframework.stereotype.Repository; import java.util.List; /** * Created by zhaopen on 5/16/2017. */ @Reposi...
JavaScript
UTF-8
1,454
2.984375
3
[]
no_license
export default function showAddItemForm() { let style = document.getElementById("addItemForm").style.display; "block" == style ? (style = "none") : (style = "block"); document.getElementById("addItemForm").style.display = style; } const input = document.getElementById("item"); const addItemForm = document.getEle...
Python
UTF-8
1,055
2.71875
3
[ "Apache-2.0" ]
permissive
# -*- coding: utf-8 -*- __author__ = 'isee15' import LunarSolarConverter converter = LunarSolarConverter.LunarSolarConverter() def LunarToSolar(year, month, day, isleap = False): lunar = LunarSolarConverter.Lunar(year, month, day, isleap) solar = converter.LunarToSolar(lunar) return (solar.solarYear, sol...
Java
UTF-8
22,960
3.28125
3
[ "Apache-2.0" ]
permissive
package alix.util; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; /** * A mutable string implementation thought for efficiency more than security. * The hash function is same as String so that a Term can be found in a Set<String>. * The same internal char array could be shared by ...
Rust
UTF-8
5,856
2.8125
3
[]
no_license
use std::collections::HashMap; use std::borrow::Borrow; use regex::Regex; struct MorseDecoder { morse_code: HashMap<String, String>, } fn main() { let decoder = MorseDecoder::new(); print!("{}", decoder.decode_bits("110011001100110000001100000011111100110011111100111111000000000000001100111111001111110011...
JavaScript
UTF-8
1,269
2.78125
3
[]
no_license
import React, { Component } from 'react'; import Todoitem from './todoitem' class Todolist extends Component { constructor(props){ super(props); this.state={ inputValue:'', list:['html','css','js'] } this.onhandleChange=this.onhandleChange.bind(this) this.onhandleClick=this.o...
Python
UTF-8
1,622
3.5625
4
[ "MIT" ]
permissive
__author__ = 'Archana V Menon, Sujith V' def dominating_set(G): """ Finds a greedy approximation for a minimal vertex cover of a specified graph. At each iteration, the algorithm picks the vertex with the highest degree and adds it to the cover, until all edges are covered. :param G: networkx gr...
JavaScript
UTF-8
836
3.90625
4
[]
no_license
// The Goal // Destroy the mountains before your starship collides with one of them. For that, shoot the highest mountain on your path. // Rules // At the start of each game turn, you are given the height of the 8 mountains from left to right. // By the end of the game turn, you must fire on the highest mountain by o...
JavaScript
UTF-8
1,359
2.703125
3
[]
no_license
import React, { Component } from 'react'; import moment from 'moment'; class Timer extends Component { constructor() { super(); this.tmrw = moment().add(1, 'day').hours('10').minutes('30').seconds('00').format(); this.before = moment().hours('7').minutes('00').seconds('00').format(); this.after = mom...