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,047 | 2.796875 | 3 | [] | no_license | #ifndef SELLER_H
#define SELLER_H
#include <QtCore>
#include <QSqlDatabase>
class Seller
{
public:
static bool Init();
static bool End();
static QSharedPointer<Seller> CreateById(long id);
static bool Modify(const QList<Seller> &sellers);
static QSharedPointer<QList<Seller>> getSellers();
sta... |
Java | UTF-8 | 249 | 2.875 | 3 | [] | no_license | package Patterns;
/*
*****
****
***
**
*
*/
public class pattern2
{
public static void main(String[] args)
{
for (int i=7; i>=1; i--)
{
for(int j=1; j<=i;j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
|
C++ | UTF-8 | 350 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
double PI = 2*acos(0);
double a;
while (cin >> a) {
double Z = a*a*(1 - (sqrt(3)/4.0) - (PI/6.0));
double Y = a*a - a*a*(PI/4.0) - 2*Z;
double X = a*a - 4*Y - 4*Z;
printf("%.3f %.3f %.3f\n", X, 4*Y, 4*... |
Java | UTF-8 | 567 | 2.359375 | 2 | [] | no_license | package com.droukos.userservice.environment.enums.topological.europe.greece.cities;
import static com.droukos.userservice.environment.enums.topological.europe.greece.provinces.Attica.ATHENS;
public enum Athens {
ZOGRAFOU(ATHENS.getCode()+"1.", ATHENS.query()+"Zografou "),
;
private final String code;
... |
Markdown | UTF-8 | 2,747 | 3.0625 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive | ---
title: File upload in Next.js and TypeScript
date: "2021-02-16"
template: "post"
draft: false
slug: "nextjs-upload"
category: "Services"
tags:
- "WebDev"
- "Services"
- "NextJS"
description: "Sharing the solution of how to create an API in Next.js that supports file upload. I hit issues that are sorted ... |
Markdown | UTF-8 | 1,539 | 2.859375 | 3 | [] | no_license | # [Virtual Consoles and Terminals](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/consoles.html)
## Virtual Consoles
The key combinations Alt+F1 through Alt+F8 have been reserved by FreeBSD for switching between virtual consoles.
Use Alt+F1 to switch to the system console (ttyv0), Alt+F2 to access the fi... |
C++ | UTF-8 | 1,322 | 3.28125 | 3 | [] | no_license | #include <map>
// ============
// class Option
// ============
class Option {
friend class OptionParser;
public:
enum Type {
BOOL,
INT,
DOUBLE,
STRING
};
Option(char flag, Type type);
bool asBool() const { return d_value.b; }
int asInt() con... |
Python | UTF-8 | 164 | 3.40625 | 3 | [] | no_license | a=int(input("Enter the number"))
b=int(input("Enter the number"))
c=int(input("Enter the number"))
if a==b and b==c and c==a:
print((a+b+c)*3)
else:
print(a+b+c) |
JavaScript | UTF-8 | 271 | 3.265625 | 3 | [] | no_license | function intro(name, job) {
console.log(`My name is ${name} and I am a ${job}`);
}
// .apply(valueForThis, arrayOfArgs)
intro.apply(undefined, ["Blake", "Software Engineer"]);
// .call(valueForThis, arg1, arg2, ...)
intro.call(undefined, "BLake", "Software Engineer");
|
JavaScript | UTF-8 | 737 | 2.828125 | 3 | [
"MIT"
] | permissive | /** @flow */
require('./styles.css');
import React from 'react';
var {PropTypes} = React;
class Answer extends React.Component {
constructor() {
super();
this.handleClick = this.handleClick.bind(this);
}
handleClick() {
this.props.onSelected(this.props.item);
}
render(): ?ReactElement {
... |
C++ | UTF-8 | 3,748 | 2.640625 | 3 | [] | no_license |
//////////////////////////////////////////////////////////////////////////////////////////
// ccipd includes
#include "ccipdCalculateDICE.h"
#include "ccipdPrepareMaskForEvaluation.h"
#include "ccipdDisableWarningsMacro.h"
// itk includes
// see http://www.itk.org/pipermail/insight-users/2008-May/026060.html
... |
Java | UTF-8 | 1,315 | 1.875 | 2 | [
"MIT"
] | permissive | /*
* Copyright 2017 Abed Tony BenBrahim <tony.benrahim@10xdev.com>
* and Gwt-JElement project contributors.
*
* 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.o... |
Java | UTF-8 | 3,841 | 2.4375 | 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 codecheck.data;
import codecheck.CodeCheckApp;
import djf.components.AppDataComponent;
import static djf.settings.App... |
Java | UTF-8 | 954 | 2.453125 | 2 | [
"Apache-2.0"
] | permissive | package com.example.joyh.arduinoAssistant.domain.interactors.impl.homepage;
import com.example.joyh.arduinoAssistant.domain.interactors.base.Interactor;
import com.example.joyh.arduinoAssistant.domain.model.impl.CollectionModel;
import java.util.List;
/**
* Created by joyn on 2018/9/17 0017.
* 用例1:已收藏的项目列表
*/
pu... |
Java | UTF-8 | 2,795 | 2.453125 | 2 | [
"Apache-2.0",
"GPL-2.0-only",
"EPL-2.0",
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"Classpath-exception-2.0"
] | permissive |
package com.commercetools.api.models.cart_discount;
import java.util.*;
import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;
/**
* CartDiscountValueRelativeDraftBuilder
* <hr>
* Example to create an instance using the builder pattern
* <div class=code-example>
* <pre><code cl... |
Markdown | UTF-8 | 3,429 | 3.09375 | 3 | [] | no_license | # 万户,卒于2020 | 抬杠工程
翻一条旧闻出来,可能大家还有一点印象:

这条新闻的标题可能存在于各位的屏幕上三秒钟就被划过了,估计在大家脑子里留下的印象就是美国人反智至此,居然傻到能把自己摔死,哈哈哈,美药丸,中必赢,等等等等
2022年的我再次看到了这个新闻,这次我认真看了一下这个疯狂发明家的人生,看起来和三秒划过标题的效果完全不一样
1969年,人类迈出了一大步。1956年出生,时年13岁的迈克·休斯,应该同众多那个年代的同龄人一样,受到了巨大的震撼,甚至将当宇航员视为毕生理想,就像《神偷奶爸》中这个镜头表现的这样:

{
player.health = Convert.ToInt32((player.health - 1.5 * magicAbility));
... |
C++ | UTF-8 | 601 | 2.859375 | 3 | [] | no_license | #include "TokenStream.hpp"
TokenStream::TokenStream(Lexer& l)
:_lexer(l)
,_idx(0)
{
token_t tok;
do
{
tok = l.getTok();
_tokens.push_back(tok);
}
while( !(tok->getType() & (t_Unknown|t_End)) );
}
TokenStream::~TokenStream()
{
}
token_t TokenStream::peek_prev() const
{
return _tokens[_idx-1];
}
token_t Tok... |
Python | UTF-8 | 375 | 3.6875 | 4 | [] | no_license | b = True
while b:
try:
inp = int(input('請輸入整數:'))
print('{0} 為 {1}'.format(inp, '奇數' if inp % 2 else '偶數'))
b = False
except ValueError:
print('請輸入整數!')
except EOFError:
print('程式中斷')
b = False
except:
print('不明程式中斷')
b = False
print('再見~')... |
Java | UTF-8 | 929 | 2.875 | 3 | [] | no_license | package com.brightcove.player.model;
public class Span extends StyledElement {
private String text;
public Span() {
}
public Span(StyledElement styledElement) {
if (styledElement != null) {
this.id = styledElement.getID();
this.styleName = styledElement.getStyleName();... |
Java | UTF-8 | 618 | 2.234375 | 2 | [] | no_license | package com.thales.dataproject.restservice.responses;
import java.util.List;
import com.thales.dataproject.restservice.models.WaypointAggregatedModel;
public class TopWaypointResponse {
private String airport;
private List<WaypointAggregatedModel> topWaipoints;
public TopWaypointResponse(String airportI... |
Java | UTF-8 | 880 | 2.703125 | 3 | [] | no_license | package model.cards.cardsActions.magicActionChildren;
import model.cards.cardsActions.Action;
import model.enums.GameEnums.SideOfFeature;
import model.gameprop.Player;
import model.gameprop.gamemodel.Game;
import model.gameprop.turnBasedObserver.AvoidDrawingForSomeTurnsObserver;
public class AvoidOpponentsCardDraw ex... |
C# | UTF-8 | 1,346 | 3.375 | 3 | [] | no_license | using System;
using System.IO.Pipes;
namespace ExcelClassLibrary
{ public struct Index
{
public int column;
public int row;
}
static public class TwentySixNumeralSystem
{
public static string ToTwentySixBasedNumeralSystem(int i) {
string res = "";
i... |
SQL | UTF-8 | 5,328 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 19, 2020 at 11:13 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
Java | UTF-8 | 4,548 | 2.484375 | 2 | [] | no_license | package com.naver.dbsample2;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.Bundle;
import android.util.Log... |
Markdown | UTF-8 | 887 | 3.203125 | 3 | [] | no_license | What if you want to configure your game to use `velocity` for most animations, but you wanted `popmotion` to handle your text animations? That's possible using configuration tiers like so:
```js
{
all: {
attrs: {
animator: 'velocity'
}
},
component: {
stage: {
direction: {
text: {... |
Python | UTF-8 | 4,485 | 3.0625 | 3 | [] | no_license | import os
import numpy as np
import pandas as pd
from configure import *
from utils import *
def sample_minibatch(data, batch_size=100, training=False):
"""
Sample minibatch from dataset
Input:
- data
- batch_size:
- training: Boolean;
Return:
-
"""
pa... |
PHP | UTF-8 | 1,077 | 3.0625 | 3 | [] | no_license | <?php
session_start(); //開啟session
header("Content-type: image/png"); //宣告此檔案將產生png
$_SESSION['captcha'] = ""; //宣告:session的變數名稱為captcha,內容為空值
$image = imagecreatetruecolor(84, 24)
or die("Cannot Initialize new GD image stream"); //設定圖片的寬度為84px、高度為24px,或是若系統不支援GD則停止執行
$transparent = imagecolorallocatealpha($... |
Markdown | UTF-8 | 291 | 3.15625 | 3 | [] | no_license | # 201. 数字范围按位与
> 给定范围 [m, n],其中 0 <= m <= n <= 2147483647,返回此范围内所有数字的按位与(包含 m, n 两端点)。
```
示例 1:
输入: [5,7]
输出: 4
示例 2:
输入: [0,1]
输出: 0
```
## 解决办法:
1. 利用左右位移来做
|
Java | UTF-8 | 6,574 | 2.515625 | 3 | [] | no_license | package com.jlsoft.framework.pi.convertor.map;
import com.jlsoft.framework.pi.convertor.map.MapMappingConvertor;
import com.jlsoft.framework.pi.api.AbstractConvertor;
import com.jlsoft.framework.pi.api.IDataProcessor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.sql.Timestamp;
import ja... |
JavaScript | UTF-8 | 4,167 | 2.640625 | 3 | [] | no_license | var crypto = require('./crypto.js')
var db = require('./database.js')
var middleware = require('./middleware.js')
var Promise = require('promise')
var sha256 = require('sha256')
exports.create_entry = function(data){
var userSecret = data['userSecret']
var spec_length = data['password_spec']['le... |
Java | UTF-8 | 680 | 3 | 3 | [] | no_license | package test.misc;
import java.io.FileWriter;
import java.io.IOException;
public class PrintIntoFileTest {
/**
* @param args
*/
public static void main(String[] args) {
FileWriter out = null;
try {
out = new FileWriter("output/output.txt");
out.write("test 2");
out.flush();
whil... |
SQL | UTF-8 | 744 | 3.84375 | 4 | [] | no_license | \echo
\echo > Creating view table_dependency
\echo
create or replace view table_dependency
(
table_catalog,
table_schema,
table_name,
r_table_catalog,
r_table_schema,
r_table_name
)
as
select distinct
a.table_catalog as table_catalog,
a.table_schema as table_schema,
a.table_na... |
Python | UTF-8 | 1,781 | 2.640625 | 3 | [
"MIT"
] | permissive | import logging
from unittest import TestCase
import pandas as pd
import pandas_ml_utils as pmu
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
logging.info(f"{pmu.__version__}")
class TestFetchYahoo(TestCase):
def test__with_prefix(self):
"""when"""
df = pd.fetch_yahoo(spy="spy", vi... |
Java | UTF-8 | 9,742 | 2.21875 | 2 | [] | no_license | package com.example.android.server;
import java.io.OutputStreamWriter;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.util.Log;
import com.example.android.database.QuestionAnswerDbAdapter;
import com.example.android.da... |
Python | UTF-8 | 14,679 | 2.796875 | 3 | [
"MIT"
] | permissive |
# #######################################################################
#
# Task : WordDocument Interaction
#
# #######################################################################
"""
Creates the autoIT stub code to be passed into the master compile
: Takes a supplied text file for the Sheepl to type
: th... |
C# | UTF-8 | 6,532 | 2.578125 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class GameDetails : GameState {
public static bool isPaused;
public static int numberOfGames = 17; //Total number of games currently implemented
public static string timeLeft;
//Holds the deta... |
Markdown | UTF-8 | 2,491 | 2.609375 | 3 | [
"MIT"
] | permissive | ## JhtBannerScrollView
### 先上图,看一下是否符合你的场景吧!
<img src="https://raw.githubusercontent.com/jinht/BannerScrollView/master/ReadMEImages/Gif/1.gif" width=240 height=426 />
### Function Description
1. 无限循环自动滚动卡片
2. 三段式循环滚动广告卡片
### how to use
#### 1. podfile
```oc
platform:ios, '8.0'
target '*****' do
pod 'JhtBanne... |
Ruby | UTF-8 | 224 | 3.265625 | 3 | [] | no_license | # i = 0
# loop do
# i += 2
# puts i
# if i == 10
# break #this will cause execution to exit the loop
# end
# end
i = 0
loop do
i += 2
puts i
if i == 10
break # this will cause execution to exit the loop
end
end
|
Java | UTF-8 | 1,886 | 2.25 | 2 | [] | no_license | package com.example.hoangdang.diemdanh.timeTable;
import android.content.Context;
import android.support.v4.content.ContextCompat;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import an... |
Java | UTF-8 | 539 | 2.109375 | 2 | [] | no_license | package com.selenium.popups;
import java.io.IOException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class WindowPopup {
static{
System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver.exe");
System.setProperty("webdriver.gecko.driver", ... |
Markdown | UTF-8 | 23,601 | 3.3125 | 3 | [
"Apache-2.0"
] | permissive | ---
title: '[Guava Cache] Guava Cache'
catalog: true
date: 2020-04-30 19:05:04
subtitle: Guava provides a very powerful memory based caching mechanism by an interface LoadingCache<K,V>...
header-img: /img/guava/guava_bg.png
tags:
- Guava Cache
---
`Guava Cache` 是在内存中缓存数据,相比较于数据库或 `redis` 存储,访问内存中的数据会更加高效。`Guava` 官网介绍,... |
Java | UTF-8 | 15,402 | 2.25 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | 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 ... |
TypeScript | UTF-8 | 1,274 | 2.984375 | 3 | [] | no_license | import { IInputState, IValidationResult, IValidator, ValidationRule } from '../models/common';
export const lengthValidator: IValidator = (rule: ValidationRule, value: string, inputState: IInputState) => {
const result: IValidationResult = {
valid: true,
ruleName: rule.name,
};
let errorMsg... |
Java | UTF-8 | 1,646 | 3.1875 | 3 | [
"MIT"
] | permissive | import java.util.*;
public class LogsAggregator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Map<String, TreeSet<String>> userIpAddresses = new HashMap<>();
Map<String, Integer> userDurations = new TreeMap<>();
int n = Integer.parseInt(scann... |
Python | UTF-8 | 6,890 | 2.71875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
@author: WavEC Offshore Renewables
email: boris.teillant@wavec.org; paulo@wavec.org
This module is part of the characterization step in the WP5 methodology. It
contains feasibility functions to compute the minimum logistic requirements to
carry out the different logistic phases. This... |
Markdown | UTF-8 | 5,182 | 2.828125 | 3 | [] | no_license | # OpenStreetMap Data Case Study
## Map Area
Greenwich, Stamford, Norwalk, Bridgeport, CT, United States
- <https://www.openstreetmap.org/relation/3306055#map=11/41.0794/-73.455>
- <https://mapzen.com/data/metro-extracts/your-extracts/b76db9fc4894>
I live in Stamford, so I am interested to see what I could find from... |
C# | UTF-8 | 1,684 | 3.1875 | 3 | [
"MIT"
] | permissive | using System;
namespace Texter
{
public class TextEffect : ITextRenderer
{
public delegate Character Func(int x, int y, Character input);
public uint Width { get; private set; }
public uint Height { get; private set; }
private ITextRenderer _renderer;
private Func _ef... |
JavaScript | UTF-8 | 2,621 | 2.609375 | 3 | [] | no_license | require('./imagecarousel')
require('./animations')
AOS.init();
$(document).ready(function(){
// Load "default" menu item section and apply active style
$('.pizzas').addClass('active');
$('.menu-content-container').load('pizzas.html')
// Mobile nav slider
$('.mobile-menu').click(function() {
$('nav')... |
Java | UTF-8 | 1,199 | 3.90625 | 4 | [] | no_license | package JiCheng;
import java.util.Scanner;
/**
* 继承的初步学习
*/
class Person{
private String name;
private int age;
public String getName(){
return this.name;
}
public void setName(String name1){
this.name = name1;
}
public int getAge(){
return this.age;
}
... |
Python | UTF-8 | 382 | 3.859375 | 4 | [] | no_license | def pennies():
sum=0.0
total=0
penniespn=5
nickel=0.05
P=input("enter the prices: ")
while(P!=""):
sum=sum+float(P)
P=input("enter the prices: ")
print(f"total payable amount is:{sum}")
round=sum*100%penniespn
if(round<penniespn/2):
cash_total=round/100
else:
cash_total=total+nickel-r... |
Markdown | UTF-8 | 21,594 | 3.453125 | 3 | [
"MIT"
] | permissive | # 说明文档
## 快速开始
这个库的灵感来自于一个全键可编程的小键盘,那个键盘可以通过按键切换不同的配置,9个按键可以当成36个快捷键使用。本来想买的,但是想想对我真没啥用,就干脆写了这么一个库模拟体验一下。
```python
import time
from xyw_macro import *
def func1():
"""命令函数1"""
time.sleep(4)
print('func1')
def func2():
"""命令函数2"""
print('func2')
def func3():
"""命令函数3"""
print('f... |
Java | UTF-8 | 1,013 | 2.921875 | 3 | [] | no_license | package hu.nive.ujratervezes.zarovizsga.workhours;
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
public class WorkHours {
public String minWork(String file) {
Path path = Path.of(file);
try (BufferedReader reader = Files.newBuffe... |
C++ | UTF-8 | 2,086 | 3.25 | 3 | [] | no_license | //=============================================================================
// ilist.cpp - файл с реализациями методов списка команд
//=============================================================================
#include "ilist.h"
// Добавление очередной команды в голову списка
void InstructionList::addInstructi... |
Markdown | UTF-8 | 1,037 | 3.890625 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: x 的平方根#69
category: 算法
tags: C
description: x 的平方根#69
---
### 目标
实现 `int sqrt(int x)` 函数。
计算并返回 `x` 的平方根,其中 `x` 是非负整数。
由于返回类型是整数,结果只保留整数的部分,小数部分将被舍去。
示例 `1:`
输入: 4
输出: 2
示例 `2:`
输入: 8
输出: 2
说明: 8 的平方根是 2.82842...,
由于返回类型是整数,小数部分将被舍去。
实现:
//C style
int mySqrt(int x) {
... |
Java | UTF-8 | 416 | 2.625 | 3 | [] | no_license | package com.bradnon.pattern2.strategy.origin;
/**
* @Description:
* @author: Brandon
* @date 2021/3/18 16:25
*/
public class StrategyTest {
public static void main(String[] args) {
Context context = new Context();
context.setStragety(new ConcreteStragetyA());
context.stargetyMethod();
... |
Java | UTF-8 | 657 | 2.171875 | 2 | [] | no_license | package co.com.proyectobase.screenplay.tasks;
import co.com.proyectobase.screenplay.ui.OrangeHrm;
import net.serenitybdd.screenplay.Actor;
import net.serenitybdd.screenplay.Task;
import net.serenitybdd.screenplay.Tasks;
import net.serenitybdd.screenplay.actions.Click;
import net.serenitybdd.screenplay.actions.Open;
p... |
Go | UTF-8 | 3,952 | 2.765625 | 3 | [] | no_license | package controllers
import (
"net/http"
"log"
"strconv"
"encoding/json"
"github.com/gorilla/mux"
"github.com/kevinmartinda/extra-task-week3/models"
"github.com/kevinmartinda/extra-task-week3/config"
)
func FindAllCategories(res http.ResponseWriter, req *http.Request) {
log.Printf("/GET categories")
var categ... |
Java | UTF-8 | 1,418 | 2.3125 | 2 | [] | no_license | package com.jswiente.phd.prototype.batch.example;
import org.springframework.batch.item.file.mapping.FieldSetMapper;
import org.springframework.batch.item.file.transform.FieldSet;
import org.springframework.validation.BindException;
import com.jswiente.phd.prototype.domain.EventType;
import com.jswiente.phd.pr... |
Python | UTF-8 | 2,506 | 2.8125 | 3 | [] | no_license | arq_lista = open("wine.data", "r")
linhas = list(map(lambda linha : linha.replace("\n", ""), arq_lista.readlines()))
linhas = list(map(lambda linha: linha.split(','), linhas))
rng = 463
xs = list(map(lambda a : a[1:], linhas))
ys = list(map(lambda a : str(a[0]), linhas))
from keras.utils import np_utils
from sklear... |
SQL | UTF-8 | 20,494 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Май 13 2019 г., 11:03
-- Версия сервера: 8.0.12
-- Версия PHP: 7.2.10
--
-- База данных: `new_savior_of_this_world`
--
CREATE DATABASE IF NOT EXISTS `new_savior_of_this_world` DEFAULT CHARACTER SET utf... |
Swift | UTF-8 | 710 | 2.875 | 3 | [] | no_license | import UIKit
// Что бы видеть изменения параметров в storyboard используем @IBInspectable
@IBDesignable class AvatarViewCustom: UIView {
@IBInspectable var radius: CGFloat = 100 {
didSet{ setNeedsDisplay() }
}
override func draw(_ rect: CGRect) {
super.draw(rect)
... |
C# | UTF-8 | 1,173 | 2.953125 | 3 | [] | no_license | using System;
using WPFLocalizeExtension.Extensions;
namespace WpfLocalizationExtensionTest
{
public static class LangHelper
{
/// <summary>
/// 根据关键字获取当前语言环境下的提示信息
/// </summary>
/// <param name="key"></param>
/// <param name="resourceFileName"></param>
/// <param... |
Python | UTF-8 | 7,350 | 2.59375 | 3 | [] | no_license | import os
import glob
import codecs
import string
import re
import pymorphy2
import pickle
import collections
from operator import itemgetter
EXCLUDE_SYMBOLS = ['№', '«', 'ђ', '°', '±', '‚', 'ћ', '‰', '…',
'»', 'ѓ', 'µ', '·', 'ґ', 'њ', 'ї', 'џ', 'є', '‹',
'‡', '†', '¶', 'ќ', '€', ... |
Python | UTF-8 | 880 | 3.40625 | 3 | [] | no_license | import numpy as np #I need numpy for arrays
import matplotlib.pyplot as plt # I need this for plotting a graph
def c_accurate(f): #defining formulas
return 5*(f-32)/9 #returning the value i need
def c_aprox(f): #defining formula
return (f-30)/2 #returing the value i need
f_temp = np.linspace(-20, 120, 141) #d... |
TypeScript | UTF-8 | 1,425 | 2.921875 | 3 | [
"ISC"
] | permissive | import { expect } from 'chai';
import tsfv from '../src';
describe('between', () => {
it('passes within range', () => {
expect(tsfv.between(1, 10).test(1)).to.be.true;
expect(tsfv.between(1, 10).test(5)).to.be.true;
expect(tsfv.between(1, 10).test('5')).to.be.true;
expect(tsfv.between(1, 10).test(new... |
Swift | UTF-8 | 2,536 | 2.71875 | 3 | [] | no_license | //
// VenueTableViewCell.swift
// Foody
//
// Created by Vaibhav Singh on 20/05/18.
// Copyright © 2018 Vaibhav. All rights reserved.
//
import UIKit
import Kingfisher
protocol VenueTableViewCellDelegate: AnyObject {
func cellDislikeButtonTapped(disliked: Bool, itemWith id: String)
}
class VenueTableViewCell... |
Java | UTF-8 | 881 | 1.976563 | 2 | [] | no_license | package com.example.mysql;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView;
import android.os.Bundle;
public class DetailUserData extends AppCompatActivity {
TextView epf,name,email,password;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(... |
Python | UTF-8 | 2,585 | 2.859375 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
@author: Vaijyant Tomar
"""
########################## Question 2 #########################################
###############################################################################
from sklearn import datasets
import numpy as np
import matplotlib.pyplot as plt
iris = datasets.load_i... |
Markdown | UTF-8 | 427 | 2.609375 | 3 | [] | no_license | # Ancestry
Ancestry is an AngularJS module consisting of a number of directives allowing to generate interactive lineage plots based on [d3.js](https://d3js.org/). Currently, it offers following plots:
* Lineage
* Lineage-scatter
* Radial lineage
* Radial phylogenetic tree
To install Ancestry package with NPM use: `n... |
Java | UTF-8 | 886 | 1.789063 | 2 | [
"Apache-2.0"
] | permissive | package com.whenling.centralize.web;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import com.whenling.centralize.model.ExtensionEntity;
import com.whenling.module.domain.model.Result;
impor... |
Markdown | UTF-8 | 2,305 | 3.421875 | 3 | [
"MIT"
] | permissive | ### Button
```html
<button type="button" class="btn btn-primary">Первичный</button>
<button type="button" class="btn btn-secondary">Вторичный</button>
<button type="button" class="btn btn-success">Успех</button>
<button type="button" class="btn btn-danger">Опасность</button>
<center>* * *</center>
<button type="button... |
Python | UTF-8 | 2,807 | 3.390625 | 3 | [] | no_license | import pygame
import random
FPS = 20
width = 500
height = 500
cellsize = 5
alive = 1
dead = 0
last_x = int(width / cellsize)
last_y = int(height / cellsize)
# initialize new array
current_cells = [[random.randint(0, 1) for i in range(last_x)] for j in range(last_y)]
pygame.init()
screen = pygame.display.set_mode([wi... |
Markdown | UTF-8 | 3,709 | 2.96875 | 3 | [
"MIT"
] | permissive | # PAPR
PAPR is an educational web trading application designed for newbies to trade on the financial markets. The application is geared towards teachers and students, where teachers can create a room with a particular set of companies for students to trade virtual money. On creation of the room a unique URL is generat... |
Java | UTF-8 | 4,056 | 2.65625 | 3 | [] | no_license | package com.codavthesis.datacollector;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.text.format.Time;
import java.util.ArrayList;
import java.util.List;
/**
* ... |
Python | UTF-8 | 7,815 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | import gzip
import re
import pandas as pd
from typing import Optional, Generator, Any, Dict, Tuple
import yaml
from kgx.prefix_manager import PrefixManager
from kgx.config import get_logger
from kgx.source import Source
from kgx.utils.kgx_utils import (
validate_node,
sanitize_import,
validate_edge,
... |
Java | UTF-8 | 1,996 | 2.390625 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package pacman.alusta.test;
import org.junit.After;
import org.junit.AfterClass;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import pacman.alusta.Pelia... |
Python | UTF-8 | 160 | 3.53125 | 4 | [] | no_license | str1 = input()
for ch in str1:
if ord('a') <= ord(ch) <= ord('z') or ord('A') <= ord(ch) <= ord('Z'):
print(ch, end = '')
else:
continue |
PHP | UTF-8 | 2,710 | 2.6875 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace Niktux\Kafkaf\Persistence\Repositories;
use Niktux\Kafkaf\Persistence\DataTransferObjects as DTO;
use Niktux\Kafkaf\Domain as Domain;
use Doctrine\DBAL\Driver\Connection;
use Onyx\Persistence\DTOHydrators\ByField;
use Onyx\Persistence\Fields;
use Niktux\Kafkaf\Persistence\C... |
Java | UTF-8 | 637 | 3.03125 | 3 | [] | no_license | package lesson004.practice;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
File file1 = new File("D:\\IT\\java-professional\\src\\lesson004\\firstFile.txt");
BufferedReader br = null;
try {
br = new BufferedReader(new FileRea... |
C# | UTF-8 | 2,148 | 2.625 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace EffectControl
{
public class EffectPool : MonoBehaviour
{
EffectManager manager;
internal EffectLibrary library;
Transform poolGO;
Dictionary<string, List<Effect>> pool;
... |
Java | UTF-8 | 399 | 2.859375 | 3 | [] | no_license | package FactoryandAbstractFactoryPattern;
/**
* Created by ashah on 14/7/17.
*/
public class AbstractFactoryProducer {
public AbstractFactory getFactory(String choice) {
if (choice.equalsIgnoreCase("Shape"))
return new ShapeAbstractFactory();
else if (choice.equalsIgnoreCase("color"... |
Python | UTF-8 | 12,666 | 3.0625 | 3 | [] | no_license | import numpy as np
from scipy import linalg
from sklearn.preprocessing import normalize
#This function returns matrices p_0, p_\uparrow and p_\downarrow.
#n is total number of states (temperatures) for ON state of TCL.
#q is number of states (temperatures) in uncomfortable zone for ON state of TCL.
#epsilon is diffusi... |
Markdown | UTF-8 | 6,895 | 3.25 | 3 | [] | no_license | ---
mathjax: true
title: 2022 CCPC 绵阳现场赛 K Pattern Matching in A Minor Low Space 题解
date: 2022-11-20 19:11:04
tags:
- String
- KMP
categories:
- 字符串
---
## 题面
求模板串 $S$ 在 $T$ 中的出现次数。
其中 $1 \le |S|, |T| \le 10^7$.
时间限制 $5$ 秒, **内存限制** $\mathbf{1}$ MB, 且**输入只能读取一次**.
## 题解
~~KMP 模板题~~
题目让你在一个空间受限的背景下, 进行**流式字... |
C++ | UTF-8 | 1,316 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std ;
using ll = long long ;
string longest( string name ) {
int n = name.length() ;
int dp[n+1][n+1] ;
for( int i = 0 ; i <= n ; i++ ) {
for( int j = 0 ; j <= n ; j++ ) {
dp[i][j] = 0 ;
}
}
... |
Java | UTF-8 | 1,501 | 2.640625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package assimp.importer.xgl;
import org.lwjgl.util.vector.Vector2f;
import org.lwjgl.util.vector.Vector3f;
import assimp.common.DeadlyImportError;
import it.unimi.dsi.fastutil.floats.FloatArrayList;
import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
final class TempMesh {
final Int2IntOpenHashMap points = new I... |
Java | UTF-8 | 649 | 1.695313 | 2 | [] | no_license | package runner;
import com.intuit.karate.junit5.Karate;
public class APITestRunner {
@Karate.Test Karate test() {
//System.getProperty("user.dir")+"\\src\\test\\java\\requests");
String commonPath=System.getProperty("user.dir")+"\\src\\test\\java";
//String[] array= {"E:\\SeleniumWorkspa... |
Java | UTF-8 | 1,042 | 2.5 | 2 | [] | no_license | package com.zw.srdz.domain.author;
import com.alibaba.fastjson.JSONObject;
import com.zw.srdz.common.util.Encrypt;
/**
* 项目名称:srdz-domain
* 类名称:LoginContextEncrypt
* 类描述: 负责登陆上下文的 加密和解密工作
* 创建人:zhangwei
* 邮箱: zhangwei_2943@163.com
* 创建时间:2015-1-30 上午10:01:19
* 修改人:zhangwei
* 修改时间:2015-1-30 上午10:01:19
*... |
Java | UTF-8 | 2,066 | 2.21875 | 2 | [] | no_license | package com.phyapp.root.physiotherapy.ModelClass;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class ProfileShowModel {
@SerializedName("success")
@Expose
private Integer success;
@SerializedName("error")
@Expose
private Integer error;
... |
Java | UTF-8 | 1,053 | 1.796875 | 2 | [
"Apache-2.0"
] | permissive | /**
* www.bplow.com
*/
package com.bplow.netconn.systemmng.domain;
import com.bplow.netconn.base.dao.domain.PageImpl;
/**
* @desc
* @author wangxiaolei
* @date 2016年5月8日 下午5:01:50
*/
public class OrganizetionDomain extends PageImpl{
private String orgId;
private String orgName;
private Stri... |
Java | UTF-8 | 3,402 | 3.359375 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package LinearSystems.Jacobi;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
*
* @author Luisito S... |
C# | UTF-8 | 578 | 2.828125 | 3 | [
"MS-PL"
] | permissive | namespace SimpleMDXParser
{
using System;
public class MDXParserException : Exception
{
private MessageCollection m_Messages;
internal MDXParserException(Message m)
{
this.m_Messages = new MessageCollection();
this.m_Messages.Add(m);
}
inte... |
Python | UTF-8 | 1,719 | 4.125 | 4 | [] | no_license | """
Question: Number Of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.
Example 1:
Input: grid = [
... |
C | UTF-8 | 5,079 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <conio.h>
#include <ctype.h>
#include "arrayEmployees.h"
#define EMP 1000
void initializeEmployees (Employees list[])
{
int i;
for (i = 0; i < EMP; i++)
list[i].isEmpty = 0;
}
int findEmployeeById (Employees list[]... |
Shell | UTF-8 | 250 | 3.1875 | 3 | [] | no_license | #!/bin/sh
NODE=$(which node)
if [ ! -x $NODE ]; then
echo "ERROR: could not find 'node' in path"
exit 1
fi
echo "Running imperative/procedural app"
$NODE nodejs_example.js
echo
echo "Running pure function app"
$NODE nodejs_example_pure.js
|
Java | UTF-8 | 640 | 2.125 | 2 | [] | no_license | package com.duzi55.music.service.impl;
import com.duzi55.music.dao.AdminMapper;
import com.duzi55.music.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author :duzi55
* @date :Created in 2020/11/28 14:03
* @description:admin... |
Markdown | UTF-8 | 2,689 | 2.71875 | 3 | [] | no_license | 
**Paul Dresser** (1857 - 1906) Was born in Terre Haute Indiana. Born Paul Drieser, his brother was the famed novelist Theodore Dreiser (*Sister Carrie*, *An American Tragedy*). Dresser's father was a religeous man and urged his son to become a priest. Dresser however would have non of it and put ... |
C++ | UTF-8 | 801 | 2.625 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<algorithm>
using namespace std;
struct pp{
int length,number;
vector<int> c;
}q[10005];
int n,a,flag = 0;
bool rule(pp fir,pp sec)
{
if(fir.length > sec.length) return false;
else if(fir.length < sec.le... |
Python | UTF-8 | 209 | 3 | 3 | [] | no_license | import pandas as pd
def read_csv_to_datetime(file):
monthly_data= pd.read_csv(file,delimiter=",",header=0)
monthly_data["Date/Time"]=pd.to_datetime(monthly_data["Date/Time"])
return monthly_data
|
Java | UTF-8 | 9,442 | 1.648438 | 2 | [] | no_license | package com.moreclub.moreapp.packages.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.Vi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.