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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,648 | 3.421875 | 3 | [] | no_license | ## 什麼是 DOM?
### 全名是 document object model ,簡單來說他將 HTML Document中的標籤和文字內容都轉換成物件 ,形成一個樹狀結構。javascript 可以拿到樹狀裡的 html 節點去改變畫面上的東西,而瀏覽器提供 DOM 這個規則,成為 javascript 和 html 溝通的橋樑。
### DOM 中的節點有四種類型:Document(指這份文件)、 Element(指 html 標籤)、 Text(指文字內容)和 Attribute(指標籤內的 class id 等屬性)
Image:https://i.imgur.com/quZtbSB.jpg
### 改變不同節點的常用... |
Java | UTF-8 | 13,094 | 2.140625 | 2 | [
"MIT"
] | permissive | package io.cucumber.core.runtime;
import io.cucumber.core.eventbus.IncrementingUuidGenerator;
import io.cucumber.core.eventbus.Options;
import io.cucumber.core.eventbus.RandomUuidGenerator;
import io.cucumber.core.eventbus.UuidGenerator;
import io.cucumber.core.exception.CucumberException;
import org.hamcrest.Matchers... |
Java | UTF-8 | 1,922 | 2.28125 | 2 | [] | no_license | package com.adp3.service.reports.impl;
import com.adp3.entity.reports.StoreReports;
import com.adp3.factory.reports.StoreReportFactory;
import com.adp3.service.reports.StoreReportsService;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit... |
PHP | UTF-8 | 126 | 2.71875 | 3 | [] | no_license | <?php
class Message
{
public $body;
public function __construct($body)
{
$this->body = $body;
}
}
|
SQL | UTF-8 | 4,051 | 2.96875 | 3 | [] | no_license | INSERT INTO category(id, name, symbol_code) VALUES
(1, 'Доски и лыжи', 'boards'), (2, 'Крепления', 'attachment'),
(3, 'Ботинки', 'boots'), (4, 'Одежда', 'clothing'),
(5, 'Инструменты', 'tools'), (6, 'Разное', 'other');
INSERT INTO user(id, registration_date, email, name, passwd, contact_info) VALUES
... |
JavaScript | UTF-8 | 1,354 | 3.515625 | 4 | [] | no_license | // Stampare tutti i numeri da 1 a 100 con le seguenti regole:
// al posto dei multipli di 3 stampare "Fizz"
// al posto dei multipli di 5 stampare "Buzz"
// al posto dei multipli di 3 e 5 stampare "FizzBuzz"
// nome repo: js-fizzbuzz
// creazione var d'appoggio
var list = ''
// ciclo per creare numeri da 1 a 100
for (... |
C++ | UTF-8 | 751 | 2.515625 | 3 | [] | no_license | //
// Created by Julian on 13.10.18.
//
#ifndef ROSBRIDGECLIENT_CSV_READER_H
#define ROSBRIDGECLIENT_CSV_READER_H
#include <vector>
#include <string>
#include <iostream>
#include <unordered_map>
#include <fstream>
#include <boost/algorithm/string.hpp>
namespace test
{
class CSVReader
{
public:
CSVReader() = delet... |
Java | UTF-8 | 3,215 | 2.125 | 2 | [] | no_license | package nju.trust.payloads.personalinfomation;
import java.util.List;
/**
* @Author: 161250127
* @Description:
* @Date: 2018/9/11
*/
public class PersonalDetailInfomation {
//学校分类
private String schoolClass;
//专业情况
private String majorCondition;
//受教育情况
private String educationBackground;
... |
Java | UTF-8 | 1,779 | 2.3125 | 2 | [] | no_license | package com.neekle.kunlunandroid.xmpp.data;
import java.util.ArrayList;
import com.neekle.kunlunandroid.xmpp.data.TypeEnum.HuddleState;
public class HuddleInfo {
// 群JID,是裸JID,主键,比如huddle@conference.openfire
private String JID = "";
// 群的当前状态
private HuddleState State;
// 群主题
private String Subject;
// 群备... |
Python | UTF-8 | 256 | 3.09375 | 3 | [] | no_license | n=int(input())
d={}
for e in range(n):
s=input().split(" ")
name=s[0]
m1=float(s[1])
m2=float(s[2])
m3=float(s[3])
d[name]=(m1,m2,m3)
print(d)
n=input("enter name")
x=d.get(n)
print(x)
add=0
for e in x:
add=add+e
print(add/3)
|
Markdown | UTF-8 | 7,977 | 2.53125 | 3 | [] | no_license | ---
description: "Recipe: Quick Brad&#39;s salmon roll ups with lemon dill cream sauce"
title: "Recipe: Quick Brad&#39;s salmon roll ups with lemon dill cream sauce"
slug: 6342-recipe-quick-brad-and-39-s-salmon-roll-ups-with-lemon-dill-cream-sauce
date: 2019-11-04T12:03:56.221Z
image: https://img-global.cpcdn.c... |
Markdown | UTF-8 | 3,026 | 2.953125 | 3 | [] | no_license |
借款单位:____(以下简称甲方)
贷款银行:______中国农业银行(以下简称乙方)
甲方用于:______
所需外汇资金,于____年__月__日向乙方申请外汇贷款。乙方根据甲方填报的《外汇借款申请书》(编号:_____)和其它有关资料,经审查同意向甲方发放外汇流动资金贷款。为明确责任,恪守信用,特签订本合同并共同遵守。
第一条 甲方向乙方借(外币名称)_____万元(大写金额)
第二条 借款期限自第一笔用汇日起到还清全部本息日止,即从____年__月__日至____年__月__日,共__月。
第三条 在合同规定的借款期限内,贷款基准利率为按__月浮动,利息每季计收一次。
第四条 甲方愿遵守... |
Java | UTF-8 | 1,234 | 2.484375 | 2 | [] | no_license | package staff.backend.model;
import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
@Entity
@Table(name = "history")
public class History {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY) // IDENTITY as the example has flyway in it and fixed schema in src/main/resources/d... |
Python | UTF-8 | 1,263 | 3.3125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
from sklearn.cluster import KMeans
# In[4]:
data = pd.read_csv('3.01.+Country+clusters.csv')
data
# In[5]:
data_mapped = data.copy()
data_mapped['Language']=da... |
JavaScript | UTF-8 | 5,550 | 2.625 | 3 | [] | no_license | //删除用户组
$(function () {
$('.delete-role-btn').click(function (event) {
event.preventDefault();
var role_id = $(this).attr('data-role-id');
zlalert.alertConfirm({
msg: '您确定要删除这个分组吗?',
confirmCallback: function () {
// 发送ajax
zlajax.post(... |
C++ | UTF-8 | 826 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <vector>
int main() {
freopen("cycles.in", "r", stdin);
freopen("cycles.out", "w", stdout);
int n, m;
scanf("%d%d", &n, &m);
std::vector<int> a(m), b(m), deg(n);
for (int i = 0; i < m; ++i) {
scanf("%d%d", &a[i], &b[i]);
deg[--a[i]]++;
deg[--b[i]]++... |
C++ | UTF-8 | 9,102 | 2.765625 | 3 | [] | no_license | #include "dataman.h"
#include <exception>
#ifdef __LOG_TEST__
#include "../Utils/logfile.h"
static LogFile logFile("DataManager", "LogTest", true);
#endif
Field::Field() :
m_position(0), m_type(Text), m_start(0), m_end(0)
{
//empty
}
Field::Field(int pos, FieldType type, unsigned int start, u... |
Python | UTF-8 | 3,895 | 4.09375 | 4 | [] | no_license | '''
implement as stack using doubly linked list
'''
import gc
class Node:
def __init__(self, data):
self.data = data
self.prev = None
self.next = None
class Stack:
def __init__(self):
self.size = 0
self.head = None
self.tail = None
self.pointer = self.... |
Java | UTF-8 | 567 | 1.84375 | 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 foodiesquad.dao;
import foodiesquad.entity.Deliver;
import java.util.List;
/**
*
* @author hmqhmq
*/
public interface Deli... |
C++ | UTF-8 | 648 | 2.828125 | 3 | [] | no_license | #include<vector>
class Solution {
public:
int jump(std::vector<int>& nums) {
if(nums.size() == 1){
return 0;
}
int step = 0;
int lastIdx= 0;
int fastIdx = nums[0];
while(true){
step++;
if(fastIdx >= nums.size() -1){
... |
Java | UTF-8 | 2,095 | 2.9375 | 3 | [] | no_license | package gui;
import javafx.scene.control.TextField;
import javafx.util.Pair;
import java.util.List;
public class SmartTextField extends TextField {
private List<Pair<Integer, Integer>> actualText;
public SmartTextField(String s) {
super(s);
}
String getTypedText() {
String orig = g... |
Java | UTF-8 | 2,401 | 2.40625 | 2 | [] | no_license | package com.costrella.android.first_android_game.game.object;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Movie;
import android.graphics.Paint;
import android.graphics... |
Java | UTF-8 | 1,618 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package cn.dyaoming.sync;
import org.springframework.cache.Cache;
import org.springframework.cache.support.AbstractCacheManager;
import java.util.Collection;
import java.util.Collections;
/**
* <p>
* 缓存控制器
* </p>
*
* @author DYAOMING
* @since 2020-04-25
* @version 0.0.4
*/
public clas... |
C# | UTF-8 | 2,078 | 2.53125 | 3 | [] | no_license | using DataLibrary;
using NewsBookLN.GestUtilizadores;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataAccessLibrary
{
public class CategoriaData : ICategoriaData
{
private readonly ISQLDataAccess _dbCat;
... |
C++ | UTF-8 | 450 | 2.71875 | 3 | [] | no_license | //
// Created by phillip.goellner on 19.02.2017.
//
#include "And.h"
//Konstruktor mit zwei Subtermen als Übergabeparameter
And::And(Term_Object* sub_left, Term_Object* sub_right)
{
subterm_left = sub_left;
subterm_right = sub_right;
}
//Die logische Auswertung dieses Ausdrucks wird zurückgegeben
bool And::e... |
Python | UTF-8 | 11,641 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | '''
Tool Dialogs
'''
import os
import pyglet
import kytten
from kytten.frame import Frame, SectionHeader, FoldingSection
from kytten.dialog import Dialog
from kytten.button import Button
from kytten.layout import VerticalLayout, HorizontalLayout, GridLayout
from kytten.widgets import Spacer, Label
from kytten.text_inp... |
Markdown | UTF-8 | 1,190 | 3.140625 | 3 | [
"MIT"
] | permissive | # Chapter5 传输层
---
考试说明
- TCP拥塞控制、TCP连接的建立与释放、TCP与UDP的对比、TCP数据段格式等是考试的重点
- TCP拥塞控制常考解答题
- 本章以客观题和解答题为主,但是题型相对固定,解题思路也明显
---
## 知识结构
本章的知识结构图如下mermaid图所示
```mermaid
graph RL
a(传输层) --> b1(传输层的功能)
a --> b2(传输层的两种服务)
b2 --> c1(可靠服务)
b2 --> c2(不可靠服务)
a --> b3(传输层的端口)
b3 --> c3(端口的作用)
b3 --> c4(... |
Python | UTF-8 | 516 | 3.5 | 4 | [] | no_license | from typing import List
def findAll(string: str, target: str) -> List[int]:
"""找到所有匹配的字符串起始位置"""
start = 0
res = []
while True:
pos = string.find(target, start)
if pos == -1:
break
else:
res.append(pos)
start = pos + 1
ret... |
Markdown | UTF-8 | 1,241 | 3.09375 | 3 | [] | no_license | # ScraperSite
A web app that lets users view and leave comments on the latest news.
With the use of:
express
express-handlebars
mongoose
body-parser
cheerio
request
to build a site where users can scrape articles from the New York Times. Then save articles of interest and add/delete notes on the articles.
on fir... |
Java | UTF-8 | 869 | 2.203125 | 2 | [] | no_license | package com.haier.demo.attach;
import java.io.IOException;
import com.sun.tools.attach.AgentInitializationException;
import com.sun.tools.attach.AgentLoadException;
import com.sun.tools.attach.AttachNotSupportedException;
import com.sun.tools.attach.VirtualMachine;
public class AttachMain {
public static void ma... |
C | UTF-8 | 2,095 | 2.65625 | 3 | [] | no_license | #include "shared.h"
GLfloat cubeVertex[] = {
0.0f, 1.0f, 0.0f, //0
1.0f, 1.0f, 0.0f, //1
1.0f, 1.0f, 1.0f, //2
0.0f, 1.0f, 1.0f, //3
0.0f, 0.0f, 0.0f, //4
1.0f, 0.0f, 0.0f, //5
1.0f, 0.0f, 1.0f, //6
0.0f, 0.0f, 1.0f, //7
};
GLushort cubeIndices[] = {
0, 1, 2, 2, 3, 0, //top
4, 5,... |
Ruby | UTF-8 | 1,988 | 4.03125 | 4 | [] | no_license | # Read a varint128 from a deobfuscated hex string value.
# Basically just keep reading bytes until one of them is less than 128 (so the 8th bit wouldn't be set).
def varint128_read(value, offset=0, verbose=false) # use offset to start reading from a number of characters in from the string
if verbose
puts value #... |
C# | UTF-8 | 2,510 | 3.453125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace 事件__订阅者方法超时的处理
{
class Program
{
static void Main(string[] args)
{
Publisher pub = new Publisher();
Subscriber1 sub1 = n... |
C++ | UTF-8 | 1,359 | 3.234375 | 3 | [
"BSD-3-Clause"
] | permissive | /*
* buffer.h
*
* Created on: Jun 9, 2020
* Author: Marcel Flottmann
*/
#ifndef BUFFER_H_
#define BUFFER_H_
#include <stddef.h>
#include <stdint.h>
namespace trail_detection
{
/**
* Represents a buffer in memory that can be accessed by the hardware through the physical address
*/
class Buffer
{
private... |
Java | UTF-8 | 836 | 3.28125 | 3 | [] | no_license | import java.util.*;
public class pattern16{
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int sp = 2*n - 3;
int st = 1;
for(int i = 1;i<=n;i++){
int val = 1;
for(int j = 1;j<=st;j++){
System.out.pr... |
C++ | UTF-8 | 309 | 2.546875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n;
cin>>n;
while(n!=-1){
int j=0,x,y,total=0;
for(int i=0;i<n;i++){
cin>>x>>y;
total+=(y-j)*x;
j=y;
}
cout<<total<<" miles"<<endl;
cin>>n;
}
return 0;
}
|
Java | UTF-8 | 224 | 1.984375 | 2 | [] | no_license | package com.corgi.example.exception;
public class QuerySyntaxException extends RuntimeException {
public QuerySyntaxException() {
}
public QuerySyntaxException(Throwable cause) {
super(cause);
}
}
|
Python | UTF-8 | 1,990 | 3.109375 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import re
import time
import reg_titanic
from reg_titanic import Surviving
external_stylesheets = ['https://github.com/plotly/dash-app-s... |
Markdown | UTF-8 | 4,023 | 2.59375 | 3 | [] | no_license | ### [2014-03-22](/news/2014/03/22/index.md)
# Post-civil war violence in Libya: The Libyan National Army fights with rebels occupying oil ports near Benghazi.
### Source:
1. [Reuters](http://www.reuters.com/article/2014/03/22/us-libya-oil-fighting-idUSBREA2L06020140322)
### Related:
1. [Post-civil war violence... |
C++ | UTF-8 | 2,473 | 3.140625 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: Euler55.cpp
*
* Description: Solution to Project Euler, Problem 55
*
* Version: 1.0
* Created: 9/2/2016 12:38:37 AM
* Revision: none
* Compiler: g++
*
* A... |
JavaScript | UTF-8 | 7,005 | 3.3125 | 3 | [] | no_license | const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');
class Grid {
constructor(width, height) {
this.scale = 5;
this.cellWidth = width / this.scale;
this.cellHeight = height / this.scale;
this.space = [];
this.changed = [];
this.generation = 0;
this.init()... |
TypeScript | UTF-8 | 3,198 | 2.59375 | 3 | [
"MIT"
] | permissive | 'use strict';
import jwt = require('jsonwebtoken');
import _ = require('lodash');
/**
* Create a new Policy
*
* @constructor
* @param {object} options - ...
* @param {string} [options.url] - Policy URL
* @param {string} [options.method] - HTTP Method
* @param {object} [options.queryFilter] - Request query filt... |
SQL | UTF-8 | 2,225 | 4.53125 | 5 | [] | no_license | -- List following details of employees: employee number, last name, first name, sex, and salary
SELECT employees.emp_no,
employees.last_name,
employees.first_name,
employees.sex,
salaries.salary
FROM employees
JOIN salaries
ON employees.emp_no = salaries.emp_no;
--List FN, LN, and Hire date for employees hir... |
C# | UTF-8 | 3,229 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;
namespace Acceso
{
public class Conexion
{
private SqlConnection Conection;
private const string CONNECTION_STRING = @"Data Source... |
C# | UTF-8 | 6,940 | 2.5625 | 3 | [] | no_license | //-----------------------------------------------------------------------
// <copyright file="SystemText.cs">
// Copyright (c) Erik Bunnstad. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace Chaos.Wedding.Models.Games
{
using System;
... |
TypeScript | UTF-8 | 2,940 | 3 | 3 | [] | no_license | import Helpers from "./Helpers";
import { M2 } from "./M2";
import { V2 } from "./V2";
export class M3 {
public m00: number;
public m01: number;
public m02: number;
public m10: number;
public m11: number;
public m12: number;
public m20: number;
public m21: number;
public m22: number;
// m00 m01 m02... |
Java | UTF-8 | 975 | 3.484375 | 3 | [] | no_license | public class MultiDimen {
public static void main(String[] args)
{
//float array with 3 rows, 2 columns
float arr[][] = new float[3][2];
//double[][] barr = {{2.3,3.4},{4.6,6.5}};
arr[0][0] = 35.4f;
arr[0][1] = 68.3f;
arr[1][0] = 53.2f;
arr[1][1] = 68.3f;
arr[2][0] = (float)45... |
C++ | UTF-8 | 4,060 | 3.609375 | 4 | [] | no_license | //Design an algorithm and write code to find the first common ancester of two nodes in a binary tree.
//Avoid stroing additional nodes in a data structure. NOTE: This is not necessarily a binary search tree.
#include <iostream>
#include <cstring>
#include <vector>
#include <list>
#include <map>
using namespace std;
... |
Markdown | UTF-8 | 803 | 2.609375 | 3 | [] | no_license | # reinforcement-learning-course
Winter Semester 2018/2019 - Albert-Ludwigs-Universität Freiburg
## Introduction
In this repository you will find different exercises for Reinforcement Learning, such as Markov Processes, Bellman Equations, Dynamic Programming or Model-free Prediction and Control.
## Glossary
- Exerci... |
C | UTF-8 | 619 | 2.609375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "diaryh.h"
int main()
{
char name[100];
char pass[100];
printf("\n\t*************************************\n");
printf("\n\tWelcome to personal diary management system!\n");
printf("\n\t*************************************\n");
prin... |
Java | UTF-8 | 988 | 2.796875 | 3 | [] | no_license | package se.liu.ida.oscth887oskth878.tddc69.project.simulation;
import se.liu.ida.oscth887oskth878.tddc69.project.simulation.units.*;
import se.liu.ida.oscth887oskth878.tddc69.project.util.Pointf;
/**
* A simple Factory for Units
*
* @author Oscar Thunberg (oscth887)
* @author Oskar Therén (oskth878)
* @version... |
Java | UTF-8 | 13,259 | 2.03125 | 2 | [
"Apache-2.0"
] | permissive | package org.folio.edge.sip2.domain.messages.requests;
import static java.lang.Boolean.FALSE;
import static java.lang.Boolean.TRUE;
import static org.folio.edge.sip2.domain.messages.requests.Renew.builder;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertEqu... |
TypeScript | UTF-8 | 3,119 | 2.9375 | 3 | [] | no_license | import { PathLike } from 'fs'
import fs from 'fs/promises'
import path from 'path'
type EnvConfigStruct = {
srcDir: string
destDir: string
backupDir: string
combinedLogsOutputDir: string
errorLogsOutputdir: string
debounceAmount: number
rezAttempts: number
rezCooldown: number
}
const defaultEnvConfig:... |
Java | UTF-8 | 283 | 2.53125 | 3 | [] | no_license | package cognizant.date;
import java.time.Clock;;
public class ClockTime {
public static void main(String[] args) {
Clock time = Clock.systemUTC();
Clock def = Clock.systemDefaultZone();
System.out.println(time);
System.out.println("Default : " + def);
}
}
|
Java | UTF-8 | 8,102 | 2.109375 | 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 GUI;
import Controller.MateriaisController;
import Utilitarios.Conexao;
import Utilitarios.Corretores;
import Utilitarios.Limi... |
C++ | UTF-8 | 3,500 | 2.640625 | 3 | [] | no_license | #include "AFMotor.h"
#include "AFMotor.h"
AF_DCMotor motor_FL(1);
AF_DCMotor motor_FR(2);
int Left_Follow = 0;
int Right_Follow = 1;
int Center_Follow = 2;
int count=0;
void setup() {
Serial.begin(9600);
motor_FL.run(RELEASE);
motor_FL.setSpeed(0);
motor_FR.run(RELEASE);
motor_FR.setSpeed(... |
TypeScript | UTF-8 | 559 | 2.515625 | 3 | [] | no_license | export enum LoadingState {
LOADED = 'LOADED',
ERROR = 'ERROR',
NEVER = 'NEVER',
LOADING = 'LOADING'
}
export enum AddFormState {
ERROR = 'ERROR',
NEVER = 'NEVER',
LOADING = 'LOADING'
}
export type TweetType = {
_id:string
text: string
user: UserType
createdAt: string,
... |
Python | UTF-8 | 3,022 | 3.015625 | 3 | [] | no_license | import os
import telebot
import requests
API_KEY = os.getenv('API_KEY')
bot = telebot.TeleBot(API_KEY)
PASSWORD = os.getenv('PASSWORD')
base_url = "https://tele-bot-back-end.herokuapp.com/"
@bot.message_handler(commands=['start'])
def greet(message):
bot.reply_to(message, '''Welcome to our bot!\nSome helpful com... |
PHP | UTF-8 | 2,211 | 2.828125 | 3 | [] | permissive | <?php
declare(strict_types=1);
namespace Laminas\Mvc\I18n;
use Laminas\I18n\Translator\TranslatorInterface as I18nTranslatorInterface;
use Laminas\Validator\Translator\TranslatorInterface as ValidatorTranslatorInterface;
use function call_user_func_array;
use function method_exists;
use function sprintf;
class Tra... |
Go | UTF-8 | 1,477 | 3.171875 | 3 | [] | no_license | package main
import (
"crypto/rand"
"fmt"
"flag"
"strings"
)
var (
helpFlag = flag.Bool("h", false, "Show this help")
knownPrefix = flag.String("p", "28:99:c7", "Specify the OUI (first six hex) separated by colon (:) or dash (-)")
numFlag = flag.Int("n", 1, "Number of entries to generate (up to 1000)")
)
cons... |
C++ | WINDOWS-1251 | 1,815 | 2.984375 | 3 | [] | no_license | // 9.11.cpp: .
//
#include "stdafx.h"
#include <string>
struct List1Element
{
char str[100];
List1Element * next;
};
List1Element * createList()
{
List1Element * tmp = new List1Element;
tmp->str[0] = 0;
tmp->next = NULL;
return tmp;
}
void delList(List1Element *head)
{
List1Element *tmp = head;
while (... |
C++ | UTF-8 | 931 | 2.703125 | 3 | [
"MIT"
] | permissive | //
// BaseScrollHandle.h
// ofxMUI_scrollbars
//
// Created by Roy Macdonald on 2/9/20.
//
#pragma once
#include "ofEvents.h"
namespace ofx {
namespace MUI {
template <typename DataType>
class BaseScrollHandle{
public:
virtual ~BaseScrollHandle(){}
ofEvent<DataType> handleChangeEvent;
///\brief set... |
Markdown | UTF-8 | 875 | 2.5625 | 3 | [] | no_license | # CSE557_a4
https://mayhoo.github.io/CSE557_a4/a4.html

√ 2 pts: When unzipped, project runs without errors or modifications on our part.
√ 30 pts: Map displays data from file, states are accurately positioned.
√ 10 pts: Hovering implemented ... |
C | UTF-8 | 2,669 | 3.390625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: ... |
JavaScript | UTF-8 | 1,609 | 2.5625 | 3 | [] | no_license | var inquirer = require("inquirer");
var axios = require("axios");
var fs = require("fs");
const doc = require('./doc.js')
inquirer
.prompt([
{
type: "input",
message: "What's your Github username?",
name: "username"
},
{
type: "list",
... |
PHP | UTF-8 | 3,310 | 3.0625 | 3 | [] | no_license | <?php
namespace Snowy\Helpers;
/**
* Class Uri
* @package Snowy\Helpers
*/
class Uri{
/**
* Текущий адрес
* @var null|array
*/
private static $currentUrl = null;
/**
* Возвращает текущий адрес
* @param int $flag
* @return string
*/
public static function getCurre... |
PHP | UTF-8 | 145 | 3.078125 | 3 | [] | no_license | <html>
<head>
<title> PHP: Strings </title>
</head>
<body>
<?php
$string = "Hello";
$string .= " World!";
echo $string
?>
</body>
</html>
|
PHP | UTF-8 | 400 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: LINH
* Date: 5/23/2019
* Time: 5:53 PM
*/
namespace App\BusinessService;
use App\Business\GetChartBL;
class GetChartBS
{
private $getChartBL;
public function __construct(GetChartBL $getChartBL)
{
$this->getChartBL = $getChartBL;
}
public fu... |
PHP | UTF-8 | 357 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use \App\Instruksi;
class InstruksiSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
for ($i=1;$i<=10;$i++) {
Instruksi::create(['id_workshop'=>$i,'id_pemateri'=>$i,'judul'=>"Judul ".... |
Python | UTF-8 | 750 | 3.828125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
cars = 100 # numbers of cars
space_in_a_car = 4 # 4.0 floating point | sits per car
drivers = 30 # number of drivers
passengers = 90 # number of passengers
cars_not_driven = cars - drivers # one driver per car
cars_driven = drivers # one driver per car i = 30
carpool_capacity = cars_driven * spa... |
Python | UTF-8 | 672 | 3.171875 | 3 | [] | no_license | #! /usr/bin/python
import random
import sys
def getBin(numStr):
xr = ""
for i in numStr:
if i == '0':
xr += chr(0)
else:
xr += chr(1)
return xr
i = int(sys.argv[1])
f = open("numbers",'w')
x = random.randint(pow(2,i-1),pow(2,i)-1)
y = random.randint(pow(2,i-1),pow... |
Python | UTF-8 | 361 | 2.859375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/12/15 14:16
# @Author : glacier
# @Site :
# @File : make_readable.py
# @Software: PyCharm Edu
import time
def make_readable(seconds):
tt = time.localtime(seconds)
str1 = time.strftime("%H:%M:%S",tt)
print(str1)
# D... |
C# | UTF-8 | 2,210 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LMGEDIApp.Infrastructure.ApplicationServices.Contracts;
namespace LMGEDIApp.Infrastructure.Services
{
public class ARCommonServices : IARCommonSer... |
Markdown | UTF-8 | 2,162 | 3.25 | 3 | [] | no_license | ---
layout: post
title: Android中移除除了首页的历史Activity
date: 2018-09-10 09:18:31 +0800
author: yitimo
categories: android
tags: ["android", "activity stack"]
keywords:
- android,
- round corner,
- activity stack,
description: Android中如何在打开新页面时清空除了首页的历史纪录,即从新页面返回时为首页
---
对于Android中Activity栈的操作提及比较多的是在``Intent``中使用这几个``Fl... |
Python | UTF-8 | 531 | 2.9375 | 3 | [] | no_license |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 29 13:05:33 2019
@author: David
"""
import sys, os
path_tools = os.path.abspath(os.path.join(os.getcwd(), os.pardir))
sys.path.insert(1, path_tools)
from tools import *
def err_deg(a1,ref):
### Calculate the error ref-a1 in an efficient way in the circular space
... |
C | UTF-8 | 887 | 3.3125 | 3 | [] | no_license | #include <string.h>
void inputSideConvolution(int lenH, int *h, int lenX, int *x, int *y) {
if (lenH > lenX) {
inputSideConvolution(lenX, x, lenH, h, y);
return;
}
// from here: lenH <= lenX
int lenY = lenH + lenX - 1;
memset(y, 0, lenY*sizeof(int)); // sets y[i]=0 for all i
for(int i=0; i < lenX; ... |
Java | UTF-8 | 1,247 | 2.078125 | 2 | [] | no_license | package testNg_Example;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Reporter;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class Wd_Te... |
Rust | UTF-8 | 13,890 | 2.671875 | 3 | [] | no_license | use std::cmp;
use tcod::colors::*;
use tcod::console::*;
mod object;
use object::*;
mod mytcod;
use mytcod::*;
mod gamemap;
use gamemap::*;
use tcod::input::{self, Event, Key};
use tcod::map::Map as FovMap;
use rand::Rng;
const PLAYER: usize = 0;
const HEAL_AMOUNT: i32 = 4;
const LIGHTNING_DAMAGE: i32 = 40;
cons... |
Java | UTF-8 | 1,524 | 2.6875 | 3 | [] | no_license | package io.github.cmansfield.card;
import io.github.cmansfield.deck.constants.Format;
import io.github.cmansfield.deck.constants.Legality;
import io.github.cmansfield.io.CardReader;
import org.testng.annotations.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;... |
Markdown | UTF-8 | 260 | 2.71875 | 3 | [] | no_license | The least squares problem, also often known as linear regression allows one to fit a linear model to observed data. It can be solved using one of two methods:
* Standard Equation
* Gradient Descent
In this implementation we'll focus on using gradient descent |
C++ | UTF-8 | 873 | 3.28125 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <vector>
#include <set>
using namespace std;
class Solution
{
public:
struct Comp
{
bool operator()(int a, int b)
{
if (a % 2 == 0)
{
return true;
}
return false;
}
};
vector<int> s... |
PHP | UTF-8 | 1,250 | 3 | 3 | [
"MIT"
] | permissive | <?php
namespace Crummy\Phlack\Common\Formatter;
use Crummy\Phlack\WebHook\CommandInterface;
class Sequencer implements FormatterInterface
{
const SEQUENCE = '<%s>';
/**
* @param string $text The text to be sequenced
* @param string $label An optional label
*
* @return string
*/
... |
PHP | UTF-8 | 2,407 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/**
* Calendar item
* Visualise image, date(s) and title.
*/
// Variables
$thumb = has_post_thumbnail ()? wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ): [null];
if (!$thumb[0]){
if ( get_post_meta( $post->ID, '_scheduled_thumbnail_id' ) ){
$array = get_post_meta( $post->ID, '_sc... |
C | UTF-8 | 987 | 2.71875 | 3 | [] | no_license | #ifndef VECTOR_H
#define VECTOR_H
#include "Point.h"
#define VECTOR_INIT_CAPACITY 4
#define VECTOR_INIT(vec) vector vec; vector_init(&vec)
#define VECTOR_ADD(vec, item) vector_add(&vec, item)
#define VECTOR_SET(vec, idx, item) vector_set(&vec, idx, item)
#define VECTOR_INSERT(vec, idx, item) vector_insert(&vec, idx,... |
Markdown | UTF-8 | 3,531 | 2.75 | 3 | [] | no_license | ---
description: "Step-by-Step Guide to Prepare Homemade Jackfruit Laddu"
title: "Step-by-Step Guide to Prepare Homemade Jackfruit Laddu"
slug: 3176-step-by-step-guide-to-prepare-homemade-jackfruit-laddu
date: 2021-12-24T15:48:56.122Z
image: https://img-global.cpcdn.com/recipes/7204066d7a958733/680x482cq70/jackfruit-la... |
JavaScript | UTF-8 | 5,297 | 3 | 3 | [] | no_license |
function summitElements(total, num) {
return total + num;
}
function findFishsOverVolumes() {
let fish = fishFarm.filter((fishes) => fishes.stockVolumeInKg > 500);
let fishNames = fish.map((pFish) => {
console.log(pFish.fishType);
});
return fishNames;
}
function filterFishForPrice() {
let costsSpace... |
Java | UTF-8 | 1,742 | 2.328125 | 2 | [] | no_license | package com.luan.java8defaultcrudapplication.service.dto;
import java.io.Serializable;
import java.time.LocalDate;
public class AddressDTO implements Serializable{
private static final long serialVersionUID = 1L;
private Long id;
private String street;
private String district;
private Long number;
pri... |
Swift | UTF-8 | 1,487 | 3.046875 | 3 | [] | no_license | //
// Controller.swift
// Tic Tac Toe
//
// Created by Tobin Bell on 7/7/16.
// Copyright © 2016 Tobin Bell. All rights reserved.
//
import UIKit
class TicTacToeController: UIViewController {
@IBOutlet weak var boardView: UIView!
@IBOutlet weak var statusLabel: UILabel!
var game = TicTacToeM... |
Java | UTF-8 | 1,568 | 2.3125 | 2 | [] | no_license | package com.aleksandra.go4mytrip;
public class NoteModel {
String IdNote;
String NoteTitle;
String TextNote;
String DateTime;
String NoteColor;
String Link;
String Image;
public NoteModel() {
}
public NoteModel(String idNote, String noteTitle, String textNote, String dateTime... |
Markdown | UTF-8 | 237 | 2.953125 | 3 | [
"MIT"
] | permissive | ### 布局
`span`表示每列占多少比列,是平均
`gutter`表示每列之间的间隔,`gutter:20`表示空格是`2em`
目前只支持均匀分布,更多的功能,比如:混合分布/分栏偏移等,请使用`u-row/u-col` |
Python | UTF-8 | 1,986 | 3.53125 | 4 | [] | no_license | #!/usr/bin/env python3
import argparse
import glob
import os
description = """"show the sets of 2 strings. string can input strings or glob or string file."""
parser = argparse.ArgumentParser(description=description)
parser.add_argument('-1', '--strings_1', nargs='+', required=True)
parser.add_argument('-2', '--strin... |
C++ | UTF-8 | 1,718 | 3 | 3 | [] | no_license | //
// Created by shaob on 2020/2/25.
//
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
struct student {
string name;
char gender{};
string ID;
int grade{};
student() = default;
student(string _name, char _gender, string _I... |
JavaScript | UTF-8 | 557 | 2.90625 | 3 | [] | no_license | var btnGuardar = document.getElementById("btnguardar");
var inputTexto = document.getElementById("inputtexto");
var btnObtener = document.querySelector("#btnobtener");
var element = document.querySelector("#snacks")
btnGuardar.addEventListener("click", function(){
var texto = inputTexto.value;
localStorage.setIte... |
Java | UTF-8 | 1,626 | 2.5625 | 3 | [
"MIT"
] | permissive | package com.mari05lim.covidinfo.model;
import com.google.gson.annotations.SerializedName;
public class WorldModel {
@SerializedName("lastUpdate")
private String lastUpdate;
@SerializedName("confirmed")
private Confirmed confirmed;
@SerializedName("deaths")
private Deaths deaths;
@Serializ... |
Java | UTF-8 | 1,875 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package org.elkan1788.extra.nuby.service;
import org.elkan1788.extra.nuby.bean.Couponlog;
import org.nutz.dao.Cnd;
import org.nutz.dao.sql.Criteria;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import java.util.Date;
import java.util.List... |
Markdown | UTF-8 | 3,750 | 2.78125 | 3 | [] | no_license | # Graph explorer
## Design goals
A highly interactive dashboard to satisfy ad-hoc information needs across many similar metrics and graphs
using mainly expressive queries as input.
Plenty of dashboards provide statically configured pages for realtime and/or historic dashboards,
others provide some dynamism but are o... |
Python | UTF-8 | 2,523 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | """
Unit tests for QuTiP partial transpose functions.
"""
import numpy as np
from qutip import Qobj, partial_transpose, tensor, rand_dm
from qutip.partial_transpose import _partial_transpose_reference
def test_partial_transpose_bipartite():
"""partial transpose of bipartite systems"""
rho = Qobj(np.arange(... |
Python | UTF-8 | 719 | 3.71875 | 4 | [] | no_license | """ useful methods for the demos """
def title(fun):
""" Add a title from the first line of the docstring to the console output
if no docstring is given, then rakes the name of the method"""
def wrapper(*args, **kwargs):
if fun.__doc__:
print('\n\t', fun.__doc__.split('\n')[0])... |
Python | UTF-8 | 6,729 | 3.15625 | 3 | [] | no_license | from flask import Flask, render_template, request
import requests, urllib, json, openpyxl, forecastio, datetime, math, decimal
from sklearn import svm
from datetime import timedelta
''' Exporting the data from our workbook '''
wb = openpyxl.load_workbook('finalML.xlsx') # open the workbook
ws = wb.get_sheet_by_name... |
Markdown | UTF-8 | 237 | 2.765625 | 3 | [] | no_license | # Dice
## Description
A randomised dice generator that picks numbers between 1-6.
## Instructions
1. Shake the micro:bit to start the randomised dice trow – the LEDs will display dice values from 6-1 and then the randomised result
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.