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 |
|---|---|---|---|---|---|---|---|
Rust | UTF-8 | 1,397 | 2.90625 | 3 | [] | no_license | use std::prelude::v1::*;
use std::boxed::FnBox;
use client::ClientObj;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum KeyAction {
MoveLeft(u8),
MoveRight(u8),
MoveUp(u8),
MoveDown(u8),
Select,
Cancel,
SetHotbar(i8),
ToggleDebugPanel,
}
impl KeyAction {
pub fn from_code(... |
PHP | UTF-8 | 747 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php namespace bot\object;
/**
* Contains information about why a request was unsuccessfull.
*
* @method bool hasMigrateToChatId()
* @method bool hasRetryAfter()
* @method int getMigrateToChatId($default = null)
* @method int getRetryAfter($default = null)
*
* @author Mehdi Khodayari <mehdi.khodayar... |
C++ | UTF-8 | 274 | 2.90625 | 3 | [] | no_license | #pragma once
#include<list>
using std::list;
struct FPNode {
FPNode() { item_name = -1; parent = nullptr; count = 0; }
FPNode(int name, FPNode* p) { item_name = name; parent = p; count = 1; }
int item_name;
int count;
list<FPNode*> childs;
FPNode* parent;
}; |
Swift | UTF-8 | 787 | 3.109375 | 3 | [] | no_license | //
// StringExtension.swift
// MyTVShows
//
// Created by Juan Jose Elias Navarro on 30/08/21.
//
import UIKit
extension String {
func height(width: CGFloat, font: UIFont) -> CGFloat {
let constraintRect = CGSize(width: width, height: .greatestFiniteMagnitude)
let boundingBox = self.boundi... |
JavaScript | UTF-8 | 2,388 | 2.703125 | 3 | [
"MIT"
] | permissive | // Generated by github.com/steida/coffee2closure 0.0.14
/**
@fileoverview Watch clicking on anchors elements. It uses Polymer
PointerEvents to enable fast click on touch devices.
Note, this trick does not work on iOS also sometimes we need zoom.
https://plus.google.com/u/0/+RickByers/posts/ej7nsuoaaDa
@see TO... |
Java | UTF-8 | 2,537 | 2.4375 | 2 | [] | no_license | package com.osu.cse.apps.mobile.woof;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
public class FamilyMainFragment ext... |
Java | UTF-8 | 4,887 | 2.984375 | 3 | [] | no_license | /**
*
*/
package ru.fizteh.fivt.students.nikitaAntonov.utils;
import java.util.ArrayList;
import java.util.TreeMap;
/**
* Дешёвая въетнамская подделка под getopt (ну надо же как-то выживать в этом
* жестоком мире без getopt`а)
*
* @author Антонов Никита
*/
public class OptionParser {
private TreeMap<Char... |
Python | UTF-8 | 1,009 | 3.59375 | 4 | [] | no_license | import collections
from typing import List
class Solution:
def maxSlidingWindow(self, nums: List[int], k: int) -> List[int]:
results = []
window = collections.deque()
current_max = float('-inf')
for i, v in enumerate(nums):
window.append(v)
if i <... |
JavaScript | UTF-8 | 2,197 | 3.375 | 3 | [] | no_license | var Personaje = /** @class */ (function () {
function Personaje(nombre) {
this.ki = 100;
this.semillas = 100;
this.nombre = "";
this.mana = 30;
this.sayayin = 25;
this.ataques = 10;
this.nombre = nombre;
}
Personaje.prototype.ataque = function (jugador... |
Ruby | UTF-8 | 358 | 2.78125 | 3 | [] | no_license | class Statement
def view(log)
print_header
log.history.each do |arr|
arr.each do |item|
if item.class == Time
print item.strftime("%c"), "\t"
else
print item, "\t\t"
end
end
print "\n"
end
end
private
def print_header
puts "Date\t\t... |
Java | UTF-8 | 617 | 2.921875 | 3 | [] | no_license | package com.wzh.crocodile.ex00_ready.thread.th01_test1;
/**
* @Description: 直接调用火箭发射倒计时(非多线程)
* @Author: 吴智慧
* @Date: 2019/11/16 14:39
*/
public class MainThread {
public static void main(String[] args) {
LiftOff launch = new LiftOff();
// 当从Runnable导出一个类时,必须实现run()方法,但是这个方法并无特殊之处(不会产生任何内在地线程能... |
C++ | UTF-8 | 1,063 | 2.59375 | 3 | [] | no_license | #ifndef CONSTANTS_H
#define CONSTANTS_H
namespace ACTORS
{
int const MENEL = 0;
int const STAFF = 1;
int const MANAGEMENT = 2;
}
namespace MENEL
{
int const TIMESTAMP = 10;
int const DRUNK = 11;
int const NOT_DRUNK = 12;
int const STATE = 13;
int const OUT = 14;
}
namespace MANAGEMENT... |
Java | UTF-8 | 3,799 | 3.40625 | 3 | [] | no_license | package pl.jakd.TramSim;
import java.awt.geom.Point2D;
import java.util.*;
/**
* klasa reprezentująca przystanek w symulacji
*
* @author jacek
*/
public class TramStop {
private String name; // nazwa
private Point2D.Double point; // pozycja na planszy
private LinkedList<Passenger> passengers; // pasażerowie n... |
Markdown | UTF-8 | 2,690 | 2.59375 | 3 | [] | no_license | ---
title: Patatesli Kabak Spaghetti | Potato Zucchini Spaghetti
date: 2020-05-16
cover: kabak.jpeg
tags: [glutensiz, vegan]
---
*(6-7 Kişilik)*
**Malzemeler:**
- 4 haşlanmış patates
- 2 domates
- 1 soğan
- 1 kabak
- 2 havuç
- 2 salatalık turşusu
- 2 çorba kaşığı maydanoz
- 2 çorba kaşığı dereotu
- 3 çorba kaşığı ze... |
Python | UTF-8 | 773 | 3.375 | 3 | [] | no_license | # Read a video stream from camera (frame by frame)
import cv2
# Capture the device from which you want to read images
cap = cv2.VideoCapture(0) # 0 means default webcam
while True :
ret, frame = cap.read() # ret is true if image is captured properly
if not ret:
break
gray_frame = cv2.cvtCol... |
PHP | UTF-8 | 1,332 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
namespace Ikimea\Kong\Api;
use Ikimea\Kong\Client;
use Ikimea\Kong\Message\ResponseMediator;
abstract class AbstractApi
{
/**
* @var Client
*/
protected $client;
/**
* @param Client $client
*/
public function __construct(Client $client)
{
$this->client = $client... |
Java | UTF-8 | 759 | 1.757813 | 2 | [
"BSD-3-Clause"
] | permissive | package elf.acceptance.test.oms.placement.common.status;
import fit.ColumnFixture;
import fitlibrary.DoFixture;
public class PlacementStatusFixture extends DoFixture {
private CreatePlacementAndCancelPlacmentFixture createPlacementAndCancelPlacment = new CreatePlacementAndCancelPlacmentFixture();
private R... |
JavaScript | UTF-8 | 1,316 | 2.828125 | 3 | [] | no_license | import RecorridoParametrico from "../recorrido_parametrico.js";
class Recta extends RecorridoParametrico {
constructor(largo, cantRepeticionesTextura = 1) {
super();
this.largo = largo;
this.sentido = 'x';
this.cantRepeticionesTextura = cantRepeticionesTextura;
}
getPosicion(u) {
if (!this... |
JavaScript | UTF-8 | 199 | 3.25 | 3 | [] | no_license | //UC1
const IS_ABSENT = 0
let empCheck = Math.floor(Math.random() * 10 % 2;
if (empCheck == IS_ABSENT) {
console.log("Employee is Absent");
return;
} else {
console.log("Emoloyee is PRESENT");
} |
Java | UTF-8 | 375 | 3 | 3 | [] | no_license | package chapter03.exercise08;
import java.util.Random;
public class Long16And8 {
public static void main(String[] args) {
long n1 = 0x2f; //Шестнадцатиричное
System.out.println("l1: " + Long.toBinaryString(n1));
long n2 = 0177; //Восьмиричное
System.out.println("l2: " + Long.toBi... |
SQL | UTF-8 | 618 | 3.421875 | 3 | [] | no_license | DELIMITER $$
CREATE FUNCTION `getRating`( `b` varchar(255)) RETURNS DECIMAL(12,4)
DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE c double;
DECLARE a double default 1;
set a = (select total_star from restaurant where Place_idPlace =(select Place_idPlace from restaurant where Place_idPlace = (select idPlace from place where... |
Java | UTF-8 | 3,311 | 1.765625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2016 Red Hat, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
C++ | UTF-8 | 565 | 3.015625 | 3 | [] | no_license | // Problem
//Sum of Square Differences
#include<iostream>
#include<vector>
#include <cmath>
#include <bitset>
#include <iterator>
#include <time.h>
#include <math.h>
#define log(x) std::cout << #x"=" << x << std::endl
int main()
{
int limit = 100;
int sum_of_squares = 0;
int square_of_sum = 0;
for(in... |
JavaScript | UTF-8 | 5,194 | 2.828125 | 3 | [
"MIT"
] | permissive | // Script to collect themepark wait times.
// include the Themeparks library
var Themeparks = require("themeparks");
// initialise caching (see https://github.com/BryanDonovan/node-cache-manager)
// var cacheManager = require('cache-manager');
// Themeparks.Settings.Cache = cacheManager.caching({
// store: require(... |
Markdown | UTF-8 | 40,506 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: "LIME: Machine Learning Model Interpretability with LIME"
excerpt: "Predict employee churn with H2O machine learning and LIME. Use LIME (local Interpretable Model-agnostic Explanations) for model explanation in data science for business."
author: "Brad Boehmke"
date: 2018-06-25 04:45:01
categ... |
JavaScript | UTF-8 | 12,379 | 2.625 | 3 | [] | no_license | /****************************************************************************
Copyright (c) 2018 Timofey Borisov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including with... |
Python | UTF-8 | 2,962 | 3.171875 | 3 | [] | no_license |
########## input file "logistic_and_svm_data.txt" has changed with space.
import math
import numpy as np
from chart import Chart
from readfile import Readfile
FILE_NAME = "data/logistic_and_svm_data.txt"
SMALL_NUMBER = 0.000000000000001
##################################################
ITERATION_NUMBER = 15000
ALPH... |
Shell | UTF-8 | 290 | 2.71875 | 3 | [] | no_license | #!/usr/bin/env bash
SSH_KEY=$1
BUNDLE_NAME=$2
VERSION=${3-`cat ./VERSION`}
BUNDLE_FILE="$BUNDLE_NAME-bundle-$VERSION.zip"
BUNDLE_PATH='/var/www/api.openrouteservice.org/html/api-plugins/'
scp -i $SSH_KEY $BUNDLE_FILE ubuntu@api.openrouteservice.org:~/
ssh -i $SSH_KEY ubuntu@api.openrouteservice.org "sudo mv ~/$BUNDLE_F... |
JavaScript | UTF-8 | 2,464 | 2.6875 | 3 | [] | no_license | (function($){
$.fn.customInput = function (settings) {
options = $.extend({}, $.fn.customInput.defaults, settings);
$.each($(this), function (i, item) {
item = $(item);
if (item.attr('type') == 'checkbox' || item.attr('type') == 'radio') {
item.hide();
idInput = item.attr('id');
label =... |
C# | UTF-8 | 2,423 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace Sokoban.Core.Tests
{
[TestFixture]
internal class MovementTests
{
[Test]
public void BasicTest()
{
const string step0 = @"####
#-@#
#--#
##... |
SQL | UTF-8 | 339 | 3.359375 | 3 | [] | no_license | CREATE TABLE [ticket].[TicketType] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[EventId] INT NOT NULL,
[Price] MONEY NOT NULL,
CONSTRAINT [PK_ButtonCode] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_ButtonCode_SaleEvent] FOREIGN KEY ([EventId]) REFERENCES [ticket].[SaleEvent] ([Id]) ON DELE... |
Python | UTF-8 | 900 | 3.4375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Jul 12 16:13:46 2014
@author: shunxu
"""
# -*- coding: utf-8 -*-
"""
Created on Sat Jul 26 11:20:43 2014
@author: shunxu
"""
import math
num_range_low = 0
num_range_high = 100
real_num = 0
remain_guess_times = 0
print int(math.ceil(math.log(4,2)))
... |
Java | UTF-8 | 969 | 2.375 | 2 | [
"MIT"
] | permissive | package com.github.twitch4j.graphql.command;
import com.apollographql.apollo.ApolloCall;
import com.apollographql.apollo.ApolloClient;
import com.github.twitch4j.graphql.internal.FetchActivePredictionsQuery;
import lombok.NonNull;
public class CommandFetchActivePredictions extends BaseCommand<FetchActivePredictionsQu... |
Markdown | UTF-8 | 3,634 | 3 | 3 | [] | no_license | # 图解Http
### 分层
TCP/IP协议族按层次分别分为4层:应用层,传输层,网络层和数据链路层.
应用层:TCP/IP协议族内预存了各类通用的应用服务.比如FTP,DNS,HTTP
传输层:TCP,UDP
网络层:网络层用来处理网络上流动的数据包.数据包是网络传输的最小数据单位
链路层:用来处理链接网络的硬件部分.

### 三次握手,四次挥手



三次握手... |
Java | UTF-8 | 3,618 | 1.976563 | 2 | [] | no_license | package com.rwq.testnetty;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import com.google.android.material.floatingactionbutton.FloatingAc... |
C# | UTF-8 | 1,735 | 3.015625 | 3 | [
"MIT"
] | permissive | using System;
namespace BodeAbp.Queue.Protocols
{
[Serializable]
public class QueueKey : IComparable<QueueKey>, IComparable
{
public string Topic { get; set; }
public int QueueId { get; set; }
public QueueKey() { }
public QueueKey(string topic, int queueId)
{
... |
Java | UTF-8 | 1,148 | 3.578125 | 4 | [] | no_license | class Solution {
public int lengthOfLongestSubstring(String s) {
int n = s.length();
int ans = 0, left=0, right=0;
Set<Character> set = new HashSet();
while(left<n && right<n){
if(!set.contains(s.charAt(right))){
set.add(s.charAt(right));
r... |
Go | UTF-8 | 1,361 | 3.84375 | 4 | [] | no_license | package main
import (
"log"
"sync"
"time"
)
type Processor struct {
queue chan int
workers sync.WaitGroup
shutdown chan struct{}
}
func (p *Processor) Run(count int) {
p.shutdown = make(chan struct{})
for i := 0; i < count; i++ {
p.workers.Add(1)
go p.worker(i)
}
}
func (p *Processor) Stop() {
clo... |
Java | UTF-8 | 917 | 3.609375 | 4 | [] | no_license | import java.util.HashMap;
import java.util.Map;
public class LongestPalindrome {
//Case sensitive, s max length = 1010
//Runtime: 6 ms
//Memory usage: 37.4 MB
public int longestPalindrome(String s) {
if (s.length() == 0) return 0;
Map<Character, Integer> occur = new HashMap<>();
... |
Markdown | UTF-8 | 2,847 | 3.5 | 4 | [] | no_license | #【区块链】一张大表还是一本大书
这两天,又读了一遍王建硕的这篇文章——《[互联网是一张网,Web3 是一张表(一张大大的表)](https://mp.weixin.qq.com/s/KMminDvloww_rZQ4qrkdfQ)》。
「怎样用最简单的话来介绍区块链这个概念」,单单是这一个想法,就把我迷住了。自己回头重新翻看了一下自己还没写完的《什么是区块链》系列,果然还是太复杂了!
我同意王建硕的意见,「用 “下一代互联网” 来解释 Web3 」确实是偷懒!Web3和Web的关系,真的就好像雷锋与雷峰塔一样。于是他说:
> Web3 是全球一张表(大大的表格),以及基于这个表的应用。
>
> 有人用互联网的技术,解释资产怎... |
Java | UTF-8 | 683 | 2.234375 | 2 | [] | no_license | package com.torlus.jnl.entities;
import com.torlus.jnl.Entity;
import com.torlus.jnl.Signal;
import com.torlus.jnl.SignalType;
public class Ab8016a extends Entity {
@Override
public String getBaseName() {
return "ab8016a";
}
@Override
public boolean requireSysclk() {
return true;
}
public Ab8016a() {
f... |
JavaScript | UTF-8 | 2,750 | 3.109375 | 3 | [] | no_license | import { elements } from './base';
// read the html element information of the selected course
export const getProductInfo = (product) => {
// console.log(course);
const productInfo = {
image: product.querySelector('img').src,
price: product.querySelector('h5').textContent,
id: produc... |
Java | UTF-8 | 2,054 | 2.0625 | 2 | [] | no_license | package controllers;
import java.io.IOException;
import java.util.List;
import com.wrapper.spotify.exceptions.SpotifyWebApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
im... |
TypeScript | UTF-8 | 816 | 2.71875 | 3 | [] | no_license | import Game from "managers/Game";
import Upgrade from "upgrades/Upgrade";
import { ALLOW_PLAYER_TO_MOVE_INDEPENDENTLY_UPGRADE_COST, UpgradeKey, UpgradeType } from "constants/UpgradeConstants";
const BUTTON_UI_ID = 'buyPlayerMoveIndependently';
const TOOLTIP_TEXT = 'Players can have one bot moving at the same time as t... |
Python | UTF-8 | 6,979 | 2.78125 | 3 | [] | no_license | from typing import List
import asyncpg
class Repo:
"""Db layer"""
def __init__(self, conn: asyncpg.pool.PoolConnectionProxy) -> None:
self.conn = conn
async def add_user(self, tg_id: int, username: str) -> None:
"""Добавляет пользователя в базу данных"""
await self.conn.execute(... |
SQL | UTF-8 | 923 | 3.671875 | 4 | [] | no_license | --insert
insert into author values(1,'박경리','토지작가');
--insert2 (컬럼 지정) 순서 몰라도 사용 가능
insert into author (no,name) values(2,'이훈');
insert into author (name,no) values('공자',3);
--insert3
insert into book values (1,'토지',null,1);
insert into book (no,title,author_no) values (2,'칼의노래',2);
--insert4 (Subquery... |
Java | UTF-8 | 1,158 | 3.390625 | 3 | [] | no_license | /**
* projectName:Java开发实战经典
* fileName:StaticCodeDemo.java
* packageName:com.java.development.five.codeblock
* date:2018年9月17日上午10:13:09
* copyright(c) 2017-2020 xxx公司
*/
package com.java.development.five.codeblock;
/**
* @title: StaticCodeDemo.java
* @package com.java.development.five.cod... |
Java | UTF-8 | 2,267 | 2.40625 | 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 filters;
import businesslogic.UserService;
import domainmodel.User;
import java.io.IOException;
import java.io.PrintStream;
im... |
Java | WINDOWS-1250 | 615 | 3.671875 | 4 | [] | no_license | package A5_Eingabe;
import java.util.Scanner;
public class EingabeKonsole {
public static void main(String[] args) {
//Eingabe
Scanner s = new Scanner(System.in);
System.out.print("Ihr alter: ");
int alter = s.nextInt();
System.out.print("Ihre Gre in cm: ");
double groesse = s.nextDouble();
... |
Java | UTF-8 | 7,690 | 1.890625 | 2 | [] | no_license | package com.harmazing.ifttt;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.protobuf.ByteString;
import com.harmazing.cache.ActiveCommandQueue;
import com.harmazing.entity.AirCondition;
... |
Markdown | UTF-8 | 10,001 | 3.09375 | 3 | [] | no_license | ---
description: 阅读libevent源码过程中的一些记录
---
# Libevent - Source Code \(3\)
## 配置event\_base
相关文件:
```c
event.h
event-internal.h
event.c
```
初始化出一个`event_base`有有两种方法,`event_base_new()`和`event_base_new_with_config()`
先看`event_base_new()`:
```c
// event.c
struct event_base *
event_base_new(void)
{
struct event_b... |
Markdown | UTF-8 | 1,490 | 3.203125 | 3 | [] | no_license | # noobannotator
This is a Rich Text Editor (based on DraftJs) that allows user to add comments and emoji's into articles.

## Features
1. Add Comments and Emoji's into rich text editor
* Hover over the comm... |
Java | UTF-8 | 13,408 | 1.875 | 2 | [] | no_license | package com.example.john.mobicare_uganda.views;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import andr... |
C++ | UTF-8 | 1,655 | 3.046875 | 3 | [] | no_license | #include "PlaneStatistic.h"
#include "Plane.h"
#include <iostream>
PlaneStatistic::PlaneStatistic()
{
statistic = new std::map<std::string, PlaneInfo*>;
}
PlaneStatistic::~PlaneStatistic()
{
}
bool PlaneStatistic::addToStatistic(const Plane& plane)
{
std::string planeModel = plane.GetModel();
if (statistic->find... |
Swift | UTF-8 | 1,364 | 2.546875 | 3 | [] | no_license | import UIKit
class LigandHeaderCollectionView: UICollectionReusableView, Reusable {
//----------------------------------------------------------------------------
// MARK: - Properties
//----------------------------------------------------------------------------
/******************** Outlet ****************... |
C# | UTF-8 | 1,547 | 3.734375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class RandomClass
{
// This generates Pseudo random values
// Do not create multiple instances of random in close time
private static read... |
Shell | UTF-8 | 722 | 2.75 | 3 | [] | no_license | #!/usr/bin/env expect
set timeout 120
spawn fabmanager create-admin --app superset
set username "{{superset.admin.username}}"
set first_name "{{superset.admin.first_name}}"
set last_name "{{superset.admin.last_name}}"
set email "{{superset.admin.email}}"
set password "{{superset.admin.password}}"
expect {
"Usernam... |
Python | UTF-8 | 624 | 4.1875 | 4 | [] | no_license | # Author : Rayaan Fakier FKRRAY001
# Date : 05 - 05 - 2014
# question1.py
def recursive_palindrome(string):
'''Python program to check whether a string is a palindrome'''
# Base Case - stop when 1 letter left
if string == "":
return "Palindrome!"
# Recursive case - prints not palindr... |
Python | UTF-8 | 3,914 | 3.203125 | 3 | [] | no_license | import unittest
import sys
sys.path.append(".")
#from puissance4_objet import connect4
from connect4 import Board, Game
class Test_board(unittest.TestCase):
def test_verif_ligne(self):
N = [[0., 0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0., 0.],
[1... |
Java | UTF-8 | 664 | 2.6875 | 3 | [] | no_license | package com.cts.cd.ui;
import java.util.Set;
import java.util.TreeSet;
import com.cts.cd.model.Person;
public class App06 {
public static void main(String [] args) {
Set<Person> persons = new TreeSet<>();
persons.add(new Person("srinivas", 53));
persons.add(new Person("asish", 23));
persons.add(new Person("... |
Java | UTF-8 | 1,839 | 3.203125 | 3 | [] | no_license | package com.huuuxi.jdk.concurrent;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentSkipListMap;
/**
*
* @author wyliujiangbin
* ConcurrentMap 增加了桶segment机制,每个桶里面都是lock() 调用;锁用的是 ReentrantLock 继承
*
* 取count: 取两次count,然后比较... |
Python | UTF-8 | 1,789 | 2.71875 | 3 | [] | no_license |
# coding: utf-8
# In[5]:
import numpy as np
import pandas as pd
from pandas import DataFrame
# In[9]:
df=pd.read_csv("central-India_rainfall_act_dep_1901_2016.csv")
df
# In[18]:
df1=pd.read_csv("south_pen-India_rainfall_act_dep_1901_2016.csv")
df1
# In[33]:
df2=pd.read_csv("ne-India_rainfall_act_dep_1901_20... |
Java | UTF-8 | 474 | 1.679688 | 2 | [] | no_license | package com.r.uebook.utils;
/**
* for storing the constants of the application
*/
public class ApplicationConstants {
public static final long SPLASH_TIME_OUT = 2000;
public static String APP_NAME = "UEBook";
//region prefs constants
public static String USERNAME = "username";
public static Str... |
Java | MacCentralEurope | 2,562 | 3.5 | 4 | [] | no_license | /*
Busiest Time in The Mall
The Westfield Mall management is trying to figure out what the busiest moment at the mall was last year. Youre given data extracted from the malls door detectors. Each data point is represented as an integer array whose size is 3. The values at indices 0, 1 and 2 are the timestamp, the co... |
Python | UTF-8 | 1,422 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # coding=utf-8
"""Test cases for posts"""
from tentd.documents import Post
from py.test import raises, mark
def test_post_owner(entity, post):
"""Assert the post has the correct owner"""
assert post in Post.objects(entity=entity)
assert post == Post.objects(entity=entity).first()
assert post.entity ==... |
Markdown | UTF-8 | 2,443 | 2.71875 | 3 | [] | no_license | # BASH技巧
1.重定向
```
echo "Chenfan@38" | passwd --stdin root >/dev/null # 无意义的信息丢到黑洞去
id chenfan >> user 2>> error # 错误信息输出到error,有用的信息输出到user中
```
2.自定义变量
```
read -p "Pls input a number: " P_number
echo $P_number
```
3.正则表达式
```
. 匹配单个字符
* 匹配前一个字符出现零次或多次
.* 匹配任意多个任意字符
[] 匹配集合中的任意单个字符,括号中为一个集合
[x-y] 匹配连续的字符串范围
\... |
C++ | UTF-8 | 385 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef TRANSFORM_COMPONENT_HEADER
#define TRANSFORM_COMPONENT_HEADER
#include "components.h"
#include "../vector2d.h"
class TransformComponent : public Component
{
public:
Vector2D position;
TransformComponent(){
position.x = 0.0f;
position.y = 0.0f;
}
TransformComponent(float x, float y){
position.x =... |
C | UTF-8 | 901 | 4.46875 | 4 | [] | no_license | /* Write a program that asks the user to enter a fraction, then reduces
the fraction to lowest terms. Hint: To reduce a fraction to lowest terms,
first compute the greatest common denominator of the numerator and
denominator. Then divide both the numerator and denominator by the GCD.*/
#include<stdio.h>
/* ... |
Java | UTF-8 | 9,781 | 2.84375 | 3 | [] | no_license | package se.edument;
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
/**
* NorthwindRepo repository class
*/
public class NorthwindRepo {
private Connection dbconn;
private Boolean inTransaction = false;
/**
... |
SQL | UTF-8 | 189 | 3.71875 | 4 | [] | no_license | SELECT properties.city AS city,
count(properties.city) AS total_reservations
FROM reservations
JOIN properties ON property_id = properties.id
GROUP BY city
ORDER BY total_reservations DESC; |
C++ | UTF-8 | 608 | 2.71875 | 3 | [] | no_license | #include "Approx_func_fabr.h"
const shared_ptr<Approx_func> Approx_func_fabr::create_approx_func(const vector<pair<double, double>> &args_and_vls, Methods method){
if (method == Step) return shared_ptr<Approx_func>(new Simple_interpol(args_and_vls));
if (method == Linear) return shared_ptr<Approx_func>(new Lin... |
Java | UTF-8 | 3,286 | 1.90625 | 2 | [
"Apache-2.0"
] | permissive | package net.pladema.clinichistory.hospitalization.controller.mapper;
import net.pladema.clinichistory.hospitalization.controller.dto.InternmentGeneralStateDto;
import net.pladema.clinichistory.hospitalization.controller.dto.internmentstate.DiagnosesGeneralStateDto;
import net.pladema.clinichistory.hospitalization.cont... |
Java | UTF-8 | 1,060 | 3.546875 | 4 | [] | no_license | package day19arraylist;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class List03 {
public static void main(String[] args) {
//2.d way to create a list
List<String> list= new ArrayList<>();
list.add("A");
list.add("B");
list.add("C");
list.add("D");
l... |
Markdown | UTF-8 | 2,016 | 3.1875 | 3 | [] | no_license | # Nesting Subroutines and the Stack
- Call instructions are branch instructions that do a bit more
- Is the size of the link register the size of the stack? No the stack could be huge.
- A link register is just yet just another register -> dedicated to holding return addresses
- How many addresses will there be? D... |
Java | UTF-8 | 1,908 | 2.203125 | 2 | [] | no_license | package fpoly.java5.assignment.controller;
import fpoly.java5.assignment.model.User;
import fpoly.java5.assignment.modelform.UserLoginForm;
import fpoly.java5.assignment.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.spri... |
Markdown | UTF-8 | 499 | 2.734375 | 3 | [
"MIT"
] | permissive | #will I have this pleasure, my master being old also?
You may want to add "of having a baby" (UDB). Sarah used this rhetorical question because she did not believe that she could have a child. This means "I cannot believe that I will experience the joy of having a child. My master is also too old." (See: [[:en:ta:vol1... |
Java | UTF-8 | 719 | 2.859375 | 3 | [] | no_license | import javax.swing.plaf.synth.SynthScrollBarUI;
public class RotationPoint {
public RotationPoint(){
String [] input = {"ptolemaic",
"retrograde",
"supplant",
"undulate",
"xenoepist",
"asymptote",
"babka",
"banoffee",
"engender",
"karpa... |
Java | UTF-8 | 14,147 | 1.820313 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later... |
Java | UTF-8 | 15,813 | 2.1875 | 2 | [] | no_license | package com.chatRobot.controller;
import com.chatRobot.model.*;
import com.chatRobot.service.impl.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframewor... |
Java | UTF-8 | 3,516 | 2.53125 | 3 | [] | no_license | package com.mead.android.crazymonkey.build;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.mead.android.crazymonkey.AndroidEmulator;
import com.mead.android.crazymonkey.Androi... |
Python | GB18030 | 1,051 | 3.078125 | 3 | [
"Artistic-2.0"
] | permissive | # -*- coding: cp936 -*-
# ܣͼԤֲֵȡ
# ŵocrĿ¼
# ļΪԭ֤ļļ
import cv2
import os
def read_img(fn):
'''
õ֤ͼ
:param fn:ͼļ·
:return:ͼ
'''
return cv2.imread(fn)
def write_img(im, fn):
cv2.imwrite(fn, im)
def get_text_img(im):
'''
õͼеı
'''
return im[3:22, 127:184]
def binarize(im):... |
Java | UTF-8 | 1,045 | 2.609375 | 3 | [] | no_license | package com.bragi.mvplcapp.data.entities;
import android.support.annotation.NonNull;
import java.util.Collections;
import java.util.List;
/**
* A model of a Car brand, containing all information related to it. The names of the
* car brand founders are stored as a list of the specific CarBrandFounder model.
*/
pub... |
C# | UTF-8 | 4,456 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace WebApi.Models
{
public class Result
{
public List<StudentResult> GetResults(StudentSearchAttribute searchAttributeData)
{
if (searchAttributeData.MaxRange == 0)
{
... |
TypeScript | UTF-8 | 4,540 | 2.609375 | 3 | [] | no_license | import DebugLog from './debuglog'
const fspromises = window.require('fs/promises')
export async function OpenFileHandle(filepath: string): Promise<{ handle: any; error: string }> {
const result: { handle: any; error: string } = { handle: undefined, error: '' }
const fileHandle = await fspromises.open(filepath, 'r... |
PHP | UTF-8 | 5,812 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
include('_pre.php');
include('Common/Common/function.php');
include('helper.php');
include('fill_function.php');
include('filter_function.php');
/**
* 生成验证码
* @param array $config
* @return
*/
function create_verify_code(array $config) {
$Verify = new \Think\Verify($config);
return $Verify->entry()... |
Java | UTF-8 | 1,219 | 2.609375 | 3 | [] | no_license | package nl.ipsen3server.resources;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import nl.ipsen3server.controllers.LoggingController;
import nl.ipsen3server.models.LogModel;
/**
* @author Anthony Schuijlenburg
*/
@Path("/log")
public class LogResource {
private Lo... |
C++ | UTF-8 | 2,027 | 2.890625 | 3 | [] | no_license | // InputProccesor.h --------------------------------------------------------
// Shayan Raouf CSS343 Section Number
// Creation Date: 2/22/2016
// Date of Last Modification: 2/19/2016
// ----------------------------------------------------------------------------
// Purpose - The input Proccessor class proccess the thre... |
Java | UTF-8 | 1,123 | 2.046875 | 2 | [] | no_license | package com.aiyi.blog.entity;
import com.aiyi.core.annotation.po.ID;
import com.aiyi.core.annotation.po.TableName;
import com.aiyi.core.annotation.po.vali.Validation;
import com.aiyi.core.annotation.po.vali.enums.ValidationType;
import com.aiyi.core.beans.PO;
import com.aiyi.core.util.MD5;
@TableName(name = "blog_use... |
C# | UTF-8 | 5,088 | 2.5625 | 3 | [] | no_license | // ----------------------------------------------------------------------------
// <copyright file="UnitOfWorkInterceptionBehavior.cs" company="SOGETI Spain">
// Copyright © 2016 SOGETI Spain. All rights reserved.
// MVVM Course by Óscar Fernández González a.k.a. Osc@rNET.
// </copyright>
// ------------------... |
JavaScript | UTF-8 | 280 | 2.78125 | 3 | [] | no_license | const [, , path] = process.argv;
const fs = require('fs');
fs.readFile(path, 'utf8', (err, data) => {
if (err) throw err;
//подсчет количества строк в файле
const rowCount = data.split('\n').length - 1;
console.log(rowCount);
});
|
Python | UTF-8 | 1,010 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | """The runner takes brain damage."""
from csrv.model.actions import action
from csrv.model import cost
from csrv.model import errors
from csrv.model import events
from csrv.model import game_object
from csrv.model import modifiers
from csrv.model import parameters
class TakeBrainDamage(action.Action):
DESCRIPTION... |
Java | UTF-8 | 1,700 | 3.609375 | 4 | [] | no_license | package net.jcip.examples.chapter5;
import java.util.*;
/**
* * @Author: cuixin
* * @Date: 2019/8/15 16:00
*/
public class UnsafeListIterator5_5 {
public static void main(String[] args) {
//错误演示,Arrays.asList里面没有实现remove等操作。
// List<String> source = Arrays.asList("Hello", "world");
List<... |
JavaScript | UTF-8 | 875 | 3.890625 | 4 | [] | no_license | var noofticket = 5;
var buyticket = prompt("Enter Your Total Ticket : ");
var eachprice = 200;
var disprice = 50;
function ticket(theory, ...rest) {
if(rest[2] < 5)
{
rest[3] = 0;
return `${theory[0]} ${rest[0]} ${theory[1]} ${rest[1]}
${theory[2]} ${rest[2]} ${theory[3]} ${rest[3]} ${theory[4]}`;
}else{
r... |
Python | UTF-8 | 12,447 | 2.6875 | 3 | [] | no_license | ## Assembler
import logging
import coloredlogs
import glob
import os
import sys
from ctypes import c_uint8
fmt = '[{levelname:7s}] {name:s}: {message:s}'
logger = logging.getLogger(__name__)
coloredlogs.DEFAULT_FIELD_STYLES['levelname']['color'] = 'white'
if len(sys.argv) >= 2 and sys.argv[1] in ['-d', '--debug']:
... |
Markdown | UTF-8 | 603 | 3.203125 | 3 | [] | no_license | # Confidence
Confidence brings people together - people generally want to talk to confident people
The problem with this is that is it makes it seem like confidence is some type of magic, when if fact confidence just stems from your comfort in a particular subject, which you get from your experience with that subject... |
JavaScript | UTF-8 | 1,989 | 4.125 | 4 | [] | no_license | console.time('computation');
/**
* Checks if a number is prime or not
* @param num - Number in consideration
* @returns {boolean} - True for prime, false for non-prime
*/
function isPrimeNumber(num) {
if (num <= 1) { // Numbers below or equal to 1 are all non-prime
return false;
}
var sqrtNum =... |
Java | UTF-8 | 1,838 | 2.3125 | 2 | [] | no_license | package com.hangman.sinapse.hangman;
import java.util.Random;
/**
* Created by Jerry Jr on 26/02/2018.
*/
public class Palavras {
private String[] temas = new String[] {"animais","paises","frutas","esportes"};
private String[] palavras = new String[] {"AVIÃO", "AERONAVE", "AUTOMÓVEL",
"MOTOCICLE... |
Shell | UTF-8 | 1,313 | 3.234375 | 3 | [] | no_license | ### Bootstrapping
# Install/configure SPF13 vim setup
_PROFILE=1
SPF="$HOME/.spf13-vim-3"
if [ ! -d $SPF ]; then
git clone --depth=1 https://github.com/spf13/spf13-vim.git $SPF
[ -z ${MSYSTEM+x} ] && sh $SPF/bootstrap.sh || printf "spf13 downloaded. Please complete installation using one of the bootstrapping sc... |
PHP | UTF-8 | 5,572 | 2.890625 | 3 | [] | no_license |
<?php
include "db.php";
mysql_select_db($mysql_database, $dbuser) or exit('Error Selecting database: '.mysql_error()); ;
/* user config variables */
$max_items = 7; /* max number of news items to show */
/* make database connection */
// $db = mysql_connect ('localhost','root','Berskin99');
//mysql_sel... |
Python | UTF-8 | 1,909 | 2.75 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 28 18:44:13 2020
@author: generalguy26
"""
#nds audio info can be found at https://www.akkit.org/info/gbatek.htm
import audioread
import struct
import codec
with audioread.audio_open('song.wav') as f: #audioread has little endian pcm16 values
state = None
data... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.