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 | 8,937 | 2.90625 | 3 | [
"MIT"
] | permissive | Audiogram was developed for our particular needs but hopefully it should be reasonably hackable besides the options provided. Here are some examples of possible customization that involve writing/editing the code and notes on how you could get started.
## Use different animations besides the wave/bars/bricks
The cod... |
C | UTF-8 | 2,351 | 2.546875 | 3 | [] | no_license | #ifndef _KETAMA_H_
#define _KETAMA_H_
/**
* XXX.XXX.XXX.XXX:YYYYY ==
* (4 * 3 + 3)[ip] + 1[delimiter] + 5[port] == 21 bytes max
*/
#define MAX_HOST_LEN 22
/* previously 'mcs' */
struct ketama_point {
uint32_t value;
uint32_t srv_id;
};
/* previously 'serverinfo' */
struct ketama_srv_info {
char addr... |
Python | UTF-8 | 920 | 3.75 | 4 | [] | no_license | #num = int(input("Input an int: "))
#counter = 0
#while counter < num:
# print(num)
# num -= 1
#num = int(input("Input an int: "))
#counter = 0
#while counter < num:
# counter += 1
# print(counter*2)
#num = int(input("Input an int: "))
#counter = num
#sum = 0
#while num != 10:
# sum += num # sum = s... |
C++ | UTF-8 | 6,894 | 2.546875 | 3 | [] | no_license | /*
D E L I Q U E S Z E N Z
Ermittlung des Deliqueszenzpunktes eines Salzes
Es wird die Luftfeuchtigkeit gesucht, bei der ein Salz
so viel Feuchtigkeit aus der Luft aufnimmt, dass es Leit-
fähig wird.
Zunächst werden die aktuellen Werte ermittelt und die
Startparameter gesetzt. Dann wird die gewünschte... |
Python | UTF-8 | 222 | 3.28125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
n=int(input('Digite a quantidade:'))
v=[]
somaimpares=0
somapares=0
contimpares=0
contpares=0
for i in range(0,n+1,1):
a=float(input('Digite um valor:'))
v=v.append(a)
print(v)
|
C++ | UTF-8 | 642 | 3.453125 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
string countAndSay(int n) {
if (n == 1) return "1";
if (n == 2) return "11";
string str = "11";
for (int i = 3; i <= n; i++) {
str += "$"; // previous char processed in current loop so dummy character required.length()
int len = str.length();
int cnt ... |
Markdown | UTF-8 | 4,344 | 3.46875 | 3 | [] | no_license | # LeetCode 专题 -- 动态规划习题
## AcWing 285. 没有上司的舞会
`难度:简单`
### 题目描述
Ural大学有N名职员,编号为1~N。
他们的关系就像一棵以校长为根的树,父节点就是子节点的直接上司。
每个职员有一个快乐指数,用整数 Hi 给出,其中 1≤i≤N。
现在要召开一场周年庆宴会,不过,没有职员愿意和直接上司一起参会。
在满足这个条件的前提下,主办方希望邀请一部分职员参会,使得所有参会职员的快乐指数总和最大,求这个最大值。
**输入格式**:
第一行一个整数N。
接下来N行,第 i 行表示 i 号职员的快乐指数Hi。
接下来N-1行,每行输入一对整数L, K,表示K是L... |
Java | UTF-8 | 2,727 | 2.203125 | 2 | [] | no_license | package com.huadingcloudpackage.www.bean;
import java.io.Serializable;
import java.util.List;
/**
* @version V1.0
* @类描述: 提交差异单 传参
* @创建人:李歌
* @修改人:
* @修改备注:
*/
public class SubmitChaYiDanBean implements Serializable {
/**
* differencesReason : 1
* refund : 60
* differencesExplain : 破损了
... |
Ruby | UTF-8 | 4,391 | 2.671875 | 3 | [
"MIT"
] | permissive | module Flutterby
module Reading
# Reloads the node from the filesystem, if it's a filesystem based
# node.
#
def reload!
logger.info "Reloading #{url.colorize(:blue)}"
time = Benchmark.realtime do
load!
stage!
emit(:reloaded)
end
logger.info "Reloaded ... |
Java | UTF-8 | 2,107 | 2.0625 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package xxxt.orgchart.dao;
import java.sql.CallableStatement;
import java.sql.ResultSet;
import oracle.jdbc.OracleTypes;
import org.hibernate.Session;
import org.json.JSONArray;
import org.json.JSONObject;
import xxxt.b... |
C | UTF-8 | 14,027 | 3.203125 | 3 | [] | no_license | /* FILE: A2_bmp_helpers.c is where you will code your answers for Assignment 2.
*
* Each of the functions below can be considered a start for you.
*
* You should leave all of the code as is, except for what's surrounded
* in comments like "REPLACE EVERTHING FROM HERE... TO HERE.
*
* The assignment document and... |
Java | UTF-8 | 346 | 2.078125 | 2 | [] | no_license | package com.dariapro.trainyourcountingskills.exception;
/**
* @author Pleshchankova Daria
*
*/
public class ExtraIsNullException extends Exception {
public ExtraIsNullException (String errorMessage) {
super(errorMessage);
}
public ExtraIsNullException (String errorMessage, Throwable err) {
... |
Python | UTF-8 | 522 | 2.6875 | 3 | [] | no_license | #! /usr/bin/env python
#Libraries and message types used
import rospy
import time
from std_msgs.msg import String
import os
#called when the send button is clicked
def callback_speak_string(msg):
os.system('espeak ' + '"' + msg.data + '"')
#print(msg.data)
#ROS setup
#Initialize this ROS node
rospy.init_... |
Java | UTF-8 | 1,101 | 4.0625 | 4 | [] | no_license | package cn.edu.bjut.nlp.basic._2object;
/*
instanceof 关键字
instanceof关键字的作用:判断一个对象是否属于指定的类别。
instanceof关键字的使用前提:判断的对象与指定的类别必须要存在继承或者实现的关系。
instanceof关键字的使用格式:
对象 instanceof 类别
instanceof关键字的作用: 目前没用。但是后天我们学习 到了多态之后就非常有用。
一般我们做强制类型转换之前都会使用该关键字先判断一把,然后在进行转换的。
*/
public class _0816_Object_Instanceof {
public s... |
Java | UTF-8 | 459 | 1.898438 | 2 | [] | no_license | package com.spring.actor.lib.web.pagination;
import com.spring.actor.lib.web.ResolveArgumentsException;
public class ResolvePaginationException extends ResolveArgumentsException {
public ResolvePaginationException(String s) {
super(s);
}
public ResolvePaginationException(String s, Throwable throw... |
C++ | UTF-8 | 2,079 | 3.46875 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
#include<time.h>
#include<conio.h>
using namespace std;
void showFile();
void menu();
void show_currentDateTime();
void show_doctors();
void show_nurses();
string doctors[100];
string nurses[100];
int doc = 0;
int nur = 0;
int main()
{
s... |
C# | UTF-8 | 284 | 2.796875 | 3 | [] | no_license | public interface IEntity
{
int Id { get; set; }
}
public class UserEntity : IEntity
{
int IEntity.Id { get; set; }
public string Name { get; set; }
}
var user = new UserEntity();
((IEntity)user).Id = -1;
user.Name = "John";
|
C++ | UTF-8 | 3,457 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <algorithm>
#define mid lt + (rt-lt)/2
#define vx Element *
using namespace std;
struct Window {
int y, r, l;
char ble;
};
Window make_window(int y, int l, int r, char ble) {
Window *node = new Window;
node->y = y;
node->r = r;
node->l = l;
n... |
Java | UTF-8 | 19,510 | 2.203125 | 2 | [] | no_license | package com.rz.bean;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang.StringUtils;
/**
* Bean类 - 系统配置
*/
public class Setting {
// 货币种类(人民币、美元、欧元、英磅、加拿大元、澳元、卢布、港币、新台币、韩元、新加坡元、新西兰元、日元、马元、瑞士法郎、瑞典克朗、丹麦克朗、兹罗提、挪威克朗、福林、捷克克朗、葡币)
public enum CurrencyType {
C... |
PHP | UTF-8 | 9,705 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by Generator.
* Package: org\majkel\tcpdfwarper
* User: Michał (majkel) Kowalik <maf.michal@gmail.com>
* Date: 2016-01-26
* Time: 23:13:35
*/
namespace org\majkel\tcpdfwarper;
/**
* Class TextOp
* @package org\majkel\tcpdfwarper
*
* Prints a text cell at the specified position.
* This m... |
Java | UTF-8 | 654 | 1.960938 | 2 | [] | no_license | package com.spring.example.myfirstdemo.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.ArrayList;
@RestController
public class MyuserController {
@GetMapping("/hellodevops")
public St... |
Python | UTF-8 | 1,466 | 3.296875 | 3 | [] | no_license | __author__ = 'smy'
class Solution(object):
def maxProfit(self,prices):
if len(prices)==0:
return 0
result = 0
lastMax = prices[-1]
for val in reversed(prices[0:len(prices)-1]):
result = max(lastMax-val,result)
lastMax = max(lastMax,val)
re... |
Java | UTF-8 | 3,190 | 2.625 | 3 | [] | no_license | package de.amr.easy.grid.ui.swing.rendering;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GraphicsEnvironment;
import java.awt.image.BufferedImage;
import java.util.Optional;
import javax.swing.JComponent;
import de.amr.easy.data.Stack;
impor... |
C# | UTF-8 | 808 | 2.546875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SceneNavigator : MonoBehaviour {
public static SceneNavigator Instance;
public static List<int> sceneNums = new List<int> ();
public static void NewSceneRoute(string scene)
{
sceneNu... |
Java | UTF-8 | 1,795 | 2.046875 | 2 | [] | no_license | package usercenter.saleManage.model;
import java.util.Date;
public class AccessRecord {
private int record_id;
private int submit_id;
private String receive_name;
private int receive_id;
private Date create_dt;
private int access_status;
private int h_id;
private int accepter_re... |
Markdown | UTF-8 | 5,269 | 2.78125 | 3 | [
"MIT"
] | permissive | # ras-frontstage routes
This page documents the ras frontstage routes that can be hit.
## Passwords endpoints
To reset a password
`passwords/reset-password/<token>`
* POST request to this endpoint allows you to reset your password
* GET request to this endpoint allows you to get the password reset form
* `token` is... |
C++ | UTF-8 | 5,132 | 2.5625 | 3 | [] | no_license | #include "ConvertProperty.h"
CORBA::Boolean
Property::extract_boolean_from_any(const CORBA::Any& a) {
CORBA::Boolean ret;
if(!(a >>= CORBA::Any::to_boolean(ret)))
throw type_exception();
return ret;
};
CORBA::Short
Property::extract_short_from_any(const CORBA::Any& a) {
CORBA::Short ret;
if(!(a >>= ret))... |
Ruby | UTF-8 | 1,039 | 3.5 | 4 | [] | no_license | #
# @lc app=leetcode id=222 lang=ruby
#
# [222] Count Complete Tree Nodes
#
# https://leetcode.com/problems/count-complete-tree-nodes/description/
#
# algorithms
# Medium (47.06%)
# Total Accepted: 248.8K
# Total Submissions: 528.7K
# Testcase Example: '[1,2,3,4,5,6]'
#
# Given a complete binary tree, count the num... |
Python | UTF-8 | 1,695 | 2.921875 | 3 | [
"MIT"
] | permissive | import enum
from typing import List
from rest_framework import status
from rest_framework.response import Response
class DataType(enum.Enum):
"""
Constants, used on generating error strings.
"""
QUERY = 'query'
PARAM = 'param'
BODY = 'body'
def extract_data(data: dict, keys: List[str]) -> ... |
Python | UTF-8 | 1,586 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python
import requests
from bs4 import BeautifulSoup as soup
# In[100]:
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'}
# In[101]:
html = requests.get(
'https://www.glassdoor.co.in/Job/los-angeles-da... |
C++ | UTF-8 | 2,146 | 2.96875 | 3 | [
"Apache-2.0",
"ISC",
"MIT"
] | permissive | #ifndef __IDX__UTILS__DATA_SET_GENERATORS__
#define __IDX__UTILS__DATA_SET_GENERATORS__
#include <algorithm>
#include <cstdint>
#include <fstream>
#include <string>
#include <set>
#include <vector>
#include "idx/utils/RandomRangeGenerator.hpp"
#include "idx/utils/CommandParser.hpp"
#include "idx/utils/8ByteDatFileIO.... |
Python | UTF-8 | 1,071 | 2.5625 | 3 | [] | no_license | from actions.login_actions import LoginActions
from facades import login_facade as login
from core.utils import datafile_handler as data_file
from facades import menu_facade as menu
import datetime
import pytest
#Prueba 1.- Registro con correo electrónico no válido
@pytest.mark.parametrize('label_email,label_passwo... |
Markdown | UTF-8 | 677 | 2.625 | 3 | [] | no_license | # 将查询条件保存为书签
*概述*.
书签能够用以保存查询条件,并与其它用户共享。
在搜索栏中输入查询条件并执行搜索。
点击位于搜索栏右侧的星型*书签*按钮,打开*新建书签*窗口。

输入书签的*名称*。
根据需要编辑*搜索字符串*一栏中的内容(如果可用)。
点击*确定*保存该查询条件为书签并关闭该窗口。
该搜索查询条件被保存并在*书签*栏中出现。
*结果*.
您将查询条件保存为书签以便之后使用。使用*书签*栏来查看并选择该书签。
|
Java | UTF-8 | 2,396 | 3.9375 | 4 | [] | no_license | public class ComputerPlayer
{
private CardStack2 myCards;
public ComputerPlayer()
{
myCards = new CardStack2();
}
public int getNumCards()
{
return myCards.size();
}
/**
* adds the given card to myCards.
* @param c - a card to add
*/
public void acc... |
Shell | UTF-8 | 170 | 2.609375 | 3 | [] | no_license | #!/bin/bash
[[ -f ${HOME}/.dotrc ]] && source ${HOME}/.dotrc
pushd ${DOTFILES:-${HOME}/.dotfiles} &>/dev/null
git submodule update --init --recursive
popd &>/dev/null
|
PHP | UTF-8 | 708 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use App\News;
use Faker\Factory as Faker;
class NewsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker::create();
for ($i = 0; $i < 12; $i++) {
$con... |
Java | UTF-8 | 335 | 1.867188 | 2 | [] | no_license | package hieuboy.developer.models;
import lombok.Data;
import java.io.Serializable;
@Data
public class PermissionModel implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String name;
private String link;
private Boolean islock;
private Integ... |
PHP | UTF-8 | 1,104 | 2.640625 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | <?php
namespace Admin\Bundle\Authentication;
use Symfony\Component\Security\Http\Authentication\AuthenticationSuccessHandlerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\HttpFoundation\Request;
use Symfony... |
Markdown | UTF-8 | 3,577 | 3.296875 | 3 | [] | no_license | ---
layout: docs
title: External plugins
permalink: /docs/extending/external/
---
Albert can be extended using regular executables. They are used like plugins, however the executables are separate processes which have separate address spaces. Therefore these executables are called *external extensions*.
An external p... |
PHP | UTF-8 | 10,910 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Utility;
use Illuminate\Http\Request;
use App\Utility;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Artisan;
class UtiliyController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
... |
Java | UTF-8 | 1,282 | 2 | 2 | [
"MIT"
] | permissive | package com.workflow.controller;
import com.workflow.entity.UserRole;
import com.workflow.entity.activiti.ResultListDataRepresentation;
import com.workflow.service.UserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bin... |
PHP | UTF-8 | 628 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Domain\Post\Http\Requests\Review;
use App\Infrastructure\Http\AbstractRequests\BaseRequest as FormRequest;
class PostReviewStoreFormRequest extends FormRequest
{
/**
* Determine if the post is authorized to make this request.
*
* @return bool
*/
public function authori... |
Java | UTF-8 | 701 | 2.296875 | 2 | [] | no_license | package com.luyunfeng.selectionpanel;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* Created by luyunfeng on 2016/12/18.
*/
public class ItemMarginDecoration extends RecyclerView.ItemDecoration {
private int[] itemMargin = new int[4];
public I... |
PHP | UTF-8 | 1,885 | 3.3125 | 3 | [] | no_license | <?php
// connecting to the database
$servername = "localhost";
$username = "root";
$password = "root";
$dbname = "manishadb_testing";
// Create a connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// die if connection was unsuccessfull
if (!$conn){
die("sorry we failed to connect ".... |
Java | UTF-8 | 16,896 | 2.984375 | 3 | [] | no_license | package com.appliedminds.martini;
import java.awt.Graphics2D;
import java.awt.Graphics;
import java.awt.event.MouseEvent;
import java.awt.event.MouseEvent;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.... |
Java | UTF-8 | 8,753 | 1.859375 | 2 | [] | no_license | package com.mrbt.lingmoney.admin.service.bank.impl;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.dom4j.Document;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Str... |
Markdown | UTF-8 | 6,523 | 2.609375 | 3 | [] | no_license | ## JINY (Jana's tINY kernel)
[JINY](https://github.com/naredula-jana/Jiny-Kernel) is a cloud OS designed from ground up for superior performance on virtual machine.
1. **What is JINY?**.
- Unlike traditional kernel Jiny is thin kernel designed for cloud. Jiny provides posix interface similar to linux, so linux applic... |
Java | UTF-8 | 27,001 | 2.234375 | 2 | [] | no_license | package Student;
import DBConnection.DBConnect;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.scene.control.ComboBox;
import javax.swing.JO... |
Python | UTF-8 | 319 | 3.15625 | 3 | [] | no_license | class Solution:
"""
@param n: An integer
@return: The number of zero in factorial
"""
def trailingZero(self, n):
if n <5:
return 0
elif n < 10:
return 1
else:
return n//5 + self.trailingZero(n//5)
a = Solution()
print(a.trailingZero(25))
|
Markdown | UTF-8 | 1,293 | 2.6875 | 3 | [] | no_license | # 视差滚动
+ 插件
+ **`Stellar 插件`**
+ 描述
+ **视差滚动** 指网页滚动过程中,多层次的元素进行不同程度的移动,视觉上形成立体运动效果的网页展示技术 主要**核心**就是 前景 和 背景 以不同的速度移动,从而创造出 3D 效果。
+ 特性
+ 视差滚动效果酷炫,适合于个性展示的场合
+ 视差滚动徐徐栈开,适合于娓娓道来,讲故事的场合
+ 视差滚动容易迷航,需要具备较强的导航功能
+ 原理
+ 传统的网页的文字、图片、背景都是一起按照相同方向相同速度滚动的,而视差滚动则是在滚动的时候,内容和多层次的背景实现或不同速度,或不同方向的运动。有的时候也可以加上一些透明度、大小的动画... |
PHP | UTF-8 | 1,411 | 2.9375 | 3 | [] | no_license | <?php
namespace App\Repositories\Corporation;
// 統合API用
use App\Libraries\IntegratedAPI\IntegratedAPIClient;
class CorporationRepository implements CorporationRepositoryInterface {
protected $IntegratedApiClient;
public function __construct(
IntegratedApiClient $IntegratedApiClient
) {
$this->IntegratedApiCli... |
Markdown | UTF-8 | 1,369 | 2.53125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: 헤더 컨트롤에 항목 추가
ms.date: 11/04/2016
helpviewer_keywords:
- controls [MFC], header
- CHeaderCtrl class [MFC], adding items
- header controls [MFC], adding items to
ms.assetid: 2e9a28b1-7302-4a93-8037-c5a4183e589a
ms.openlocfilehash: 5749a0cae2dfe7e6c9f4c166eca487e36c2d21d2
ms.sourcegitcommit: c21b05042debc97d14... |
C++ | UTF-8 | 1,638 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "detector.hpp"
namespace giraffic::primes
{
detector::detector(std::uint64_t max_number, std::uint64_t portion, std::size_t workers, std::shared_ptr<giraffic::core::logger> logger)
:m_max_number(max_number), m_portion(portion), m_workers(workers), m_logger(logger), m_numbers(max_number + 1, true), m_async_... |
Python | UTF-8 | 2,515 | 2.53125 | 3 | [] | no_license | __author__ = 'xyang'
import os
import shutil
import fileinput
import re
class manageFile():
def __init__(self):
pass
def remove_character(self, filepath, count, testcase,mode):
lines = open(filepath).readlines()
fp = open('test_suite_debug.cfg','w')
for s in lines:
... |
Python | UTF-8 | 366 | 3.046875 | 3 | [] | no_license | myDict = {}
print myDict
myDict['ABC'] = "Company ABC"
myDict['XYZ'] = "Corporation XYZ"
myDict['ZZZ'] = "ZZZ Inc"
print myDict
print myDict['ABC']
for x in myDict.keys():
print x, myDict[x]
for x in myDict:
print x
myDict['ZZZ'] = "Updated Company"
print myDict['ZZZ']
if 'ZZZ' in myDict:
print "True"
print... |
C# | UTF-8 | 8,441 | 2.921875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Threading;
namespace FractalViewer
{
class FractalGen
{
private int NO_OF_THREADS;
public PictureBox PB;
public Bitmap DrawArea;
private WPart[] WpArray;
pu... |
JavaScript | UTF-8 | 1,676 | 4.0625 | 4 | [] | no_license | const message = document.querySelector('.message');
const guess = document.querySelector('input');
const btn = document.querySelector('.btn');
let play = false;
let newWord = "";
let randWord = "";
let words = ['empowerment', 'feminism', 'science', 'math',
'women', 'awareness', 'confidence', 'creative', 'd... |
Java | UTF-8 | 2,021 | 2.59375 | 3 | [] | no_license | package servlets;
import models.UserModel;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet... |
SQL | UTF-8 | 1,371 | 4 | 4 | [] | no_license | /***********************
Author: Deepak Luitel
Assignment: SQL Queries on Mondial Dataset
CMSC424 Database Design
Spring 2015
***********************/
/*Question no:1*/
SELECT name "Name", area "Sq kms", area*0.386102 "Sq miles"
FROM continent;
/*Question no:2*/
SELECT DISTINCT c.name Name, c.population Population... |
Java | UTF-8 | 1,401 | 2.515625 | 3 | [] | no_license | package OficeHourse._day02;
import com.cybertek.utilities.WebDriverFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.BeforeClass;
import java.util.concurrent.TimeUnit;
public class ZeroBankAccountActivity1 {
/*1. The user navigates to the login page: http... |
Java | UTF-8 | 5,052 | 2.875 | 3 | [] | no_license | package models;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
public class ProfileModel implements Serializable {
private static final long serialVersionUID = 1L;
private static int idCounter = 0;
private int id;
... |
C# | UTF-8 | 1,632 | 3.71875 | 4 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
namespace _05.BombNumbers
{
class BombNumbers
{
static void Main()
{
List<int> sequence = Console.ReadLine().Split(' ').Select(int.Parse).ToList();
int[] bomb = Console.ReadLine().Split(' ').Select(int.... |
Python | UTF-8 | 1,725 | 3.34375 | 3 | [
"MIT"
] | permissive | import numpy as np
class Perceptron(object):
def __init__(self, eta=0.01, n_iter=50, random_state=1):
'''
:param eta: (float) learning rate, between 0 and 1
:param n_iter: (int) ~ epoch
:param random_state: (int) Random number generator seed
Atttribute:
w_: (1d-arra... |
PHP | UTF-8 | 604 | 2.84375 | 3 | [] | no_license | <?php
if ($argc == 3)
{
require_once('includes/movies.utils.php');
require_once('includes/student.utils.php');
if (!student_validate_login($argv[1]))
puts('Error: is not a valid login.');
elseif (!student_exists($argv[1]))
puts('Error: student does not exist.');
else
{
if (!movies_exists($argv[2]))
puts(... |
Ruby | UTF-8 | 1,530 | 3.109375 | 3 | [
"MIT"
] | permissive | class CLI
def call
puts "Please enter your name"
@name = gets.strip
puts "\n\nWelcome #{@name}, to FITTech Job Qual Finder!\n"
JobScrape.scrape_all
welcome_user
menu
end
def welcome_user
puts "Are you ready to look over job postings? y/n\n\n"
re... |
JavaScript | UTF-8 | 4,643 | 2.90625 | 3 | [] | no_license | const canvasWidth = window.innerWidth
const canvasHeight = window.innerHeight
let started = false
let numPendulums = 4
let pendulums
let reverb, filter
function setup(){
createCanvas(canvasWidth, canvasHeight)
reverb = new p5.Reverb()
filter = new p5.LowPass();
reverb.drywet(0.9)
pendulums = Ar... |
Python | UTF-8 | 10,028 | 2.65625 | 3 | [
"MIT"
] | permissive | """MA243x0A series USB power sensor"""
import functools
from datetime import datetime
import sys
import asyncio
import itertools
import pyvisa
from anritsu_pwrmtr.common import (
InstrumentBase,
get_idn,
Subsystem,
State,
)
ERRORSTATUS = [
"Temperature change of more than 10 °C after zeroing",
... |
Markdown | UTF-8 | 4,515 | 2.6875 | 3 | [
"MIT"
] | permissive | ---
title: 信息获取与验证·2022扩展包
date: 2022-03-23 01:04
categories:
- 事实核查
tags:
- 事实核查
description: 不吐不快升级包。
is_series: true
series_title: 事实核查
---
这篇东西是去年东奥期间那篇[《后信息时代的信息获取和验证指南》](/blog/2021/09/11/a-guide-for-information-get-and-check-on-this-post-information-age/)的后续,当时,我们讨论了对于信息源的分级和筛选。而正在发生的俄国全面入侵事件,是一次对前述原则的有效演练,也是一次更... |
Java | UTF-8 | 3,741 | 2.140625 | 2 | [] | no_license | package com.mcindoe.dashstreamer.views;
import java.util.ArrayList;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
... |
Java | UTF-8 | 2,951 | 2.9375 | 3 | [] | no_license | package com.tonux.spring.jdbc.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import com.tonux.spring.jdbc.model.Utilisateur;
import com.tonux.spring.jdbc.rowmappers.UtilisateurRow;
import org.springfr... |
Shell | UTF-8 | 1,061 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
# Update the petalinux makefile to copy the rootfs.tar.gz file to the Vitis platform staging area
sed -i '31i\\tcp -f images\/linux\/rootfs.tar.gz \${OUTPUT}\/src\/\${CPU_ARCH}\/xrt\/image\/rootfs.tar.gz' petalinux/Makefile
# Update the petalinux project for SD card rootfs
cp petalinux/project-spec/config... |
PHP | UTF-8 | 827 | 2.6875 | 3 | [] | no_license | <?php
require __DIR__ . '/vendor/autoload.php';
use Test\CouponDiscountCalculator;
use Test\FixedAbsoluteCoupon;
use Test\FixedSlabCoupon;
$couponDiscountCalculator = new CouponDiscountCalculator();
$fixedAbsoluteCoupon = new FixedAbsoluteCoupon();
$fixedAbsoluteCoupon->maxAmount = 1000;
$fixedAbsoluteCoupon->minAm... |
Swift | UTF-8 | 26,351 | 3.0625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // UIViewExtensions.swift - Copyright 2022 SwifterSwift
#if canImport(UIKit) && !os(watchOS)
import UIKit
// MARK: - enums
public extension UIView {
/// SwifterSwift: Shake directions of a view.
///
/// - horizontal: Shake left and right.
/// - vertical: Shake up and down.
enum ShakeDirection {
... |
JavaScript | UTF-8 | 1,407 | 4.21875 | 4 | [] | no_license | /*
Given a sorted array, two integers k and x, find the k closest elements to x in the array.
The result should also be sorted in ascending order.
If there is a tie, the smaller elements are always preferred.
Example 1:
Input: [1,2,3,4,5], k=4, x=3
Output: [1,2,3,4]
Example 2:
Input: [1,2,3,4,5], k=4, x=-1
Output: [... |
C# | UTF-8 | 2,536 | 2.546875 | 3 | [] | no_license | using Microsoft.Crm.Sdk.Samples.HelperCode;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
namespace CrmHelper
{
public st... |
Rust | UTF-8 | 471 | 2.515625 | 3 | [] | no_license | use std::env;
use chrono::Duration;
const DEFAULT_REPORT_INTERVAL: u16 = 60; // every minute
pub fn get_metric_report_interval() -> u16 {
env::var("REPORT_INTERVAL").ok()
.and_then(|v| v.parse::<u16>().ok())
.unwrap_or(DEFAULT_REPORT_INTERVAL)
}
pub fn get_max_metrics_age() -> Duration {
env:... |
C++ | UTF-8 | 9,324 | 2.796875 | 3 | [] | no_license | #include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define PIN 6 //PIN di uscita dei dati.
int ora = 0; //Variabile contenente le ore.
int minuti = 0; //Variabile contenente i minuti.
int secondi = 0; //Variabile contenente i secondi.
boolean m = false; //Variabile booleana che d... |
Python | UTF-8 | 1,465 | 2.515625 | 3 | [] | no_license | import pandas as pd
from datetime import datetime
campaignsSettings = pd.ExcelFile('CAMPAIGNS_SETTINGS.xlsx').parse('Sheet 1')
campaignsWithPeIndex = pd.ExcelFile('CAMPAIGNS_WITH_PE_INDEX.xlsx').parse('Sheet1')
campaignNames = campaignsSettings['NAME_CAMPAIGN']
def convertToDate(str):
return datetime(str[0]//1000... |
Java | UTF-8 | 355 | 1.664063 | 2 | [] | no_license | package com.rckdeveloper.fitenessapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class HandPushUpActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.lay... |
JavaScript | UTF-8 | 547 | 2.8125 | 3 | [] | no_license |
const initState = {
inputValue: '222',
list: []
}
export default (state = initState, action) => {
switch (action.type) {
case 'change_input':
let newValue = JSON.parse(JSON.stringify(state))
return {
...newValue,
inputValue: action.data
}
case 'add_todo':
let... |
Java | UTF-8 | 2,294 | 2.359375 | 2 | [] | no_license | package com.dvnchina.advertDelivery.sysconfig.dao.impl;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.dvnchina.advertDelivery.bean.PageBeanDB;
import com.dvnchina.advertDelivery.dao.impl.BaseDaoImpl;
import com.dvnchina.advertDelivery.sysconfig.bean.ChannelInfo;
import com.dv... |
Java | UTF-8 | 491 | 1.90625 | 2 | [] | no_license | package com.authorization.AuthServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.nimbusds.jose.jwk.JWKSet;
@RestController
public class JwtController {
@Autowired... |
C++ | ISO-8859-7 | 3,438 | 2.609375 | 3 | [
"BSL-1.0"
] | permissive | /*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.tx... |
C++ | UTF-8 | 466 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main()
{
int cTeste, k, teste;
cin >> cTeste;
while(cTeste--) {
cin >> k;
while(k--) {
cin >> teste;
switch(teste) {
case 1: cout << "Rolien\n"; break;
case 2: cout << "Naej\n"; break;
... |
C# | UTF-8 | 3,900 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | using System.Collections.Generic;
using NUnit.Framework;
namespace CrossCutting.Diagnostics
{
static class LoggingExtensionTestCases
{
public static IEnumerable<ITestCaseData> GetTestCases()
{
yield return new TestCaseData(new LogLevelTester(
LogLevel.Debug,
... |
Java | UTF-8 | 1,576 | 2.25 | 2 | [] | no_license | package com.app.health;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.... |
Python | UTF-8 | 431 | 3.296875 | 3 | [] | no_license | from pylab import pi
# kg/m^3
STEEL_MASS_DENSITY = 7700
def sphere_mass(radius, mass_density):
return (4 / 3) * pi * radius ** 3 * mass_density
def steel_sphere_mass(radius):
return sphere_mass(radius, STEEL_MASS_DENSITY)
print("steel sphere mass for 1mm")
print(steel_sphere_mass(.001))
print("steel sph... |
Python | UTF-8 | 8,134 | 2.578125 | 3 | [] | no_license | """
game.py
a good place to start
Here we are again, old friends. Every day is a good day for a christmas adventure.
"""
import pygame
from pygame.locals import *
pygame.init()
from src.controller_handler import ControllerHandler
from src.player import Player
from src.enemy import Enemy
from src.templates import pla... |
Java | UTF-8 | 1,128 | 2.3125 | 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 model;
/**
*
* @author vivi
*/
public class Utilisateur {
private String pseudo;
private boolean estConnecte;
p... |
C++ | UTF-8 | 2,692 | 2.5625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define nmax 1007
using namespace std;
struct data
{
long k,l,r,gt;
};
long n,m,w[nmax],d,c;
data a[nmax];
void duyet(long u, long yon,long last,long canh)
{
if (a[u].k==2)
{
duyet(a[u].l,yon,2,a[u].r);
duyet(a[u].r,yon,2,a[u].l);
}
if... |
Python | UTF-8 | 5,966 | 2.765625 | 3 | [] | no_license | import json
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import numpy as np
import pandas as pd
import math
# Rota_01_187_DFS resultados
x = []
y = []
x1 = []
y1 = []
x2 = []
y2 = []
x3 = []
y3 = []
a1 = 'pdfFuel.json'
a2 = 'pdfFuelFuzzy.json'
a3 = 'pdfSpeed.json'
a4 = 'pdfSpeedFuzzy.json'
... |
C++ | GB18030 | 1,086 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Complex
{
public:
Complex(double re = 0, double im = 0):real(re), imag(im) {};
//<<ʵ
friend ostream& operator <<(ostream& output, Complex& c);
//>>ʵ븴
friend istream& operator >>(istream& input, Complex& c);
private:
double real;//ʵ
double imag;... |
C# | UTF-8 | 8,633 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Lista.Classes
{
class Registro0400 : Registro
{
public string cod_depe;
public string indr_insc_munl;
public string cnpj_proprio;
publi... |
C# | UTF-8 | 1,523 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Linq;
using System.Data.SqlClient;
namespace StopSQLServer
{
public partial class Frm_Main : Form
{
public Frm... |
C++ | GB18030 | 575 | 3.1875 | 3 | [] | no_license | //
// Created by һ on 2020/6/23.
// Q14ǰ
//
#include "util.h"
class Solution {
public:
/**
* 1:Ƚ
*/
string longestCommonPrefix(vector<string>& strs) {
if (strs.size() == 0) {
return "";
}
string result = strs[0];
for (int i = 1; i < strs.size(); i++) {
... |
Java | UTF-8 | 185 | 1.921875 | 2 | [] | no_license | package miu.edu.ati.ati.controller;
import miu.edu.ati.ati.domain.Country;
import java.util.List;
public interface CountriesController {
public List<Country> getAllCounties();
}
|
Java | UTF-8 | 4,412 | 2.25 | 2 | [] | no_license | package com.example.demo.web;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframewo... |
C++ | UTF-8 | 1,171 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;
/* 矩阵快速幂 */
#define INF 0x3f3f3f3f
#define M 10000
struct Mat {
long long m[2][2];
Mat() {
memset(m, 0, sizeof(m));
}
};
Mat... |
C | GB18030 | 698 | 2.890625 | 3 | [] | no_license | /*
* num: 201510050407
* puepose: Ӽ
* Create: 20161231
* Author: Albert
*/
#include<stdio.h>
#include<math.h>
main()
{
double a,s,h1,h2,h3,h4,c,p1,p2,l,f;
double H1,XH,JH,Hp,lp,Hp1,lp1,Js,jg,n,n1,sum;
scanf("%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf%lf",&a,&s,&h1,&h2,&h3,&h4,&c,&p1,&p2,&l,&... |
C++ | UTF-8 | 2,755 | 2.65625 | 3 | [
"BSD-3-Clause"
] | permissive | /* -*- coding: utf-8 -*-
*
* OneEuroFilter.cc -
*
* Author: Nicolas Roussel (nicolas.roussel@inria.fr)
*
*/
#include <libgametrak/utils/OneEuroFilter.h>
namespace gametrak {
void LowPassFilter::setAlpha(double alpha) {
if (alpha<=0.0 || alpha>1.0)
throw std::range_error("alpha should be in (0.0., ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.