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 |
|---|---|---|---|---|---|---|---|
Ruby | UTF-8 | 197 | 2.59375 | 3 | [] | no_license | class ExchangeRate
def self.calculate_rate(date, amount, base_curr, counter_curr)
rate = FxLib::ExchangeRate.at(date, base_curr, counter_curr)
return (rate * amount).round(4)
end
end
|
Markdown | UTF-8 | 33,721 | 3.078125 | 3 | [] | no_license | # 科学网—终极问题:时间和宇宙的生与死 - 徐明昆的博文
# 终极问题:时间和宇宙的生与死
已有 3441 次阅读2015-6-15 18:50|个人分类:[相对论与量子力学](http://blog.sciencenet.cn/home.php?mod=space&uid=537101&do=blog&classid=153381&view=me)|系统分类:[论文交流](http://blog.sciencenet.cn/home.php?mod=space&do=blog&view=all&uid=537101&catid=11)
别人,或者我猜测:
1... |
Java | UTF-8 | 208 | 1.867188 | 2 | [] | no_license | package com.example.demo.services;
import com.example.demo.entities.Project;
public interface ProjectService {
Project createProject(Long userId, Project project);
Project getProject(Long id);
}
|
Python | UTF-8 | 1,943 | 4.5625 | 5 | [
"MIT"
] | permissive | ## Part 1 - Lab week 3
## Program to take input of name and print Hello "name"
# 1 name = str(input("Enter you name :"))
# 1 print("Hello {} ".format(name))
## Part 2
## Subtract 1st num from 2nd num and print
# 2 x = int(input("Please Enter first Number :",))
# 2 y = int(input("Please Enter second Number :"))
... |
Go | UTF-8 | 688 | 2.71875 | 3 | [] | no_license | package main
import (
"database/sql"
"log"
_ "github.com/mattn/go-sqlite3"
)
var gAskDB *sql.DB
// GetAskDB 获取当前的数据库连接,注意此方法不支持多线程访问,本程序目前也没有类似的需求。
func GetAskDB() *sql.DB {
if gAskDB == nil {
db, err := sql.Open("sqlite3", "./ask.db")
if err != nil {
log.Fatal(err)
}
_, err = db.Exec(`
create table ... |
Python | UTF-8 | 1,436 | 3.390625 | 3 | [] | no_license | class Solution:
def alienOrder(self, words):
graph = {}
indegree = {}
for word in words:
for c in word:
if c not in graph:
graph[c] = set()
indegree[c] = 0
prev_word = words[0]
for i in range(1,len(words)):
... |
Python | UTF-8 | 9,465 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | from keras.layers import Dropout, Dense, Embedding, LSTM, Bidirectional
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.models import Sequential
from sklearn.metrics import matthews_corrcoef, confusion_matrix
from sklearn.model_selection import train_test... |
Java | UTF-8 | 785 | 1.664063 | 2 | [] | no_license | package my.gov.kpn.quiz.core.dao;
import my.gov.kpn.quiz.core.model.QaPrincipal;
import my.gov.kpn.quiz.core.model.QaRoleType;
import my.gov.kpn.quiz.core.model.QaUser;
/**
* @author rafizan.baharum
* @since 11/9/13
*/
public interface QaPrincipalRoleDao {
void grant(QaPrincipal principal, QaRoleType roleType... |
C# | UTF-8 | 1,309 | 2.53125 | 3 | [] | no_license | using System;
using System.ComponentModel;
using System.Collections.ObjectModel;
using mywowNet;
namespace mywowNet.Data
{
public class Item : Entry
{
private int modelId;
private E_ITEM_TYPE type;
private string subclassName;
public int ModelId
{
... |
C++ | UTF-8 | 1,087 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <cmath>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
int plist[10000],pcount=0;
int prime(int n){
int i;
if ((n!=2&&!(n%2))||(n!=3&&!(n%3)... |
Markdown | UTF-8 | 1,491 | 2.53125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "[政治] 游錫堃:亡國必先亡史 應加強台灣史教育"
date: 2020-08-03T13:49:55.000Z
author: RTI 中央廣播電臺
from: https://www.rti.org.tw/news/view/id/2074622
tags: [ RTI 中央廣播電臺 ]
categories: [ RTI 中央廣播電臺 ]
---
<!--1596462595000-->
[[政治] 游錫堃:亡國必先亡史 應加強台灣史教育](https://www.rti.org.tw/news/view/id/2074622)
------
<div>
<img src="... |
Python | UTF-8 | 2,457 | 2.703125 | 3 | [
"MIT"
] | permissive | from scrapy.spiders import Spider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.http import Request
import numpy as np
class PageRankSpider(Spider):
name = "pagerank-crawler"
allowed_domains = [
"en.wikipedia.org"
]
start_urls = [
"https://en.wiki... |
C# | UTF-8 | 3,816 | 2.515625 | 3 | [] | no_license | using IRC.Helpdesk.Core;
using IRC.Helpdesk.Core.POCOs;
using IRC.Helpdesk.Core.Tests;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Tests
{
/// <summary>
/// Tests for <see cref="ExcelAssetReader"/> Class
/// </summary>
public clas... |
JavaScript | UTF-8 | 1,578 | 2.890625 | 3 | [] | no_license | export function sortByOrigin(list){
var new_Array = [];
var groupby = new Map();
list.forEach((item, i) => {
if (!groupby.has(item.origin))
groupby.set(item.origin,[])
groupby.get(item.origin).push(item);
});
for (const [key,value] of groupby.entries()){
value.forEach((item, i) => {
ne... |
Java | UTF-8 | 1,535 | 3.71875 | 4 | [] | no_license | package builtin.algorithms;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class SortingTest {
public void testMergeSorting() {
Person p1 = new Person("Bob", 1);
Person p2 = new Person("Alice", 2);
Person p3 = ne... |
C++ | UTF-8 | 1,166 | 2.984375 | 3 | [] | no_license | //
// Action_Delay.h
// WalaberEngine
//
// Created by Gulliver, Christopher on 5/28/13.
//
//
#ifndef WalaberEngine_Action_Delay_h
#define WalaberEngine_Action_Delay_h
#include <IAction.h>
namespace Walaber
{
/*! An action that waits / delays for a specific amount of time before finishing execution
*/
... |
SQL | UTF-8 | 12,095 | 3.203125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : vm
Source Server Version : 50537
Source Host : localhost:3306
Source Database : Standard
Target Server Type : MYSQL
Target Server Version : 50537
File Encoding : 65001
Date: 2015-03-22 20:12:37
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... |
PHP | UTF-8 | 934 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Omnipay\MyPay\Message;
use Omnipay\Common\Message\AbstractResponse;
class RefundResponse extends AbstractResponse
{
/**
* Is the response successful?
*
* @return bool
*/
public function isSuccessful()
{
return $this->getCode() === 'B200';
}
/**
* ... |
Markdown | UTF-8 | 830 | 2.875 | 3 | [] | no_license | # Reflection by Add Your Name Here
## Using a fenced code block, please display the output from running your program
Please add the requested fenced code block.
## What was your strategy for computing the complement of a DNA string? How did you test it?
Please provide a response to this question.
## How did your p... |
C# | UTF-8 | 952 | 2.578125 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameController : MonoBehaviour
{
[SerializeField]
private List<GameObject> upgradeList;
public DropTable DropTable { get; private set; }
private void Start()
{
DropTable = new DropTable();
... |
Python | UTF-8 | 5,704 | 2.890625 | 3 | [
"MIT"
] | permissive |
import networkx as nx
import re
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
#get edgelist
f = open('cmap_edgelist.txt')
text_edge = f.readlines()
#get vertexids
f = open('cmap_vertexids.txt')
text_node = f.readlines()
dict_node = {}
#define directional graph
G=nx.DiGraph()
#get all node... |
PHP | UTF-8 | 228 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace DevGroup\Multilingual\interfaces;
interface ContentTabHandlerInterface
{
/**
* @param int $contextId
*
* @return array [$key => $data]
*/
public function contextData($contextId);
} |
Python | UTF-8 | 554 | 4.625 | 5 | [] | no_license | print('Crie um programa que leia o nome completo de uma pessoa e mostre:'
'\n 1- O nome com todas as letras maiúsculas. '
'\n 2- O nome com todas minúsculas.'
'\n 3- Quantas letras ao todo(sem os espaços)'
'\n 4- Quantas letras tem o primeiro nome.')
nome = str(input('Digite seu nome completo: '... |
Java | UTF-8 | 24,917 | 3.234375 | 3 | [] | no_license | package edu.ucalgary.ensf409;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import java.awt.*;
/**
* <h1>Program</h1>
* This program implements an application that
* is used to determine the cheapest combination of
* inventory items that can be used to fulfill an order that
... |
Java | UTF-8 | 339 | 1.96875 | 2 | [] | no_license | package de.rooftop.radio.band;
import java.util.List;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface BandRepository extends CrudRepository<Band, Long>{
List<Band> findA... |
Shell | UTF-8 | 278 | 3.203125 | 3 | [] | no_license | port=5000
if [ "$1" != "" ]; then
echo "Positional parameter 1 contains something"
else
echo "Positional parameter 1 is empty"
fi
mkdir -p logs/"$d/latency"
mkdir -p logs/"$d/bandwidth"
for i in {0..10}
do
newport=`expr $port + $i`
./main node $newport "$1" &
done
|
Swift | UTF-8 | 3,907 | 2.8125 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | //
// HashingManager.swift
// DropBit
//
// Created by Mitchell on 5/31/18.
// Copyright © 2018 Coin Ninja, LLC. All rights reserved.
//
import Foundation
import CommonCrypto
import PhoneNumberKit
struct HashingManager {
func salt() throws -> Data {
guard keyDerivation.salt.isNotEmpty,
let salt = key... |
Markdown | UTF-8 | 2,016 | 3.078125 | 3 | [] | no_license | ---
title: 事务的四种隔离级别
tags:
- 数据库
- 事务
---
# 事务的四种隔离级别
## 数据库事务的隔离级别有4种
* 由低到高分别为Read uncommitted 、Read committed 、Repeatable read 、Serializable
* 在事务的并发操作中可能会出现脏读,不可重复读,幻读
## Read uncommitted
* 读未提交,顾名思义,就是一个事务可以读取另一个未提交事务的数据
* 事务回滚会导致脏读
## Read committed
* 读提交,顾名思义,就是一个事务要等另一个事务提交后才能读取数据
* 一个事务范围内两个相同的查询却返回了不同... |
Java | UTF-8 | 617 | 1.921875 | 2 | [] | no_license | package com.thomsonreuters.testproject.client;
import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* The async counterpart of <code>GreetingService</code>.
*/
public interface GreetingServiceAsync {
void greetServer(String[] input, AsyncCallback<String> callback) throws Illeg... |
C++ | UTF-8 | 5,417 | 2.765625 | 3 | [] | no_license | // $Id: file_sys.cpp,v 1.5 2016-01-14 16:16:52-08 - - $
#include <iostream>
#include <stdexcept>
#include <unordered_map>
using namespace std;
#include "debug.h"
#include "file_sys.h"
int inode::next_inode_nr {1};
struct file_type_hash {
size_t operator() (file_type type) const {
return static_cast<size_t... |
Python | UTF-8 | 12,531 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | # Copyright (C) 2017-2019 New York University,
# University at Buffalo,
# Illinois Institute of Technology.
#
# 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 th... |
Java | ISO-8859-1 | 611 | 3.234375 | 3 | [] | no_license | package upacademy.HelloWorld;
public class Fizbuz {
public static void main (String[] args) {
ScannerUtils su = new ScannerUtils () ;
System.out.println ("Digite um nmero entre 1 e 40...");
int userValue = su.getInt(1, 40);
int i = 0;
while (i <= userValue) {
if (i%3 == 0 && i % 5 == 0) {
... |
Java | UTF-8 | 2,279 | 3.578125 | 4 | [] | no_license | package src.Interviews.Servicenow;
import java.util.ArrayList;
import java.util.List;
public class MergeList {
/**
* Given two lists of nodes, merge them, end result :
*
* In given list, nodeId is sorted with duplicates.
*
* return:
* All node has the same values should be sumed toge... |
TypeScript | UTF-8 | 1,406 | 2.921875 | 3 | [
"MIT"
] | permissive | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
import { html, TemplateResult } from 'lit-html'
/**
* Get the value of an HTML meta tag.
*/
export function meta(name: string): string {
return (document.querySelector(`meta[nam... |
Java | UTF-8 | 1,397 | 3.515625 | 4 | [] | no_license | package in.array;
public class MergeTwoSortArray {
public static Integer[] mergeArray(Integer [] sortedArr1,Integer [] sortedArr2)
{
Integer[] mergeArray = null;
if(sortedArr1.length<=0 && sortedArr2.length<=0)
{
System.out.println("Both array are blank");
}
else if(sortedArr1.length<=0)
{
retur... |
C# | UTF-8 | 790 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using entity;
namespace DAL
{
public class logindal
{
public bool Authenticate(loginentity le)
{
try
{
TrainingDBEntities db = new Train... |
SQL | UTF-8 | 4,924 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 25, 2020 at 06:08 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
Python | UTF-8 | 247 | 2.921875 | 3 | [] | no_license | from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
my_seq = Seq("GATCGATGGGCCTATATAGGATCGAAAATCGC", IUPAC.unambiguous_dna)
print(repr(my_seq))
print(repr(my_seq.complement()))
print(repr(my_seq.reverse_complement()))
print(repr(my_seq[::-1])) |
Java | UTF-8 | 10,516 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 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 ... |
JavaScript | UTF-8 | 20,468 | 2.828125 | 3 | [
"MIT"
] | permissive | //
// # Rules for expressions.
//
import { proto } from "~/util"
import { Match, Rule } from "~/parser"
import { AST, SpellParser } from "~/languages/spell"
/** TODOC!!! */
SpellParser.Rule.InfixOperatorSuffix = class infix_operator extends Rule.Sequence {
// set `outputDatatype` to specify explicit datatype in st... |
C++ | UTF-8 | 2,161 | 2.953125 | 3 | [] | no_license | #include "pch.h"
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int count = 0;
struct point {
int x;
int y;
};
int compare_by(struct point p1, struct point p2, char c) {
count++;
//ここを埋める
if (p1.x == p2.x && p1.y == p2.y) {
return 0;
}
else if (c == 'X') {//Xの処理
if (p1.x > p2.x)... |
Java | UTF-8 | 1,577 | 3.671875 | 4 | [] | no_license | package bankingsix;
// customer classs
class CustomersSix {
// instance variables
String customerName;
String customerID;
// private variable for this class soley
private AccountSix account;
// constructor with parameters.
CustomersSix(String customerName, String customerID, AccountSix account){
... |
Markdown | UTF-8 | 3,442 | 2.640625 | 3 | [
"CC-BY-4.0",
"MIT",
"LicenseRef-scancode-generic-cla"
] | permissive | ---
title: Run content moderation jobs in Azure Content Moderator | Microsoft Docs
description: Learn how to run content moderation jobs in the API console.
services: cognitive-services
author: sanjeev3
manager: mikemcca
ms.service: cognitive-services
ms.technology: content-moderator
ms.topic: article
ms.date: 08/03/2... |
TypeScript | UTF-8 | 10,166 | 2.53125 | 3 | [] | no_license |
// 关卡控制逻辑
class Level {
public displayName:string;
public map:Map;
public bt:Battle; // 反向引用回所属 battle
public keys:Elem[] = []; // 装着所有的关卡初始钥匙
public levelType; // 关卡种类
private cfg;
private lv;
public Init(bt:Battle, cfg) {
this.displayName = cfg.displayName;
this.bt = ... |
Python | UTF-8 | 671 | 3.03125 | 3 | [] | no_license | nobel_winners = [
{'category': 'Physics',
'name': 'Albert Einstein',
'nationality': 'Swiss',
'sex': 'male',
'year': 1921},
{'category': 'Physics',
'name': 'Paul Dirac',
'nationality': 'British',
'sex': 'male',
'year': 1933},
{'category': 'Chemistry',
'name': 'Marie Curie',
'nationality': 'Polish',
'sex': 'female',
'yea... |
Java | UTF-8 | 1,223 | 2.125 | 2 | [] | no_license | package cn.mldn.vshop.action.back;
import cn.mldn.util.factory.Factory;
import cn.mldn.util.web.ModelAndView;
import cn.mldn.vshop.service.back.IItemServiceBack;
import cn.mldn.vshop.util.action.AbstractBaseAction;
import cn.mldn.vshop.vo.Item;
public class ItemActionBack extends AbstractBaseAction {
public... |
Shell | UTF-8 | 619 | 3.484375 | 3 | [] | no_license | #!/bin/bash
#
# Test custom level2 creation
#
# Usage: ./ead.sh IISH flow home folder
flows_home=$1
if [ ! -d "$flows_home" ] ; then
echo "flows_home folder should point to the iish-flows home directory."
exit -1
fi
global_home=$flows_home/src/main/global
cd $flows_home/src/main/flow1/custom_level2
na=12345
... |
Markdown | UTF-8 | 89,200 | 3.9375 | 4 | [] | no_license | 数据结构
## 线性表
线性表的物理存储结构有两种,顺序存储结构与链式存储结构。
### 顺序存储结构
#### 概念
- 线性表List是由零个或多个数据元素组成的有限序列。也就是说可以为空。而当存在多个元素时,第一个元素无前驱,最后一个元素无后继,其他元素都有且只有一个前驱与后继。元素之间是一对一的关系;
- 数据类型是一组性质相同的值的集合及定义在此集合上的一些操作的总称。如C语言中按照取值的不同,数据类型可以分为两类,原子类型(不可分解,如int、double、char)与结构类型(如整型数组);
- 抽象数据类型 ADT (Abstract Data Type),类似于面向对象中的类,由方法与属性组成, ADT就... |
JavaScript | UTF-8 | 1,044 | 3.078125 | 3 | [] | no_license | nose_x=0;
nose_y=0;
difference=0;
leftwrist_x=0;
rightwrist_x=0;
function setup(){
video=createCapture(VIDEO);
video.size(560,500);
canvas=createCanvas(560,500);
canvas.position(760,170);
video.position(150,150);
poseNet=ml5.poseNet(video,modelLoaded);
poseNet.on('pose',gotResults);
}
function draw(){... |
C++ | UTF-8 | 338 | 2.609375 | 3 | [] | no_license | #pragma once
#include "ExplicitHand.hpp"
class StraightAceLowHand : public ExplicitHand
{
public:
StraightAceLowHand(Player& player);
~StraightAceLowHand() = default;
bool operator<(const ExplicitHand& rhs) const noexcept override;
bool operator>(const ExplicitHand& rhs) const noe... |
Java | UTF-8 | 1,822 | 1.671875 | 2 | [] | no_license | package com.tencent.mm.plugin.appbrand.jsapi.version;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.config.AppBrandInitConfigWC;
import com.tencent.mm.plugin.appbrand.report.... |
Python | UTF-8 | 538 | 3.796875 | 4 | [] | no_license | class ListList:
def __init__(self, value):
self.value = value
self.setofvalues = set(item for sublist in self.value for item in sublist)
#wtf is this lol
def __iter__(self):
print('Using __iter__')
return(item for sublist in self.value for item in sublist)
#again, wtf is this
def __contains__(self,valu... |
Java | UTF-8 | 1,467 | 2.578125 | 3 | [] | no_license | package pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import driver.WebDriverManager;
public class SignInPage extends WebDriverManager{
private WebDriver driver;
private By n... |
Python | UTF-8 | 1,060 | 2.5625 | 3 | [] | no_license | import sys
input = sys.stdin.readline
N, L = map(int, input().rstrip('\n').split())
base = [list(map(int, input().rstrip('\n').split())) for _ in range(N)]
answer = 0
def check(base, result):
for r in range(N):
if len(set(base[r])) == 1:
result += 1
continue
now = base[r][0... |
Java | UTF-8 | 3,500 | 3.0625 | 3 | [] | no_license | package adamsdd.calculator.model;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.regex.Matcher;
public class Calculations {
private Map<String, BiFunction<BigDecimal, BigDecimal, BigDecimal>> ... |
JavaScript | UTF-8 | 1,145 | 3.84375 | 4 | [] | no_license | const handlers = {}
/**
* 1. How do we let you add more than 1 handler for the same type?
*/
const trigger = (type, ...args) => {
// iterate and invoke each handler within this key
handlers[type].forEach(handler => handler(...args))
}
const on = (type, handler) => {
// if the key doesn't exist
if(!(type in han... |
Java | UTF-8 | 549 | 1.875 | 2 | [] | no_license | package com.example.demo.repository;
import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.examp... |
SQL | UTF-8 | 562 | 4.28125 | 4 | [] | no_license | --Listar o nome do cliente e quantidade de produtos diferentes comprados em 2018
--SELECT * FROM Cliente where NomeCliente = 'Allan Silva'
--SELECT* FROM Produto
--SELECT * FROM Venda
--SELECT * FROM VendaItem
SELECT Total.Nome, COUNT(Total.idProduto) AS Total
FROM
(SELECT C.NomeCliente AS Nome, VI.IdProduto A... |
C | GB18030 | 558 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void PrintTrangle(int n);
/*
ӡͼ
ӡn-1space
ӡ2i-1*
ӡ1\n
*/
void PrintTrangle(int n)
{
int i,j;
for(i=1;i<=n;i++)
{
for(j=0;j<n-i;j++)
printf(" ");
for(j=0;j<2*i-1;j++)
printf("*");
printf("\n");
}
... |
Python | UTF-8 | 1,624 | 4.25 | 4 | [] | no_license | '''
Exercise 16 (and Solution)
Write a password generator in Python. Be creative with how you
generate passwords - strong passwords have a mix of lowercase letters,
uppercase letters, numbers, and symbols. The passwords should
be random, generating a new password every time the user asks
for a new password. Include yo... |
Java | UTF-8 | 606 | 2.890625 | 3 | [] | no_license | package com.mmall.concurrency.example.singleton;
import com.mmall.concurrency.annotations.NotRecommend;
import com.mmall.concurrency.annotations.ThreadSafe;
import java.util.Vector;
//饿汉式
@ThreadSafe
public class SingletonExample2 {
//构造私有化
private SingletonExample2(){
}
//单例对象
static {
instance = new Singl... |
Ruby | UTF-8 | 4,019 | 3.75 | 4 | [] | no_license | require 'csv'
$mod_mode = 0 #change criteria for printing student list
@students = []
@modifier = "" #specifier for printing student list criteria
@mod_list = [] #student list returned after applying mods
def input_students
puts "Please enter the names of the students and their cohorts"
puts "Use this format 'N... |
Markdown | UTF-8 | 2,263 | 3.875 | 4 | [] | no_license | [包围区域](https://leetcode.com/problems/surrounded-regions/description/)
```
Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.
A region is captured by flipping all 'O's into 'X's in that surrounded region.
For example,
X X X X
X O O X
X X O X
X O X X
After running your funct... |
Java | UTF-8 | 13,816 | 1.859375 | 2 | [] | no_license | package web.app.rest.company;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.annotation.security.RolesAllowed;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Query;
import javax.persistence.TypedQuery;
... |
C# | UTF-8 | 1,065 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace OneSnip
{
public class Snip
{
public event EventHandler<SnipEventArgs> SnipCreated;
private Bitmap image;
priv... |
Swift | UTF-8 | 1,075 | 2.890625 | 3 | [] | no_license | //
// FirebaseAuthManager.swift
// DoubleXP
//
// Created by Toussaint Peterson on 10/10/19.
// Copyright © 2019 Peterson, Toussaint. All rights reserved.
//
import FirebaseAuth
import UIKit
class FirebaseAuthManager {
func createUser(email: String, password: String, completionBlock: @escaping (_ success: Bool... |
C# | UTF-8 | 1,456 | 2.78125 | 3 | [] | no_license | using ELearning.API.Helper;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
namespace ELearning.API.Middlewares
{
public class ExceptionMiddleware
{
private readonly RequestDelegate _next;
publ... |
Markdown | UTF-8 | 5,775 | 3.734375 | 4 | [] | no_license | # `(困难)` [5729.finding-mk-average 求出 MK 平均值](https://leetcode-cn.com/problems/finding-mk-average/)
[contest](https://leetcode-cn.com/contest/weekly-contest-236/problems/finding-mk-average/)
### 题目描述
<div class="notranslate"><p>给你两个整数 <code>m</code> 和 <code>k</code> ,以及数据流形式的若干整数。你需要实现一个数据结构,计算这个数据... |
Java | UTF-8 | 2,397 | 2.375 | 2 | [] | no_license | package com.switchfully.spaceshark.model.parkingLot;
import com.switchfully.spaceshark.model.Price;
import com.switchfully.spaceshark.model.addresses.Address;
import com.switchfully.spaceshark.model.people.ContactPerson;
import javax.persistence.*;
@Entity
@Table (name = "parkinglot")
public class Parkinglot {
... |
JavaScript | UTF-8 | 1,015 | 2.640625 | 3 | [] | no_license | 'use strict';
/**
* @type {Symbol}
*/
let singleton = Symbol();
/**
* @type {Symbol}
*/
let singletonEnforcer = Symbol()
/**
* Scene of the Game.
* Created with PhysiJS
*
* @class Scene
*/
class Scene {
constructor(enforcer) {
if(enforcer != singletonEnforcer) throw "Cannot construct singleton S... |
C# | UTF-8 | 1,244 | 2.53125 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Door : MonoBehaviour {
public bool open = false;
public float doorOpenAngle = -90f;
public float doorClosedAngle = 0f;
public float doorAngleX = -90f;
public float doorAngleZ = 0f;
public float smooth = 2f; //speed of... |
JavaScript | UTF-8 | 3,825 | 2.5625 | 3 | [] | no_license | import React, { Component } from "react";
import Footer from "./Footer";
import { firestore } from "../components/firebase/firebase";
class Contact extends Component {
constructor() {
super();
this.state = {
firstName: "",
lastName: "",
email: "",
subject: "",
message: "",
... |
Java | UTF-8 | 701 | 1.984375 | 2 | [] | no_license | package com.bcd.service;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.bcd.dao.UserDao;
import com.bcd.entity.User;
import com.bcd.util.PageBean;
@Service
@Transactional(readOnly=fa... |
JavaScript | UTF-8 | 2,622 | 2.765625 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect, useRef } from 'react';
import Player from '../../components/player/Player';
import Opponent from '../../components/opponent/Opponent';
import css from './Game.sass';
const Game = () => {
// Just hardcode for now
const players = [
'player',
'cpu1',
'cpu2',
'cpu... |
Java | UTF-8 | 2,779 | 2.34375 | 2 | [
"MIT"
] | permissive | // Generated from D:/Projects/MT/LALR/src/main/java/util/grammar\GrammarParser.g4 by ANTLR 4.7.2
package util.grammar;
import org.antlr.v4.runtime.tree.ParseTreeListener;
/**
* This interface defines a complete listener for a parse tree produced by
* {@link GrammarParserParser}.
*/
public interface GrammarParserLis... |
Java | UTF-8 | 5,231 | 2.15625 | 2 | [] | no_license | package sg.edu.nus.comp.android3dvisualisationtool.app;
import android.app.ActionBar;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.FragmentManager;
import android.content.Context;
import android.content.pm.ConfigurationInfo;
import android.graphics.Point;
import android.net.Uri;
... |
Java | UTF-8 | 4,037 | 2.671875 | 3 | [
"MIT"
] | permissive | package jpaoletti.jpm2.core.converter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import jpaoletti.jpm2.core.exception.ConfigurationException;
import jpaoletti.jpm2.core.exception.ConverterException;
import jpaoletti.jpm2.core.model.ContextualEntity;
import jpaoletti.jpm2.core.model.Field;
import ... |
C | UTF-8 | 6,126 | 2.5625 | 3 | [] | no_license | #include "include/ft_printf.h"
void compil_testper(int i, int j, int k)
{
j = printf("%d\n>>%%<<\n", i);
fflush(stdout);
k = ft_printf(">>%%<<");
fflush(stdout);
printf(" Diff = %d\n", (j - k - 3));
fflush(stdout);
}
void compil_testper1(int j, int k)
{
j = printf(">>%%<<\n");
fflush(stdout);
k = ft_pri... |
Python | UTF-8 | 869 | 2.6875 | 3 | [] | no_license | #when writing Python scripts in which you manipulate an entry in the Workspace, you need to synchronize the Workspace changes with the Project Table before using a Structure entry from the Project Table.
import sys,os
from schrodinger.maestro import maestro
from schrodinger import project
from schrodinger import surf... |
PHP | UTF-8 | 4,006 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | <?php
namespace DaPigGuy\PiggyCrates\Tasks;
use DaPigGuy\PiggyCrates\Main;
use DaPigGuy\PiggyCustomEnchants\CustomEnchants\CustomEnchants;
use pocketmine\block\Block;
use pocketmine\command\ConsoleCommandSender;
use pocketmine\item\enchantment\Enchantment;
use pocketmine\item\enchantment\EnchantmentInstance;
use pock... |
Ruby | UTF-8 | 1,212 | 2.609375 | 3 | [] | no_license | # == Schema Information
#
# Table name: follows
#
# id :integer not null, primary key
# user_id :integer not null
# followable_type :string
# followable_id :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Follow < ... |
Swift | UTF-8 | 329 | 2.609375 | 3 | [
"MIT"
] | permissive | //
// StreamMessage.swift
// SampleAgoraBroadcast
//
// Created by Roger Carvalho on 03/08/2020.
// Copyright © 2020 Roger Carvalho. All rights reserved.
//
import Foundation
/**
Holds the dictionary keys for messages sent between host and audience
*/
enum StreamMessage: String {
case MessageType = "type"
... |
Java | UTF-8 | 2,373 | 2.390625 | 2 | [] | no_license | package com.dxc.common_tools.kafka;
import java.util.Properties;
import java.util.concurrent.ExecutionException;
import org.apache.kafka.clients.producer.Callback;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.... |
Java | GB18030 | 278 | 2.453125 | 2 | [] | no_license | package com.design.pattern.behavioral.strategy.imooc;
/**
* Created by geely
*/
public class LiJianPromotionStrategy implements PromotionStrategy {
public void doPromotion() {
System.out.println(",γ̵ļ۸ֱӼȥõļ۸");
}
}
|
JavaScript | UTF-8 | 1,284 | 3.171875 | 3 | [] | no_license | function solve(input) {
var start = parseInt(input[0]);
var end = parseInt(input[1]);
console.log("<table>");
console.log("<tr><th>Num</th><th>Square</th><th>Fib</th></tr>")
for (var i = start; i <= end; i++) {
var result = [];
var currentResult = 'no';
switch(i) {
... |
Java | UTF-8 | 476 | 3.421875 | 3 | [] | no_license |
public class SimpleSingletoneClass {
private static SimpleSingletoneClass instance;
private SimpleSingletoneClass(){
}
public static SimpleSingletoneClass getInstance(){
if(instance == null){
System.out.println("Returned new instance");
instance = new SimpleSingletoneClass();
return instance;
}
... |
C++ | UTF-8 | 536 | 3.09375 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
int n,k;
string input;
cin >> n >> k;
cin >> input ;
int mid = n/2;
int i;
int flag = 0;
for(i=n-1;i>=1;i--)
{
int si = n - i;
if(input.substr(0,i) == input.substr(si,i))
{
flag = 1;
break;
}
}
strin... |
Markdown | UTF-8 | 1,673 | 2.609375 | 3 | [
"MIT"
] | permissive | # express-upload-progress
Sample application to demonstrate file uploading with [express.js](http://expressjs.com/). The upload progress is shown in a progress bar, that is styled with [Twitter's Bootstrap](http://twitter.github.com/bootstrap/).
## Demo
[express-upload-progress.herokuapp.com/](http://express-upload-... |
JavaScript | UTF-8 | 875 | 2.609375 | 3 | [] | no_license | const Discord = require('discord.js');
const commonUtil = require('./utils/common-util.js');
const client = new Discord.Client();
const Token = 'MjUxMjA5NDQxNzA0MjgwMDc3.CzsZjQ.zz8y-OqJtJk6_BeOHSaTyOwuCYE';
client.on('ready', () => {
console.log('Blackwatch is keeping an eye on you...');
})
cl... |
Python | UTF-8 | 503 | 3.5 | 4 | [] | no_license | '''
@Description:
@Author: 陈十一
@Date: 2020-07-23 09:47:50
@LastEditTime: 2020-07-23 10:16:31
@LastEditors: 陈十一
'''
print("请输入m:")
m = int(input())
# 数学推导可得奇数范围,然后生成对应列表
nums = [i for i in range(m * m - m + 1, m * m + m + 1, 2)]
# 平平无奇的字符串拼接
output = str(m) + "*" + str(m) + "*" + str(m) + "\n=" + str(m*m*m) + "\n="
f... |
Java | UTF-8 | 1,480 | 2.75 | 3 | [] | no_license | package test;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public class Execution {
public static void main(String[] args) {
Student s = new Student("H234");
Student s2 = new Student("H234");
System.out.println(s.equals(s2));
Map<Student,... |
Python | UTF-8 | 775 | 3.015625 | 3 | [] | no_license | import cv2
class EyeDetector:
def __init__(self, faceCascadePath, eyeCascadePath):
self.faceCascade = cv2.CascadeClassifier(faceCascadePath)
self.eyeCascade = cv2.CascadeClassifier(eyeCascadePath)
def track(self, image):
faceRect = self.faceCascade.detectMultiScale(image, scaleFactor = 1.1,
minN... |
Java | UTF-8 | 2,453 | 3.140625 | 3 | [] | no_license | package main;
import java.math.BigDecimal;
import java.util.Random;
public class K_means_Strategy implements ClusteringStrategy {
private int cluster;
private VectorList vectorList;
private ClusterList clusterList ;
public boolean isEmpty = false;
public K_means_Strategy(int numberOfCluster, VectorList vector... |
PHP | UTF-8 | 589 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Purchase extends Model
{
use HasFactory;
protected $table = 'purchases';
/**
* The database primary key value.
*
* @var string
*/
protected $primaryKe... |
JavaScript | UTF-8 | 1,365 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Card from '../../components/Cards/UserCard';
import Loader from '../../components/Loader';
import moment from 'moment';
function Users(){
const [state, setState] = useState([]);
useEffect(() => {
fetch('https://api.jsonbin.io/b/5d3c29c135e3f814032b5d... |
Java | UTF-8 | 1,628 | 3.828125 | 4 | [] | no_license | package practicce.rec;
public class MidtermsPractice {
public static int minimumNum(int a, int b, int c) {
return Math.min(Math.min(a, b), c);
}
public static int maximumNum(int x, int y, int z) {
return Math.max(Math.max(x, y), z);
}
public static int average(int a, ... |
Go | UTF-8 | 2,809 | 3.015625 | 3 | [] | no_license | package db
import "fmt"
import "reflect"
import "regexp"
import "github.com/ziutek/mymysql/mysql"
import "time"
import "misc/naming"
var escape_regexp *regexp.Regexp
func init() {
escape_regexp = regexp.MustCompile(`(\'|\"|\.|\*|\/|\-|\\)`)
}
//----------------------------------------------- escape chars
func SQL_... |
Python | UTF-8 | 1,607 | 3.71875 | 4 | [] | no_license | # -------------------------------------------------------------------------------------------------------------------
# -------------------------------- Decompose Conditional ------------------------------------------------------------
# --------------------------------------------------------------------------------... |
Java | UTF-8 | 663 | 3.09375 | 3 | [] | no_license | package com.learncode.tree;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class Ex05LevelOrderSpiralTraversalTest {
@Test
void traverse() {
Tree<Integer> tree = new Tree<>();
Node root = tree.addRoot(4);
Node two = tree.addToLeftOf(root, 2);
... |
Swift | UTF-8 | 2,069 | 2.6875 | 3 | [] | no_license | //
// MyScrollTextView.swift
// MyScrollBannerView
//
// Created by OOPer in cooperation with shlab.jp, on 2016/3/27.
// Copyright © 2016 OOPer (NAGATA, Atsuyuki). All rights reserved. See LICENSE.txt .
//
import UIKit
class MyScrollTextView: UIScrollView {
var animationPixelsPerSecond: CGFloat = 60
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.