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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 2,917 | 2.5625 | 3 | [] | no_license | // delicaey
const hotDelicaeyImg = document.querySelectorAll('.hotDelicaey-contain li img')
const hotDelicaeyName = document.querySelectorAll('.hotDelicaey-contain p')
const hotDelicaeyAddress = document.querySelectorAll('.hotDelicaey-block span')
const hotDelicaeyContain = document.querySelector('.hotDelicaey-contain... |
C++ | UTF-8 | 3,073 | 3.421875 | 3 | [] | no_license | #include "PID_CONTROL.h"
/*
How to use:
The setpoint is the desired reading from your sensor (ie a gyroscope value that reads 90 degrese after a right turn)
The SensorReading is the current value (ie the current gyroscope value)
The OutputVar is the Variable to store or write the output
Kp, Ki, and ... |
Markdown | UTF-8 | 5,643 | 2.53125 | 3 | [] | no_license | # 科学网—SCC 2008:我的科研起点 - 王东明的博文
# SCC 2008:我的科研起点 精选
已有 8869 次阅读2014-10-31 22:01|系统分类:[科研笔记](http://blog.sciencenet.cn/home.php?mod=space&do=blog&view=all&uid=1362128&catid=1)|关键词:国际会议,组织工作,科研|[科研](misc.php?mod=tag&id=274), [... |
Java | UTF-8 | 323 | 1.757813 | 2 | [] | no_license | package com.redwrench.android.framework;
public interface Game {
public Input getInput();
public FileOps getFileIO();
public Graphics getGraphics();
public Audio getAudio();
public void setScreen(Screen screen);
public void onResume();
public void onPause();
public Screen getStartScreen();
... |
C# | UTF-8 | 1,085 | 2.5625 | 3 | [] | no_license |
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace odev2
{
public class BinaryTree
{
public string veri;
public int indis;
public BinaryTree sag, sol;
public string isim;
public List<string> s1, s3, s4, s6;
public Lis... |
PHP | UTF-8 | 852 | 3.03125 | 3 | [] | no_license | <h2>Liste des articles</h2>
<?php
$query = $pdo->query("SELECT * FROM article");
// fetchAll retourne tous les résultats d'un coup
$articles = $query->fetchAll();
echo '<ul>'; // unordered list
foreach ($articles as $article) {
echo '<li>' // list item
// titre de l'article dans un lien po... |
Markdown | UTF-8 | 852 | 2.859375 | 3 | [] | no_license | java int 类整数的最大值是 2 的 31 次方 - 1 = **2147483648 - 1** = **2147483647**
bai -231——231-1,即-2147483648——2147483647
可以用 **Integer.MAX_VALUE** 表示它,即 int value = Integer.MAX_VALUE;
Integer.MAX_VALUE + 1 = Integer.MIN_VALUE = **-2147483648**
再大的数就要用 long (最大值 2 的 63 次方 - 1 )或者 BigDecimal 表示
前缀和、前缀积也称前缀和数组,前缀积数组。
给一数组... |
Java | UTF-8 | 714 | 2.671875 | 3 | [
"MIT"
] | permissive | package com.mprzybylak.minefields.jpa.relationships.onetomany.uni;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
@Entity
public class Reader {
@Id
private long id;
... |
C++ | UTF-8 | 1,868 | 2.875 | 3 | [
"MIT"
] | permissive | #include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys[ROWS][COLS] = {
{ '0', '1', '2', '3' },
{ '4', '5', '6', '7' },
{ '8', '9', 'A', 'B' },
{ 'C', 'D', 'E', 'F' }
};
byte rowPins[ROWS] = { 9, 8, 7, 6 }; // row pins
byte colPins[COLS] = { 5, 4, 3, 2 }; // column pins
// init keypad obj... |
C++ | UTF-8 | 826 | 3.09375 | 3 | [] | no_license | #include <unordered_set>
#include <vector>
using namespace std;
struct ListNode {
int val;
ListNode* next;
ListNode()
: val(0)
, next(nullptr)
{
}
ListNode(int x)
: val(x)
, next(nullptr)
{
}
ListNode(int x, ListNode* next)
: val(x)
, ... |
SQL | UTF-8 | 536 | 2.640625 | 3 | [] | no_license | CREATE TABLE [Resource].[Gatherer]
(
[GathererId] INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
[ResourceTypeID] INT NOT NULL,
[Name] NVARCHAR(50) NOT NULL,
[Range] INT,
[CycleUnits] NVARCHAR(50) NOT NULL,
[CycleTime] NVARCHAR(50) NOT NULL,
[CycleAmount] NVARCHAR(50) NOT NULL,
[SkillID1] INT NOT NUL... |
Rust | UTF-8 | 1,081 | 2.84375 | 3 | [] | no_license | use std::net::{TcpStream, TcpListener, Ipv4Addr};
use std::thread;
use std::io::Write;
use process;
use serde_json;
pub trait OpServer {
fn ip(&self) -> Ipv4Addr;
fn hostname(&self) -> String;
}
pub struct TcpServer<'a> {
listener: &'a TcpListener,
}
impl<'a> OpServer for TcpServer<'a> {
fn ip(&sel... |
C# | UTF-8 | 3,886 | 2.703125 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using UnityEditor;
/// <summary>
/// Author: Mauricio Galvez
/// Date Created: 30/03/15
/// Last Edited: 30/03/15
/// Armor Creator - Editor Window used to create Armor
/// </summary>
public class ArmorCreator : EditorWindow
{
public string Name; // Name value
public i... |
PHP | UTF-8 | 10,458 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
/**
* This file is part of cyberspectrum/i18n-contao.
*
* (c) 2018 CyberSpectrum.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This project is provided in good faith and hope to be usable by anyone.
*
* @package cy... |
Java | UTF-8 | 8,384 | 1.75 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2004 Anite - Central Government Division
* http://www.anite.com/publicsector
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENS... |
PHP | UTF-8 | 1,800 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class UsersController extends Controller
{
/**
* [all description]
*
* @return [type] [description]
*/
public function all()
{
return User::all();
}
/**
* Create user rec... |
C++ | UTF-8 | 821 | 3.078125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Car.cpp
* Author: Administrator
*
* Created on April 28, 2016, 8:20 AM
*/
#include "Car.h"
Car::Car(int year, st... |
Markdown | UTF-8 | 786 | 2.546875 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Module Info Dialog Box
description: "The Module Info dialog box displays all the kernel mode modules loaded on the system from which the event log trace was gathered."
ms.date: 05/10/2022
---
# Module Info Dialog Box
The **Module Info** dialog box displays all the kernel mode modules loaded on the system... |
PHP | UTF-8 | 2,587 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Base\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
use App\Http\Base\Traits\ModuleTrait;
/**
* ModuleServiceProvider
*
* The service provider for the modules. After being registered
* it will make sure that each of the modules are properly loaded
* i.... |
TypeScript | UTF-8 | 2,251 | 3.8125 | 4 | [] | no_license | /**
* https://leetcode.com/problems/largest-rectangle-in-histogram/
*/
export function largestRectangleArea(heights: number[]): number {
if (!heights.length) {
return 0
}
const stack = [0]
let maxArea = 0
for (let index = 1; index < heights.length; index++) {
if (heights[index] > heights[stack[st... |
JavaScript | UTF-8 | 5,514 | 2.71875 | 3 | [] | no_license | var container;
var camera, scene, renderer, controls;
var clock = new THREE.Clock();
var cubes= [];
var objectURL;
var buffer;
initDragDrop();
init();
animate();
function loadSample(url) {
var contextClass = (window.AudioContext ||
window.webkitAudioContext ||
window.mozAudioContext ||
window.oAudioCon... |
Markdown | UTF-8 | 837 | 3.46875 | 3 | [
"BSD-3-Clause"
] | permissive | ###Synopsis
`#include <stdio.h>`
`int fgetpos(FILE *stream, fpos_t *pos);`
###Description
The function gets the current file position of the <u>stream</u> and writes it to <u>pos</u>.
Arguments:
<u>stream</u> - the stream to be examined,
<u>pos</u> - a pointer to an object, in which the current file position of t... |
SQL | UTF-8 | 11,100 | 3.828125 | 4 | [] | no_license | --
--DROP TABLE IF EXISTS "IBF-pipeline-output".dashboard_calculated_affected_adm3;
--select cast('ZMB' as varchar) as country_code
-- ,*
-- ,cattle_affected * 1 +
-- goat_affected * 0.1 +
-- sheep_affected * 0.1 +
-- pig_affected * 0.28 +
-- chicken_affected * 0.01
-- as livestock_affected
----INTO "IBF-pipeline-outpu... |
TypeScript | UTF-8 | 5,846 | 2.6875 | 3 | [] | no_license | import NamedError from '../../../helpers/NamedError'
const enum PoolParamsByteLengths {
POOL_HASH = 28,
VRF = 32,
IPV4 = 4,
IPV6 = 16,
OWNER = 28,
REWARD = 29,
METADATA_HASH = 32,
}
export type PoolOwnerParams = {
stakingPath?: any //BIP32Path
stakingKeyHashHex?: string
}
export type SingleHostIPRe... |
C | UTF-8 | 171 | 3.5 | 4 | [] | no_license | #include <stdio.h>
int main()
{
int i = 1, sum = 0;
while (i < 11)
{
sum += i;
i++;
}
printf("THe Sum is %d\n", sum);
return 0;
}
|
C++ | UTF-8 | 2,575 | 2.90625 | 3 | [] | no_license | // you can do it now shubham
#include<bits/stdc++.h>
# define ll long long
using namespace std;
struct node
{
ll pro;
ll b;
};
bool compare(node n,node m)
{
if(n.pro==m.pro)
{
return n.b<m.b;
}
return n.pro<m.pro;
}
ll findsome(node* product ,ll n, ll mid)
{
int i,j;
ll some=0;... |
JavaScript | UTF-8 | 4,021 | 3.984375 | 4 | [] | no_license | // Créer une variable nomVoiture, lui assigner la valeur suivante : "Peugeot"
var nomVoiture = "Peugeot";
// En une seule ligne de code, déclarer trois variables :
var identite = {prenom : "John", nom : "doe", age : 35};
// Créer une variable appelée x, lui assigner la valeur suivante : 50
// Créer deux variables... |
C# | UTF-8 | 479 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace Extract
{
public class ColumnModel
{
public readonly string name;
public readonly string type;
public readonly ReadOnlyCollection<string> values;
public ColumnModel(string name, string type, List<string> values ... |
Python | UTF-8 | 232 | 3.90625 | 4 | [] | no_license | print "Lacos"
a = 1
x = input("1-Para contar de 1 a 10\n2-Para contar de 10 a 1\n")
if x == 1:
while True:
print a
a = a + 1
if a == 11:
break
elif x == 2:
a = 10
while True:
print a
a = a -1
if a == -1:
break
|
C++ | UTF-8 | 2,266 | 2.71875 | 3 | [] | no_license | #include "CMSprite.h"
namespace CML
{
CMSprite::CMSprite()
{
_x = 0.0f;
_y = 0.0f;
_widht = 200.0f;
_height = 300.0f;
_texturePositionX = { 0.0f }, _texturePositionY = { 0.0f };
_image = nullptr;
}
CMSprite::CMSprite(float xPosition, float yPosition, float widht, float height)
{
_x = xPosition;
... |
Java | UTF-8 | 2,171 | 3.03125 | 3 | [
"MIT"
] | permissive | package cn.edu.cug.cs.gtl.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class ArrayUtils {
public static byte[] createByteArray(byte[] ba) {
if (ba == null)
return null;
byte[] r = new byte[ba.length];
System.arraycopy(ba, 0, r, 0... |
Java | UTF-8 | 527 | 2.484375 | 2 | [] | no_license | package implementation;
import interpreter.PrintScriptInterpreter;
public class CustomImplementationFactory implements InterpreterFactory {
@Override
public PrintScriptInterpreter interpreter() {
// your PrintScript implementation should be returned here.
// make sure to ADAPT your implementa... |
Python | UTF-8 | 484 | 2.734375 | 3 | [] | no_license | import pygame
import sys
playScreen=pygame.image.load('data\GameForm\PlayScreen.png')
playScreen=pygame.transform.scale(playScreen, (1368,768))
class Game:
def start(self):
pygame.init()
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
screen.blit(playScreen, (0, 0))
whi... |
TypeScript | UTF-8 | 5,061 | 2.515625 | 3 | [
"MIT"
] | permissive | import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { TestBed } from '@angular/core/testing';
import type {
SkyIndicatorDescriptionType,
SkyLabelType,
} from '@skyux/indicators';
import { LabelHarnessTestComponent } from './fixtures/label-harness-test.component';
import { LabelHarnessT... |
Java | UTF-8 | 241 | 1.53125 | 2 | [] | no_license | package com.fastspring.pizza.api.data.repo;
import org.springframework.data.jpa.repository.JpaRepository;
import com.fastspring.pizza.api.data.entity.Cart;
public interface ShoppingCartRepository extends JpaRepository<Cart, Integer> {
}
|
Python | UTF-8 | 317 | 3.015625 | 3 | [] | no_license | import sys
N = int(input().strip())
array = list(map(int, input().strip().split()))
fc = sys.maxsize
array.sort()
for i in range(N-2):
nums = array[i:i+3]
ave = sum(nums)/3
temp = ((nums[0] - ave) ** 2 + (nums[1] - ave) ** 2 + (nums[2] - ave) ** 2)/3
if temp < fc:
fc = temp
print("%.2f" % fc) |
Ruby | UTF-8 | 1,080 | 3.984375 | 4 | [] | no_license | # easy_503.rb - After Midnight (Part 2)
MINUTES_IN_DAY = 1440
def after_midnight(time)
time_arr = time.split(':').map(&:to_i)
time_arr[0] = time_arr[0] * 60 % MINUTES_IN_DAY
time_arr.reduce(:+)
end
def before_midnight(time)
time_arr = time.split(':').map(&:to_i)
time_arr[0] *= 60
(MINUTES_IN_D... |
Python | UTF-8 | 958 | 4.15625 | 4 | [] | no_license | # 返回一个可调用对象,该对象使用操作数的getItem方法从其操作数中提取项。如果指定了多个项,则返回查找值的元组
from operator import itemgetter
print(itemgetter(1)('ABCDEF'))
print(itemgetter(1,3,5)('ABCDEF'))
print(itemgetter(slice(2,None))('ABCDEF'))
d = {'name': 'Charles', 'age': 18, 'addr': 'Shanghai'}
print(itemgetter('name')(d))
# 获取类中字段的值
class User:
def... |
Java | UTF-8 | 1,131 | 3.453125 | 3 | [] | no_license | public class Solution_53_Maximum_SubArray {
public int maxSubArray(int[] nums) {
int len = nums.length;
int ans = nums[0];
int maxSum = nums[0];
if (len == 1){return maxSum;}
for (int i = 1; i < len; i++) {
// 这个地方的意思是 每次确定是否结束前边的序列
// 只要前边的maxSum大于0,就... |
Java | UTF-8 | 6,523 | 1.875 | 2 | [] | no_license | package cc.landingzone.dreamweb.sso.sp;
import cc.landingzone.dreamweb.common.CommonConstants;
import cc.landingzone.dreamweb.sso.CertManager;
import cc.landingzone.dreamweb.sso.SamlGenerator;
import com.aliyuncs.CommonRequest;
import com.aliyuncs.CommonResponse;
import com.aliyuncs.DefaultAcsClient;
import com.aliyun... |
Java | UTF-8 | 469 | 2.21875 | 2 | [] | no_license | package br.com.fiap.financas.vo;
public class MensagemBean {
private String from, message;
public MensagemBean(String from, String message) {
super();
this.from = from;
this.message = message;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
... |
JavaScript | UTF-8 | 19,412 | 2.515625 | 3 | [] | no_license | const { parse } = require('path');
const CompleteFinancingContract = artifacts.require("CompleteFinancingContract");
require('chai')
.use(require('chai-as-promised'))
.should();
contract("CompleteFinancingContract", (accounts) => {
// defining the accounts of the GanacheCLI
let[supplier1,supplier2,buyer1, buy... |
Java | UTF-8 | 2,165 | 2.515625 | 3 | [] | no_license | package com.uady.proyectofinal;
/**
* Created by Antonio Soto on 19/05/2017.
*/
public class Delivery {
private static Delivery delivery = new Delivery();
private String statusName;
private String shippingDescription;
private int shippingQuantity;
private int shippingSize;
private String c... |
Java | UTF-8 | 1,866 | 1.882813 | 2 | [] | no_license | package com.pitatto.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
@Entity
@Data
@Table(name = "t_company_recruit_site_page")
public class RecruitSiteEntity {
@Id
... |
Java | UTF-8 | 1,280 | 3.03125 | 3 | [] | no_license | package projet.vueGraphique;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import projet.cartes.Carte;
import projet.joueur.Partie;
public clas... |
JavaScript | UTF-8 | 342 | 2.59375 | 3 | [] | no_license | var http = require('http');
onRequest = (request, response) => {
console.log('Ein User führt einen Request durch' + request.url);
response.writeHead(200, { 'Context-Type': 'text/plain' });
response.write('Ein bisschen Data');
response.end();
};
http.createServer(onRequest).listen(1337);
console.log('Serve... |
Java | UTF-8 | 1,021 | 2.03125 | 2 | [] | no_license | package com.eCommerce.lojaOnline.service;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.eCommerce.lojaOnline.model.Loja;
import com.eCommerce.lojaOnline.model.Produto;
import com.eCommerce.lojaOnline.repository.Loja... |
PHP | UTF-8 | 836 | 2.5625 | 3 | [] | no_license | <?php
class Tag extends AppModel {
public $hasAndBelongsToMany = array('Photo');
public $actsAs = array('Ordered' => array('foreign_key' => false));
public function get_tags($photo_count = true) {
if ($photo_count === true) {
$tag_query = "
SELECT Tag.id, Tag.weight, Tag.name, Tag.created... |
Java | UTF-8 | 295 | 1.578125 | 2 | [] | no_license | package com.capgemini.capskills.configurations.security.dao;
import org.springframework.data.repository.CrudRepository;
import com.capgemini.capskills.configurations.security.models.SecurityRole;
public interface ISecurityRoleCrudRepository extends CrudRepository<SecurityRole, Integer> {
}
|
C++ | UTF-8 | 937 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <vector>
#include <iostream>
#include <string.h>
using namespace std;
int main()
{
int n;
int t;
int x;
int y;
int w;
int sum;
scanf("%d", &t);
for (int cs = 1; cs <= t; cs++) {
vector <int> arr;
char names[200][1000];
char temp[1000];
scanf("%d", &n);
sum = 0;
... |
Python | UTF-8 | 1,243 | 3.609375 | 4 | [] | no_license | import random
# Super Class
# The super() function lets us call a bit of code from the parent class
# inside our own class. This is really helpful when you need to override
# a method from the superclass, defining your own version, but keep the
# effects of the parent class's version of the code.
#
# For more about s... |
Ruby | UTF-8 | 2,967 | 2.796875 | 3 | [] | no_license | require "test_help"
# Useful test helpers.
#
# Many have been looted from stellar test code seen in applications by technoweenie,
# zenspider, and topfunky.
class Fusionary::Test::TestCase < Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
# Work around a ... |
C# | UTF-8 | 1,078 | 2.8125 | 3 | [
"MIT"
] | permissive | using System.Net;
using System.Threading.Tasks;
namespace RHttpServer
{
/// <summary>
/// Http server where request are handled as tasks
/// <para />
/// Good for processing requests of varying size
/// </summary>
public sealed class TaskBasedHttpServer : BaseHttpServer
{
... |
C# | UTF-8 | 1,449 | 2.75 | 3 | [] | no_license | namespace Git_Pack
{
public class CommandLineArguments : ICommandLineArguments
{
public string RepositoryPath
{
get;
set;
}
public string OutputDirectoryPath
{
get;
set;
}
public string OutputZipPath
... |
Python | UTF-8 | 1,764 | 3 | 3 | [
"MIT"
] | permissive | from bibliopixel.animation import BaseMatrixAnim
import bibliopixel.colors as colors
import math
class Pinwheel(BaseMatrixAnim):
def __init__(self, led, dir = True):
super(Pinwheel, self).__init__(led)
self._center = (self.width / 2, self.height / 2)
self._dir = dir
self._len = (s... |
Java | ISO-8859-1 | 998 | 2.9375 | 3 | [] | no_license | package com.cosmo.ui.controls;
import com.cosmo.Workspace;
/**
* Clase abstracta que deben implementar los controles de formulario.
*
* @author Gerard Llort
*/
public abstract class FormField
{
//==============================================
// Constructors
//===========================... |
Java | UTF-8 | 1,562 | 2.0625 | 2 | [] | no_license | // Copyright (C) 2011 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
Markdown | UTF-8 | 729 | 2.546875 | 3 | [] | no_license | date: 2013-03-23
title: Long time no blog
已经很久没有写博客了,某次受小胖的[org-blog](https://github.com/crackcell/org-blog)的启发,突然想自己也捣鼓一个静态博客生成的工具,用markdown写博客内容,于是就有了现在这个东西。一来是确实有东西想写写了,二来练一练前端和Perl。还有很多没弄好的,比如样式还很丑(= =|||)。慢慢改进先……
想想上次写blog还是在差不多快1年半前了,那时候还在用Godaddy的空间,把wordpress跟REICN的空间放在一起搭的。后来自己脑残,糟蹋了REICN,也糟蹋了自己的博客。
... |
C++ | UTF-8 | 1,881 | 2.59375 | 3 | [] | no_license | #include "TinyGPS++.h"
const int LORA_RX = 16;
const int LORA_TX = 17;
const int GPS_RX = 26;
const int GPS_TX = 27;
void loraInit();
void clearBuffer();
void gpsInit();
TinyGPSPlus gps;
void setup() {
/*ES920とのシリアル通信の初期化*/
Serial2.begin(115200, SERIAL_8N1, LORA_RX, LORA_TX);
delay(1000);
loraInit();
Seri... |
Python | UTF-8 | 122 | 3.109375 | 3 | [] | no_license | with open("cat.jpg", "rb") as f:
byte = f.read(1)
while byte != b"":
print(byte)
byte = f.read(1)
|
Java | UTF-8 | 409 | 3.15625 | 3 | [] | no_license | package callmethod_demo;
import java.util.Scanner;
public class MethodDemo21 {
public static void findDayofWeek() {
Scanner input = new Scanner(System.in);
System.out.println("Enter the day number");
int d = input.nextInt();
input.close();
switch (d) {
}
}
public static void main(String[] args... |
Java | UTF-8 | 5,340 | 2.09375 | 2 | [] | no_license | package com.tsh.vas.model;
import java.io.Serializable;
import java.util.List;
/**
* BillDetailInfo
*
* @author dengjd
* @date 2016/11/3
*/
public class BillDetailInfo implements Serializable {
public static class CommissionInfo {
/**
* 销售价格
*/
private String salePrice;... |
SQL | UTF-8 | 1,706 | 4.09375 | 4 | [] | no_license | CREATE TABLE ENEMIES(
ID INT PRIMARY KEY,
NAME VARCHAR(50) NOT NULL,
HP FLOAT NOT NULL,
DAMAGE FLOAT NOT NULL
);
CREATE TABLE HEROES(
ID INT PRIMARY KEY,
NAME VARCHAR(50) NOT NULL,
LEVEL INT NOT NULL,
CLASS VARCHAR(50) NOT NULL,
STATUS VARCHAR(50),
HP FLOAT NOT NULL
);
CREATE TABLE SKILLS(
... |
Java | UTF-8 | 1,098 | 2.4375 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dto;
import java.sql.Timestamp;
public class QuizObj {
private int quizId;
private Timestamp dateChange;
private int money;
private int userId;
public QuizObj() {
}
public QuizObj... |
Java | UTF-8 | 4,240 | 2.59375 | 3 | [] | no_license | package shapeshooser;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.control.ColorP... |
SQL | UTF-8 | 18,725 | 3.015625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50636
Source Host : localhost:3306
Source Database : admin4
Target Server Type : MYSQL
Target Server Version : 50636
File Encoding : 65001
Date: 2018-09-28 13:44:48
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... |
Java | UTF-8 | 4,534 | 2.421875 | 2 | [
"Apache-2.0"
] | permissive | package wuzm.android.kframe.widget;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.animation.RotateAnimation;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import andro... |
Java | UTF-8 | 508 | 1.742188 | 2 | [] | no_license | package com.pqsoft.leaseDate.service;
import java.util.Map;
import com.pqsoft.skyeye.api.Page;
import com.pqsoft.util.BaseUtil;
import com.pqsoft.util.PageUtil;
public class LeaseDateService {
private String basePath = "leaseDate.";
public Page queryPage(Map<String,Object> param){
param.put("TYPE_", "还款计划状态"... |
Markdown | UTF-8 | 1,015 | 3.234375 | 3 | [] | no_license | #1 第1次实验
# 第一次实验
## 1.实验目标
(1)学习和搭建开发环境(Android Studio);
(2)了解GitHub网站的功能及提交的基本的要求;
## 2.实验步骤
(1)搭建开发环境(Android Studio 3.1正式版),运行(截图);
(2)加入Git项目(Fork),将项目克隆(Clone)到自己帐号下;
(3)$ git clone https://github.com/BeamGod/android-labs-2018/
(4)创建以学号命名的个人实验目录:com1614080901113。
其中,com开头表示计算机班,soft开头表示软件班,数字为个人学号。
(5)创建一个Java... |
SQL | UTF-8 | 2,474 | 4.03125 | 4 | [] | no_license | -- name: get-all-campaigns
-- gets all sms campaigns
SELECT *
FROM `sms-gateway`.sms_campaign
ORDER BY id DESC
LIMIT :offset, :limit;
-- name: fetch-one-campaign
-- gets one sms campaign
SELECT *
FROM `sms-gateway`.sms_campaign
WHERE id = :id;
-- name: fetch-active-campaigns
-- fetches all the active campaigns
SEL... |
Markdown | UTF-8 | 3,125 | 3.703125 | 4 | [] | no_license | ## Gauss' Law
- **Gauss' law** = a mathematical model that relates **net flux($\phi$)** and enclosed charge
- Mathematically it looks like this
$$ \epsilon_0 \Sigma \phi = \Sigma q $$
- Or, substituting the definition of net flux, we get
$$ \epsilon_0 \oint \bigg( \vec{E} \cdot d\vec{A} \bigg) = \Sigma q $$
- The charg... |
Java | UTF-8 | 7,927 | 3.3125 | 3 | [] | no_license | public class Logic {
int score = 0;
int yahztees = 0;
Gameplay GameplayObject = new Gameplay();
private int[] dice;
public Logic(int[] dice){
this.dice = dice;
}
private int ones(){
int score = 0;
for (int i = 0; i < 5; i++){
if (dice[i] == 1){
... |
C++ | UTF-8 | 12,395 | 2.6875 | 3 | [] | no_license | #include "Supervisorio.h"
#include "ui_Supervisorio.h"
Supervisorio::Supervisorio(QWidget *parent) : QMainWindow(parent), ui(new Ui::Supervisorio) {
// Seta a User Interface
ui->setupUi(this);
// Busca as portas seriais disponíveis e mostra no combo box
serial = new Serial();
// Alimenta a lista ... |
C# | UTF-8 | 1,269 | 2.609375 | 3 | [
"MIT"
] | permissive | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
namespace Microsoft.Zelig.Runtime
{
using System;
//
// The default behavior is to discard the overridden method, but this doesn't work for constructors.
// So, instead of picking a default, the code has to explain what to... |
Java | UTF-8 | 2,320 | 2.796875 | 3 | [] | no_license | package infovis.scatterplot;
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
public class MouseController implements MouseListener, MouseMotionListener {
private Model model = null;
private View view = null;
private int x = 0... |
Python | UTF-8 | 2,700 | 3.625 | 4 | [] | no_license | """
Задание 3.
Приведен код, формирующий из введенного числа
обратное по порядку входящих в него
цифр и вывести на экран.
Сделайте профилировку каждого алгоритма через cProfile и через timeit
Сделайте вывод, какая из трех реализаций эффективнее и почему
"""
import timeit
import cProfile
def revers(enter_num, rever... |
C# | UTF-8 | 652 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace EX_three
{
class Du_lieu
{
public void ShowDL()
{
Console.Write("Nhap n=");
int n = int.Parse(Console.ReadLine());
int[] arr = new int[n+1];
... |
Java | UTF-8 | 380 | 2.4375 | 2 | [] | no_license | public class SampleMain{
public static void main(String[] args){
PartsStore partsStore = new PartsStore();
partsStore.FindPartsWithBrand("Hard Drive", "Lenovo");
partsStore.FindCheapestMemory(32);
partsStore.UpdateStock();
partsStore.FindCheapestMemory(16);
partsStore.TotalPrice("GPU", "Asus", ... |
JavaScript | UTF-8 | 9,101 | 2.90625 | 3 | [] | no_license | Chart.defaults.global.defaultFontFamily = 'Roboto';
Chart.defaults.global.defaultFontColor = '#333';
Chart.Legend.prototype.afterFit = function() {
this.height = this.height + 5;
};
Chart.pluginService.register({
beforeDraw: function(chart) {
if (chart.config.options.elements.center) {
// Get ctx f... |
JavaScript | UTF-8 | 1,638 | 4.375 | 4 | [] | no_license | // 给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。
//
// 注意:
// 假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−2^31, 2^31 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。
//
// 示例 1:
// 输入:x = 123
// 输出:321
// 示例 2:
// 输入:x = -123
// 输出:-321
// 示例 3:
// 输入:x = 120
// 输出:21
// 示例 4:
// 输入:x = 0
// 输出:0
//方法一:使用字符串变换的方法。缺点:用了很多基本库,影响性能的其实。
functi... |
Java | UTF-8 | 1,542 | 2.421875 | 2 | [] | no_license | package com.sivalabs.springboot;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.MediaType;
import o... |
Markdown | UTF-8 | 42,065 | 3.09375 | 3 | [] | no_license | * 1 為促進性別地位之實質平等,消除性別歧視,維護人格尊嚴,厚植並建立性別平等之教育資源與環境,特制定本法。本法未規定者,適用其他法律之規定。
> 釋:按憲法第七條規定:「中華民國人民,無分男女、宗教、種族、階級、黨派,在法律上一律平等。」,次按憲法增修條文第十條第六項規定:「國家應維護婦女之人格尊嚴、保障婦女之人身安全、消除性別歧視、促進兩性地位之實質平等。」,為落實上開憲法規定意旨,並厚植性別平等教育之資源與環境,提昇教育本質與內涵,建設性別平等之公民社會,爰制定本法。
* 2 本法用詞定義如下:一、性別平等教育:指以教育方式教導尊重多元性別差異,消除性別歧視,促進性別地位之實質平等。二、學校:指公私立各級學校。三、性侵害... |
C# | UTF-8 | 1,836 | 3.34375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Diagnostics;
namespace BasicSingleton
{
public class Highlander
{
private static Highlander instance;
private static int instanceCount = 0;
private static object syncRoot = new object... |
Java | UTF-8 | 350 | 2.015625 | 2 | [
"MIT"
] | permissive | package me.heacewalker.microkernel.core;
import java.util.List;
public class TradeStream {
List<TradeProcessor> tradeProcessors;
public TradeStream(List<TradeProcessor> tradeProcessors) {
this.tradeProcessors = tradeProcessors;
}
public List<TradeProcessor> getTradeProcessors() {
re... |
Python | UTF-8 | 759 | 3.5 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python
# encoding: utf-8
"""
two-sum.py
Created by Shuailong on 2016-03-10.
https://leetcode.com/problems/two-sum/.
"""
class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
d = {... |
Python | UTF-8 | 1,020 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | """这个例子将展示如何使用BP神经网络构建多分类的神经网络"""
import sys
import numpy as np
import pandas as pd
import classicML as cml
DATASET_PATH = './datasets/iris_dataset.csv'
CALLBACKS = [cml.callbacks.History(loss_name='categorical_crossentropy',
metric_name='accuracy')]
# 读取数据
dataframe = pd.read_csv(... |
Markdown | UTF-8 | 4,198 | 2.90625 | 3 | [
"MIT"
] | permissive | ---
path: /growth-hackers/
title: Growth Hackers Conference Notes
date: 2013-05-10 22:50:00 Z
---
## Growth vs Growth Hacking
[Keith Rabois](https://twitter.com/rabois)
Value => Growth => Growth Hacking
### Lessons
1. First grow based on real value
2. Growth hacking is an observational science
3. Feature design is... |
PHP | UTF-8 | 408 | 2.78125 | 3 | [] | no_license | <?php
/**
* Tells whether user is logged in or not
* @return boolean
* @package MIS
* @name LoggedIn
* @author Harsh Vardhan Ladha & Yogesh Chauhan
* @copyright Computer Science & Engineering Department, NIT Silchar
* @link http://mis.nits.ac.in
* @license NIT Silchar
*/
function loggedIn(){
if(Se... |
Markdown | UTF-8 | 2,311 | 4.03125 | 4 | [] | no_license |
# [Jumping in the hills](https://www.codechef.com/problems/HILLS)
Problem Code: **HILLS**
There are **N** hills in a row numbered 1 through **N** from left to right. Each hill has a height; for each valid **i**, the height of the **i**-th hill is **H_i**. Chef is initially on the leftmost hill (hill number 1). He can... |
PHP | UTF-8 | 3,349 | 3.234375 | 3 | [] | no_license | <?php
require "ErrorCode.php";
header("Content-Type:text/html;charset=UTF-8");
class User
{
/**
* 数据库连接句柄
*/
private $_db;
public function __construct($_db) //构造方法传入,而不是require进来
{
$this ->_db = $_db;
}
/**
* 用户登录
*/
publ... |
Markdown | UTF-8 | 2,640 | 4.125 | 4 | [] | no_license | ##### 类
```dart
//声明类
class Person{
// le==类的属性
String name = '张三';
//类的方法
void getInfo(){
print('我是'+name+'');
}
}
void main(){
//实例化类,然后得到一个对象
Person p = new Person();
print(p.name);
//访问类中的属性
p.getInfo();
// Dart 所有的内容都是对象
Map m = new Map();
//属性为扳手
// 方法为方块
print(m.length);
m.ad... |
JavaScript | UTF-8 | 3,203 | 2.796875 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function () {
// see more-less 1
const seeMoreLessBtn1 = document.querySelector(".see-more-less-btn1");
const additionalPictures1 = document.querySelector(".additional-pictures1");
seeMoreLessBtn1.addEventListener("click", function() {
if (additionalPictures... |
C# | UTF-8 | 669 | 2.5625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ParticleSystem
{
public class ChaoticParticle : Particle
{
public ChaoticParticle(MatrixCoords position, MatrixCoords speed)
: base(position, speed)
... |
C++ | UTF-8 | 800 | 3.109375 | 3 | [] | no_license | //
// Complex.cpp
// Ex10_08
//
// Created by MacBook Pro on 2019/11/21.
// Copyright © 2019 MacBook Pro. All rights reserved.
//
#include <complex>
#include "Complex.hpp"
Complex::Complex(double x,double y){
real=x;
imaginary=y;
}
bool Complex::operator==(const Complex & c)const{
if(real==c.real&&imagi... |
PHP | UTF-8 | 873 | 3.078125 | 3 | [] | no_license | <?php
class CourseDAO extends DAO{
protected $table;
public function __construct($flag=true) {
parent::__construct();
$this->flag = $flag;
$this->table = "course";
}
public function getById($id) {
$data = $this->get($id);
return $this->createObject($data);
... |
Python | UTF-8 | 755 | 3.078125 | 3 | [] | no_license | #!/usr/bin/env python
from nose.tools import *
from vector3d import Vector3d
class TestVector3d:
def __init__(self):
self.a = Vector3d(1,2,3)
self.b = Vector3d(2,3,4)
def test_init(self):
eq_(self.a, [1,2,3])
def test_addition(self):
eq_(self.a + self.b, [3,5,7])
@raises(AttributeErr... |
SQL | UTF-8 | 1,338 | 3.703125 | 4 | [
"MIT",
"BSD-4-Clause-UC",
"BSD-3-Clause",
"ISC",
"bzip2-1.0.6",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause",
"Artistic-2.0",
"PostgreSQL",
"LicenseRef-scancode-unknown"
] | permissive | drop table if exists r;
create table r(a int, b int);
SELECT attnum::information_schema.cardinal_number
from pg_attribute
where attnum > 0 and attrelid = 'r'::regclass;
-- this one should fail
SELECT attnum::information_schema.cardinal_number
from pg_attribute
where attrelid = 'r'::regclass;
SELECT *
from (SE... |
TypeScript | UTF-8 | 2,336 | 2.53125 | 3 | [
"MIT"
] | permissive | import { MongoConnectionSettingsBuilder } from '../src/lib/mongo-connection-settings';
const testConnectionString = `mongodb+srv://abc:pWd1!@internal-ohjxv.gcp.mongodb.net/accounts?retryWrites=true&w=majority`;
describe('MongoConnectionSettings', () => {
it('Parse proto with +srv', () => {
const connString1 = `... |
Python | UTF-8 | 1,324 | 2.5625 | 3 | [] | no_license | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Activation, Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
import pickle
import numpy as np
from tensorflow.keras.callbacks import TensorBoard
import datetime
NAME = 'Cats-vs-Dogs-CNN'
tensorboard = Te... |
C | UTF-8 | 2,807 | 2.78125 | 3 | [
"MIT"
] | permissive | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.h :+: :+: :+: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.