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 |
|---|---|---|---|---|---|---|---|
Shell | UTF-8 | 544 | 3.09375 | 3 | [] | no_license | #!/bin/bash
source "./00_check_condition.include"
create_veth_pair_data() {
DATA_NS=$1
DATA_VETH_NS=$2
DATA_VETH_HOST=$3
DATA_VETH_IP_NS=$4
DATA_VETH_BR=$5
if [ ! -z $DATA_VETH_NS ]; then
echo "*** create DATA veth pair"
create_veth_pair_link_host $DATA_NS \
$DATA_VETH_NS $DATA_VETH_HOST \
... |
JavaScript | UTF-8 | 998 | 3.375 | 3 | [] | no_license | 'use strict';
function showCirclePromise(radius) {
return new Promise(resolve => {
let circle = document.createElement('div');
Object.assign(circle.style, configureStyles(radius));
circle.id = 'circle2';
let prevCircle = document.getElementById("circle2");
let container = d... |
Python | UTF-8 | 4,005 | 2.671875 | 3 | [
"MIT"
] | permissive | from bs4 import BeautifulSoup
import re
import csv
import time
import requests
DEFAULT_MENU_PATH = "./get_industy_name/classify/menu.csv"
class SearchClassify(object):
def __init__(self, csv_file):
self.companyinfo = {}
self.count = 0
self.company_name = ""
self.company_name_full... |
Ruby | UTF-8 | 87 | 2.90625 | 3 | [] | no_license | fibonacci = 8.times.inject([0,1]) do |a, idx|
a << a[-2] + a[-1]
end
puts fibonacci |
Markdown | UTF-8 | 13,220 | 3.09375 | 3 | [] | no_license | ---
order: 1
title: Start Here
---
# Alpine.js を始めましょう!
まずは、`i-love-alpine.html`という名前で、空のHTMLファイルを作成します。
テキストエディタを使用して、ファイルに以下の内容を入力します。
```alpine
<html>
<head>
<script defer src="https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js"></script>
</head>
<body>
<h1 x-data="{ message: 'I ❤️ Alpine' }" x-text="messa... |
Java | UTF-8 | 163 | 2.171875 | 2 | [] | no_license | #include <stdio.h>
#include <string.h>
int main()
{
char a[100];
int length;
gets(a);
length = strlen(a);
printf("%d",length);
return 0;
} |
Java | UTF-8 | 3,335 | 2.609375 | 3 | [] | no_license | package presentation;
import business.ValidateTextbox;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.layout.GridDat... |
JavaScript | UTF-8 | 887 | 4.09375 | 4 | [] | no_license | //cria um array de objetos de faixa de precos para ele possa ser usado em um site o mercado livre
//faixa, tooltip, min.max
//1 opção por objetos
let faixas = [
{tooltip: '1000 a 2000', min: 1000, max: 2000 },
{tooltip: '2000 a 3000', min: 2000, max: 3000 },
{tooltip: '4000 a 5000', min: 4000, max: 5000 }... |
C# | UTF-8 | 4,858 | 2.703125 | 3 | [] | no_license | using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
namespace Kwaazaar.Config
{
public static class ConfigExtensions
{
private static bool _enabled = false;
private static ... |
Python | UTF-8 | 6,741 | 3.875 | 4 | [] | no_license | #! /usr/bin/env python
# -*- coding:Utf8 -*-
"""LEARN DECORATOR WITH SAM AND MAX"""
"""SAM AND MAX"""
########################################
#### Classes and Methods imported : ####
########################################
from functools import wraps
#####################
#### Constants : ####
##################... |
Java | UTF-8 | 280 | 1.90625 | 2 | [] | no_license | package com.ymd.nioserver.server;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.List;
public interface IMessageReader {
public void read(Socket socket, ByteBuffer byteBuffer) throws IOException;
public List<Message> getMessages();
}
|
Go | UTF-8 | 845 | 2.9375 | 3 | [] | no_license | package server
import (
"context"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/gorilla/mux"
)
func Run() {
router := mux.NewRouter()
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("Hello, GraphQL!"))
}).Methods(http.M... |
C | UTF-8 | 2,124 | 3.171875 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
void creatArrOfShift(int *arrOfShift, char *temp, int tempLen){
for (int i = 0; i < 256; i++)
arrOfShift[i] = tempLen;
for (int i = 0; i < tempLen - 1; ++i){
arrOfShift[(int)temp[i]] = tempLen - 1 - i;
}
}
int main(){
FILE* inputFile = fopen("in.txt... |
Python | UTF-8 | 544 | 3.4375 | 3 | [] | no_license | with open('sachintendulkar.txt') as f: #Reading the file
data=f.read()
f.closed
print(data)
datalist = data.split() #Splitting the words in the file into lists
datafreq = []
for w in datalist: #looping through the words in the file
datafreq.append(datalist.count(w))
print("\nParagr... |
Java | UTF-8 | 5,242 | 2.625 | 3 | [] | no_license | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import jakarta.servlet.ServletException;
import jakarta.servlet.htt... |
C++ | UTF-8 | 585 | 3.171875 | 3 | [] | no_license | //
// FindSignAndMagnitude.cpp
// CppPractice
//
// Created by Justin Owen on 10/26/18.
// Copyright © 2018 Justin Owen. All rights reserved.
//
#include "FindSignAndMagnitude.hpp"
#include <iostream>
#include <cmath>
#include <utility>
#include <iomanip>
std::pair<int, double> FindSignAndMagnitude(const double &V... |
Python | UTF-8 | 631 | 2.953125 | 3 | [] | no_license | import tensorflow as tf
# Just disables the warning, doesn't enable AVX/FMA
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
matrix1 = tf.constant([[3, 3]])
matrix2 = tf.constant([[2],
[2]])
product = tf.matmul(matrix1, matrix2) # matrix multiply np.dot(m1, m2)
# method 1
sess = t... |
Java | ISO-8859-1 | 13,218 | 2.46875 | 2 | [] | no_license | package fr.picresenar.esquisse3D.etapes;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import fr.picresenar.esquisse3D.MainEsquisse;
import fr.picresena... |
C++ | UTF-8 | 1,654 | 2.796875 | 3 | [] | no_license | #include <stdint.h>
const uint8_t pins[8] = {
11, 12, 13, 14, 15, 16, 17, 18,
};
const uint8_t CS = 1;
const uint8_t SK = 2;
const uint8_t DI = 3;
const uint8_t DO = 4;
const uint8_t GND = 5;
const uint8_t TEST = 6;
const uint8_t NC = 7;
const uint8_t VCC = 8;
void setPin(uint8_t pin, uint8_t value) {
digitalWri... |
Python | UTF-8 | 6,137 | 3.734375 | 4 | [] | no_license | #! /usr/bin/python
# - coding: utf-8 -*-
"""现有i张10元纸币, j 张5元纸币, k张两元纸币, 购物后要支付n元(n为整数),
要求编写一个时间复杂度为O(1)的函数FindSolution(i, j, k, n), 功能是算出是否能用现在手上拥有的纸币拼凑成n元, 而不需要找零.
如:共有5张10元纸币,5张5元纸币,5张2元纸币,许凑齐27元,需2张10元纸币,1张5元纸币,1张2元纸币
共有5张10元纸币,5张5元纸币,5张2元纸币,需凑齐100元,无法凑齐
"""
def find_solution(i: int, j: int, k: int, n: int):... |
Rust | UTF-8 | 14,942 | 2.609375 | 3 | [] | no_license | use std::ops::Range;
use iced_graphics::{Backend, Defaults, Primitive, Renderer};
use iced_native::{
layout, mouse, scrollable, text, Align, Background, Color, Element, Hasher,
HorizontalAlignment, Layout, Length, Point, Rectangle, Row, Size, Widget, Container, Column, Scrollable
};
use super::{cell::Cell, Su... |
Markdown | UTF-8 | 1,899 | 2.65625 | 3 | [
"MIT"
] | permissive | # Scanner Soundboard
Reads codes via RFID or 1D/2D barcode USB scanners and plays soundfiles
mapped to them.
The input device is grabbed exlusively so that scanned codes will be
passed to the program regardless of what program/window currently has
focus.
I originally developed this to play insider jokes as custom so... |
Markdown | UTF-8 | 2,529 | 3.359375 | 3 | [] | no_license | # In Short
## Developing Flow
(short version)
1. `git pull/checkout` (clean checkout, no node_modules)
2. `npm install`
3. Make changes
4. Build - run `npm run ES6-to-ES5` (_lib_ folder will be updated)
5. Test (with Centralized-App - see the _Developing Flow_ _In Detail_ below)
6. Commit and push your chan... |
JavaScript | UTF-8 | 773 | 2.671875 | 3 | [] | no_license | app.factory('validations', function () {
return {
isEmpty: function (value) {
if (value === "" || value === null || value === undefined) {
return true;
} else {
return false;
};
},
isNumeric: function (value) {
... |
Java | UTF-8 | 491 | 1.71875 | 2 | [] | no_license | package com.xd.smartconstruction.pojo.vo.response;
import com.xd.smartconstruction.pojo.vo.BaseVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author mm
* @Date 2021-02-01 11:18
*/
@ApiModel("分页返回模型")
@Data
public class ... |
Java | UTF-8 | 856 | 2.53125 | 3 | [] | no_license | package com.example.hello.model;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.UUID;
@Entity
@Table(name = "greetings")
public class Greeting {
@Id
@Gen... |
Python | UTF-8 | 1,110 | 2.875 | 3 | [] | no_license | import cv2
import numpy
capLeft = cv2.VideoCapture(1) #sets cap1 as the first camera (0 is the default laptop camera which isn't being used)
capRight = cv2.VideoCapture(0) #sets cap2 as the second camera
while(True):
# creates the frames for each camera
ret, frameLeft = capLeft.read()
ret, frameRight = ca... |
JavaScript | UTF-8 | 5,916 | 2.6875 | 3 | [] | no_license | 'use strict'
function Workspace(w, h, gridX, gridY, grid) {
var ws = this;
this.id = uniqueId();
this.width = w || 10000;
this.height = h || 10000;
this.backgroundColor = "#000000";
this.gridSizeX = gridX || 32;
this.gridSizeY = gridY || 32;
this.grid = grid;
this.gridify();
this.cotr = "... |
Swift | UTF-8 | 5,713 | 2.59375 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright © 2020 Itty Bitty Apps. All rights reserved.
import Foundation
struct ColourSection {
var title: String?
var rows: [ColourItem]
}
extension RevertItems {
static var coloursData: [ColourSection] {
if #available(iOS 13.0, *) {
let labelSection = ColourSection(title: "LABEL", rows: [
... |
Java | UTF-8 | 5,228 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | /*
* 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 in writing, software
* distribut... |
Markdown | UTF-8 | 372 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | # DateToWords
Write a program that accepts as input from the user the date in dd-mm-yyyy format. The output should be the date in words. Sample input: Input date: 04-04-1982 Output: Fourth of April, Nineteen Eighty Two
#To Run
```
javac DateToWords.java
java DateToWords
Please enter date in dd-mm-yyyy format
04-12... |
Python | UTF-8 | 1,045 | 3.234375 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
import bs4
def gethtml(url):
try:
r=requests.get(url, timeout = 30)
r.raise_for_status
r.encoding = r.apparent_encoding
return r.text
except:
print('哈哈错了吧')
def transf(ulist,html):
soup = BeautifulSoup(html,"html.parser"... |
Python | UTF-8 | 668 | 3.765625 | 4 | [] | no_license | def tambah(a, b, c=0, d=0 ):
if a == 0:
print("hasil b")
return b + c + d
elif b == 0:
print("hasil a")
return a + c + d
return a + b + c + d
def cetak(p):
if p == 1:
print("angka 1")
return
tulisan = str(p) # casting
print("Hasilnya adalah " + t... |
Java | UTF-8 | 6,120 | 1.875 | 2 | [] | no_license | package com.example.ressenger;
import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import a... |
Shell | UTF-8 | 664 | 3.640625 | 4 | [] | no_license | #/bin/bash
[ -f $HOME/.vault ] && mv $HOME/.vault $HOME/.vault.bckp
[ -f $HOME/.token-helper.sh ] && rm $HOME/.token-helper.sh
printf "Creating token helper..\n"
tee -a ~/.token-helper.sh << END
#/bin/bash
case "\$1" in
"get")
[ -f $HOME/.vault-token ] && cat $HOME/.vault-token
exit 0
;;
"erase")
... |
JavaScript | UTF-8 | 934 | 2.984375 | 3 | [] | no_license |
function handleLoginResult(resultDataString) {
resultDataJson = JSON.parse(resultDataString);
console.log("handle login response");
console.log(resultDataJson);
console.log(resultDataJson["status"]);
if (resultDataJson["status"] === "success") {
console.log("u made it");
... |
Java | ISO-8859-7 | 516 | 2.625 | 3 | [] | no_license | package com.saray.sinotk.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class DateTimeUtil {
public static Date GetDate(String testtime)
{
Date date = null;
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"... |
Python | UTF-8 | 231 | 3.34375 | 3 | [] | no_license | n = int(input())
num = list(map(int,input().split()))
temp = []
for i in range(n):
if num[i] == i:
temp.append(num[i])
if len(temp) == 0:
print(-1)
else:
for i in sorted(temp):
print(i,end=' ')
|
Python | UTF-8 | 1,563 | 2.859375 | 3 | [] | no_license | import unittest
from Lesson17 import ex6_1
from Lesson17 import ex7_2
from Lesson17 import ex11_2
from Lesson17 import ex16_2
class AllTests(unittest.TestCase):
def test_dict(self):
self.assertEqual(ex6_1.for_dict(('Bitcoin', 'Ether', 'Ripple', 'Litecoin'), ('BTC', 'ETH', 'XRP', 'LTC')),
... |
Java | UTF-8 | 59,404 | 2.015625 | 2 | [] | no_license | package distanceProj;
import location.Location;
import kml.PathToKML;
import email.GoogleMail;
import shortestPath.ShortestDistance;
import helpFiles.HelpWindow;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.a... |
Java | UTF-8 | 563 | 2.109375 | 2 | [] | no_license | package com.pliniosalazar.todo.repositories;
import com.pliniosalazar.todo.domain.Todo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface TodoRepository extends JpaRepository<Todo, Integer> {
@Query("SELECT... |
Java | UTF-8 | 916 | 2.265625 | 2 | [] | no_license | package ibtikar.Fakhr;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class LoginPage extends PageBase{
public LoginPage(WebDriver driver) {
super(driver);
}
//home login button
@FindBy(xpath = "//a[@href='/ar/login']")
WebEleme... |
PHP | UTF-8 | 499 | 2.53125 | 3 | [] | no_license | <?php
require_once "config.php";
//$user = new User();
//
//$user->loadById(1);
//
//echo $user
//
//;
//
//$userList = User::getList();
//echo json_encode($userList);
//$expecificUsename = User::searchUser("Andre");
//echo json_encode($expecificUsename);
//$user = new User();
//
//
//$user->login("Andre","12345678... |
Java | UTF-8 | 784 | 2.15625 | 2 | [] | no_license | package edu.nju.hostelworld.dao;
import edu.nju.hostelworld.model.Hostel;
import edu.nju.hostelworld.util.City;
import edu.nju.hostelworld.util.HostelState;
import edu.nju.hostelworld.util.ResultMessage;
import java.util.List;
/**
* Created by Sorumi on 17/2/5.
*/
public interface HostelDao {
public ResultMes... |
JavaScript | UTF-8 | 3,890 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | /*
Import the internal libraries:
- CountryController
*/
import {
CountryController,
} from '../controller';
// Create instance of CountryController otherwise you can't use it
const countryController = new CountryController();
const initializeEndpoints = (parentRouter, authService) => {
/**
* @swagger
... |
C++ | UTF-8 | 998 | 2.53125 | 3 | [] | no_license | #ifndef BULLET_H_
#define BULLET_H_
#include <Entity.h>
#include <Weapon.h>
#include <QVector2D>
#include <CommonGlobal.h>
//Наследуется от MovingEntity (координаты точки + направление) и от QGraphicsRectItem (прямоугольник)
class KW_COMMON_EXPORT Bullet: public MovingEntity, public QGraphicsRectItem
{
public:
B... |
Java | UTF-8 | 2,531 | 2.109375 | 2 | [] | no_license | package dsc.echo2app;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import nextapp.echo2.app.ApplicationInstance;
import nextapp.echo2.webcontainer.WebContainerServlet;
import nextapp.echo2.webrender.Ser... |
JavaScript | UTF-8 | 2,893 | 2.609375 | 3 | [] | no_license | //небольшие ф-ции которые встраиваются и работают с тем что мы dispatchнули до того как вызовется оригинальный редуксовый dispatch
//Задача middleware привести в понятный для redux формат данные которые мы dispatchнули до самого rewdux
import * as types from '../actions/types';
import {selectStore,insertStore,deleteSto... |
Python | UTF-8 | 2,272 | 2.734375 | 3 | [] | no_license | from web3 import Web3, HTTPProvider
import json
import requests
def getWeb3():
'''
Return web3 object
'''
return Web3(HTTPProvider('https://mainnet.infura.io/'))
def loadContracts():
'''
Loads contracts from MEW git, falls back to local instance if fails
'''
ETH_TOKEN_URI = '''
... |
Markdown | UTF-8 | 3,112 | 2.703125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
description: "Learn more about: Threading objects and features"
title: "Threading objects and features"
ms.date: "10/01/2018"
helpviewer_keywords:
- "threading [.NET], features"
- "managed threading"
ms.assetid: 239b2e8d-581b-4ca3-992b-0e8525b9321c
---
# Threading objects and features
Along with the <xref:Sys... |
Java | UTF-8 | 1,463 | 3.375 | 3 | [] | no_license | package OopPrinciples;
public class Student {
private String StudentsFirstName;
private String StudentsLastName;
private int StudentsAge;
private String StudentsDateOfBirth;
private String StudentsFaculty;
private String StudentsPassingYear;
public Student(String StudentsFirstName, Stri... |
Ruby | UTF-8 | 483 | 2.6875 | 3 | [] | no_license | module CheckinHelper
def success_names(names)
if names.empty?
''
elsif names.length == 1
"#{names.first} was successfully checked in. "
else
"#{names.collect {|n| n}.to_sentence} were successfully checked in."
end
end
def fail_names(names)
if names.empty?
''
e... |
Python | UTF-8 | 2,256 | 3.15625 | 3 | [
"MIT"
] | permissive | """Houses the Pegasus parser class
Unicode characters not being read correctly?
Check out http://stackoverflow.com/a/844443/510036
"""
from __future__ import unicode_literals
import inspect
from itertools import chain as iterchain
from pegasus.rules import _build_rule, ParseError, Lazy
class EmptyRuleException(Exce... |
Python | UTF-8 | 725 | 3.328125 | 3 | [] | no_license | import sys
def find_row(arr, x):
for i, row in enumerate(arr):
if x in row:
return i
return -1
T = int(sys.stdin.readline())
for i in range(T):
r1 = int(sys.stdin.readline()) - 1
arr1 = [map(int, sys.stdin.readline().split()) for j in range(4)]
r2 = int(sys.stdin.readline()) - ... |
JavaScript | UTF-8 | 3,778 | 2.75 | 3 | [] | no_license | const browserUtils = require('../../src/browserUtils')
document.body.innerHTML = `
<div class="app">
<nav class="app__nav">
<a href="" class="app__link"></a>
<a href="" class="app__link"></a>
</nav>
<main class="app__cont">
<a href="" class="app__link"></a>
<a href="" class="app__link"></a>
</ma... |
C | UTF-8 | 2,959 | 2.78125 | 3 | [] | no_license | //
// main.c
// gps
//
// Created by 20161104586 on 17/6/26.
// Copyright © 2017年 马德辉. All rights reserved.
//
#include <stdio.h>
#include <string.h>
int main()
{
char num1[63];
char num2[70];
char date[7];
char time[7];
char eastlongitude[10];
char northlat[9];
char high[5];
i... |
Java | UTF-8 | 495 | 1.734375 | 2 | [] | no_license | package com.yolo.dao.chat;
import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;
import com.yolo.dao.chat.inf.BookIncomeDaoInf;
@Repository
public class BookIncomeDao implem... |
PHP | UTF-8 | 4,049 | 2.859375 | 3 | [] | no_license | <?php
use model\StructureProfile\infrastructure\GeoJsonStatementBuilder;
use model\StructureProfile\application\Profile;
use model\StructureProfile\application\DTO\GeoJsonSelection;
use model\StructureProfile\application\DTO\SelectionType;
use model\StructureProfile\application\exception\InvalidSelectionTypeException... |
Shell | UTF-8 | 816 | 4.03125 | 4 | [
"BSD-3-Clause"
] | permissive | #!/bin/bash
if [ -z "$1" ]; then
echo "Error! You have to provide a known architecture name"
return 1
else
TARGET_NAME=$1
echo "TARGET_ARCHITECTURE set to '$TARGET_NAME'"
fi
export TARGET_ARCHITECTURE=$TARGET_NAME
#Check target architecture toolchain script
THIS_DIR="$( cd "$( dirname "${BASH_SOURCE... |
Python | UTF-8 | 1,450 | 3.1875 | 3 | [] | no_license | import logging
import random
from minichess.games.abstract.board import AbstractBoardStatus
from minichess.games.abstract.piece import PieceColor
class Simulator:
def __init__(self, env_class, board, active_color, simulation_iterations=75):
self.env = env_class()
self.env.board = board
sel... |
Go | UTF-8 | 970 | 2.75 | 3 | [] | no_license | package kit
import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewTrees(t *testing.T) {
//tc := []int{1, 2, 3,4,5,6,7, 8, Null,9,9,Null,Null,10}
//tc := []int{1,Null,2,Null,3}
tc := []int{1, 2, 3,4,5, Null,6}
nodes := NewTrees(tc)
//fmt.Println(nodes.InOrder(), nodes.depth)
fmt.Prin... |
Python | UTF-8 | 3,156 | 3.453125 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright © 1999, 2000, 2001, 2002 Progiciels Bourbeau-Pinard inc.
# François Pinard <pinard@iro.umontreal.ca>, 1999.
"""\
A graph is made from a set of vertices, and a set of oriented arcs.
Each vertex should be immutable and not None. An arc is a tuple. The first
an... |
PHP | UTF-8 | 6,260 | 3.09375 | 3 | [] | no_license | <?php
/**
* Miscellaneous utility functions used by Sugar.
*
* Provides several utility functions used by the Sugar codebase.
*
* PHP version 5
*
* LICENSE:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"),... |
C++ | UTF-8 | 1,190 | 3.203125 | 3 | [] | no_license | /*le2*/
#ifndef NAME_H
#define NAME_H
class Name {
public:
Name(const std::string& fname) : fname_{fname} {}
Name(const Name& other) : fname_{other.fname_} {} //kop.konst
Name(Name&& ) { swap(other); } //move.konst
Name& operator=(const Name& rhs) & {
Name{rhs}.swap(*this);
return *this;
}
Name&... |
Ruby | UTF-8 | 661 | 3.015625 | 3 | [
"MIT"
] | permissive | class Hero
attr_accessor :name
attr_writer :biography, :appearance, :connections
@@all = []
def initialize(name, biography, appearance, connections)
self.name = name
self.biography = biography
self.appearance = appearance
self.connections = connections
self.cla... |
C++ | UTF-8 | 1,173 | 2.625 | 3 | [
"BSD-2-Clause",
"Apache-2.0"
] | permissive | /*
Part of BridgeData.
Copyright (C) 2016-17 by Soren Hein.
See LICENSE and README.
*/
#ifndef BRIDGE_GROUP_H
#define BRIDGE_GROUP_H
#include <string>
#include <list>
#include "Segment.h"
using namespace std;
class Group
{
private:
string nameVal;
Format formatVal;
list<Segment> segmen... |
C++ | UTF-8 | 393 | 2.65625 | 3 | [] | no_license | #include <cstdio>
#define ll long long
using namespace std;
inline void fastRead(ll *a)
{
register char c=0;
while (c<33)
c=getchar_unlocked();
*a=0;
while (c>33)
{
*a=*a*10+c-'0';
c=getchar_unlocked();
}
}
int main()
{
ll n, k;
fastRead(&n);
fastRead(&k);
ll count = 0;
while(n--){
ll a;
fastRead... |
Markdown | UTF-8 | 1,531 | 3.65625 | 4 | [] | no_license | # 1.6 存储设备形成层次结构
在处理器和一个较大较慢的设备(例如主存)之间插**入**一个更小更快的存储设备(例如高速缓存)的想法已经成为一个普遍的观念。实际上,每个计算机系统中的存储设备都被组织成了一个**存储器层次结构**,如图 1-9 所示。在这个层次结构中,从上至下,设备的访问速度越来越慢、容量越来越大,并且每字节的造价也越来越便宜。寄存器文件在层次结构中位于最顶部,也就是第 0 级或记为 L0。这里我们展示的是三层高速缓存 L1 到 L3,占据存储器层次结构的第 1 层到第 3 层。主存在第 4 层,以此类推。
![图 1-9 一个存储V... |
Markdown | UTF-8 | 702 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | # Configuring Widgets
The blog module comes bundled with some useful widgets. To take advantage of them, you'll need to install the
[SilverStripe widgets module](https://github.com/silverstripe/silverstripe-widgets). Widgets are totally optional -
so your blog will work just fine without having widgets installed.
Y... |
Markdown | UTF-8 | 7,748 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | [#]: subject: "How I configure Vim as my default editor on Linux"
[#]: via: "https://opensource.com/article/22/2/configure-vim-default-editor"
[#]: author: "David Both https://opensource.com/users/dboth"
[#]: collector: "lujun9972"
[#]: translator: "lkxed"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://l... |
C++ | UTF-8 | 7,426 | 2.609375 | 3 | [] | no_license | //
// Created by shenc on 2017/11/7.
//
#include "Window.h"
#include "VulkanSupport.h"
#include "PhysicalDevice.h"
#include "Device.h"
Window::Window(Device* device,const char *title, int x, int y, int w, int h, bool isFullScreen) :
m_strWindowTitle(title),
m_iWindowWidth(w),
m_iWindowHeight(... |
Java | UTF-8 | 4,983 | 2.609375 | 3 | [] | no_license | package com.westosia.TradingPlugin.trading;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.CommandPermission;
import co.aikar.commands.annotation.Default;
import co.aikar.commands.annotation.Description;
import com.westosia.TradingPlugin.list... |
Python | UTF-8 | 1,046 | 3.015625 | 3 | [
"MIT"
] | permissive | from modules import connection
from modules import formatter
def get_errors_per_day():
conn = connection.get_connection()
conn.execute('''
WITH t AS
(SELECT DATE(log.time) AS failureDate,
ROUND((SUM(CASE WHEN
SUBSTRING(log.status, 0, 4)::INTEGER >= 400
THEN 1
... |
Java | UTF-8 | 637 | 2.671875 | 3 | [] | no_license | package com.abin.lee.distribute.algorithm.classic.manage;
import com.abin.lee.distribute.algorithm.classic.Acceptor;
public class AcceptorDaemon extends Thread{
private Acceptor acceptor;
public AcceptorDaemon(Acceptor acceptor){
this.acceptor = acceptor;
}
@Override
public void... |
Java | UTF-8 | 4,663 | 2.640625 | 3 | [] | no_license | package net.equj65.indexgenerator.generator;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
imp... |
Java | UTF-8 | 634 | 2.015625 | 2 | [] | no_license | package com.javadeveloperzone.service;
import com.javadeveloperzone.modal.OrderDetails;
import com.javadeveloperzone.repository.OrderDetailsRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class OrderServi... |
Python | UTF-8 | 1,901 | 4.03125 | 4 | [] | no_license |
# I wrote this code to help me with math homework
# because my calculator gave decimals when I needed
# simplified square roots. It is a combination/modification
# of two other programs I had previously written as experiments:
# a quadratic formula calculator and a prime number checker.
while T... |
C++ | UTF-8 | 24,008 | 3.25 | 3 | [] | no_license | /* -*- mode: c++; -*- */
/** @file map_store.h
*
* Implementation of the MapStore class.
*
* This file implements the MapStore class, which is used to store
* growable grid-based maps. Map data is stored in double values.
*/
#ifndef MAP_STORE_H
#define MAP_STORE_H
#include <list>
#include "map_store_error.... |
JavaScript | UTF-8 | 1,704 | 2.671875 | 3 | [
"MIT"
] | permissive | const DAO = require("../../lib/dao");
const mySQLWrapper = require("../../lib/mysqlWrapper");
class User extends DAO {
/**
* Overrides TABLE_NAME with this class' backing table at MySQL
*/
static get TABLE_NAME() {
return "users";
}
/**
* Returns a user by its ID
*/
static async getByID(_, {... |
Java | UTF-8 | 1,409 | 2.9375 | 3 | [] | no_license | package forRank;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
import java.util.StringTokenizer;
public class Q5533 {
private static final int ROUND = 3;
public stat... |
Markdown | UTF-8 | 3,635 | 4.09375 | 4 | [] | no_license | ## 正则-模式-学习笔记
### 正则模式
+ 贪婪匹配
+ 非贪婪匹配
+ 独占模式
贪婪模式,简单说就是尽可能进行最长匹配。非贪婪模式呢,则会尽可能进行最短匹配。
### 贪婪模式
在正则中,表示次数的量词默认是贪婪的,在贪婪模式下,会尝试尽可能最大长度去匹配。
使用`+`的正则匹配
```python
# 使用+号的正则贪婪(默认),只匹配到一个匹配项
>>> import re
>>> re.findall(r'a+', 'aaabb')
['aaa']
# 下面是*好的正则贪婪(默认),匹配到4个(包含三个空串),如下图
>>> import re
>>> re.findall(r'a*', 'aaab... |
Java | UTF-8 | 3,964 | 2.34375 | 2 | [] | no_license | package com.julibo.demo.sb2x.controller;
import com.github.pagehelper.PageInfo;
import com.julibo.demo.sb2x.exception.CustomException;
import com.julibo.demo.sb2x.model.StudentModel;
import com.julibo.demo.sb2x.service.StudentService;
import com.julibo.demo.sb2x.vo.StudentVo;
import io.swagger.annotations.Api;
import ... |
Python | UTF-8 | 1,582 | 4.25 | 4 | [] | no_license | """
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
Approach
______________
Two Pointers
+++++++++++++++
Start from the end
while index1 >=0 or index2 >=0 or carry:
maintain
new_node = cur1 + cur2 + carry %2
carry = carry + cur1 + cur2... |
TypeScript | UTF-8 | 1,612 | 2.671875 | 3 | [
"MIT"
] | permissive | const { When, Then } = require('cucumber');
const { expect } = require('chai');
import { ViewerPage } from './../pages/viewer.po';
const page = new ViewerPage();
When(
'the user swipe {string} and the velocity is between {string}',
async (direction: string, velocity: string) => {
if (direction === 'left-to-r... |
Java | UTF-8 | 336 | 1.867188 | 2 | [] | no_license | package com.mallproject.generator.dao;
import com.mallproject.generator.domain.TbBrand;
import java.util.List;
public interface TbBrandMapper {
int deleteByPrimaryKey(Long id);
int insert(TbBrand record);
TbBrand selectByPrimaryKey(Long id);
List<TbBrand> selectAll();
int updateByPrimaryKey(Tb... |
PHP | UTF-8 | 4,923 | 2.6875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: sOxOs
* Date: 2014/12/19
* Time: 15:24
* Packed from alipay_core
*/
namespace Common\Lib\Alipay;
class AlipayCore
{
/**
* Convert parameter array into URL parameter
* @param $params array Array with key and value
* @return string Key-Value Pair in URL ... |
C# | UTF-8 | 1,122 | 2.5625 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace MS.Internal.Text.TextInterface
{
// Compatibility warning:
/***********************... |
Java | UTF-8 | 3,316 | 2.265625 | 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 project.lavanderia.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;... |
Java | UTF-8 | 1,498 | 2.4375 | 2 | [] | no_license | package com.bdcom.bean.ncimport;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
/**
* @author Jianan
* @Date
*/
public class NCImpHeader {
Long id;
String ncOrg = "01"; //库存组织
String impDate;
String kb; //库别
String type = "40-01";
public Long getId() {
retu... |
C++ | UHC | 544 | 2.875 | 3 | [] | no_license |
#include "PlayerUnit.h"
#include "Bullet.h"
PlayerUnit player;
extern Bullet bulletArr[BULLET_COUNT];
void SetPlayerPos(UINT x, UINT y)
{
player.posX = x;
player.posY = y;
}
void PlayerShoot()
{
// Ⱦ̴ Ѿ ã
bool bfoundBullet = false;
for (size_t i = 0; i < BULLET_COUNT; i++)
{
if (bulletArr[i].isAlive == fa... |
Markdown | UTF-8 | 72 | 2.59375 | 3 | [] | no_license | # angular-custom-webpack
Example project for configuring custom webpack
|
Java | UTF-8 | 4,279 | 2.671875 | 3 | [] | no_license | package com.Diamond.Finder.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import com.Diamond.Finder.GameMap.TilesMap;
import com.Diamond.Finder.States.Content;
public class MistStudent extends Entity {
private BufferedImage[] downSprites;
private BufferedImage[] leftSprites;
private B... |
PHP | UTF-8 | 1,306 | 2.5625 | 3 | [] | no_license | <?php
//Insert Header
require('header.php');
?>
<div class="row">
<div class="two columns">
<a class="button" href="add-recipe.php">Add Recipe</a>
</div>
</div>
<table class="u-full-width recipeList">
<thead>
<tr>
<th>Recipe</th>
<th>Prep Time<... |
Java | UTF-8 | 703 | 1.703125 | 2 | [
"Apache-2.0"
] | permissive | package wang.ismy.blb.aggregation;
import com.spring4all.swagger.EnableSwagger2Doc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign... |
Markdown | UTF-8 | 423 | 2.8125 | 3 | [] | no_license | >现在每个我遇见的笑着的人,他们都不曾因为苦而放弃,他们只因扛而成长。
>
>谁不希望自己活得轻松,没有压力,一切随性,但如果你真的那样去做的话,你会发现这个世界都在和你作对。
>
>如果有一天你真的觉得自己轻松了,那也不是因为生活越来越容易了,而是因为我们越来越坚强。
>
——《谁的青春不迷茫》 |
Markdown | UTF-8 | 1,361 | 2.890625 | 3 | [
"WTFPL"
] | permissive | # One Saying Generator
A small Python program generating text as images
## What is One Saying Generator?
This is a simple python 3 program helping you generate text as images. By doing that,
you are allowed to publish beautiful texts in your wechat website.
After running it, input the texts you want to generate like... |
C++ | UTF-8 | 1,342 | 2.59375 | 3 | [] | no_license | //
// CVHistogram.hpp
// OpenCV
//
// Created by aa on 16/10/12.
// Copyright © 2016年 yunlian. All rights reserved.
//
//
// 直方图
//
//
//
//
#ifndef CVHistogram_hpp
#define CVHistogram_hpp
#include <stdio.h>
#define k8BitMax 256
using namespace cv;
/*
* 处理灰度图的直方图
*/
class Histogram1D {
private:
//像素颜色个... |
C++ | UTF-8 | 609 | 2.890625 | 3 | [] | no_license | #ifndef HW_02_STDIOBOARDVIEW_H
#define HW_02_STDIOBOARDVIEW_H
#include "Board.h"
class StdioBoardView {
public:
StdioBoardView(Board &board) : board(board) {};
~StdioBoardView() = default;
/** Основной цикл игры, от начала до конца. */
void runGame();
// Можно добавлять методы при н... |
Java | UTF-8 | 868 | 3.28125 | 3 | [] | no_license | /**
* This class holds the Full-time employee informations and calculates salary
* @author Ahmet ORUC
*
*/
public class FullTime extends Employee {
private double severancePay;
private double overWorkSalary;
private int weekNormalHour=40;
private int dayofWork = 20;
/**
* @param str informations of the ... |
Markdown | UTF-8 | 1,378 | 2.609375 | 3 | [] | no_license | # Article D422-53-9
A la fin de chaque exercice, l'agent comptable en fonctions prépare le compte financier de l'établissement pour l'exercice
écoulé.
Le compte financier comprend :
1° La balance définitive des comptes ;
2° Le développement des dépenses et des recettes budgétaires ;
3° Le tableau récapitulatif de ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.