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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 1,266 | 3.265625 | 3 | [] | no_license | using System;
using System.Runtime.Serialization;
using Xunit;
namespace Pandemonium.Test.Extensions.Object
{
public class CloneTests
{
[Fact]
public void Should_Clone_Object_Values_To_New_Reference()
{
Sample value = new Sample { Anything = "anything" };
Sampl... |
Markdown | UTF-8 | 12,919 | 3.15625 | 3 | [] | no_license | ###### tags: `單元測試的藝術`
# Chapter 8 好的單元測試的支柱
### 8.2 撰寫可維護的測試
隨著時間推移,測試會變得難以理解及維護。所以可維護性是大多數開發人員撰寫單元測試的核心問題之一。
> 系統每一個**微小的改變**,即使沒有bug,都會使**測試失效**,而導致需要花時間修正測試
本節介紹 3 個技巧來讓測試**更好維護**
- [ ] **1. 只考慮測試公開契約**
- [ ] **2. 刪除重覆的測試**
- [ ] **3. 測試隔離的實踐**
## 8.2.1 測試私有或保護的方法
+ **只考慮測試公開契約**
- 因爲私有方法不會獨立存在,必定被其他公開方法呼叫
... |
Java | UTF-8 | 1,813 | 3.9375 | 4 | [] | no_license | public class ResizeableTest {
public static void main(String[] args) {
Shape[] shapes = new Shape[3];
shapes[0] = new Circle(5);
shapes[1] = new Rectangle(5.2, 3.2);
shapes[2] = new Square(3.3);
for (Shape shape : shapes) {
if (shape instanceof Circle) {
... |
C++ | UTF-8 | 4,734 | 2.6875 | 3 | [] | no_license | #ifndef SPACE_INFO_H
#define SPACE_INFO_H
#include <memory>
#include <cmath>
#include <Cube.h> // Tao's occupancy mask
//#include <volume.h> // Tao's volume struct
#include "Volume3DScalar.h"
#include "commondefs.h"
using std::shared_ptr;
//struct SpaceInfo3D
//{
// point
//};
struct SpaceConverter
{
// voxel co... |
C++ | UTF-8 | 2,853 | 3.015625 | 3 | [] | no_license | #include "tablecheck.h"
#include "modprod.h"
#include <fstream>
#include <iostream>
using namespace std;
// This table contains a random permutation of the values from 00 through ff, inclusive.
// (Need to compute the inverse transform in code.)
bool checkS(string line) {
if (line.size() != 2 + 256 * 2) {
cerr << ... |
Python | UTF-8 | 2,489 | 2.8125 | 3 | [] | no_license | import numpy as np
import sys
import csv
from sklearn.cluster import AffinityPropagation
from sklearn import metrics
# Text proc
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
import codecs
def read_text_file(inpFile,delim):
f = open(inpF... |
Java | UTF-8 | 800 | 2.390625 | 2 | [] | no_license | package iVotas.Action;
import org.apache.struts2.interceptor.SessionAware;
import java.util.ArrayList;
public class VotarEleicoesAction extends Action implements SessionAware{
private String listaeleicoes = "";
@Override
public String execute() throws Exception {
ArrayList<String> auxeleicoes;
... |
C++ | UTF-8 | 264 | 2.53125 | 3 | [] | no_license | #include<stdio.h>
int main() {
int n, arr[20], sumFirstLast;
sumFirstLast = 0;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &arr[i]);
}
sumFirstLast= arr[0] + arr[n- 1];
printf("%d", sumFirstLast);
return 0;
}
|
Shell | UTF-8 | 513 | 3.046875 | 3 | [] | no_license | #!/bin/bash
#---VladVons@gmail.com
source ./const.sh
source $DIR_ADMIN/conf/script/service.sh
TestEx()
# ------------------------
{
Test
echo
rsync localhost::
}
Init()
# ------------------------
{
Log "$0->$FUNCNAME"
touch $cLog1
chmod 600 $cLog1
chown root:wheel $cLog1
}
Info()
{
Log "$0->$FU... |
Java | UTF-8 | 3,860 | 2.265625 | 2 | [] | no_license | package entity;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.util.Date;
@Entity
public class PostInfo {
private int postid;
private String rightname;
private String posttitle;
private Date posttime;
priva... |
Java | UTF-8 | 3,183 | 2.484375 | 2 | [] | no_license | package kirgiz.stockandsalesmanagement.app.service;
import kirgiz.stockandsalesmanagement.app.domain.Usr;
import kirgiz.stockandsalesmanagement.app.repository.UsrRepository;
import kirgiz.stockandsalesmanagement.app.repository.search.UsrSearchRepository;
import kirgiz.stockandsalesmanagement.app.service.dto.UsrDTO;
im... |
Markdown | UTF-8 | 40,432 | 3.3125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "前端笔记"
date: 2017-06-08
excerpt: ""
tag:
- js基础
comments: true
---
2.z-index配合position使用,只在定位元素上奏效
4.获取鼠标位置:
```js
//获取鼠标相对文档开头的位置
function getMousePosition(evt){
var e = evt || window.evt;
//Chrome下用document.body;IE下document.documentElement
var scrollX = document.documentElemen... |
Java | UTF-8 | 3,262 | 2.671875 | 3 | [] | no_license | package dsp.hadoop.examples;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.... |
Python | UTF-8 | 1,569 | 3.984375 | 4 | [] | no_license | ### Clases en Python
### Seguramente te has fijado ya que cuando necesitamos utilizar algunas
### funciones especiales, tenemos que "importar" una biblioteca.
### A lo largo de las sesiones hemos utilizado las bibliotecas "os" y
### "random".
### Estas bibliotecas son compendios que contienen clases
### y funciones q... |
Java | UTF-8 | 1,861 | 2.4375 | 2 | [] | no_license | package com.example.logic_university;
import android.os.AsyncTask;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import ... |
C# | UTF-8 | 1,321 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace PZ1_Mahno_.Сlass_library
{
public class Owner
{
public string owner_name { get; set; }
public long owner_phone { get; set; }
public DateT... |
Python | UTF-8 | 1,052 | 2.578125 | 3 | [
"MIT"
] | permissive | import time
class TestRoomTemp:
url = "/home_api/room_temp"
def test_post(self, client):
res = client.post(self.url)
assert res.status_code != 200 # This should fail
data = {"name": "pytest", "value": -1}
res = client.post(self.url, json=data)
assert res.status_code ... |
Java | UTF-8 | 188 | 1.539063 | 2 | [] | no_license | package com.riotdata.demo.domain.riotChamp;
import org.springframework.data.jpa.repository.JpaRepository;
public interface ChampionRepository extends JpaRepository<Champion, String> {
}
|
C++ | UTF-8 | 4,602 | 2.875 | 3 | [] | no_license | #include "TreeNodes.h"
// #include "NameValueTypeVisitor.h"
// #include "NameValueTypeActions.h"
// the order of static vars initialization is always respected for each translation unit
const char* NameValueNode::_arrayIndex[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
const unsigned int NameValueNode::... |
Java | UTF-8 | 2,203 | 2.1875 | 2 | [] | no_license | package com.sinco.carnation.goods.tools;
import net.weedfs.client.WeedFSClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.sinco.carnation.goods.service.GoodsService;
import com.sinco.carnation.sys.service.AccessoryServiceImpl;
import co... |
Markdown | UTF-8 | 2,757 | 2.5625 | 3 | [
"MIT"
] | permissive | # Safari Cookbook
[][cookbook]
[][travis]
[cookbook]: https://supermarket.chef.io/cookbooks/safari
[travis]: https://travis-ci.org/dhoer/chef-safari
T... |
Python | UTF-8 | 7,665 | 2.578125 | 3 | [] | no_license | import operator, os, stat
def extract_input():
global input_str, orig_burst
with open("MP04 Checker.txt", "r", encoding="utf-8") as f:
file_input = f.read().split("\n")
process_amt = int(file_input[0])
init_arrival_times = file_input[1].split()
init_burst_times = file_input[2].split()
... |
Python | UTF-8 | 1,994 | 2.6875 | 3 | [] | no_license | '''
This class runs on an xyz file (taken as the second argument).
'''
from parse_xyz import Trajectory
from process_coord import Coordinate
#from lattice import Lattice
import numpy as np
import sys
params = (1, 1, .11268, 1.1051, .96, 1.00547, .05153) #sigma, epsilon, alpha, r_a, a_g, sig_g, r_g
unred_params = (34... |
Java | UTF-8 | 1,423 | 2.0625 | 2 | [] | no_license | package com.jalarbee.aleef.account.api;
import akka.Done;
import akka.NotUsed;
import com.jalarbee.aleef.account.api.model.Account;
import com.lightbend.lagom.javadsl.api.Descriptor;
import com.lightbend.lagom.javadsl.api.Service;
import com.lightbend.lagom.javadsl.api.ServiceCall;
import com.lightbend.lagom.javadsl.a... |
Markdown | UTF-8 | 772 | 2.59375 | 3 | [
"MIT"
] | permissive | # Material UI
> styling component framework for React
```bash
npm install @material-ui/core
```
## Styles
> CSS-in-JS styling solution
```bash
npm i @material-ui/styles
```
### Theming
```js
export const arc = createMuiTheme({
palette: {
common: {},
primary: {
main: '',
},
secondary: {
... |
Java | UTF-8 | 20,312 | 2.609375 | 3 | [] | no_license | package com.mifan.article.article;
import com.mifan.article.AbstractTests;
import com.mifan.article.domain.TopicsClassification;
import com.mifan.article.domain.TopicsClustering;
import org.junit.Test;
import org.moonframework.amqp.Data;
import org.moonframework.amqp.Resource;
import org.moonframework.core.amqp.Messag... |
JavaScript | UTF-8 | 885 | 2.578125 | 3 | [] | no_license | import Subject from "../models/subject.js";
export const getSubjects = async (req, res) => {
const {classId} = req.query;
const filter = classId ? {class: classId} : {};
try {
const subjects = await Subject.find(filter);
res.status(200).json(subjects);
} catch (error) {
... |
Java | UTF-8 | 2,839 | 2.15625 | 2 | [] | no_license | package com.huntor.demo.entity;
import javax.persistence.*;
import java.util.Date;
/**
* Created by liuyang on 2017/8/16.
*/
@Entity
@Table( name = "tag_life_cycle_statistics" )
public class TagLifeCycleStatistics {
private Integer id;
private Integer lastLifeCycleId;
private String lastLifeCycleName;
... |
Java | UTF-8 | 1,009 | 3.25 | 3 | [] | no_license | package leetcode.unique_paths;
class Solution {
final static int[][] memoization = new int[101][101];
public int uniquePaths(int m, int n) {
if (m == 1 || n == 1) {
return 1;
} else {
final int firstCall = memoization[m - 1][n] == 0 ? uniquePaths(m - 1, n) : memoization... |
C++ | GB18030 | 1,720 | 3.859375 | 4 | [] | no_license | // operatorTree.cpp
// IJ
#include <iostream>
#include <cstdio>
// ʾ
typedef struct BiTNode
{
int data;
struct BiTNode *lchild, *rchild;
}BiTNode, *BiTree;
// Ҷӽ
int sum1 = 0;
void countLeafNum1(BiTNode *T)
{
if (T == NULL) {
return;
}
if (T->lchild == NULL && T->rchild == NULL) {
sum1++;
}
countLeafNum1(... |
Java | UTF-8 | 970 | 3.125 | 3 | [
"MIT"
] | permissive | package chapter04;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
import org.hamcrest.core.Is;
import org.junit.Assert;
import org.junit.Test;
public class ImmutableCollectionsExamplesTest {
@Test
public void testImmu... |
Java | UTF-8 | 2,087 | 2.90625 | 3 | [] | no_license | package topc.easy;
import java.util.*;
import java.io.*;
// SRM 272 Division II Level Three - 1000
// brute force, geometry
// statement: http://community.topcoder.com/stat?c=problem_statement&pm=5885&rd=8069
// editorial: http://www.topcoder.com/tc?module=Static&d1=match_editorials&d2=srm272
public class VectorPolyg... |
JavaScript | UTF-8 | 196 | 3.09375 | 3 | [] | no_license | export default class NumericHelper {
constructor(number) {
this.number = number;
}
isEven() {
return this.number % 2 === 0;
}
isOdd() {
return this.number % 2 === 1;
}
}
|
C++ | UTF-8 | 337 | 2.515625 | 3 | [] | no_license | //
// Created by Niv Swisa on 23/08/2020.
//
#include "../controller/Display.h"
void Display::execute(vector<string> para)
{
if(para.size()>2){
cout<<"You must insert less parameters"<<endl;
return;
}
Maze2d maze;
maze = _model->display(para[1]);
_view->getOut() << maze;
//co... |
Rust | UTF-8 | 7,482 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2017 Dmitry Tantsur <divius.inside@gmail.com>
//
// 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 ap... |
Java | UTF-8 | 2,060 | 3.984375 | 4 | [] | no_license | package DynamicProgramming;
/**
* This method is used to find the subset of an array which sums up to a certain number.
*
* @author ankit
*
*/
public class SubsetSum {
public static void main(String[] args) {
int set[] = {3, 34, 4, 12, 5, 2};
System.out.println(isSubsetSum(9, set));
System.out.print("U... |
Markdown | UTF-8 | 5,654 | 2.703125 | 3 | [] | no_license | 一九
“兄台,我们错了认错,是惊鸿剑客坚持要追你出口怨气。”许纯芳胆量大些,也显得俏皮活泼,羞笑着接口,“你扮猪吃老虎,也不是什么好德行呀!兄台,救命大恩,不敢或忘,可否将贵姓大名赐告?”
“你们可以去查呀!专管闲事的行道女英雄,应该有查的本钱。”
“我年轻少见识,你应该宽宏大量……”
“少废话!快走吧!他们快要搜回来了。”他挥手赶人,“不要妄想惊鸿剑客两个人回来救你们,他们从西面落荒逃走的,我敢打赌,他们已经逃回州城了。”
“他会带了摩云神手的人回来救我们的。”霸剑奇花讪讪地说,仍然不敢抬头,羞态可掬,武林女英雌的气概消失无踪。
“是吗?摩云神手那几手鬼画符武功,比惊鸿剑客... |
Shell | UTF-8 | 129 | 3.15625 | 3 | [] | no_license | #! /bin/sh
for file in $(find . -name "*.tig"); do
content=$(cat $file)
if [ -z "$content" ]; then
echo $file
fi
done
|
Java | ISO-8859-3 | 2,653 | 2.546875 | 3 | [] | no_license | package tests;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.GregorianCalendar;
import com.microsoft.sqlserver.jdbc.SQLServerException;
import clases.basicas.ConfiguracionImpl;
import clases.basicas.CuentaImpl;
import clases.basicas.VotacionImpl;
import clases.gestion.ConexionSQL;
import ... |
Markdown | UTF-8 | 14,379 | 2.59375 | 3 | [] | no_license | ---
group: cloud-guide
title: Configuration management for store settings
functional_areas:
- Cloud
- Deploy
---
Configuration management in {{site.data.var.ece}} provides a new way to deploy across your environments with minimal downtime. The process extracts all configuration settings from your Magento implement... |
Ruby | UTF-8 | 559 | 2.59375 | 3 | [
"MIT"
] | permissive | # frozen_string_literal: true
require 'pug'
class MockClient < Pug::Interfaces::Client
attr_accessor :message_queue, :sent_messages
def initialize
@sent_messages = []
@message_queue = []
end
# Overrides
def listen
queue = @message_queue
yield queue.shift until queue.empty?
end
def sen... |
Java | UTF-8 | 733 | 1.976563 | 2 | [] | no_license | /*
* Copyright 2005-2017 ptnetwork.net. All rights reserved.
* Support: http://www.ptnetwork.net
* License: http://www.ptnetwork.net/license
*/
package net.ptnetwork.dao;
import net.ptnetwork.Page;
import net.ptnetwork.Pageable;
import net.ptnetwork.entity.Member;
import net.ptnetwork.entity.MemberDepositLog;
/**... |
JavaScript | UTF-8 | 940 | 4.03125 | 4 | [] | no_license | // Ecrivez une fonction qui étant donné un tableau de n nombres
// tous identiques sauf un
// retourne le seul nombre qui n’est pas identique aux autres.
function nbOccur(val, myArray) {
const occurTab = myArray.filter(function(num) {
return num === val;
});
return occurTab.length;
}
const numbers = [1, 2, 1... |
Go | UTF-8 | 10,585 | 2.828125 | 3 | [] | no_license | // !可修改点权的 Link-Cut Tree
// https://ei1333.github.io/library/structure/lct/link-cut-tree-lazy-path.hpp
// https://hitonanode.github.io/cplib-cpp/data_structure/link_cut_tree.hpp
// LinkCutTreeLazy(rev,id,op,mapping,composition): コンストラクタ.
// rev は要素を反転する演算を指す.
// id は作用素の単位元を指す.
// op は 2 つの要素の値をマージする二項演算,... |
Python | UTF-8 | 1,475 | 3.390625 | 3 | [] | no_license | #########################
# ColorfulLED #
#########################
# @Author: Aaron Earl #
# 5/25/19 #
# #
# From Freenove RPi #
# tutorials #
# Ch.5 RGBLED #
# #
# Task: Use PWM and #
# SW PWM to change #
# RGBLED Colors #
#########################
import RPi.GPIO as GPIO
import time
import... |
Markdown | UTF-8 | 4,993 | 3.28125 | 3 | [] | no_license | # Ch1. Meet Python: *Everyone Loves Lists*
- summarized by 전승일(2014/9/14)
- source code: http://www.headfirstlabs.com/books/hfpython/
- support site: http://python.itcarlow.ie
## What’s to like about Python? (python의 매력)
* PC, 맥, 휴대기기, 휴대폰, 웹, 대형서버에서 빠르고 쉽게 코드 작성, GUI 생성 가능
* Programming Languages Ranking: h... |
PHP | UTF-8 | 2,384 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace jR\I\Cache;
use jR\I\Cache;
/**
* Redis缓存驱动
* 要求安装phpredis扩展:https://github.com/nicolasff/phpredis
*/
class Redis extends Cache {
/**
* 架构函数
* @param array $options 缓存参数
* @access public
*/
public function __construct($options=array()) {
if ( !extension_loaded('... |
C++ | UTF-8 | 3,774 | 3.515625 | 4 | [] | no_license | // 11 - CountSemiprimes.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <assert.h>
#include <vector>
using namespace std;
/// Find smallest prime divisor for each number
vector<int> sieveOfEratosthenes(int N)
{
vector<int> sieve(N+1, 0); // +1 zero indexed
sieve[0] ... |
Python | UTF-8 | 1,002 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from sys import argv
import os
import re
outfile = argv[2] if len(argv) > 2 else argv[1]
fout = open(outfile, "w")
title = {
"实验目标" : "##",
"实验内容" : "##",
"实验步骤" : "##",
"实验检查" : "##",
"思考题" : "##"
}
index = [0]
def indexstr():
return ".".join(m... |
Shell | UTF-8 | 462 | 2.921875 | 3 | [] | no_license | #!/bin/bash
# script that compiles NAS applications with different register allocation algorithms.
# You can find each executable file under ./llvm/APP/app.$class.regalloc.o
# 25.2.2016 Created by Mohammad
cd ./llvm
for result in */ ; do
echo $result
cd ${result}
app=${PWD##*/}
echo $app
for clas... |
Python | UTF-8 | 367 | 3.5625 | 4 | [] | no_license | class Ejemplo:
__atributo_privado = "Soy un atributo inalcanzable desde afuera"
def __metodo_privado(self):
print("Soy un método inalcanzable desde afuera")
def metodo_publico(self):
self.__metodo_privado()
def getAtributoPrivado(self):
print(self.__atributo_privado)
e = Ejemp... |
TypeScript | UTF-8 | 2,962 | 2.671875 | 3 | [
"MIT"
] | permissive | import { standardize, createPredictionResult, createTeamNameLookup, getOneHotEncoding } from "./index";
import * as tf from "@tensorflow/tfjs";
import { numAllTimeTeams } from "@gvhinks/epl-constants";
describe("test utils", (): void => {
const arsenal = getOneHotEncoding("Arsenal")
const villa = getOneHotEncoding... |
Markdown | UTF-8 | 1,370 | 2.578125 | 3 | [] | no_license | ---
layout: post
title: 连番激战II:都输给了时间
date: 2014-10-27 22:28
author: alvachien
comments: true
tags: [Real Madrid, 皇家马德里, 皇马]
categories: [五洲足坛]
---
红蓝输球了,虽然比分并不是悬殊的大比分,而是相对让双方都能接受的一个“1:3”,但,下半场白衣军团完全在场面上和气势上压制住了红蓝军团。作为白衣拥趸的我,在这个场景下,却始终开心不起来。好吧,我无次数想过在伯纳乌能够还给巴萨一个5:0,也曾经再次期待让巴萨在伯纳乌列队欢迎冠军皇马,但是看到红蓝队中,金毛狮王普约尔已经离开了巴萨,守门员不再是那... |
C++ | UTF-8 | 12,512 | 2.75 | 3 | [
"MIT"
] | permissive | #include "ahi.hpp"
#include <iostream>
#include <sstream>
uintptr_t AHI::base_addr = 0x0;
std::map<LPVOID, BYTE[JMP_OPCODE_SIZE]> AHI::func_backups;
std::map<std::pair<LPVOID, LPVOID>, BYTE *> AHI::opcode_backups;
void AHI::init(void) { base_addr = (uintptr_t)GetModuleHandle(nul... |
Python | UTF-8 | 21,767 | 3.234375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"Python-2.0"
] | permissive | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com)
import unittest
from collections import OrderedDict, defaultdict, deque, namedtuple
class OrderedDictTests(unittest.TestCase):
def test_dunder_repr(self):
d = OrderedDict({5: 1, 6: 0})
actual = str(... |
Swift | UTF-8 | 1,269 | 2.875 | 3 | [
"MIT"
] | permissive | //
// ImageResizer.swift
// OperationComparison
//
// Created by Ellen Shapiro on 10/10/18.
// Copyright © 2018 Bakken & Baeck. All rights reserved.
//
import UIKit
class ImageResizer: NSObject {
enum Error: Swift.Error {
case imageDidNotResize
}
static func resizeImage(_ image: UIIm... |
Python | UTF-8 | 3,475 | 3.6875 | 4 | [] | no_license | #desafio1 programa que tenha uma tupla totalmente preenchida de 0 a 20 e receba um valor de 0 a 20 e mostrar por extenso
#desafio2 tupla como os 20 primeiros colocados da tabela do brasileiro e mostre os 5 primeiros colocados, os ultimos 4, lista com ordem alfabetica e posição do sport
#desafio3 programa que gere cinco... |
SQL | UTF-8 | 2,446 | 3.078125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.15.9
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 22, 2018 at 11:50 AM
-- Server version: 5.6.37
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
Shell | UTF-8 | 2,185 | 4.21875 | 4 | [] | no_license | #!/bin/bash
# Script to check for host response to ICMP Timestamp
# Timestamp will be converted to current time of day & compared
# Output to stdout will display time in ms & H:M:S
#
# Edit local_tz variable below to adjust time offset to your locale
#
# Author: Jason Ashton
# Created: 08/24/2015
#
# Timezone offset ... |
C# | UTF-8 | 1,155 | 2.9375 | 3 | [] | no_license | using System;
namespace SrtTranslator.Core
{
public class Subtitle
{
public SubtitleId Id { get; private set; }
public SubtitleTimestamps Timestamps { get; private set; }
public SubtitleText Text { get; private set; }
public Subtitle(
SubtitleId id,
Sub... |
Java | UTF-8 | 6,121 | 1.890625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2023 Google LLC
*
* 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 to... |
Markdown | UTF-8 | 6,775 | 2.796875 | 3 | [] | no_license | ## 鸡腿保卫战-EOS概念入门文章
---
### **百科登场**
简介
> *EOS,可以理解为Enterprise Operation System,即为商用分布式应用设计的一款区块链操作系统。EOS是引入的一种新的区块链架构,旨在实现分布式应用的性能扩展。注意,它并不是像比特币和以太坊那样的货币,而是基于EOS软件项目之上发布的代币,被称为区块链3.0。*
特点
>*1. EOS有点类似于微软的windows平台,通过创建一个对开发者友好的区块链底层平台,支持多个应用同时运行,为开发dAPP提供底层的模板。*
>*2. EOS通过并行链和DPOS的方式解决了延迟和数据吞吐量的难题,EOS是每秒可以上千级别的处... |
C# | UTF-8 | 1,507 | 2.921875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Configuration;
namespace SafeConnectCore
{
public class Logger
{
private const string LOG_ENABLED_KEY = "LogEnabled";
private static readonly string LOG_DIRECTORY = Path.Combine(... |
Java | UTF-8 | 20,086 | 2.15625 | 2 | [] | no_license | package com.kaplanteam.cathy.dangerparty.Level3;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.annotation.Nu... |
Java | UTF-8 | 1,274 | 3.609375 | 4 | [] | no_license | import java.util.ArrayList;
import java.util.stream.*;
public class StreamReview{
public static void main(String[] args){
ArrayList<String> list1 = new ArrayList<>();
list1.add("test");
list1.add("string");
list1.add("hello");
list1.stream()
.filter((t) -> t.length() <= 5)
.forEach((t) -> System.out.... |
C# | UTF-8 | 1,434 | 2.796875 | 3 | [] | no_license | using System.Net;
using System.Net.Mail;
using System.Text;
using System.Threading.Tasks;
using Application.Interfaces;
using Microsoft.Extensions.Options;
namespace Infrastructure.Email
{
public class EmailSender : IEmailSender
{
private readonly SMTPConfigModel _smtpConfig;
public EmailSende... |
Python | UTF-8 | 155 | 3.078125 | 3 | [
"MIT"
] | permissive |
class AlarmError(Exception):
@classmethod
def NoMatchingAlarm(cls, name: str):
return cls(f'Unable to find alarm matching name: {name}.')
|
Java | UTF-8 | 1,103 | 3.71875 | 4 | [] | no_license | package day51;
import java.util.Stack;
public class MinStack {
//create 2 stack one normal stack
private Stack<Integer> stackData;
//one stack only stores min number in every step see push
private Stack<Integer> stackMin;
public MinStack() {
this.stackData = new Stack<Integer>();
... |
Markdown | UTF-8 | 587 | 2.9375 | 3 | [] | no_license | # 第1回 Pythonの基本的な関数の使い方とデバッグ方法
ここでは,Pythonの基本的な関数の使い方とデバッグ方法について勉強しましょう.
まずは説明を読んで,練習問題に取り組みましょう.
- [説明:Pythonの基本的な関数の使い方とデバッグ方法](https://github.com/Shimamura-Lab-SU/Sharing-Knowledge-Database/blob/master/python_exercise/01_basic/description.md)
- [練習問題1](https://github.com/Shimamura-Lab-SU/Sharing-Knowledge-Da... |
Java | UTF-8 | 792 | 2.078125 | 2 | [] | no_license | package activities;
import java.util.Map;
import entities.Comment;
public class CommentEnviar extends Comment {
private Map hora;
public CommentEnviar(Map hora) {
this.hora = hora;
}
public CommentEnviar() {
}
public CommentEnviar(String comment, String nombre, String urlFoto, Stri... |
Java | UTF-8 | 1,177 | 2.9375 | 3 | [] | no_license | package com.nelliott.noahcollegeapp;
public class Guardian extends FamilyMember{
String mLastName;
String mFirstName;
String mOccupation;
String mObjectId;
@Override
public String getFirstName() {
return mFirstName; }
@Override
public void setFirstName(String firstName) {
... |
Java | UTF-8 | 464 | 1.765625 | 2 | [] | no_license | package my.study.dataprepare.bean;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
@Data
public class ForexTrade implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private String deal;
private String login;
private String type;
... |
Java | UTF-8 | 578 | 2.515625 | 3 | [] | no_license | package com.eomcs.util;
// 클라이언트의 요청 정보를 다루는 역할
public class CommandRequest01 {
private String commandPath;
private String remoteAddr;
private int remotePort;
public CommandRequest01(String commandPath, String remoteAddr, int remotePort) {
this.commandPath = commandPath;
this.remoteAddr = remoteAddr;... |
Java | UTF-8 | 964 | 3.15625 | 3 | [] | no_license | package StepDefinitions;
public class _01_LoginFunction {
//
// @Given("^Navigate to the website$")
// public void navigate_to_the_website() {
// System.out.println("Navigate to website");
// }
//
// @When("^User enters valid username and password$")
// public void user_enters_valid_username_and_... |
Java | UTF-8 | 1,984 | 2.34375 | 2 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /**
* Tencent is pleased to support the open source community by making Tseer available.
*
* Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a... |
Python | UTF-8 | 2,375 | 2.71875 | 3 | [] | no_license | from json_reader import get_tweets, get_contains, get_most_common
import nltk
from nltk.collocations import *
from nltk import ngrams
#removes all words before the word for (inc)
def clean_awards(awards):
new = []
for i in awards:
if i.find(" rt ") != -1 or i.find(" rt") != -1 or i[0:3] == "rt ":
contin... |
Python | UTF-8 | 57 | 2.546875 | 3 | [] | no_license | print("hello world")
x = 2
if(x == 2):
print("test")
|
C | UTF-8 | 1,470 | 2.703125 | 3 | [] | no_license | /*
* cachelab.h - Prototypes for Cache Lab helper functions
*/
#ifndef CACHELAB_TOOLS_H
#define CACHELAB_TOOLS_H
#define MAX_TRANS_FUNCS 100
typedef struct trans_func{
void (*func_ptr)(int M,int N,int[N][M],int[M][N]);
char* description;
char correct;
unsigned int num_hits;
unsigned int num_misses;
un... |
JavaScript | UTF-8 | 3,070 | 3.078125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // This example requires the Places library. Include the libraries=places
// parameter when you first load the API. For example:
// <script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&libraries=places">
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
center: {l... |
Java | UTF-8 | 1,753 | 2.4375 | 2 | [] | no_license | package com.sunsoft_supplier.net.network;
import android.os.CountDownTimer;
import com.sunsoft_supplier.net.checknet.CheckNet;
import com.sunsoft_supplier.utils.LogUtil;
import com.sunsoft_supplier.utils.ToastUtil;
import okhttp3.Call;
/**
* 监听网络请求时间
* Created by MJX on 2017/4/17.
*/
public class HttpCountDown ... |
Markdown | UTF-8 | 1,139 | 2.9375 | 3 | [] | no_license | # Worker-as-a-promise
## A WebWorker enhancer for communicate through a classical asynchronous promised base interface
### Example
```js
import { decorateWorker } from 'worker-as-a-promise';
const myWorker = new Worker('My/worker/script.js');
const worker = decorateWorker(myWorker);
// Comunicate using promise inter... |
Python | UTF-8 | 355 | 3.046875 | 3 | [] | no_license | import serial
# set ports and other constants for collecting data
ARDUINO_COM_PORT = "/dev/ttyACM0"
BAUD_RATE = 9600
SERIAL_PORT = serial.Serial(ARDUINO_COM_PORT, BAUD_RATE, timeout=1)
speed = 1
while speed != 0:
speed = int(input("Choose a speed from 1-32, or type '0' to stop."))
if 0 <= speed <= 32:
SERIAL_POR... |
Java | UTF-8 | 4,727 | 2.46875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2013 Sebastian Kaspari
*
* 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... |
Java | UTF-8 | 556 | 1.6875 | 2 | [] | no_license | package com.fontar.proyecto.presupuesto.excel.parser.labels;
public class Labels {
public static final DefaultLabels Default = DefaultLabels.instance;
public static final ANRLabels ANR = ANRLabels.instance;
public static final ARAILabels ARAI = ARAILabels.instance;
public static final CFLabels CFGeneral = CFLabel... |
Python | UTF-8 | 1,993 | 3.625 | 4 | [] | no_license | class Node(object):
"""
docstring
"""
def __init__(self, elem=-1, left=None, right=None):
"""
docstring
"""
self.elem = elem
self.left = left
self.right = right
class Tree(object):
"""
docstring
"""
def __init__(self):
"""
... |
Python | UTF-8 | 2,926 | 2.84375 | 3 | [
"MIT"
] | permissive |
import collections
import os
import sys
# take a list of user ids and and clustering assignment
# assign labels to each user
# also need the user <--> activity mapping
def get_labels_for_users(user_list_path, activity_list_path, clusters_file_paths, out_dir, addtl_act_ids_path=None):
out_dir = out_dir.rstrip(os... |
Python | UTF-8 | 515 | 3.890625 | 4 | [] | no_license | import numpy as np
arr = np.array([[1, 2, 3],[4, 5, 6],[7, 8, 9]])
bool_arr = arr > 3
print("bool\n", bool_arr)
print("true values\n", arr[bool_arr])
# or in sigle way
print("true values\n", arr[arr>3])
arr1 = np.array([[1, 2, 3.23],[4, 5, 6],[7, 8, 9]], dtype=np.float64)
print("arr1\n", arr1) # or np .add ... |
Python | UTF-8 | 9,708 | 2.703125 | 3 | [] | no_license | """
test.py - functions to support tests
"""
import logging
import numpy as NP
from .. import (DigitalSignal, QuadratureHybrid, SignalGenerator,
is_quadrature, rect_to_polar)
logger = logging.getLogger(__name__)
class SignalProber(object):
"""
tests various DigitalSignal objects created with Signa... |
Java | UTF-8 | 670 | 1.585938 | 2 | [] | no_license | package com.hqyj.javaSpringBoot.modules.account.service;
import com.github.pagehelper.PageInfo;
import com.hqyj.javaSpringBoot.modules.account.pojo.Role;
import com.hqyj.javaSpringBoot.modules.common.vo.Result;
import com.hqyj.javaSpringBoot.modules.common.vo.SearchVo;
import java.util.List;
/**
* @author qb
* @ve... |
C++ | UTF-8 | 828 | 2.6875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long number;
number n, result, temp;
vector<number> tree[500001];
bool used[500001] = { false };
void pairUp(number node, number prev) {
for (auto next : tree[node]) {
if (next == prev) continue;
pairUp(next, node);
}
... |
Java | UTF-8 | 389 | 2.21875 | 2 | [] | no_license | package PageClasses;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import Utility.Constants;
public class ShippingPage {
private static WebElement element = null;
public static WebElement shippingOptionOne(WebDriver driver){
element = driver.findEl... |
JavaScript | UTF-8 | 792 | 2.671875 | 3 | [] | no_license | const express = require('express');
const morgan = require('morgan');
const app = express();
// tell the express to use morgan
app.use(morgan('tiny'))
// app.use((req, res, next) => { // defining Middleware
// console.log('First mIDDLEWARE');
// return next(); // callBack
// });
app.use((req, res, next) => ... |
JavaScript | UTF-8 | 8,809 | 2.515625 | 3 | [
"MIT",
"Apache-2.0",
"PHP-3.0"
] | permissive | $(function() {
//模拟下拉框
$('.input_1').on('click', function () {
if ($('.food1').is('.hide')) {
$('.food1').removeClass('hide');
} else {
$('.food1').addClass('hide');
}
})
$('.input_2').on('click', function () {
if ($('.food2').is('.hide')) {
... |
Java | UTF-8 | 3,339 | 3.59375 | 4 | [] | no_license | import java.util.ArrayList;
public class Part1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
ComparableList c = new ComparableList();
String obj[] = { "345", "1", "2", "3" };
c.addFromArray(obj);
A a1 = new A(6);
A a2 = new A(7);
B b1 = new B(2, 4);
B b2 = new B(3, ... |
JavaScript | UTF-8 | 349 | 3.25 | 3 | [] | no_license | let PorcDeEstudents = 33;
let PorcDeMentors = 11;
let total = PorcDeEstudents + PorcDeMentors;
PorcDeEstudents = Math.round((100 * PorcDeEstudents) / total);
PorcDeMentors = Math.round((100 * PorcDeMentors) / total);
console.log("Percentaje of students: " + PorcDeEstudents + "%");
console.log("Percentaje of mentor... |
Python | UTF-8 | 170 | 3.734375 | 4 | [] | no_license | num1=1.5
num2=2.5
print(num1+num2)
x=10
y=14
z=18
print("x+y+z",x+y+z)
print(type(x))
print(type(y))
print(type(z))
print("x+y",x+y)
print("x+y-z",x+y-z)
|
Python | UTF-8 | 12,021 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | import pytest
from pyecore.ecore import *
from pyecore.commands import *
from pyecore.resources import URI, ResourceSet
from pyecore.utils import DynamicEPackage
from pyecore.notification import EObserver, Kind
from os import path
class LastObserver(EObserver):
def __init__(self, notifier=None):
super()._... |
Java | UTF-8 | 3,020 | 2.5 | 2 | [] | no_license | package controllers;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.annotation.Mu... |
JavaScript | UTF-8 | 728 | 2.796875 | 3 | [] | no_license | import React from 'react';
class State extends React.Component{
constructor(props){
super(props);
this.state = {
name :' ',
};
this.changeToHanh = this.changeToHanh.bind(this);
}
changeToHanh(){
if(this.state.name === 'THAI'){
this.setState(... |
Java | UTF-8 | 608 | 2.296875 | 2 | [] | no_license | package com.dh.mediaplayer.bean;
/**
* Created by DH on 21/05/2015.
*/
public class PlaylistOff {
private long id;
private String namePlaylist;
public PlaylistOff() {
}
public PlaylistOff(int id, String namePlaylist) {
this.id = id;
this.namePlaylist = namePlaylist;
}
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.