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 | 1,632 | 3.78125 | 4 | [] | no_license | using System;
namespace Лаба_4_2._2_
{
class Program
{
static void Main(string[] args)
{
Bird b = new Bird();
b.DisplayInfo();
b.HightFly();
Owl o = new Owl();
o.DisplayInfo();
Dog d = new Dog();
d.DisplayInf... |
Python | UTF-8 | 1,820 | 3.484375 | 3 | [] | no_license | import unittest
from calc import Calc
class calcClassTest(unittest.TestCase):
##test Add function
def test_addFunc(self):
add = Calc()
self.assertEqual(add.add(10,5), 15)
self.assertEqual(add.add(20,10), 30)
##test Subtract function
def test_subtractFunc(self):
add = C... |
C | UTF-8 | 1,127 | 4 | 4 | [] | no_license | #include "binary_trees.h"
/**
* binary_tree_size - function that size of a tree
* @tree: pointer to a tree
* Return: size of the tree
*/
size_t binary_tree_size(const binary_tree_t *tree)
{
size_t count = 0;
if (!tree)
return (0);
count = binary_tree_size(tree->left) + 1 + binary_tree_size(tree->right);
retu... |
C++ | UTF-8 | 575 | 3.28125 | 3 | [
"MIT"
] | permissive | #include<iostream>
using namespace std;
int simple(int p, int r, int t){
int ans;
ans = (p*r*t)/100 + p;
return ans;
}
int main(){
int p,t,age,r;
cout<<"Enter amount of fixed deposite: ";
cin>>p;
cout<<"Enter time in year: ";
cin>>t;
cout<<"Enter Depositor's age: ";
cin>>age;
... |
C# | UTF-8 | 3,159 | 2.625 | 3 | [
"MIT"
] | permissive | /* oio * 6/23/2014 * Time: 7:10 AM
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Threading;
using NAudio.Wave;
namespace AvUtil.Core
{
/// <summary>
/// This class isn't quite working or implemented yet.
/// Once it is, will become a part of the common-sound library (gen.snd... |
C# | UTF-8 | 3,227 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using TheWayShop_2._0.Models;
namespace TheWayShop_2._0.DB
{
public class AppDbInitializer
{
public static void Initial(AppDbContext context)
{
if (!context.CategoryItems.Any())
... |
PHP | UTF-8 | 4,367 | 3.34375 | 3 | [] | no_license | <?php
//Declaracion de la clase BaseDatos
class BaseDatos
{
//Variables de la clase
private $host="localhost";
private $db="mathDice";
private $user="js_cmd";
private $pass="js_cmd";
private $conexion;
//CREAMOS EL CONSTRUCTOR
function __construct() {
$this->conexion = new m... |
Python | UTF-8 | 97 | 2.8125 | 3 | [] | no_license | #maxsplit
import re
st="programinglanguage"
result=re.split(r"m",st,maxsplit=1)
print(result) |
SQL | UTF-8 | 203 | 3.171875 | 3 | [] | no_license | -- name: GetWriteUpsByTags :many
SELECT write_ups.*
FROM write_ups
INNER JOIN write_up_tags
ON write_ups.id = write_up_tags.write_up_id
WHERE write_up_tags.tag_id = $1
ORDER BY write_up.created_at DESC;
|
Java | UTF-8 | 266 | 2.625 | 3 | [] | no_license | package Assignment;
import java.util.Scanner;
public class TestCalculator {
public static void main(String[] args) {
Calculator c1 = new Calculator();
c1.sum(100, 50);
c1.sub(100, 50);
c1.mul(100, 50);
c1.div(100, 50);
}
}
|
PHP | UTF-8 | 194 | 4.125 | 4 | [] | no_license | <!-- ans - 5 palindrome -->
<?php
$num = 222;
$rev = strrev($num);
if ($num == $rev) {
echo " <b>$num</b> it is a palindrome";
} else {
echo " <b>$num</b> it is not palindrome";
}
?>
|
C++ | UTF-8 | 2,014 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#define BUFFER_SIZE 40
int main(int argc, char *argv[])
{
int client_sockfd;
int len;
... |
Python | UTF-8 | 1,386 | 2.703125 | 3 | [] | no_license | import argparse
import dns.message
import dns.exception
import base64
import requests
import urllib3
# verification is lame
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def get_doh(resolver, query):
headers = {"accept": "application/dns-message", 'host': resolver}
msg = dns.message.mak... |
Markdown | UTF-8 | 1,360 | 2.984375 | 3 | [] | no_license |
- # Git Workflow
The git workflow is called Gitflow and consists of how the developer works with the different branches, the branches are spaces or environments where you can code and you can create as many as you need.
The branches defined in this workflow are:
: ')
if num_str == 'done':
break
else:
nums.append(float(num_str))
total = 0
for num in nums:
total += num
average = total... |
C# | UTF-8 | 4,564 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
namespace Shelland.ImagingLibrary.Commands.Effects
{
public class OffsetAntialiasCommand : IImageProcessing
{
private Bitmap _srcBitmap = null;
private She... |
Markdown | UTF-8 | 10,634 | 2.96875 | 3 | [
"MIT"
] | permissive | ---
title: Getting Started with Microservices using Go, gRPC and Kubernetes
author: tin-rabzelj
tags:
- Go
- Kubernetes
- Docker
- gRPC
description: This article aims to provide a simple introduction to building microservices in Go, using gRPC, and deploying them to a Kubernetes cluster. It shows how to set up ... |
Java | UTF-8 | 3,368 | 2.078125 | 2 | [] | no_license | package com.e_prescription;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.speech.RecognitionListener;
import android.speech... |
Markdown | UTF-8 | 2,143 | 3.34375 | 3 | [] | no_license | ```html
<div id="demo" class="carousel slide" data-ride="carousel">
<!-- 指示符 -->
<ul class="carousel-indicators">
<li data-target="#demo" data-slide-to="0" class="active"></li>
<li data-target="#demo" data-slide-to="1"></li>
<li data-target="#demo" data-slide-to="2"></li>
</ul>
<!-- 轮播图片 -->
<... |
JavaScript | UTF-8 | 659 | 2.609375 | 3 | [] | no_license | $(document).ready(function () {
var route;
var m = document.getElementById('mainMenu').getElementsByTagName('li');
var len = m.length;
for (var i = 0; i < len; i++) {
route = '{{ env.route }}';
if (route.toLowerCase() == '/' && m[i].children[0].innerHTML.toLow... |
PHP | UTF-8 | 627 | 2.703125 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace Navplan\System\Domain\Service;
interface IHttpService {
function getRequestMethod(): string;
function getGetArgs(): array;
function getPostArgs(): array;
function getCallbackArg(string $key = "callback");
function hasGetArg(string $key): bool;
fun... |
C# | UTF-8 | 1,759 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Data;
namespace Repository.EntityFramework
{
public class Repository<TEntity> : Repository<Context, TEntity>
where... |
Java | UTF-8 | 3,493 | 1.757813 | 2 | [
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-unknown"
] | 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"); you ... |
JavaScript | UTF-8 | 3,209 | 2.703125 | 3 | [] | no_license | 'use strict';
const chai = require('chai');
const sinon = require('sinon');
const { Generator } = require('../index.js');
const should = chai.should();
const debug = sinon.spy(console, 'debug');
describe('The Generator', () => {
const generator = new Generator();
it('should provide a default name with no extra... |
C# | UTF-8 | 3,936 | 2.953125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using NewLife.Collections;
using NewLife.Data;
namespace NewLife.Http
{
/// <summary>Http请求响应基类</summary>
public abstract class HttpBase
{
#region 属性
/// <summary>协议版本</summary>
public String Version { get; set; } = "1.1";... |
C# | UTF-8 | 2,416 | 3.625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace Week4Lab
{
class Program
{
static void Print<T>(string label, IEnumerable<T> results)
{
Console.WriteLine(label);
foreach (var result in results)
Console.WriteLine("... |
Java | UTF-8 | 2,516 | 3.796875 | 4 | [] | no_license | import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* John Watson performs an operation called a right circular rotation on an
* array of integers, [a0, a1, ..., a(n-1)]. After performing one right circular
* rotation operation, the array is transformed from [a0, a1, ..., a(n-1)] to
* ... |
Markdown | UTF-8 | 1,223 | 3.015625 | 3 | [] | no_license | 学习笔记
1. 有效的字母异位词 DiffPostionWord.java
2. 移动零 MoveZero.java
3. 删除排序数组中的重复项 RemoveDupByTarget.java
4. 合并两个有序链表 Merge2SortLinkedList.java
5. 两数之和 TwoNumAdd.java
6. 合并两个有序数组 Merge2Array.java
我选择了6个简单的习题来完成本次的作业。
原本的算法基础比较薄弱, 又不想以一个不好的开端开始,因此没有选择中等以上难度的。但是他们会在我的计划清单中,保证以后的课程不落下为前提完成他们。
第一周收获:
1. 在做三数之和时,学到了一种新的“判断”、... |
JavaScript | UTF-8 | 3,526 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import './App.css';
import { Container, Button, Row, Col } from 'react-bootstrap';
import Header from './components/Header';
import Variable from './components/Variable';
import Results from './components/Results';
function App() {
const [oilRefineries, setOilRefin... |
Java | UTF-8 | 8,441 | 1.96875 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"MPL-1.0",
"W3C",
"GPL-1.0-or-later",
"LicenseRef-scancode-unicode",
"LGPL-2.1-or-later",
"LGPL-2.0-or-later",
"CDDL-1.0",
"MIT",
"Apache-2.0",
"JSON",
"EPL-1.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-un... | permissive | /**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.content;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
... |
Python | UTF-8 | 12,255 | 2.703125 | 3 | [
"MIT"
] | permissive | import ujson as json
import random
from enum import Enum
from RAIchu_Enums import MoveType, AIType, PredictionType, Player
from Battle_Resources import Battle_Resources
from RAIchu_Utils import RAIchu_Utils
class Battle_State():
def __init__(self, current_state_str, move_required, prev_action):
... |
Java | UTF-8 | 584 | 1.820313 | 2 | [] | no_license | package com.qa.Assessment;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
public class LoadUpPage {
@FindBy(xpath = "//*[@id=\"j_username\"]")
private WebElement user;
@FindBy(xpath = "//*[@id=\"main-panel\"]/div/form/table/tbody/tr[2]/td[2]/input")
private WebElement pass; ... |
Java | UTF-8 | 1,366 | 2.921875 | 3 | [] | no_license | class Solution {
public String mostCommonWord(String paragraph, String[] banned) {
paragraph = paragraph.replaceAll("[^a-zA-z0-9]"," ").toLowerCase();
String[] words = paragraph.split("\\s+");
HashMap<String, Integer> map = new HashMap<String, Integer>();
String maxString="";
... |
Markdown | UTF-8 | 3,149 | 3.40625 | 3 | [
"MIT"
] | permissive | # Flyweight \(解释器模式\)
## Code
```javascript
let examCarNum = 0 // 驾考车总数
/* 驾考车对象 */
class ExamCar {
constructor(carType) {
examCarNum++
this.carId = examCarNum
this.carType = carType ? '手动档' : '自动档'
this.usingState = false // 是否正在使用
}
/* 在本车上考试 */
examine(ca... |
Python | UTF-8 | 6,533 | 2.640625 | 3 | [] | no_license | import base64
import os
import cv2
import requests
from aip import AipOcr # 百度AI的文字识别库
import matplotlib.pyplot as plt
import time
import queue
import numpy as np
os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'
path1 = './video/material/%s.jpg' # 视频转为图片存放的路径(帧)
path2 = './video/img/%s.jpg' # 图片经过边缘提取后存放的路径
path3 = './v... |
Python | UTF-8 | 1,759 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | from typing import Any, Dict, List, Tuple
import pytest
from construct import Byte, Struct, Construct, Padded
from constructutils import InlineError, InliningStruct, Inline, InlineStruct
data: List[Tuple[Construct, Dict[str, Any], bytes]] = [
(
InliningStruct(
'a' / Byte
),
{'... |
Shell | UTF-8 | 1,052 | 3.96875 | 4 | [] | no_license | #!/bin/sh
#
# ocland This shell script takes care of starting and stopping
# ocland server
#
# Author: Cercos-Pita J.L. <jlcercos@gmail.com>
#
# description: ocland server is a service that wait for clients \
# connections in order to perform OpenCL massive computations \
# remotely.
# Involved variable... |
Python | UTF-8 | 206 | 2.796875 | 3 | [] | no_license | import sys
data = open(sys.argv[1]).read().split('\n')
for i in range(len(data)):
data[i] = data[i].replace(r'\\', '').replace(r'\"', '')
with open(sys.argv[1], 'w') as f:
f.write('\n'.join(data))
|
C# | UTF-8 | 2,457 | 2.53125 | 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;
namespace Factory_management
{
public partial class attendance : Form
{
public attendanc... |
C | UTF-8 | 1,372 | 2.65625 | 3 | [] | no_license | #ifndef _SCHEDULER_H_
#define _SCHEDULER_H_
#include "types.h"
/* \brief Initializes scheduler.
*
* Initializing scheduler entails:
* - allocating and preparing idle process state
* - allocating and preparing first process state
* - setting program counter to code passed as arg
* - inserting first process in qu... |
PHP | UTF-8 | 674 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Http\Resources\TagResource;
class ProjectResource extends JsonResource {
/**
* Transform the resource into an array.
*
* @param \Illuminate\Http\Request $request
* @return array
*/
public fu... |
Java | UTF-8 | 9,054 | 2.078125 | 2 | [] | no_license | package com.socrata;
/*
Copyright (c) 2010 Socrata.
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 ... |
PHP | UTF-8 | 185 | 2.546875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace App\Models\ViewModels;
use App\Models\User;
class UserProfile {
public $user;
public function __construct(User $user) {
$this->user = $user;
}
}
|
Java | UTF-8 | 1,297 | 2.453125 | 2 | [] | no_license | package ac.za.cput.service.user.implement;
import ac.za.cput.domain.user.Employee;
import ac.za.cput.repository.user.EmployeeRepository;
import ac.za.cput.repository.user.implement.EmployeeRepositoryImpl;
import ac.za.cput.service.user.EmployeeService;
import org.springframework.stereotype.Service;
import java.util.S... |
Markdown | UTF-8 | 1,869 | 2.640625 | 3 | [] | no_license | # Article D217-1
Les associations régulièrement déclarées ayant pour objet statutaire de mettre à disposition des femmes et des familles
toutes informations, notamment familiale, sociale, professionnelle, économique, éducative et de santé, tendant à promouvoir
les droits des femmes et l'égalité entre les femmes et les... |
Python | UTF-8 | 4,712 | 2.671875 | 3 | [] | no_license | import gym
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple
from itertools import count
from PIL import Image
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as ... |
Java | UTF-8 | 946 | 3 | 3 | [] | no_license | package mechanics.rb2d.shapes;
import static java.lang.Math.cos;
import static java.lang.Math.sin;
import de.physolator.usr.components.Vector2D;
import de.physolator.usr.tvg.Shape;
import de.physolator.usr.tvg.TVG;
public class Circle extends AbstractShape {
public double radius;
public Circle() {
this(1);
}
... |
Swift | UTF-8 | 601 | 2.984375 | 3 | [] | no_license | //
// NetworkHandler.swift
// TMDb
//
// Created by Atiqa Ikram on 21/02/2020.
// Copyright © 2020 Atiqa Ikram . All rights reserved.
//
import Foundation
struct NetworkHandler{
/// Sends a request for the requested API endpoint and returns a completion closure with Data object or error string
/// ... |
Python | UTF-8 | 1,789 | 3.4375 | 3 | [] | no_license | # Finds max and min # of extra entities per website (out of all articles WITH CAPTIONS)
import csv
data_file = "/Users/mirandadayadkins/Desktop/Media_Bias/Data/processed_data/Main_Entities/" \
"caption_main_figures_edited.csv"
# Finds maximum number of extra entities in the captions from a given website... |
Markdown | UTF-8 | 2,753 | 2.984375 | 3 | [] | no_license | ---
id: one-to-many-relations
title: One to Many relations
---
Este tutorial vai mostrar como é fácil incluir relações Um para Muitos em seu projeto móvel.
Vamos começar baixando o Projeto Starter:
<div className="center-button">
<a className="button button--primary"
href="https://github.com/4d-go-mobile/tutorial-On... |
Java | UTF-8 | 188 | 1.585938 | 2 | [] | no_license | package com.my.admin.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
public enum E {
@Autowired
UNKNOWN;
}
|
Python | UTF-8 | 619 | 3.203125 | 3 | [] | no_license | from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
'''
print(lemmatizer.lemmatize("cats")) #cat
print(lemmatizer.lemmatize("cacti")) #cactus
print(lemmatizer.lemmatize("geese")) #goose
print(lemmatizer.lemmatize("rocks")) #rock
print(lemmatizer.lemmatize("python")) #python
'''
print(lemmatizer.le... |
JavaScript | UTF-8 | 656 | 2.6875 | 3 | [] | no_license | /*Middleware authorization:
Verify the existence of a jwt in the header of the HTTP request*/
const jwt = require('jsonwebtoken');
require('dotenv/config');
const authorization = (req, res, next) => {
const token = req.header('x-auth-token');
if (!token) return res.status(401).json({message:"Access denied. N... |
JavaScript | UTF-8 | 800 | 4.28125 | 4 | [] | no_license | // 观察者模式:观察者、被观察者(在被观察者中存储观察者) 之间有关系
// 订阅和发布没有关系 观察者模式是基于发布订阅的
// 被观察者
class Subject{
constructor(){
this.arr=[]//存储谁在观察
this.state="很开心"
}
attach(o){
this.arr.push(o)
}
setState(newState){
this.state=newState
this.arr.forEach(o=>o.update(newState))
}
}
... |
Ruby | UTF-8 | 1,237 | 4.25 | 4 | [] | no_license | # Problem 4
#
# A palindromic number reads the same both ways. The largest palindrome made
# from the product of two 2-digit numbers is 9009 = 91 99.
#
# Find the largest palindrome made from the product of two 3-digit numbers.
require 'rubygems'
require 'pp'
def is_a_palindrome?(number)
number = number.to_s
m... |
Java | UTF-8 | 245 | 2 | 2 | [] | no_license | public class Main
{
public static void main(String[] args) {
BioStudents b=new BioStudents();
b.display();
b.displaybio();
System.out.println();
Students s=new Students();
s.display();
}
}
|
JavaScript | UTF-8 | 86 | 2.8125 | 3 | [] | no_license | var nome = "Alexander"
var sobreNome = "Brandao"
console.log(nome + " " + sobreNome); |
PHP | UTF-8 | 234 | 3.046875 | 3 | [
"BSD-4-Clause-UC",
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive",
"TCL",
"ISC",
"Zlib",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"blessing",
"MIT"
] | permissive | --TEST--
array_values() preserves next index from source array when shallow-copying
--FILE--
<?php
$a = [1,2,3];
unset($a[2]);
$b = array_values($a);
$b[] = 4;
print_r($b);
--EXPECT--
Array
(
[0] => 1
[1] => 2
[2] => 4
)
|
Python | UTF-8 | 628 | 2.8125 | 3 | [] | no_license | from typing import Dict
from bs4 import BeautifulSoup
import requests
import re
URL = "https://www.johnlewis.com/2018-apple-ipad-pro-12-9-inch-a12x-bionic-ios-wi-fi-cellular-512gb/space-grey/p3834614"
TAG_NAME = "p"
QUERY = {"class": "price price--large"}
request = requests.get(URL)
content = request.content
soup = B... |
Java | UTF-8 | 783 | 2.15625 | 2 | [] | no_license | package by.Andrey.jis3telegram.command;
import org.junit.Assert;
import org.junit.jupiter.api.Test;
public class CommandServiceTest {
// @Test
// public void getCommand() {
// System.out.println(CommandService.getWordFromCommand("/get word put over"));
// }
@Test
public void getMeaningsFro... |
Java | UTF-8 | 146 | 1.507813 | 2 | [] | no_license | package PAGES;
import org.openqa.selenium.WebDriver;
public class EntertainmentPage {
public EntertainmentPage(WebDriver driver){
}
}
|
C# | UTF-8 | 2,803 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
namespace TravelOnline.Class.NewClass
{
public class TopMenu
{
public static String GetTopMenuString(string MenuType)
{
StringBuilder Strings = new StringBuilder();
... |
C# | UTF-8 | 1,907 | 2.75 | 3 | [] | no_license | using Priority_Queue;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AStar : Algorithms {
public AStar()
{
name = "A*";
}
public override void StartAlgorithm(TDTile start, TDTile end, TGMap map)
{
algoSteps.Clear();
SimplePriorityQueue<TDTile> f... |
Python | UTF-8 | 793 | 3.046875 | 3 | [] | no_license | # python3
import sys
def compute_min_refills(distance, tank, stops):
# write your code here
running_tank = tank
refills = 0
car_index = 0
stops.append(distance)
check_diff = 0
diff_list = list()
for index, stop in enumerate(stops):
if index == len(stops) - 1:
br... |
JavaScript | UTF-8 | 2,730 | 2.859375 | 3 | [] | no_license | $(document).ready(function() {
$('#submitButton').prop("disabled", true);
function updateFormEnabled() {
if (verifySelect()) {
$('#submitButton').prop("disabled", false);
} else {
$('#submitButton').prop("disabled", true);
}
}
function verifySelect() {
if ($("#countySel :selected").val() !== '') {
... |
C++ | UTF-8 | 2,079 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <functional>
void run_test();
namespace testSpace{
template <std::size_t... M>
struct _indices{};
template <std::size_t N, std::size_t... M>
struct _indices_builder : _indices_builder<N - 1, N - 1, M...>{};
template <std::size_t... M>
struct _indices_builder<0, M...>{
us... |
C# | UTF-8 | 3,118 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
namespace Vim.BFast
{
/// <summary>
/// Anything that can be add to a BFAST has to be abled to compute its size, and write to a stream.
/// </summary>
public interface IBFastComponent
{
long Get... |
Markdown | UTF-8 | 11,939 | 2.71875 | 3 | [] | no_license |
# Another World 3DO Technical Notes
Another World has been ported on many platforms. The way the game was written (interpreted game logic) clearly helped.
This document focuses on the 3DO release made by Interplay in 1994. This version was not a straight port. In addition to reworking the assets, the game code was m... |
Java | UTF-8 | 172 | 1.671875 | 2 | [] | no_license | package ru.podelochki.otus.socketchat.services;
public interface ClientMessageService extends MessageService {
void addReceiver(ServiceMessageHandler receiver);
}
|
Shell | UTF-8 | 781 | 2.8125 | 3 | [] | no_license | BASEDIR=$(cd "$(dirname "$1")"; pwd)/$(basename "$1")
KUBERNETES=/usr/local/share/kubernetes2/kubernetes-1.0.1
KUBECTL=./cluster/kubectl.sh
cd $KUBERNETES
#stop services
$KUBECTL stop -f ${BASEDIR}kube-yml/local/redis-service.yml
$KUBECTL stop -f ${BASEDIR}kube-yml/local/main-service.yml
$KUBECTL stop -f ${BASEDIR}ku... |
Java | UTF-8 | 381 | 3.09375 | 3 | [] | no_license | package com.ejemplo.figuras;
public class Cubo extends Figura {
private double lado;
public double getLado() {
return lado;
}
public void setLado(double lado) {
this.lado = lado;
}
@Override
public void draw() {
System.out.println(getEtiqueta() + " con area " + volumen());
}
pu... |
PHP | UTF-8 | 4,941 | 3.078125 | 3 | [] | no_license | <?php
/**
* Контроллер AdminUserController
* Управление в админпанели
*/
class AdminUserController extends AdminBase
{
/**
* Action для страницы "Управление..."
*/
public function actionIndex()
{
// Проверка доступа
self::checkAdmin('superadmin');
// Получаем список
... |
Python | UTF-8 | 4,991 | 2.84375 | 3 | [] | no_license | """
This file contains test functions for channel_join function
in channel.py.
"""
import pytest
from data import data
from src.other import clear_v1
from src.error import InputError, AccessError
from src.channel import channel_join_v2
from src.auth import auth_register_v2
from src.channels import channels_create_v2, c... |
C++ | UTF-8 | 348 | 2.5625 | 3 | [] | no_license | #include "eventoTransmissao.h"
eventoTransmissao::eventoTransmissao(double t, const pessoa* p) : evento(evento::TRANSMISSAO, t), p(p), src(p->id()) {}
pessoa eventoTransmissao::origem() const
{
return *p;
}
const pessoa *eventoTransmissao::ptr() const
{
return p;
}
const unsigned int eventoTransmissao::id()... |
Markdown | UTF-8 | 329 | 2.734375 | 3 | [
"CC-BY-4.0"
] | permissive | # 整式加减
2008-12-01
已知a2(a的平方)+ab=4,ab+b2(b的平方)=-1。求①a2(a的平方)-b2(b的平方)的值②a2(a的平方)+3ab+2b2(2*b的平方)的值
①a方-b方=(a方+ab)-(b方-ab)=4-(-1)=5②a方+3ab+2b方=(a方+ab)+(2ab+2b方)=4+2(ab+b方)=4+2*(-1)=4-2=2
|
C++ | UTF-8 | 1,176 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <unordered_map>
using namespace std;
class Solution {
public:
int len ;
vector<string> ans;
vector<string> generateParenthesis(int n) {
len = n;
dfs(0 , 0 , "");
return ans;
}
void df... |
C++ | UTF-8 | 2,816 | 3.234375 | 3 | [] | no_license | #include "account_manager.h"
AccountManager::AccountManager(const char *filename){
account_filename = std::string(filename);
if(!load(filename))
std::cerr << "AccountManager(): load initial data error." << std::endl;
}
AccountManager::AccountManager(){
}
AccountManager::~AccountManager(){
}
bool
AccountManage... |
Markdown | UTF-8 | 3,322 | 2.53125 | 3 | [] | no_license | ---
title: modules
tag: modules
birth: 2017-03-28
modified: 2017-03-28
---
# modules
**前言:详解 node 的模块加载机制**
---
## API
详解模块暴露的 API
* **require(id)** 加载一个模块,详见 [模块机制](#模块机制)
* **require.cache** 缓存对象,键为文件的全局路径,值为解析后的地址
* **require.extensions** 不同扩展的处理函数
* **require.main** 模块的入口脚本
* **requir... |
Python | UTF-8 | 1,636 | 2.8125 | 3 | [
"Apache-2.0",
"Swift-exception"
] | permissive | #!/usr/bin/env python3
import re
import subprocess
import sys
def run():
if len(sys.argv) > 1:
print("""
ns-html2rst - Convert Cocoa HTML documentation into ReST
usage: nshtml2rst < NSString.html > NSString.rst
""")
sys.exit(0)
html = sys.stdin.read()
# Treat <div class="declara... |
JavaScript | UTF-8 | 799 | 2.546875 | 3 | [] | no_license | import React from "react";
import styled from "styled-components";
const TitleH1 = styled.h1`
font-size: 32px;
text-align: center;
color: #641c1c;
`;
const Button = styled.button`
background: ${(props) => (props.active ? "#641c1c" : "#cccccc")};
color: ${(props) => (props.active ? "#ffffff" : "#000000")};
... |
Java | UTF-8 | 2,491 | 2.140625 | 2 | [] | no_license | package cn.showclear.www.pojo.base;
/**
* @author Wang Junbo
* @description 订单查询类
* @date 2019/4/16
*/
public class SearchOrderQo {
private OrderDo orderDo;
private String prodName;
private Double prodPrice;
private Integer prodQuantity;
private String typeName;
private String buyUserName;
... |
Python | UTF-8 | 934 | 2.8125 | 3 | [] | no_license | import matplotlib.pyplot as plt
import pandas as pd
data = pd.read_csv('filtering_target_seqs_PB_Ca.csv')
x = data['target sequences cutoff']
genes = data['genes']
auc = data['auc']
target = data['Target / bp FI']
fig, ax1 = plt.subplots()
color = 'tab:red'
ax1.set_xlabel('Number of target sequences in ORF used as c... |
Python | UTF-8 | 458 | 3.515625 | 4 | [] | no_license | guess = int(input("\nyou have eight tries. \n\nguess a number 1-25?"))
num = 14
count = 1
while guess != num and count < 8:
if guess > num:
print("\ntoo high, guess again!")
guess = int(input("\nwhat's the number?"))
elif guess < num:
print("\ntoo low, guess again!")
guess = int... |
TypeScript | UTF-8 | 888 | 3.046875 | 3 | [] | no_license | export abstract class Produto{
private codigo : string;
private nome : string;
private genero : string;
private preco : number;
public constructor(codigo : string, nome : string, genero : string, preco : number){
this.codigo = codigo;
this.nome = nome;
this.genero = genero;
this.preco = preco;
... |
Java | UTF-8 | 2,273 | 2.265625 | 2 | [
"MIT"
] | permissive | package com.xiongxh.baking_app.data.bean;
import android.arch.persistence.room.ColumnInfo;
import android.arch.persistence.room.Entity;
import android.arch.persistence.room.ForeignKey;
import android.arch.persistence.room.PrimaryKey;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.Serial... |
JavaScript | UTF-8 | 2,251 | 2.953125 | 3 | [] | no_license | //**************************************************
//*DONT USE, DOESN'T WORK, USE WeatherCardb instead*
//**************************************************
import React, { useState } from 'react';
import axios from 'axios';
import { useAsync } from 'react-async';
var zoneId = '';
const loadWeather = async () =>{
... |
C++ | UTF-8 | 1,147 | 3.40625 | 3 | [] | no_license | #include <bitset>
class HashClass{
public:
HashClass(int c, int s) : cap(c), seed(s) {}
int hashFunc(string &value) {
int ret = 0;
for (int i = 0; i < value.size(); ++i) {
ret += seed * ret + value[i];
ret %= cap;
}
return ret;
}
private:
... |
Shell | UTF-8 | 223 | 2.796875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
source ./selfdrive/golden/guess_op_ip.sh
echo $OP_IP
PORT=8022
RSA_FILE=~/.ssh/op.rsa
TARGET=$1
if [ "$2" ]; then
TARGET=$2
fi
set -x
scp -r -P $PORT -i $RSA_FILE $1 root@$OP_IP:/data/openpilot/$TARGET |
Java | UTF-8 | 2,761 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package jp.yokomark.remoteview.reader.utils;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.RemoteViews;
import java.lang.reflect.Fi... |
C | UTF-8 | 7,164 | 3.5 | 4 | [] | no_license | /**
* @file cs131_program_1_FLAST.c
* @author YOUR NAME HERE
* @author Prof. Adams
* @date THE CURRENT DATE
*/
// INSTRUCTIONS:
// TASK 0/5: LOG IN TO ECLIPSE AND TYPE THE FOLLOWING IN PuTTY:
// cd ~/cs131
// touch cs131_program_1_FLAST.c
// git add cs131_program_1_FLAST.c
// git commit -m "Initial creati... |
Shell | UTF-8 | 1,191 | 2.875 | 3 | [] | no_license | # vimで日本語が文字化けする場合:
# http://d.hatena.ne.jp/over80/20080907/1220794834
# Githubへのpushでusername/passwordを省略する方法
# http://shoken.hatenablog.com/entry/20120629/p1
# こんな感じで自分の$HOME直下に.netrcファイルを作成する。
#
# machine github.com
# login syokenz
# password xxxxxxx
# HTTPSではなくSSHを使う
# http://stackoverflow.com/questions/6565357/g... |
C | UTF-8 | 6,199 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <stdint.h>
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include "gamma.h"
#include <stdbool.h>
#include <string.h>
int main() {
/*
scenario: test_random_actions
uuid: 775876853
*/
/*
random actions, total chaos
*/
gamma_t* board = gamma_new(9, 4, 8, 5);
assert( board != NULL );
assert( gamm... |
Python | UTF-8 | 1,842 | 3.21875 | 3 | [] | no_license | class Accounts:
def __init__(self):
self.firstname = Accounts.new_firstname()
self.lastname = Accounts.new_lastname()
self.middlename = Accounts.new_middlename()
self.username = Accounts.new_username()
self.password = Accounts.new_pass()
self.account_number = Accounts.newacc_number()
self.account... |
Markdown | UTF-8 | 629 | 2.609375 | 3 | [] | no_license | ---
layout: post
title: Macbook Air, upgrade or not? No, thanks.
date: 2016-11-16
categories: #off-topic #mac
---
Someone asked if I have thought about upgrading my Macbook Air 11" and the answer is **no, I won't upgrade yet**.
Still more than enough for everything I use it for and the SSD makes it blazing fast. B... |
Python | UTF-8 | 1,617 | 2.5625 | 3 | [] | no_license | import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def main():
fs = 44100
Ts = 1/fs
suffix = "_f"
rows_fname = "rows_buffs_size" + suffix + ".csv"
cols_fname = "cols_irs_size" + suffix + ".csv"
buffs_fname = "n_proc_buffers" + suffix + ".csv"
proc_fname = "p... |
Markdown | UTF-8 | 2,535 | 2.734375 | 3 | [
"MIT"
] | permissive | # React Todo App
A basic todos application with data persistence and authentication that uses ReactJS on the frontend and Firebase on the backend.
## Usage
Install packages
```
npm install
```
And build client.min.js bundle
```
npm run build
```
Now index.html can be used with the bundled javascript file to view... |
Java | UTF-8 | 1,749 | 2.78125 | 3 | [] | no_license | package com.garethabrahams.repository.impl;
import com.garethabrahams.factory.EmployeeFactory;
import com.garethabrahams.model.Employee;
import com.garethabrahams.repository.EmployeeRepository;
import org.junit.Assert;
import org.junit.Test;
import sun.awt.geom.AreaOp;
import java.applet.Applet;
import static org.ju... |
C# | UTF-8 | 2,232 | 2.96875 | 3 | [] | no_license | using Cash_Register_Divyansh.ApplicationTypes;
using Cash_Register_Divyansh.Contracts.Business;
using Cash_Register_Divyansh.Models;
using System;
namespace Cash_Register_Divyansh.BusinessLogic
{
/// <summary>
/// Responsible for discount calculation of scanned items
/// </summary>
public class CostCal... |
Shell | UTF-8 | 9,216 | 3.40625 | 3 | [
"MIT"
] | permissive | # Set Variables
PROJECT="default"
HOST_PROJECT="default"
NETWORK="default"
SUBNET="default"
REGION="us-east4"
ZONE="us-east4-a"
USER_EMAIL="default"
USER_ROLE_NAME="netappuserrole"
SERVICE_CONNECTOR_ROLE_NAME="netappscrole"
SERVICE_CONNECTOR_SERVICE_ACCOUNT_NAME="netapp-service-connector"
CVO_SERVICE_ACCOUNT_NAME="neta... |
Java | UTF-8 | 389 | 1.78125 | 2 | [
"Apache-2.0"
] | permissive | package xyz.erupt.annotation.config;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
/**
* @author YuePeng
* date 2020-12-23.
*/
@Target({ElementType.METHOD, ElementType.TYPE, ElementType.FIELD, ElementType.TYPE_PARAMETER, ElementType.PARAMETER}... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.