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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 1,243 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2014-08-25 11:28:59
# @Author : River Jiang (jamestotle@gmail.com)
# @Link : http://nobody.com
# @Version : $Id$
def drop_first_last(grades):
first, *middle, last = grades
return avg(middle)
user_record = ('Dave', 'dave@example.com', '773-555-1212... |
C++ | UTF-8 | 2,500 | 3.078125 | 3 | [] | no_license | export module cmoon.property.require_concept;
import <utility>;
import <type_traits>;
import cmoon.meta;
import cmoon.property.is_applicable_property;
namespace cmoon
{
namespace require_concept_cpo
{
void require_concept();
template<class E, class P>
concept has_adl =
requires(E&& e, P&& p)
{
req... |
C# | UTF-8 | 3,687 | 3.21875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Assignment1
{
public class Program
{
public static void Main(string[] args)
{
bool running = true;
bool exit = false;
/* While current m... |
JavaScript | UTF-8 | 1,821 | 2.515625 | 3 | [] | no_license | import React from "react"
import "../../assets/stylesheets/main.css"
const Newpost = (props) => {
let title = React.createRef(null);
let description = React.createRef(null);
let articleBody = React.createRef(null);
let tagList = React.createRef(null);
function NewArticle(e) {
e.preventDefault();
fe... |
Markdown | UTF-8 | 4,059 | 3.265625 | 3 | [
"MIT"
] | permissive | # tilewarm
A command-line tool to warm up your tile server cache. Give it a URL template, coordinates, and list of zoom levels and it will systematically request all tile images in the given area.
```bash
npm install -g @alvarcarto/tilewarm
```
Docker example:
```bash
docker build -t tilewarm .
docker run tilewarm h... |
Python | UTF-8 | 10,881 | 3 | 3 | [] | no_license | import pygame as pg
import math
import random
import time
DEBUG_LEVEL = 0
WIN_WIDTH = 1280
WIN_HEIGHT = 1024
col_num_min = 1
col_num_max = 15
col_num_range = col_num_max - col_num_min + 1
ROW_COUNT = 5
COL_COUNT = 5
pg.font.init()
pg.display.init()
pg.init()
CELL_FONT = pg.font.SysFont("comicsans", 50)
WIN = pg.... |
Python | UTF-8 | 10,880 | 2.765625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import argparse
import os
import sys
sys.path.append("..")
from fixorchestra.orchestration import *
from fixrepository.repository import *
def compare_repository_with_orchestration(repository, orchestration):
data_type_errors = []
# TODO
code_set_errors = []
# TODO
print(... |
Java | UTF-8 | 1,411 | 2.40625 | 2 | [] | no_license | /**
*
*/
package thirdstage.exercise.jackson.databind.case5;
import org.apache.commons.lang3.tuple.Pair;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml... |
Java | UTF-8 | 1,708 | 2.3125 | 2 | [] | no_license | package jpa;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.MapsId;
import javax.persi... |
Python | UTF-8 | 1,022 | 4.125 | 4 | [] | no_license | # The decimal number, 585 = 1001001001 (binary), is palindromic in both bases.
# Find the sum of all numbers, less than one million, which are palindromic
# in base 10 and base 2.
# (Please note that the palindromic number, in either base, may not include
# leading zeros.)
import time
def is_palindrome(val... |
PHP | UTF-8 | 557 | 2.71875 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
namespace LazyRecord\Command;
use CLIFramework\Command;
class SchemaCommand extends Command
{
function brief() { return 'schema command.'; }
function init()
{
parent::init();
$this->registerCommand('build', 'LazyRecord\Command\BuildSchemaCommand');
$this->registerCommand(... |
PHP | UTF-8 | 1,903 | 3.140625 | 3 | [] | no_license | <?php // $year = date('Y');
// echo $year;
?>
/<?php//$productName = "Mike the Frog Shirt, Orange"
// $productPrice = 20;
?>
<ul>
<li><?php // echo SproductName; ?> - Price: <?php // echo SproductPrice;?></li>
<?php
// $productName = "Logo Shirt, Blue";
// $productPrice = 25;
// ?>
<li><?php //echo $pro... |
Java | UTF-8 | 535 | 1.914063 | 2 | [] | no_license | package com.investsmart.server;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
publi... |
Java | UTF-8 | 1,582 | 2.328125 | 2 | [] | no_license | package model;
/*
* @author Tran Chuyen
*/
import java.util.*;
import java.lang.*;
public class TuanLamViec {
private int id;
private Date ngayBatDau;
private Date ngayKetThuc;
private String thang;
private String nam;
private ArrayList<CaLamViec> dsCaLamViec;
public TuanLamViec() {
... |
Java | UTF-8 | 634 | 2.4375 | 2 | [] | no_license | /**
*
*/
package com.iyuba.iyubaclient.util;
import android.R.integer;
/**
* @author yao
* 根据积分判断等级
*/
public class CheckGrade {
public int Check(String points){
int i=0,j=0;
i=Integer.parseInt(points);
if(i>0&&i<51){
j=1;
}else if(i>50&&i<201){
j=2;
}else if(i>200&&i<501){... |
Python | UTF-8 | 468 | 3.796875 | 4 | [] | no_license | arr = [8,1,5,3,2,0,2,6,5]*1000
def bubleSort(arr):
count = 0
for j in range(len(arr)-1):
# print("\n\n", "-"*50, "Iteration", j)
for i in range(len(arr)-1-j):
count += 1
# print("index",i, 'value', arr[i])
if arr[i] > arr[i+1]:
arr[i],arr[i+1]... |
Python | UTF-8 | 1,339 | 3.578125 | 4 | [] | no_license | import csv
def write_as_file(info_list):
with open("employee_info.csv",'a+',newline='') as csv_file:
writer=csv.writer(csv_file)
if csv_file.tell==0:
writer.writerows(["Name","Age","Degree","email-id","phone-no"])
writer.writerow(info_list)
if __name__=="__main__":
co... |
PHP | UTF-8 | 2,493 | 2.890625 | 3 | [
"MIT"
] | permissive | <?php
function sendContactMail($name, $phone, $email, $message) {
$mail = new PHPMailer();
// Definiciones en config/configEmail.php
// Permitir el uso de SMTP o mail() normal
if(EMAIL_USE_SMTP) { // Configuración de SMTP Mailer
// Establecer que se va a usar SMTP
$mail->IsSMTP();... |
Java | UTF-8 | 373 | 2.015625 | 2 | [
"MIT"
] | permissive | package activesupport.proxy;
import org.openqa.selenium.Proxy;
public class ProxyConfig {
public static Proxy dvsaProxy() {
Proxy proxy = new Proxy();
proxy.setHttpProxy(System.getProperty("httpProxy"));
proxy.setSslProxy(System.getProperty("httpsProxy"));
proxy.setNoProxy(System.g... |
Python | UTF-8 | 1,213 | 3.03125 | 3 | [
"MIT"
] | permissive | #/usr/bin/python
# Script: 301 Final Project Script
# Author: Courtney Hans
# Date of latest revision: 9/23/2020
# Purpose: Create a new Linux EC2 lamp stack instance in AWS using boto3 SDK
#import boto3 library
import boto3
ec2 = boto3.resource('ec... |
Java | UTF-8 | 2,066 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | package ru.job4j.battlegame.units.elf;
import ru.job4j.battlegame.Squad;
import ru.job4j.battlegame.units.AbstractUnit;
import java.util.Random;
/**
* Mage.
*
* @author Ruzhev Alexander
* @since on 24.06.2017.
*/
public class Mage extends AbstractUnit {
/**
* Name.
*/
private static final Stri... |
Python | UTF-8 | 331 | 3.15625 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 28 12:07:05 2020
@author: Hp
"""
str1=(input("enter the list1"))
#list13=[1,3,6,78,35,55]
str2=(input("enter the list1"))
list1=list(str1.split())
list2=list(str2.split())
#list3=[]
list3=list(set(list1) & set(list2))
print("intersection of list", lis... |
Java | UTF-8 | 486 | 2.671875 | 3 | [] | no_license | package model.util;
import java.util.Comparator;
import model.general.Proceso;
public class CompBurst implements Comparator<Proceso> {
@Override
public int compare(Proceso o1, Proceso o2) {
if(o1 == o2) {
return 0;
}
if(o1.getPcb().getBurstTime() == o2.getPcb().getBurstTime... |
Java | UTF-8 | 2,259 | 1.953125 | 2 | [] | no_license | package com.centris.campus.dao;
import java.util.List;
import java.util.Map;
import com.centris.campus.forms.StudentRegistrationForm;
import com.centris.campus.vo.StageMasterVo;
import com.centris.campus.vo.StudentRegistrationVo;
import com.centris.campus.vo.TransportTypeVO;
import com.centris.campus.vo.regi... |
Java | UTF-8 | 489 | 3.0625 | 3 | [] | no_license | package com.noida.learning;
public class RecursionDemo {
public void printRecursively(int arr[],int n){
if(n==-1){
return;
}
System.out.print("\t "+arr[n]);
printRecursively(arr,--n);
}
public void print(int arr[]){
printRecursively(arr, arr.length-1);
... |
JavaScript | UTF-8 | 1,793 | 2.921875 | 3 | [] | no_license | import OpenWeatherMapAPI from '../../api/openWeatherMapAPI';
const apiKey = process.env.REACT_APP_OWM_API_KEY;
const icon = (code) => `http://openweathermap.org/img/wn/${code}@2x.png`;
export const getCurrentTemperature = (lat, lon) => (dispatch) => {
OpenWeatherMapAPI.get(
`/weather?lat=${lat}&lon=${lon}&appid... |
Java | UTF-8 | 337 | 1.8125 | 2 | [
"Apache-2.0"
] | permissive | package com.gdn.venice.dao;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import com.gdn.venice.persistence.VenCountry;
/**
*
* @author yauritux
*
*/
public interface VenCountryDAO extends JpaRepository<VenCountry, Long>{
public List<VenCountry> findByCountryCode(String... |
Markdown | UTF-8 | 11,056 | 2.65625 | 3 | [] | no_license | ---
title: 移民归纳--我前后的思考与目标国的挑选
date: 2022-10-31 15:41:48
categories:
- 移民
tags:
- 移民
top: 99
---
<!-- toc -->
# 修改日志
* 2022/10/29
- 初稿,吐吐槽
- 简单说说跑路的缘由
- 简单的说一下自己的国家选择
* 2022/10/29
- 解释一下什么是美国小绿卡
- 祥林嫂的话移到后边吧,没人关心
- 增加了普通众生--穷逼跑路
# 归纳黄页
[移民归纳--鸽总日记](/2022/10/28/imm-geziwang-roadmap/... |
Python | UTF-8 | 222 | 3.546875 | 4 | [] | no_license | '''
插入排序
时间复杂度:O(n^2)
稳定性:稳定
'''
def insert_sort(x):
N = len(x)
for i in range(1,N):
j = i -1
key = x[i]
while j >= 0:
if x[j] > key:
x[j+1] = x[j]
x[j] = key
j = j -1
|
Java | UTF-8 | 429 | 1.945313 | 2 | [] | no_license | package com.zhou.autopullcode.entity;
public class TokenMapping {
private String token;
private String appname;
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getAppname() {
return... |
Java | UTF-8 | 547 | 2.109375 | 2 | [] | no_license | package fr.ubordeaux.ddd.example.domain.model.evil.factories;
import fr.ubordeaux.ddd.annotations.types.Factory;
import fr.ubordeaux.ddd.example.domain.model.good.aggregates.GoodAggregate;
/**
* Factory
*
*/
@Factory
public class EvilFactoryWithoutEntityValueObjectConstructorAccess {
public GoodAggregate newAgg... |
JavaScript | UTF-8 | 5,461 | 3.046875 | 3 | [] | no_license | const showModal = () => {
let modal = document.getElementById("modal");
if (modal.style.display === "block") {
modal.style.display = "none";
} else {
modal.style.display = "block";
}
}
let list = []
class newItem {
constructor(name, email, address, phone) {
this.name = name... |
Java | UTF-8 | 32,038 | 1.632813 | 2 | [] | no_license | package net.divinerpg.dimensions.vethea;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.divinerpg.dimensions.vethea.all.Bow;
import net.divinerpg.dimensions.vethea.all.FloatingTree4;
import net.divinerpg.dimensions.vethea.all.FloatingTree5;
import net.divinerpg.dimensions.vethe... |
Rust | UTF-8 | 10,598 | 2.75 | 3 | [
"BSL-1.0",
"Apache-2.0",
"Unlicense",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla"
] | permissive | // Copyright (c) Microsoft Corporation.
// Licensed under the MIT license OR Apache 2.0
//! Sources both listen- and connection-based tunnels
use futures::stream::{BoxStream, Stream, StreamExt};
use std::{net::SocketAddr, pin::Pin, task::Poll};
use super::protocol::tunnel::{from_quinn_endpoint, BoxedTunnel, QuinnTunn... |
Python | UTF-8 | 308 | 3 | 3 | [] | no_license | from itertools import combinations_with_replacement
s=input().split()
n=s[0]
n1= int(s[1])
print(list(combinations_with_replacement(n,n1)))
#print(per)
l=list(combinations_with_replacement(n,n1))
l=list(map(list,l))
print(l)
res = [''.join(ele) for ele in l]
res.sort()
print(res)
for i in res:
print(i) |
Java | UTF-8 | 1,396 | 2.265625 | 2 | [] | no_license | package com.revolut.task.rest.service.impl;
import com.revolut.task.rest.dao.impl.AccountDaoImpl;
import com.revolut.task.rest.dto.AccountDto;
import com.revolut.task.rest.dto.TransferDto;
import com.revolut.task.rest.model.Account;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks... |
Python | UTF-8 | 257 | 3.953125 | 4 | [] | no_license | def sum_of_list(num_list):
if len(num_list) == 0:
return 0
else:
lst = num_list
return lst[0] + sum_of_list(lst[1:])
num_list=[44,23,77,11,89,3]
result = sum_of_list(num_list)
print("Sum of the elements:", result)
|
Java | UTF-8 | 12,461 | 2.59375 | 3 | [] | no_license | package it.unipi.dii.lsmsd.pokeMongo.javaFXextensions.panes.addRemove;
import it.unipi.dii.lsmsd.pokeMongo.bean.Pokemon;
import it.unipi.dii.lsmsd.pokeMongo.exceptions.DuplicatePokemonException;
import it.unipi.dii.lsmsd.pokeMongo.javaFXextensions.buttons.RegularButton;
import it.unipi.dii.lsmsd.pokeMongo.javaFXextens... |
Swift | UTF-8 | 6,902 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// ForzaPacket.swift
// ForzaData
//
// Created by Quentin Zervaas on 29/11/18.
//
import Foundation
public struct ForzaPacket {
public struct RawPacket {
}
}
// https://forums.forzamotorsport.net/turn10_postsm926839_Forza-Motorsport-7--Data-Out--feature-details.aspx
extension ForzaPacket.Raw... |
PHP | UTF-8 | 3,663 | 2.5625 | 3 | [] | no_license | <?php
/**
* Template Name: Unidades
*/
// Utilizando o thumbnail da página como banner
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id, "full", true);
// $replace = preg_replace("/ /", "+", $string);
/**-----------------------------------------------------
*
* Página que ... |
JavaScript | UTF-8 | 3,483 | 2.8125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import NavHooks from "./components/NavHooks";
import AppList from "./containers/AppList.js";
import "./styles.css";
const API = "http://localhost:3001/apps";
const App = () => {
const [apps, setApps] = useState([]);
const [activePage, setActivePage] = useState(... |
Python | UTF-8 | 669 | 2.796875 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as statm
import seaborn as sbn
sbn.set()
data = pd.read_csv('real_estate_price_size_year.csv')
y = data['price']
x1_1var = data['size']
x_1var = statm.add_constant(x1_1var)
x1_2var = data[['size','year']]
x_2var = statm.... |
Markdown | UTF-8 | 3,093 | 2.765625 | 3 | [] | no_license | ---
title: "Balancing bias and burden in personal network studies"
description: |
Personal network data is increasingly used to answer research questions about the interplay between individuals (i.e., egos) and their social environment (i.e., alters). Researchers designing such data collections face a trade-off: When... |
Markdown | UTF-8 | 16,672 | 2.59375 | 3 | [] | no_license | 네트워크
네트워크란 무언가와 무언가가 무언가에 의해 연결되어서 무언가를 주고받는 것
Node와 Link 즉, 점과 선이 복합적으로 연결되어있어 점들이 주고받는 것을 말한다.
컴퓨터 네트워크란 컴퓨터와 컴퓨터가 그물망처럼 통신 매체로 연결되어서 데이터를 운반하는 것을 말한다. 즉, 복수의 컴퓨터에서 리소스를 공유한다는 것
리소스란 컴퓨터랑 사용자가 가진 것
ex) 프린터, cpu의 처리 능력, 사용자가 가진 지식, 하드디스크의 총 용량/미사용 용량, 메일, 파일 등
리소스를 유용하게 활용하기 위해 공유하는 것이 네트워크의 장점이다.
리소스 공유하는 것
- 데이터 통신... |
Shell | UTF-8 | 600 | 3.265625 | 3 | [] | no_license | #!/bin/bash
CURRENT_DIR=$(dirname "$0")
if [ -d ${HOME}/.tmux ];
then
today=`date +%Y%m%d`
if $FOR_VIM; then
for i in ${HOME}/.tmux.conf ${HOME}/.tmux; do [ -e $i ] && [ ! -L $i ] && mv -f $i $i.$today; done
for i in ${HOME}/.tmux.conf ${HOME}/.tmux ; do [ -L $i ] && unlink $i ; done
fi
fi
mkdir -p ${HO... |
C | UTF-8 | 1,039 | 3.109375 | 3 | [
"Apache-2.0"
] | permissive | #include <stdio.h>
#include "List.h"
int main(int argc, char *argv[]) {
List list = InitMyList(10);
PrintList(list);
//MakeEmpty(list);
//PrintList(list);
printf("find 5 result is %d\n", Find(5, list));
Delete(5, list);
printf("5 is delete \n");
printf("find 5 result is %d\n", Find(5, list));
PrintList(list... |
C | UTF-8 | 1,777 | 2.953125 | 3 | [] | no_license | #include "../irc.h"
/*
** From RFC 2812
** special = %x5B-60 / %x7B-7D
** ; "[", "]", "\", "`", "_", "^", "{", "|", "}"
*/
static int is_special(char byte)
{
if (byte >= 0x5B && byte <= 0x60)
return (1);
return (0);
}
/*
** From RFC 2812
** nickname = ( letter / special ) *8( letter / digit / special / "-" )
*/... |
Java | UTF-8 | 5,625 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | package modelo;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
/**
* Implementa o CRUD para objeto controlador Create/Retreave/Update/Delete
*
* @author marcos
*
... |
Python | UTF-8 | 1,174 | 3.46875 | 3 | [] | no_license | # Definition for singly-linked list.
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
#方法2:
## 最简单的方法,直接使用带进位的按位求和的方法,由于本身两个链表就相当于数字的反序,所以直接也不需要对齐,按位相加,找个变量存下进位即可
class Solution(object):
def addTwoNumbers(self, l1, l2):
"""
:type l1: ListNode
... |
Python | UTF-8 | 5,164 | 3.015625 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This will prompt for a password:
zip --encrypt file.zip files
This is more insecure, as the password is entered/shown as plain text:
zip --password (password) file.zip files
'''
from __future__ import unicode_literals
import sys
import time
import zipfile
import... |
Python | UTF-8 | 4,798 | 2.734375 | 3 | [] | no_license | __author__ = 'robert'
import struct
from io import BytesIO
from rdflib import URIRef, BNode, Literal
# Constants
MAGIC_NUMBER = b'BRDF'
FORMAT_VERSION = 1
#record types
NAMESPACE_DECL = 0
STATEMENT = 1
COMMENT = 2
VALUE_DECL = 3
ERROR = 126
END_OF_DATA = 127
#value types
NULL_VALUE = 0
URI_VALUE = 1
BNODE_VALUE... |
Java | UTF-8 | 544 | 2.359375 | 2 | [] | no_license | package com.pineapplepiranha.games.scene2d.actor;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.pineapplepiranha.games.scene2d.GenericActor;
/**
* Created with IntelliJ IDEA.
* User: barry
* Date: 8/23/14
* Time: 10:44 PM
* To change this template use File... |
Java | UTF-8 | 231 | 1.601563 | 2 | [
"MIT"
] | permissive | /**
* @generated VGen 1.3.3
*/
package ast;
public interface Expr extends AST {
public Tipo getTipo();
public void setTipo(Tipo tipo);
public Boolean getModificable();
public void setModificable(Boolean modificable);
}
|
PHP | UTF-8 | 3,200 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
class sentry {
var $loggedin = false;
var $userdata;
function sentry(){
session_start();
header("Cache-control: private");
}
function logout(){
unset($this->userdata);
session_destroy();
... |
JavaScript | UTF-8 | 6,775 | 2.640625 | 3 | [] | no_license | /* eslint-disable camelcase */
import moment from 'moment';
import { getData, saveData } from './dataStore';
import { MYTRIPS, TRAVEL_SERVER_URL } from './contant';
import { element } from './common';
const controls = {
formTripPlan: document.querySelector('form[name="tripPlan"]'),
name: document.querySelector('in... |
Java | UTF-8 | 7,952 | 1.625 | 2 | [] | no_license | package com.example.cristian.workful20;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTas... |
Java | UTF-8 | 1,775 | 2.15625 | 2 | [] | no_license |
package services;
import java.util.Collection;
import java.util.List;
import javax.transaction.Transactional;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframewor... |
Python | UTF-8 | 33,003 | 3.234375 | 3 | [] | no_license | # CS 421: Natural Language Processing
# University of Illinois at Chicago
# Fall 2020
# Chatbot Project - Chatbot Evaluation
#
# Do not rename/delete any functions or global variables provided in this template and write your solution
# in the specified sections. Use the main function to test your code when runnin... |
JavaScript | UTF-8 | 318 | 3 | 3 | [] | no_license | const is_inside = ([x,y],[recX,recY,recWidth,recHeight])=>{
if ((x>=recX && x<=(recX+recWidth))&&(y>=recY && y<=(recY+recHeight))){
return true;
}else{
return false;
}
}
console.log( is_inside([100, 120], [140, 60, 70, 50]) );
console.log( is_inside([200, 120], [140, 60, 100, 200]) ); |
Java | UTF-8 | 2,846 | 2.109375 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /*
* MIT License
*
* Copyright (c) 2020 Udo Borkowski, (ub@abego.org)
*
* 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 without limitation the rights
* ... |
C++ | UHC | 800 | 3.40625 | 3 | [] | no_license | // 12_traits
#include <iostream>
using namespace std;
//int a;
//int* p; // p Ÿ : int*
//int x[5]; // ̸ : x x Ÿ : int[5]
// T[N]
template<typename T> struct IsArray
{
static constexpr int size = -1; // 迭 ƴѰ
static constexpr bool value = false;
};
template<typename T, int N> struct I... |
PHP | UTF-8 | 3,767 | 2.75 | 3 | [] | no_license | <?php
namespace Hadefication\Siren;
use Hadefication\Siren\Support\SirenBag;
class Siren
{
/**
* Collect messages
*
* @param string $type the type of message to store
* @param string $message the message to store
* @param s... |
Python | UTF-8 | 1,275 | 3.921875 | 4 | [] | no_license | #methode
class Time(object):
"Objet et méthode permettant d'aficher l'heure lorsqu'un instantnous est fourni"
def affiche_heure(self):
print("{0}:{1}:{2}".format(self.heure,format(self.minute,'02d'),format(self.seconde,'02d')))
now=Time()
now.heure=int(input("entrez les heures : "))
now.minute=int(in... |
Swift | UTF-8 | 3,130 | 2.953125 | 3 | [] | no_license | //
// HomePresenter.swift
// MediaDemo
//
// Created by Ali Tarek on 7/1/21.
//
import Foundation
protocol HomePresenterProtocol: class
{
var view: HomeViewProtocol? { get set }
func error(_ error: Error)
func didReceiveNewEpisodes(_ newEpisodes: [Episode])
func didReceiveChannels(_ channels:... |
Python | UTF-8 | 828,624 | 3.015625 | 3 | [
"MIT"
] | permissive | from constraint import Problem, Domain, AllDifferentConstraint
import matplotlib.pyplot as plt
import numpy as np
def _get_pairs(variables):
work = list(variables)
pairs = [ (work[i], work[i+1]) for i in range(len(work)-1) ]
return pairs
def n_queens(n=8):
def not_in_diagonal(a, b):
... |
C++ | UTF-8 | 751 | 2.8125 | 3 | [] | no_license | //
// Created by Florent on 15/12/2018.
//
#ifndef PROJECT_BASE_IMAGE_H
#define PROJECT_BASE_IMAGE_H
#include <string>
#define GLM_FORCE_INLINE
#define GLM_FORCE_XYZW_ONLY
#include <glm/vec3.hpp>
class BaseImage {
protected:
///It is the height of the picture
uint32_t hauteur;
///It is the width of the picture... |
PHP | UTF-8 | 3,511 | 2.734375 | 3 | [] | no_license | <?php
/* *
* This script is backported from the FLOW3 package "TYPO3.Form". *
* *
* It is free software; you can redistribute it and/or modify it under *
... |
C++ | UTF-8 | 8,137 | 2.515625 | 3 | [] | no_license | /*=========================================================================
Copyright 2009 Rensselaer Polytechnic Institute
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/lice... |
C# | UTF-8 | 587 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using Xamarin.Forms;
namespace Cicerone.Shared.Converters
{
public class ReverseBoolConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (va... |
Python | UTF-8 | 3,027 | 3.234375 | 3 | [] | no_license | #This program helps filter a file of x,y,z points into min and max values of a defined square.
import matplotlib.pyplot as plt
import operator
import matplotlib as mpl
plt.ion()
#open txt file
with open("semi.txt") as file:
file = file.readlines()
x=[]
y=[]
z=[]
for i in file:
x.append(float(i.... |
Java | UTF-8 | 3,566 | 2.15625 | 2 | [] | permissive | /*******************************************************************************
* Copyright (c) 2018, TechEmpower, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributio... |
Python | UTF-8 | 1,111 | 3.625 | 4 | [] | no_license | """
Auteur - Jamie Kalloe, Michael van Kampen
"""
from iteration_utilities import grouper
prijzen = (3.23, 5.32, 8.23, 2.23, 9.98, 7.43, 6.43, 8.23, 4.23)
def main():
print("{}".format(samen(prijzen)))
l = groeperen(prijzen)
print("{}".format(l))
gegroepeerd(l)
totaal_prijs = samen(prijzen)
l... |
Markdown | UTF-8 | 895 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
title: "Testimonials"
date: 2020-06-27T17:57:05+02:00
weight: 7
---
#### Please submit a pull request [here](https://github.com/CompositionalIT/farmer/blob/master/docs/content/testimonials/_index.md) with details of your success stories of using Farmer!
> "We've been using Farmer to help rapidly onboard our custo... |
Markdown | UTF-8 | 5,102 | 2.671875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: python/tk 学习总结
category: 学习
keywords: 学习,2015
---
# tk 学习总结
# 布局
1. grid 按行列排局。
2. pack 在原有基础上,拼接。
- 从哪个方向拼接, 左右上下。
3. 当部件大小小于分配给它空间时表现。
# tk 注意点
1. 调试布局表现时,把背景色打开,更能调试出问题。
2. grid, pack不能混合使用(个人经验)。
3. 调用after来实现定时更新。
# tk 实践经验
1. 使用类的方式,写tk代码会更少。
# tk 实例
;
~Camera();
void onResize(float left, float top, float righ... |
Java | UTF-8 | 1,775 | 1.984375 | 2 | [] | no_license | package cn.ben.shiro.modules;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresGuest;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.apache.shiro.authz.annotation.Req... |
Go | UTF-8 | 3,241 | 2.640625 | 3 | [
"MIT"
] | permissive | package sonarcloud
import (
"context"
"encoding/json"
"fmt"
"github.com/fatih/structs"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/iancoleman/strcase"
"strconv"
"time"
)
type UserGroupsSearchResponse struct {
Groups []UserGroup... |
C++ | UTF-8 | 160 | 2.84375 | 3 | [] | no_license | #include <iostream>
int main(int argc, char* argv[])
{
int v;
int t;
while (std::cin >> v >> t)
{
std::cout << v * t * 2 << std::endl;
}
return 0;
}
|
Python | UTF-8 | 1,370 | 3.5625 | 4 | [
"MIT"
] | permissive | import os
from itertools import zip_longest
from .constants import CHROME_DRIVER, FIREFOX_DRIVER
def grouper(iterable, n, fill_value=None):
"""
Iterate data into fixed-length chunks or blocks.
Example:
Iterating array with n = 2
[N1, N2, N3, N4, N5, N6]
Iterations:
(N1, N2) -> (N3, N4) -... |
Java | UTF-8 | 2,688 | 2.578125 | 3 | [] | no_license | package org.frc2020.droid.climber;
import org.xero1425.base.actions.Action;
public class LifterCalibrateAction extends Action {
public LifterCalibrateAction(LifterSubsystem sub) throws Exception {
super(sub.getRobot().getMessageLogger());
sub_ = sub ;
holding_power_ = sub.getRobot().getSe... |
C# | UTF-8 | 1,636 | 3.96875 | 4 | [
"CC-BY-NC-4.0",
"CC-BY-NC-SA-4.0"
] | permissive | namespace Shoping
{
class Person
{
private string name;
public string Name
{
get { return name; }
set
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentException("Name cannot be empty");
... |
Markdown | UTF-8 | 2,685 | 3.078125 | 3 | [
"MIT"
] | permissive | ---
templateKey: blog-post
title: Filipino Pork Adobo
date: 2023-03-24
description: Filipino Pork Adobo is a savory and flavorful dish made with tender pork marinatedand cooked in a soy sauce and vinegar-based sauce, and lots of garlic...
whetter: I ❤️ Adobo
sideNote: Garlic is widely regarded as a superfood due to its... |
C++ | UTF-8 | 332 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main ()
{
int a,b,c;
cin>>a>>b>>c;
int perimeter,area;
int p;
if(a+b>c && a+c>b && c+b>a){
cout<<"YEP"<<endl;
perimeter=a+b+c;
p=perimeter/2;
area=sqrt(p*(p-a)*(p-b)*(p-c));
cout<<perimeter<<endl<<a... |
Markdown | UTF-8 | 587 | 2.96875 | 3 | [] | no_license | ---
layout: post
title: "Html document"
date: 2016-06-04 07:30:24 +0800
---
Document对象定义:每个载入浏览器的 HTML 文档
Document 对象使我们可以从脚本中对 HTML 页面中的所有元素进行访问
提示:Document 对象是 Window 对象的一部分,可通过 window.document 属性对其进行访问。
比如:
(1)Find an element by element id
```
document.getElementById(id)
```
(2)Find elements by tag name
```... |
C++ | UTF-8 | 5,545 | 3.9375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
using namespace std;
int checkArraySort(string* A,int arraySize);
int binarySearchR(string* A, int first, int last, int key);
int activate;
int main()
{
int count=-1; //will store the number of words in the file created
ifstream access ("words_in.txt"... |
C# | UTF-8 | 656 | 3.046875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Task3
{
class Sample
{
static void Main(string[] args)
{
int index;
for (index = 0; index < 100; index++)
{
Console.... |
JavaScript | UTF-8 | 1,096 | 2.953125 | 3 | [] | no_license | import config from '../../config';
import Tile from '../../models/terrain/tiles/Tile';
export default class WorldMap {
// WorldMap holds only data of entire map, no rendering data. Using only coordinates of tiles
constructor() {
let i,j;
this.tiles = [];
for(i=0; i<config.WORLD_WIDTH; i++) {
this.tiles[i] =... |
Markdown | UTF-8 | 3,964 | 2.5625 | 3 | [] | no_license | # Karaf 2, Camel and REST / SQL QuickStart
This example demonstrates how to use SQL via JDBC along with Camel's REST DSL to expose a RESTful API.
### Configuring
The `src/main/fabric8/deployment.yml` should be updated with a mysql username/password that can access your mysql system.
### Building
The example can be... |
C++ | UTF-8 | 17,504 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*
This file is part of TACS: The Toolkit for the Analysis of Composite
Structures, a parallel finite-element code for structural and
multidisciplinary design optimization.
Copyright (C) 2010 University of Toronto
Copyright (C) 2012 University of Michigan
Copyright (C) 2014 Georgia Tech Research Corporatio... |
Java | UTF-8 | 415 | 2.703125 | 3 | [] | no_license | package cn.answering.design.mode.num2.observe;
/**
* @author zhangjp
* @date 2020-05-08 22:30
* @qq 34948062
* @github: https://github.com/Hugh1029
* @web: https://answering.cn
* @description
*
* 主题,说的更直白一点,就是被观察者
*
*/
public interface Subject {
void addObserver(Observer observer);
void removerObse... |
C++ | UTF-8 | 22,838 | 2.890625 | 3 | [
"MIT"
] | permissive | #include "../../include/Switch/__opaque_unicode_string__.hpp"
#include "../../include/Switch/System/Array.hpp"
#include "../../include/Switch/System/ArgumentNullException.hpp"
#include "../../include/Switch/System/ArgumentOutOfRangeException.hpp"
#include "../Native/Api.hpp"
size_t __opaque_unicode_string__::npos = st... |
JavaScript | UTF-8 | 649 | 3.15625 | 3 | [] | no_license | function defaultParams(
func = function() {
x = 3;
console.log("x in params is: ", x);
},
x,
y
) {
console.log("initial x in inner: ", x);
var x = 5;
y = 90;
console.log(y, arguments[2]);
func();
console.log("last x in inner: ", x);
}
defaultParams(undefined, 4, "y");
/*
function defaultPar... |
Python | UTF-8 | 360 | 2.734375 | 3 | [] | no_license | import cv2
video = cv2.VideoCapture(0)
while True:
# Read a new frame
success, frame = video.read()
if not success:
# Frame not successfully read from video capture
break
# Display result
cv2.imshow("frame", frame)
k = cv2.waitKey(1) & 0xff
if k == 27: break # ESC pressed
... |
Java | UTF-8 | 3,354 | 3.25 | 3 | [] | no_license | package week3.lab7_interfaces_object.lab2_hrapp.testing;
import java.time.LocalDate;
import org.junit.Assert;
import org.junit.Test;
import week3.lab7_interfaces_object.lab2_hrapp.Company;
import week3.lab7_interfaces_object.lab2_hrapp.Department;
import week3.lab7_interfaces_object.lab2_hrapp.Employee;
import week3... |
Markdown | UTF-8 | 2,123 | 3.828125 | 4 | [] | no_license | # Level Two
## Puzzle
The Spartans had their own encryption method, different from how the Romans did it. They would take a long string of characters, and wrap them around a stick.
From Wikipedia,
"
Suppose the rod allows one to write four letters around in a circle and five letters down the side of it. The plainte... |
Java | UTF-8 | 342 | 2.28125 | 2 | [] | no_license | package name.hanyi.playcards;
public class PlayCard {
private String suits;
private String ranks;
public PlayCard(String ranks, String suits) {
this.suits = suits;
this.ranks = ranks;
}
public String getSuits() {
return suits;
}
public String getRanks() {
... |
Markdown | UTF-8 | 2,097 | 2.5625 | 3 | [] | no_license | ---
title: Top 10 commands on your terminal
date: 2018-12-29 20:40:03
tags:
---
On [Shekhar Gulati's blog](https://shekhargulati.com/2018/05/21/top-10-commands-that-you-use-on-your-command-line-terminal/), I discovered a neat command that lists the top 10 commands that you use in your terminal, based on your shell his... |
Markdown | UTF-8 | 579 | 3.015625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # Lab 03
## Using local modules
In this lab we are going to use local modules to create the same infrastruture.
| Resource | Name |
|:----------|:----------|
| Resource Group | demo03 |
| Virtual Network | vnet03 |
| Subnet | subnet03 |
## Procedure
Firt of all, init the folder:
```sh
$ terrafom i... |
TypeScript | UTF-8 | 4,902 | 2.640625 | 3 | [] | no_license | namespace L11_Advanced {
// install load listener on window, declare global variables
window.addEventListener("load", handleLoad);
export let crc2: CanvasRenderingContext2D;
let reloadBtn: HTMLButtonElement;
let height: number = 0;
let width: number = 0;
let flowers: Flower[] = [];
let ... |
JavaScript | UTF-8 | 2,067 | 2.625 | 3 | [] | no_license | /**
* http://usejsdoc.org/
*/
const server = express();
var bodyParser = require('body-parser');
var mysql = require('mysql');
var con = mysql.createConnection({
host: "localhost",
user: "root",
password: "",
database : 'telecorp',
port: 3306
});
server.get('/', (req, res) => {
res.send('Hola mundo cómo está... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.