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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 448 | 2.796875 | 3 | [] | no_license | package org.wedu.demo1;
public class Student {
String name;
int age;
static String place;
public void study(){
System.out.println(this.name+"在学习");
}
public void doHomeWork(){
System.out.println(name+"在做作业");
}
public Student(){
place="中国";
}
}
//父类 ... |
Markdown | UTF-8 | 4,178 | 2.828125 | 3 | [
"MIT"
] | permissive |
# \<auth0-element\>[](https://www.webcomponents.org/element/johnlim/auth0-element)
A collection of Polymer V1.0 elements that makes it easy to declaratively use [Auth0](https://auth0.com).
> For Polymer V2.0, pleas... |
Java | UTF-8 | 2,888 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019-present Open Networking Foundation
*
* 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 appl... |
Python | UTF-8 | 3,693 | 3.40625 | 3 | [] | no_license | import os
import spacy
import string
import unidecode
from collections import Counter
def tuples_to_dicts(keys, list_of_tuples):
return [dict(zip(keys, values)) for values in list_of_tuples]
class Document:
def __init__(self, file_path):
# The name of the file is obtained
self._file_name = os... |
Python | UTF-8 | 332 | 4.03125 | 4 | [] | no_license | # Example 4-15. Two examples using shave_marks from Example 4-14
>>> order = '“Herr Voß: • ½ cup of Œtker™ caffè latte • bowl of açaí”.'
>>> shave_marks(order)
'“Herr Voß: • ½ cup of Œtker™ caffe latte • bowl of acai”.'
>>> Greek = 'Ζέφυρος, Zéfiro'
>>> shave_marks(Greek)
'Ζεφυρος, Zefiro'
|
Ruby | UTF-8 | 720 | 3.765625 | 4 | [] | no_license | # Included Modules
# Ruby version 2.4.0 introduced an Array#min method not available in prior versions of Ruby; we wrote this exercise before that release. To follow along, please use the documentation for Ruby 2.3.0:
# https://ruby-doc.org/core-2.3.0/Array.html
# Use irb to run the following code:
a = [5, 9, 3, 1... |
Markdown | UTF-8 | 3,355 | 2.71875 | 3 | [] | no_license | # openCMX
## The openCMX Standard
openCMX is a proposed Open Source, standardized, modular for factor and I/O specification for small, scalable, general computing devices.
**Goals**
The goal of openCMX is to establish an Open Sourced standard PCB and connector design for small low powered devices that allows an ind... |
C# | UTF-8 | 4,335 | 3.140625 | 3 | [
"MIT"
] | permissive | namespace Easy.Common.Extensions;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Linq;
/// <summary>
/// A set of extension methods for <see cref="Stream"/>.
/// </summary>
public static class StreamExtensions
{
private const cha... |
PHP | UTF-8 | 1,001 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | <?php
class ReverseArray implements ArrayAccess
{
private $start_index = 0;
private $internal_array = [];
/**
* @param uint $starting_index the starting point for the
* array. All accesses to the ReverseArray are calculated as
*
*
* $internal_array[$starting_index - $target]
*
* where $target is the index ... |
Markdown | UTF-8 | 3,217 | 2.6875 | 3 | [] | no_license | # xiaoyouMini
效友项目小程序端
主要实现如下功能
1用户注册功能:
本地校园学生用户通过省份、姓名(昵称)、专业、性别、学生证号码进行注册,通过审核后再进行爱好标签选择,如计算机、音乐等,注册完成后可使用本平台服务。
2用户登录功能:
本地校园学生用户注册成功后登录本平台使用服务,服务包括:需求发布\获取、二手物品信息上传、用户间即时通信、个人资料修改\查看等。
3搜索功能:
分为两个类型,即二手物品与技能服务,通过关键词限定,二手物品通过例如“二手书籍”“二手乐器”等进行搜寻,技能服务通过专业例如“计算机”“外语”“音乐”等进行搜寻,为用户提供整个平台的信息搜索功能,分别接旧物与技能需求的数据库,做到两边关键词不干扰... |
C++ | UTF-8 | 901 | 2.578125 | 3 | [
"Unlicense"
] | permissive | /**
* AUTEUR : Damien ROGÉ
* DATE : 19 JANVIER 2019
**/
#include <iostream>
#include <string>
#include <stdio.h>
#include "CSVParser.hpp"
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
using namespace std;
TEST_CASE( "CSVParser", "[]" ) {
... |
C++ | UTF-8 | 758 | 4.03125 | 4 | [] | no_license | /*
* Exercise 10.22: Rewrite the program to count words of size 6 or less using
* functions in place of the lambdas.
*
* By Faisal Saadatmand
*/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
bool check_size(const std::string &s, const std::string::size_type &s... |
Python | UTF-8 | 1,137 | 3.265625 | 3 | [] | no_license | import statistics
from single_point import parse
def parse_data(data_file_full_path):
""" This method parses the data into the final matrix [M x N] - called X matrix.
and Nx1 vector of classifier results - Y vector.
"""
final_x_matrix = list()
final_y_vector = list()
try:
... |
JavaScript | UTF-8 | 2,422 | 2.96875 | 3 | [] | no_license | import React from 'react';
class AddUser extends React.Component {
constructor(props) {
super(props);
this.state = {
user: {
firstName: '',
lastName: '',
username: '',
},
userExist: false
}
}
handleSubmit = (event) => {
event.preventDefault();
const... |
Java | UTF-8 | 2,250 | 2.453125 | 2 | [
"MIT"
] | permissive |
package mage.cards.m;
import java.util.UUID;
import mage.abilities.Mode;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.combat.CantBlockAllEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.IndestructibleAb... |
JavaScript | UTF-8 | 13,388 | 2.78125 | 3 | [
"MIT"
] | permissive | "use strict";
/**
* @module {connect.Behavior} can-connect/data/url/url data/url
* @parent can-connect.behaviors
* @group can-connect/data/url/url.data-methods data methods
* @group can-connect/data/url/url.option options
*
* @option {connect.Behavior}
*
* Uses the [can-connect/data/url/url.url] option to imple... |
Python | UTF-8 | 3,260 | 4.09375 | 4 | [
"MIT"
] | permissive | import unicodedata
class NormalizedStr:
'''
By default, Python's str type stores any valid unicode string.
This can result in unintuitive behavior.
For example:
>>> 'César' in 'César Chávez'
True
>>> 'César' in 'César Chávez'
False
The two strings to the right of the in keyword... |
Python | UTF-8 | 517 | 3.125 | 3 | [] | no_license | inFile = open('input.txt', 'r', encoding='utf8')
outFile = open('output.txt', 'w', encoding='utf8')
candidateDict = {}
for line in inFile.readlines():
candidate, votesCandidate = list(map(str, line.strip().split()))
if candidate not in candidateDict:
candidateDict[candidate] = 0
candidateDi... |
Markdown | UTF-8 | 2,901 | 2.640625 | 3 | [] | no_license | # Article 4
Les plafonds prévus par l'article D. 755-28 du code de la sécurité sociale sont fixés à :
a) Pour les allocataires occupant en location des locaux construits avant le 1er janvier 1976 :
Désignation : Personne isolée, Plafond : 908
Désignation : Ménage sans personne à charge : Plafond : 1 065
Désignatio... |
JavaScript | UTF-8 | 2,192 | 2.765625 | 3 | [] | no_license | var db = require('../db/mydb.js');
//loginに飛んできたときの処理がsaveStatusに入っている。
exports.login = function(req, res, next) {
var saveStatus;
if(req.session.saveStatus){
saveStatus = req.session.saveStatus;
delete req.session.saveStatus;
}else{
saveStatus = 'welcome';
}
res.render('login', { title: 'my chat app', stat... |
Markdown | UTF-8 | 1,015 | 2.890625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Uploading files using Python 3 in less than 100 lines
Simple server for listing file directory over HTTP, and uploading files.
Based on `http.server`, this module adds file upload functionality to it.
Just as with `http.server`, you SHOULD NOT use this module in
untrusted environment (such as servers exposed to the... |
Go | UTF-8 | 284 | 2.875 | 3 | [] | no_license | package detect
// App 会根据给定的目录发现application类型
func App(dir string, c *Config) (string, error) {
for _, d := range c.Detectors {
check, err := d.Detect(dir)
if err != nil {
return "", err
}
if check {
return d.Type, nil
}
}
return "", nil
}
|
C++ | WINDOWS-1250 | 1,273 | 3.25 | 3 | [] | no_license | #include "helper.h"
void processFile(student* &head, const string &fileName, int &counter)
{
ifstream file;
string subject;
string teacher;
string row;
file.open(fileName); //Wczytywanie protokow z parametru.
if (!file.good())
cout << "Nie udalo sie odczytac pliku" << endl; //Sprawdzanie poprawnoci odczy... |
Python | UTF-8 | 1,833 | 2.859375 | 3 | [] | no_license | import typing
class ReadMetricResponse:
def __init__(self, payload):
self.co2 = (payload[2] << 8) + payload[3]
self.temperature = payload[4] - 40
def __repr__(self):
return "co2: %d, temperature: %d" % (self.co2, self.temperature)
class SensorMixin(object):
READ_METRIC =... |
TypeScript | UTF-8 | 1,112 | 2.625 | 3 | [] | no_license | import SimpleLevel from "../lib/simple-level";
import { IncomingTransaction, IncomingTransactionJson } from "@interstatejs/tx";
export class IncomingTransactionsDatabase extends SimpleLevel {
length?: number;
constructor(dbPath?: string) {
super('incoming-transactions', dbPath);
}
static async create(dbP... |
JavaScript | UTF-8 | 207 | 3.65625 | 4 | [] | no_license | let farenheitToCelsius = function(f){
let c = 5 * (f - 32) / 9
return c
}
console.log(32 + 'ºF --> ' + farenheitToCelsius(32) + 'ºC')
console.log(68 + 'ºF --> ' + farenheitToCelsius(68) + 'ºC') |
Java | UTF-8 | 940 | 2.546875 | 3 | [] | no_license | package dao;
import domin.Student;
import java.sql.SQLException;
import java.util.List;
/**
* Created by Administrator on 2020/7/23.
* 针对学生表的数据访问
*/
public interface StudentDao {
//一页显示多少数据
int PAGE_SIZE=5;
//查找学生所有信息
List<Student> findAll() throws SQLException;
//添加学生信息
void insert(Stude... |
Python | UTF-8 | 7,256 | 3.421875 | 3 | [] | no_license | # autor: Lukáš Gajdošech
# uloha: 2. domace zadanie Vyraz
class Vyraz:
class Stack:
def __init__(self):
self._pole = []
def push(self, data):
self._pole.append(data)
def pop(self):
if self.empty():
return None
r... |
Java | UTF-8 | 241 | 1.828125 | 2 | [] | no_license | package com.enjoy.service;
import com.enjoy.entity.ProductEntity;
public interface ProductService {
ProductEntity getDetail(String id);
ProductEntity modify(ProductEntity product);
boolean status(String id, boolean upDown);
}
|
C++ | UTF-8 | 677 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int m;
cin >> m;
int arr[m];
for(int i = 0; i < m; i++){
cin >> arr[i];
}
sort(arr, arr + m);
int n;
cin >> n;
int ar[n];
for(int i = 0; i < n; i++){
cin >>... |
Java | UTF-8 | 1,074 | 2.171875 | 2 | [
"MIT"
] | permissive | package com.mahogano.core.presta.mapper;
import com.mahogano.core.presta.entity.Category;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class CategoryMapper implements RowMapper<Category> {
@Override
public Category mapRow(ResultSet rs, int i)... |
PHP | UTF-8 | 2,327 | 2.53125 | 3 | [] | no_license | <?php
$return ="";
$getDomains = new GetDomains;
$return = $getDomains->getDomains();
?>
<div class="col-lg-4"></div>
<div class="col-lg-2">
<form action="getdomains" method="post">
<input type="hidden" name="start" value="<?php echo $return[1];?>"></input>
<button class="btn btn-default<?php if( $return... |
Java | UTF-8 | 406 | 1.859375 | 2 | [] | no_license | package com.tt.Lodging;
import java.util.List;
public interface LodgingService {
// 로그인한 유저의 숙소 중 commonCode가 LDG0301인 숙소 조회
LodgingVO getLodgingRegistering(int userNo);
List<LodgingVO> getLodgingsByLoginedUserNo(int userNo);
void registerLodging(LodgingVO lodging);
void updateLodging(LodgingVO lodg... |
JavaScript | UTF-8 | 385 | 2.53125 | 3 | [] | no_license | const StoreTemplate = document.createElement('template');
StoreTemplate.innerHTML = "Store Page"
class Store extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.shadowRoot.appendChild(StoreTemplate.content.cloneNode(true));
}
connectedCallback()... |
Java | UTF-8 | 316 | 2.265625 | 2 | [] | no_license | package gerenciamentoDeMemoria;
public class Gerenciamento {
private int indice;
public void setValorRegistradores(Processo p) {
p.setRegBase(indice);
p.setRegLimite(indice + p.getValorProcesso() - 1);
indice += p.getValorProcesso();
}
}
|
Python | UTF-8 | 441 | 3.515625 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 13 19:07:32 2021
@author: erina
"""
# 最適なパラメータWを求める
# W = (XtX) **-1 Xty
import numpy as np
X = np.array([
[1, 2, 3],
[1, 2, 5],
[1, 3, 4],
[1, 5, 9]
])
y = np.array([
[1],
[5],
[6],
[8]
])
Xt = X.T
XtX = np.... |
SQL | UTF-8 | 1,036 | 3.015625 | 3 | [] | no_license | /*
Warnings:
- You are about to drop the column `standard` on the `SampelDetail` table. All the data in the column will be lost.
- Added the required column `nilai_ambang_batas` to the `SampelDetail` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA forei... |
C++ | UTF-8 | 1,288 | 2.734375 | 3 | [] | no_license | #include "VariableManager.h"
#include "../Util/Log.h"
using namespace std;
namespace restless
{
VariableManager::VariableManager(void) :
_nullVariable("nullvariable", _nullInt)
{
}
VariableManager::~VariableManager(void)
{
}
bool VariableManager::exists(const char * name)
{
return ... |
JavaScript | UTF-8 | 1,734 | 4.0625 | 4 | [] | no_license | //rehash:
//traverse old: 1. traverse .table, 2. traverse.table's SLL
//rehash: 1. get to newTable's index 2. traverse to the end of the SLL there
//make sure to set newly hashed node's next to null
//Trie: TrieNode has children, value, isWord attributes
function TrieNode(value){
this.value=value
this.children... |
Markdown | UTF-8 | 2,088 | 3 | 3 | [
"MIT"
] | permissive | # Table Re-Use
Reusing of a table refers to changing the model that the table represents.
Looking at the following column factory the model is quite clear:
```typescript
columnFactory()
.table(
{ prop: 'id' },
{ prop: 'name' },
{ prop: 'email' },
)
.build();
```
For this column definition set, the... |
PHP | UTF-8 | 2,399 | 2.703125 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
/**
* @see https://github.com/phly/keep-a-changelog for the canonical source repository
*/
declare(strict_types=1);
namespace Phly\KeepAChangelog\Changelog;
use Phly\KeepAChangelog\Common\AbstractEvent;
use Phly\KeepAChangelog\Common\ChangelogEntry;
use Phly\KeepAChangelog\Common\EditorAwareEventInter... |
C++ | UTF-8 | 11,341 | 2.78125 | 3 | [] | no_license | #ifndef MATH_HPP
#define MATH_HPP
#include<cmath>
#include <boost/math/distributions/normal.hpp> // for normal_distribution
#include "traits.hpp"
#include "convertion.hpp"
#include <type_traits>
#include <chrono>
#include <numeric>
#include <algorithm>
#include <random>
#include <cassert>
#include <cmath>
namespa... |
JavaScript | UTF-8 | 1,830 | 2.703125 | 3 | [] | no_license | /*
Evan MacHale - N00150552
20.04.19
New.js
*/
import React, { Component } from 'react';
import axios from 'axios';
import PropTypes from 'prop-types';
// Material Components
import { Cell, Row } from '@material/react-layout-grid';
import { Headline3, Headline4, Headline6 } from '@material/react-typography';
/*... |
Markdown | UTF-8 | 2,166 | 2.953125 | 3 | [
"MIT"
] | permissive | <div align="center">
<h1>Stockport Availability Package</h1>
</div>
<div align="center">
<strong>Enable access to Stockports availabiity and feature toggling services.</strong>
</div>
<br />
<div align="center">
<sub>Built with :heart: by
<a href="https://www.stockport.gov.uk">Stockport Council</a>
</div>
## ... |
C++ | UTF-8 | 4,692 | 2.8125 | 3 | [
"MIT"
] | permissive | //specialization for epoch based reclamation
#include <iostream>
#include "reclam_epoch.hpp"
template< typename T >
queue_lockfree_total_impl<T, trait_reclamation::epoch>::queue_lockfree_total_impl(){
Node * sentinel = new Node();
_head.store( sentinel );
_tail.store( sentinel );
}
template< typename T >
... |
Java | UTF-8 | 10,935 | 1.734375 | 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 Controller_Window;
import datennetz_simulation.Datennetz_Simulation;
import static datennetz_simulation.Datennetz_Simu... |
JavaScript | UTF-8 | 11,754 | 2.734375 | 3 | [
"MIT"
] | permissive | // this file represents the client side of the multiplayer API
$(function () {
if (localStorage.defRows) {
document.forms["start_play_config"]["in_rows"].value = localStorage.defRows;
} else {
document.forms["start_play_config"]["in_rows"].value = 20;
}
if (localStorage.defCols) {
... |
Java | UTF-8 | 1,106 | 2.078125 | 2 | [] | no_license | package com.brijesh.onlinecamera.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.brijesh.onlinecamera.dao.CategoryDAO;
import com.brijesh.... |
Java | UTF-8 | 1,323 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | package stream.scotty.demo.flink;
import stream.scotty.core.windowType.*;
import stream.scotty.flinkconnector.*;
import stream.scotty.demo.flink.windowFunctions.*;
import org.apache.flink.api.java.tuple.*;
import org.apache.flink.streaming.api.*;
import org.apache.flink.streaming.api.datastream.*;
import org.apache.fl... |
PHP | UTF-8 | 1,300 | 2.796875 | 3 | [] | no_license | <?php
if ( isset( $argv[1] ) ) {
$dir = $argv[1];
if ( !is_dir( $dir ) ) {
echo "Not a directory: $dir\n";
exit( 1 );
}
} else {
$dir = '.';
}
if ( !check_dir( $dir ) ){
exit( 1 );
} else {
exit( 0 );
}
function check_dir( $dir ) {
$handle = opendir( $dir );
if ( !$handle ) {
return true;
}
$success... |
Python | UTF-8 | 542 | 3.421875 | 3 | [] | no_license | #types of style of charts
#solid
#dashed
#dashed doted
#doted
import pandas as p
import matplotlib.pyplot as m
d={'X':[1,2,3,4,5],'Y':[2,6,4,8,3]}
df=p.DataFrame(d)
m.plot(df['X'],df['Y'],'r',linestyle='--',marker='v',markeredgecolor='r',label='Temp') #markeredgecolor used to change color of marker edge
#che... |
Python | UTF-8 | 296 | 3.5625 | 4 | [] | no_license | _end ='$'
def make_trie(*words):
root = dict()
for word in words:
current_node = root
for letter in word:
current_node = current_node.setdefault(letter,{})
current_node[_end] = _end
return root
words =["apple","orrange","apply","ranger","ape"]
root = make_trie(words)
print root
|
C++ | UTF-8 | 559 | 2.875 | 3 | [] | no_license | #include "InitialConditionClass_Sin.h"
bool InitialConditionClass_Sin::Initialize(double r[],
double Phi[],
int gridSize){
int freq = 5;
const double PI_CONST = 3.1415926535897932384626433832795028841971693993751058209749;
... |
Python | UTF-8 | 700 | 2.75 | 3 | [] | no_license | import mysql.connector as mysql
from Manager import Manager
DB_NAME = 'Wydawnictwo'
DB_HOST = '185.204.216.201'
DB_USER = 'seba'
DB_PASSWD = '123'
def getDB():
return mysql.connect(host=DB_HOST, user=DB_USER, passwd=DB_PASSWD, database=DB_NAME)
def printAllValFromTable(table, cursor):
cursor.execute("SELECT... |
Python | UTF-8 | 186 | 3.65625 | 4 | [] | no_license | tt = [32,5,12,8,3,75,2,15]
odd = []
pair = []
for num in tt:
if num % 2 == 0:
pair.append(num)
else:
odd.append(num)
print('Pair : ', pair)
print('Odd : ', odd) |
C | UTF-8 | 2,819 | 3.96875 | 4 | [] | no_license | #include<stdio.h>
// Author : Indresh(kmr.ndrsh@gmail.com)
// Linked list with simple manually created nodes
// Add a node with data field 60 in between and before node with data field 30
/* #############
OUTPUT:
Linked List
Before:
10--> 20--> 30--> 40--> 50--> NULL
Linked List
After:
10--> ... |
Java | UTF-8 | 374 | 2.875 | 3 | [] | no_license | import java.io.File;
import java.util.Scanner;
public class Helper {
public static String[] readFile(String path) throws Exception {
String[] result = new String[3];
File file = new File(path);
Scanner sc = new Scanner(file);
int i = 0;
while(sc.hasNextLine()) {
result[i++] = sc.nextLine... |
Markdown | UTF-8 | 3,551 | 3.078125 | 3 | [] | permissive | # Monthly Budget
For me, by me, to help me keep track of monthly expenses and how they compare to my income for that month. It'd be cool to make this more general purpose, but I built it to specifically work with the CSV file I can download from my personal bank, which details transactions for a specified time period.... |
PHP | UTF-8 | 3,358 | 2.53125 | 3 | [] | no_license | <?php
require_once 'Connection.php';
require_once 'WineTableGateway.php';
$id = session_id();
if ($id == "") {
session_start();
}
$connection = Connection::getInstance();
$gateway = new WineTableGateway($connection);
$statement = $gateway->getWines();
?>
<!DOCTYPE html>
<html>
<head>
<?php require "s... |
C++ | UTF-8 | 464 | 2.625 | 3 | [] | no_license | #include<stdio.h>
#include<stack>
using namespace std;
int N;
stack<int> st1,st2,st3;
int main() {
scanf("%d",&N);
int i;
for(i=N;i>=1;i--) st1.push(i);
int a,b;
while(scanf("%d%d",&a,&b) != -1) {
if(a==1) {
for(i=1;i<=b;i++) {
st2.push(st1.top());
st1.pop();
}
} else {
for(i=... |
Python | UTF-8 | 2,313 | 3.359375 | 3 | [] | no_license | import sqlite3
import requests
from bs4 import BeautifulSoup
# Request URl
response = requests.get("http://books.toscrape.com/catalogue/category/books/history_32/index.html")
soup = BeautifulSoup(response.text, "html.parser")
books = soup.find_all('article')
# print(type(books))
# for book in books:
# print(book)
... |
Markdown | UTF-8 | 10,466 | 3.59375 | 4 | [
"MIT"
] | permissive | ---
id: advanced
title: xform 进阶
---
import * as advancedExamples from 'story/src/xform/2-advanced-examples.stories';
本页将介绍 xform 的一些进阶用法,包括表单片段复用、数组类型表单、嵌套表单数据结构等。
:::danger
文档内容较多,书写龟速,目前还非常粗糙。
:::
## 表单片段复用
先看以下示例,在家庭信息登记表中,「个人信息」、「父亲」等部分的表单内容是完全相同的,但它们的数据存放路径不同。
此时我们将表单中的相同部分抽取到 PersonForm 中,并利用 Form.Object 来... |
Java | UTF-8 | 544 | 3.234375 | 3 | [] | no_license | import java.util.Scanner;
public class Z2 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in, "UTF-8");
System.out.println("Please enter number for length of the arrey: ");
int a = input.nextInt();
input.close();
int[] F = new int[a];
... |
Markdown | UTF-8 | 887 | 3.1875 | 3 | [] | no_license | # example-redirector
Example Redirector app - C#, .NetCore 3.0, WEB API
### Build and run the app (from the output directory) with the follwing command lines:
```
export ASPNETCORE_URLS=http://0.0.0.0:5080/
dotnet ./Redirector.dll ./mapping.json
```
### Mapping File (mapping.json)
```
{
"defaultDestination": "... |
Rust | UTF-8 | 1,599 | 2.703125 | 3 | [
"MIT"
] | permissive | use crate::Signature;
use std::collections::HashMap;
use paste::paste;
pub type LenOperation = fn(&ColumnWrapper) -> Result<usize, ErrorDesc>;
pub type LenDictionary = HashMap<Signature, LenOperation>;
use crate::*;
#[allow(dead_code)]
const OP: &str = "len";
macro_rules! binary_operation_load {
($dict:ident... |
Python | UTF-8 | 1,991 | 2.71875 | 3 | [] | no_license | #! python3
#This is a program to update customerCell and locationCell and nameCell, signatureCell on the excel file templates in Crucible.
import win32com.client as win32
import os
import tkinter as tk
import sys
#--------FUNTIONS---------
#Updates cells in excel workbook
def updateWb(file):
wb =... |
Java | UTF-8 | 941 | 2.90625 | 3 | [] | no_license | package com.jugueteria.util;
import com.jugueteria.modelo.Usuario;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class UsuarioMapper {
public Map<String, Object> getMap(Usuario usuario) {
Map<String, Object> answer = new HashMap<String, Object>(... |
Python | UTF-8 | 6,842 | 3.75 | 4 | [
"CC-BY-4.0"
] | permissive | #! /usr/bin/env python
# How am I going to find the points where paths intersect?
#
# Might as well go naive, because runtime doesn't matter for inputs this small.
#
# Parse the 'movements' into two lists of segments starting at (0, 0), then
# loop across both lists, checking whether any segment in one intersects with... |
Python | UTF-8 | 2,099 | 2.828125 | 3 | [] | no_license | import wx
import wx.lib.flatnotebook as fnb
# Test types:
# 1. No notebook, the two webkit ctrls are side-by-side in a sizer,
# the button destroys the 2nd webkit ctrl
# 2. Use native notebook, button deletes 2nd page
# 3. Use FlatNotebook, button deletes 2nd page
TEST = 2
from wx.webkit import WebKitC... |
Swift | UTF-8 | 1,442 | 2.65625 | 3 | [
"MIT"
] | permissive | import UIKit
final class EmbeddedBlueprintViewController: UIViewController {
var blueprint: Blueprint? {
didSet { didChangeBlueprint() }
}
private lazy var imageView = UIImageView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(imageView)
imageView.contentMode = .scaleAsp... |
Python | UTF-8 | 7,395 | 2.515625 | 3 | [] | no_license | from GlobalConstants import searchVarNamesInOrder, fixedParamDict
from SSOptProgressPlot import SSOptProgressPlot
from shared import savedParametersFile
from ResultsJudge import ResultsJudge
from SSMatchAll import SSMatchAll
from Namespace import Namespace
import multiprocessing as mp
from pprint import pformat
from ma... |
Java | UTF-8 | 5,908 | 2.796875 | 3 | [
"MIT"
] | permissive | package com.jamesratzlaff.rawrecover;
import java.beans.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public interface LongRange extends Serializable, Comparable<LongRange> {
default long getEnd() {
retur... |
Markdown | UTF-8 | 3,013 | 2.796875 | 3 | [] | no_license | # Cocoon
This is the backend for the app Cocoon : https://github.com/cs160-sp16/Group-30-Project
#### Domain : cocoon-healthcare.herokuapp.com
#### Video : https://youtu.be/d1S3OY9g25Y
### APIs:
#### /login:
- Inputs : { "name" : "" OR NAME, "email": EMAIL, "password": PASSWORD}
- Output : SUCCESS or FAILURE to ... |
C++ | UTF-8 | 865 | 2.625 | 3 | [
"MIT"
] | permissive | #include "Arduino.h"
#include <EBot.h>
int speed = 115;
EBot eBot = EBot();
void setup() {
eBot.begin();
eBot.setSpeed(speed);
}
void loop() {
int num1,num2,num3;
num1 = eBot.getLine1();
num2 = eBot.getLine2();
num3 = eBot.getLine3();
if ((num1 == 0) && num2 && num3) {
eBot.setDirection(EBot::ROTA... |
C++ | UTF-8 | 1,695 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <cmath>
using namespace std;
const int MAX = 1000000;
bool P[MAX];
int Prime[MAX];
int start, pos;
int head, tail;
bool visit[MAX];
bool flag;
int step;
int prime_num;
class Point{
public:
int _x;
int _d;
Point()
{}
Point(int x, int d = -1):
_x(x), _d(d)... |
Java | UTF-8 | 1,047 | 3.109375 | 3 | [] | no_license | package com.github.jschmidt10.advent.day11;
import com.github.jschmidt10.advent.day11.WaitingArea.Seat;
import com.github.jschmidt10.advent.util.StringInputFile;
import java.util.List;
public class Day11 {
public static void main(String[] args) {
String filename = "input/day11/input.txt";
StringInputFile in... |
Go | UTF-8 | 1,588 | 2.96875 | 3 | [
"MIT"
] | permissive | package models
import (
"errors"
)
// The type of VPN security association integrity algorithm
type VpnIntegrityAlgorithmType int
const (
// SHA2-256
SHA2_256_VPNINTEGRITYALGORITHMTYPE VpnIntegrityAlgorithmType = iota
// SHA1-96
SHA1_96_VPNINTEGRITYALGORITHMTYPE
// SHA1-160
SHA1_160_VPNINTE... |
Java | UTF-8 | 338 | 2.09375 | 2 | [] | no_license |
public class Sanduiche {
public Pao criaPao() {
return new PaoFrances();
}
public Queijo criaQueijo() {
return new QueijoPrato();
}
public Presunto criaPresunto() {
return new PresuntoFrango();
}
public Ovo criaOvo() {
return new OvoCapoeira();
}
public Tomate criaTomate() {
return new Tom... |
C++ | UTF-8 | 354 | 2.828125 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int n;
cin >> n;
int start = 0;
vector<int>v;
for (int i = 0; i < n; i++)
{
int a;
cin >> a;
v.push_back(a);
}
sort(v.begin(), v.end());
int m = n;
for (int i = 0; i < v.size(); i++)
{
start = max(start,v[i]*(m... |
Java | UTF-8 | 2,721 | 2.28125 | 2 | [] | no_license | package com.example.android.notebookapplication;
import android.os.Build;
import android.os.Bundle;
import androidx.annotation.RequiresApi;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGr... |
JavaScript | UTF-8 | 823 | 2.984375 | 3 | [] | no_license | var http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
// Create a server object
const server = http.createServer(function (req, res) {
// http header
res.writeHead(200, {'Content-Type': 'text/html'});
var url = req.url;
if(url ==='/index') {
res.write(' Welcome!');
res.end();
... |
Java | UTF-8 | 343 | 1.984375 | 2 | [
"MIT"
] | permissive | package org.lpw.clivia.upgrader;
import org.lpw.photon.dao.orm.PageList;
interface UpgraderDao {
PageList<UpgraderModel> query(int pageSize, int pageNum);
UpgraderModel findById(String id);
UpgraderModel latest();
void insert(UpgraderModel upgrader);
void save(UpgraderModel upgrader);
voi... |
Markdown | UTF-8 | 25,951 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 深入剖析 Flink Straming WC流程
subtitle:
date: 2020-05-26
author: danner
header-img: img/post-bg-ios9-web.jpg
catalog: true
tags:
- Flink
- bigdata
---
Flink 版本:1.10
```scala
def main(args: Array[String]) {
// Checking input parameters
val params = ParameterT... |
Markdown | UTF-8 | 3,589 | 3.328125 | 3 | [
"MIT"
] | permissive | # loveboat-nested-scopes
support nested auth scopes in hapi
(a transform written for [**loveboat**](https://github.com/devinivy/loveboat))
[](https://travis-ci.org/devinivy/loveboat-nested-scopes) [ {
this.partials = {
header: await this.load('../../templates/common/header.hbs'),
footer: await this.load('../../templates/common/footer.hbs')
}... |
Java | UTF-8 | 3,110 | 2.984375 | 3 | [] | no_license | /* This code is part of Freenet. It is distributed under the GNU General
* Public License, version 2 (or at your option any later version). See
* http://www.gnu.org/ for further details of the GPL. */
package plugins.Library.util;
import static plugins.Library.util.Maps.$;
import java.util.Map.Entry; // work... |
Java | UTF-8 | 869 | 1.625 | 2 | [] | no_license | /*
* Decompiled with CFR 0.151.
*/
package com.google.firebase.crashlytics.internal.common;
import com.google.firebase.crashlytics.internal.common.CrashlyticsController;
import com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler$CrashListener;
import com.google.firebase.crashlytics.in... |
Python | UTF-8 | 3,027 | 2.921875 | 3 | [] | no_license | import random
import arcade
class Enemy(arcade.AnimatedWalkingSprite):
def __init__(self):
super().__init__()
self.width = 100
self.height = 100
self.stand_right_textures = [arcade.load_texture( ":resources:images/animated_characters/male_adventurer/maleAdventurer_idle... |
Java | UTF-8 | 186 | 1.734375 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package org.joyrest.model.http;
public class PathParam extends NameValueEntity<String, String> {
public PathParam(String name, String value) {
super(name, value);
}
}
|
Python | UTF-8 | 4,240 | 3.484375 | 3 | [] | no_license | """
The
architecture difference from the classic DQN network is shown on the picture
below. The classic DQN network (top) takes features from the convolution
layer and, using fully-connected layers, transforms them into a vector of Qvalues, one for each action. On the other hand, dueling DQN (bottom) ta... |
Java | UTF-8 | 547 | 3.28125 | 3 | [] | no_license | package com.dmitryvoronko.sort;
/**
* Created by Dmitry on 06/09/2016.
*/
public final class InsertionSort extends Sort {
public final void sort(Comparable[] comparables) {
int in, out;
for (out = 1; out < comparables.length; out++) {
Comparable temp = comparables[out];
i... |
Python | UTF-8 | 3,101 | 3.96875 | 4 | [] | no_license | """Day 11 Puzzle"""
class PasswordException(Exception):
"""Exception for passwords."""
def __init__(self, value):
Exception.__init__(self, value)
self.value = value
def __str__(self):
return repr(self.value)
def increment_password(password):
"""Function to increment password.""... |
Python | UTF-8 | 1,073 | 2.953125 | 3 | [] | no_license | import urllib.request
from bs4 import BeautifulSoup
challengeno = 0
aorb = "none"
try:
challengeno = int(input("Enter challenge number (1-10)"))
except ValueError:
print("Not an integer \nAssuming Challenge 9")
challengeno = 9
aorb = input("Enter challenge number (1-10)").lower()
x=0
if aorb != "a":
x +... |
Go | UTF-8 | 3,896 | 2.578125 | 3 | [] | no_license | package routers
import (
"fmt"
"net/url"
"strconv"
"strings"
"time"
"simple-blog/pkg/global"
"simple-blog/pkg/utils"
"simple-blog/pkg/models"
"github.com/gin-gonic/gin"
)
func Index(c *gin.Context) {
limit, _ := strconv.Atoi(global.Options["postsListSize"])
page, _ := strconv.Atoi(c.Query("page"))
if p... |
Python | UTF-8 | 3,376 | 2.703125 | 3 | [] | no_license | ##
# 2015-05-16 - Ultrasound code - Reliable
# Maarten Pater (www.mirdesign.nl)
#
# Based on work of Keith Hekker and Matt Hawkins
# Keith: http://khekker.blogspot.nl/2013/03/raspberry-pi-and-monitoring-sump-pump.html
# Matt: http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-pa... |
JavaScript | UTF-8 | 844 | 2.796875 | 3 | [] | no_license | // // const API_KEY = ""; // Assign this variable to your JSONBIN.io API key if you choose to use it.
// // const DB_NAME = "my-todo";
// const API_KEY = "$2b$10$LoUxYgccdNGEGfOHMu8ETOpoo2Rmk4gLRrxwH827xE.NNk/7ni9Sm";
// // Gets data from persistent storage by the given key and returns it
// async function main () {
... |
Java | UTF-8 | 1,098 | 2.1875 | 2 | [] | no_license | package com.escola.escola.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.... |
Python | UTF-8 | 1,276 | 4.28125 | 4 | [] | no_license | # TODO Create an empty list to maintain the player names
players = []
# TODO Ask the user if they'd like to add players to the list.
# If the user answers "Yes", let them type in a name and add it to the list.
# If the user answers "No", print out the team 'roster'
name_player = input("Quieres agregar jugadores ... |
C++ | UTF-8 | 513 | 2.828125 | 3 | [] | no_license | #ifndef CONTROLLER_H
#define CONTROLLER_H
#include <vector>
#include "movie.h"
#include "repository.h"
class Controller
{
private:
Repository* repo;
public:
Controller(Repository* repo);
~Controller();
/*
* Controller method that returns the entire list of movies from the repository
*/
... |
C | UTF-8 | 11,202 | 3.1875 | 3 | [] | no_license | /* Archivo: createpart.c
Descripción: contiene funciones para crear una partición según las especificaciones dadas en el nunciado
del proyecto. La descripción de los archivos se encuentra en un archivo de texto que recibe como parámetro.
La salida es un archivo binario con el contenido de la partición. Tambié... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.