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,635 | 2.9375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct figure
{
char ch;
double rx1,rx2,ry1,ry2;
double cx1,cy1,cr1;
};
main()
{
ios::sync_with_stdio(0);
char ch;
double a,b,c,d,x,y;
figure fff[10];
int idx1=0,point=1;
while(cin>>ch&&c... |
Python | UTF-8 | 289 | 2.53125 | 3 | [] | no_license | import multiprocessing as mpi
def run(a):
print(a.get())
if __name__ == '__main__':
queue=mpi.Queue()
for i in range(10):
queue.put(i)
for i in range(5):
p = mpi.Process(target=run, args=(queue,))
p.start()
p.join()
print(queue.get()) |
Java | UTF-8 | 4,734 | 2.71875 | 3 | [
"MIT"
] | permissive | package com.daxton.fancychat.api;
import com.daxton.fancychat.FancyChat;
import com.daxton.fancychat.config.PlayerData;
import com.daxton.fancycore.api.character.conversion.ColorConversion;
import com.daxton.fancycore.nms.ItemBaseComponent;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.HoverEve... |
Markdown | UTF-8 | 3,763 | 3.125 | 3 | [] | no_license | # Image
## Image
포토문자\(MMS\)에 사용 될 이미지 관리 관련 예제 입니다.
### 서버에 이미지 파일 등록
- 이미지 파일을 쿨에스엠에스 미디어 서버에 저장합니다.
```text
import sys
from sdk.api.image import Image
from sdk.exceptions import CoolsmsException
## @brief This sample code demonstrate how to upload image through CoolSMS Rest API
if __name__ == "__main__":
... |
SQL | UTF-8 | 2,945 | 3.828125 | 4 | [] | no_license | -- comentários
-- a linha abaixo cria um banco de dados
create database dbinfox;
-- a linha abaixo escolhe o banco de dados a ser utilizado
use dbinfox;
-- o bloco de instruções abaixo cria uma tabela
create table tbusuarios(
iduser int primary key,
usuario varchar(50) not null,
fone varchar(15),
login varchar(15) not... |
C# | UTF-8 | 2,840 | 2.875 | 3 | [
"Unlicense"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Windows.Forms;
namespace GetUnusedSkills
{
public partial class Form1 : Form
{
... |
PHP | UTF-8 | 1,724 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php
require_once __DIR__ .'/../vendor/autoload.php';
use Kristuff\Mishell\Console;
Console::log(' '. Console::text('Overview:', 'underlined', 'bold'));
Console::log(" - Use " . Console::text("int|bool ", 'blue') . Console::text("Console::askInt()", 'lightblue', 'underlined') . " to ask user to enter a number in the... |
Java | UTF-8 | 294 | 1.90625 | 2 | [] | no_license | package com.matey.bootwebservice.web.dto;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@Getter
@RequiredArgsConstructor
@ToString(of = { "name", "amount" })
public class HelloResponseDTO {
private final String name;
private final int amount;
}
|
Java | UTF-8 | 1,617 | 2.484375 | 2 | [] | no_license | package Object;
import AccesData.DatabaseConnection;
import DAO.DAOEtat;
import DAO.DAOPersonne;
import java.util.ArrayList;
import java.util.Date;
public class Commande {
private int id;
private float prix;
private Date date;
private Personne personne;
private ArrayList<Pain> pains;
private ... |
JavaScript | UTF-8 | 4,243 | 2.96875 | 3 | [] | no_license | /*
* decaffeinate suggestions:
* DS103: Rewrite code to no longer use __guard__
* DS104: Avoid inline assignments
* DS201: Simplify complex destructure assignments
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
clas... |
JavaScript | UTF-8 | 2,699 | 2.875 | 3 | [] | no_license | import React, {useState} from 'react';
import './ExpenseForm.css';
import './NewExpense.css';
const ExpenseForm = (props) => {
//const [enterdTitle, setEnteredTitle] = useState('');
//const [enteredAmount, setEnteredAmount] = useState('');
//const [enteredDate, setEnteredDate] = useState('');
const [... |
Python | UTF-8 | 7,297 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | # ========================================================================
# Copyright (C) 2019 The MITRE Corporation.
#
# 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.apa... |
Python | UTF-8 | 547 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python3
import json
import subprocess
import sys
def run(input_file):
with open(input_file, encoding='utf-8') as data_file:
data = json.load(data_file)
for item in data['data']:
output = subprocess.check_output([
'mongo',
'report',
'--eval',
... |
C++ | UTF-8 | 871 | 3.203125 | 3 | [] | no_license | // ===-- chapter-4/chapter-4.cpp -------------------------- -*- C++ -*- --=== //
/**
* @file
* @brief Chapter 4: Integral Type Wappers and Operators
*
* C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost
* and Beyond.
*
* @author Matt Bisson - 2/28/2014
*/
#include "exercise-4-0.hpp"
#inc... |
C# | UTF-8 | 741 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Passenger.Core.Domain;
using Passenger.Core.Repositories;
namespace Passenger.Infrastructure.Repositories
{
public class InMemoryDriverRespository : IDriverRepository
{
private static ISet<Driver> _dr... |
Java | UTF-8 | 15,669 | 1.742188 | 2 | [
"MIT"
] | permissive | /*
* ***** BEGIN LICENSE BLOCK *****
*
* Zimbra Collaboration Suite Server
* Copyright (C) 2011, 2012 VMware, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the ... |
Java | UTF-8 | 1,546 | 2.9375 | 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.
*/
package lab4.net.suetholz.pos.lineitem;
import lab4.net.suetholz.pos.Product;
import lab4.net.suetholz.pos.api.LineItemStrategy;
/**
... |
Markdown | UTF-8 | 1,278 | 2.640625 | 3 | [] | no_license | ---
layout: post
title: "chemistry ពិសោធន៍កម្រិតរលាយរបស់សមាសធាតុអុីយ៉ុងនិងសមាសធាតុកូវ៉ាឡង់"
date: 2021-04-28
category: Chemistry
published: True
list tittle: "videos"
---
<html>
<head>
<style>
body {
background-color: #BE77EC;
}
</style>
</head>
<body>
<p>
The video and poster below is an experiment on the solub... |
C++ | UTF-8 | 501 | 3.671875 | 4 | [] | no_license | #include"time.h"
time::time()
{
cout<<"\n\n default constuctor called\n";
hh=mm=sec=0;
}
time::time(int h,int m,int s)
{
cout<<"\n\n paramaterized constructor \n\n";
hh=h;
mm=m;
sec=s;
}
time::time(time &t)
{
cout<<"\n\n copy constuctor called \n\n";
this->hh=t.hh;
this->mm=t.mm;
this->sec=t.sec;
}
void... |
JavaScript | UTF-8 | 2,485 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | /**
Copyright 2016 Split Software
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 in writing, software... |
PHP | UTF-8 | 942 | 2.546875 | 3 | [] | no_license | <?php
header("Content-Type: text/html; charset=utf-8");
if(isset($_POST['name'])) {
$email = "sergas5555@yandex.ru"; #Email, на него придут письма
$title = "Заказ с сайта "; #Заголовок письма
$text = "
Информация о покупателе:
Имя: ".$_POST['name']."
Телефон: ".$_POST['phone']."
Модель: ".$_POST['comm... |
C | UTF-8 | 368 | 2.8125 | 3 | [] | no_license | #include <sys/utsname.h>
#include <unistd.h>
void main()
{
struct utsname name;
struct utsname *pname;
pname=&name;
if(uname(pname)<0){
printf("Error!\n");
exit(1);
}
printf("%s\n",pname->sysname);
printf("%s\n",pname->nodename);
printf("%s\n",pname->release);
printf("%s\n",pname-... |
Java | UTF-8 | 415 | 2.234375 | 2 | [] | no_license | package db.model;
/**
* Created by eason on 2017/8/23.
*/
public class TableModel {
private String name;
private String Comment;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getComment() {
return C... |
Python | UTF-8 | 3,539 | 3.40625 | 3 | [] | no_license | def transliterate(logoi):
#
# Purpose: replaces greek characters with latin
# Input Parameter(s): logoi: greek characters and punctuation(string)
# Return Value(s): a transliterated word, name, phrase or sentence(string)
#
# first, we find where all of the capitalized words and names are,
... |
Java | UTF-8 | 699 | 3.40625 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.List;
public class prgrmd28_practice_arraylist {
public static void main(String[] args) {
// TODO Auto-generated method stub
List<String>a1=new ArrayList<String>();
a1.add("item1");
a1.add("item2");
a1.add("item3");
a1.add("item4");
a1.add("item5... |
Ruby | UTF-8 | 1,486 | 2.65625 | 3 | [
"MIT"
] | permissive | require_relative 'kb8_utils'
require_relative 'kb8_run'
class Kb8Context
attr_accessor :cluster,
:name,
:namespace,
:user
CMD_CONFIG_VIEW = "#{Kb8Run::CMD_KUBECTL} config view -o yaml"
def initialize(context)
context_setting = nil
case context.class.to_s... |
PHP | UTF-8 | 577 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests\PhoneNumber;
use Illuminate\Foundation\Http\FormRequest;
use App\Rules\PhoneNumber\IsMatchesToken;
class TokenRequest extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'digits' => ['... |
Java | UTF-8 | 1,008 | 3.28125 | 3 | [] | no_license | package lab6;
class Counter extends Thread {
private final int number;
private final long n;
private final long N;
private final int countOfThreads;
private long result = 0;
private long date1;
private long date2;
Counter(int number, long n, long N, int countOfThreads) {
... |
PHP | UTF-8 | 1,096 | 3.015625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
table{
margin:auto;
}
th,td:nth-child(n){
text-align: left;
padding: 0.2em 0.5em 0.2em 0.5em;
border-bottom: 1px solid;
}
tr:last-child td{
border-bottom: 0px;
}
</style>
</head>
<body>
<?php
$data=array(
array("Volvo",22,... |
JavaScript | UTF-8 | 758 | 2.75 | 3 | [] | no_license | const { chromium } = require('playwright');
(async() => {
// function code
// launching browser
const browser = await chromium.launch({ headless:false , slowMo:100 });
// creating a page inside browser
const page = await browser.newPage();
// navigating to site
await page.goto('https://the-... |
C++ | UTF-8 | 679 | 2.78125 | 3 | [] | no_license | class Solution {
public:
double minmaxGasDist(vector<int>& stations, int K) {
int n = stations.size();
double begin = 0, end = stations[n-1] - stations[0];
while(end - begin > 0.000001) {
double mid = (begin+end)/2;
//calculate k_mid
... |
Java | UTF-8 | 1,943 | 3.140625 | 3 | [] | no_license | package task_2.task_2_1.view;
import task_2.task_2_1.model.Options;
import java.util.Scanner;
public class UserInput {
private Scanner scn;
public UserInput(){}
public int enterIntValue(BooksView view){
scn = new Scanner(System.in);
int val = 0;
while(true){
if(scn... |
Python | UTF-8 | 556 | 2.53125 | 3 | [] | no_license | import os, sys
# files for which trees 2b created
indir='trees/'
alle=os.listdir(indir)
#
for a in alle[:]:
info=open(indir+a).read()
vals=[]
for k in info.split(':')[1:]:
number=k.split(')')[0].split(',')[0]
vals.append([float(number),number])
vals.sort()
# mark top branch
for v in vals[:-3]:
... |
JavaScript | UTF-8 | 933 | 2.703125 | 3 | [] | no_license |
window.onload = function () {
var dps = []; // dataPoints
var chart = new CanvasJS.Chart("scrollChart",{
height: 230,
title :{
text: "Scrolling chart"
},
data: [{
type: "line",
dataPoints: dps
}]
});
var xVal = 0;
var yVal = 100;
var updateInterval = 100;
var dataLeng... |
C++ | UTF-8 | 1,013 | 2.609375 | 3 | [] | no_license | /*
* main.cpp
* Math. Code Reference: Marching Cubes C-Algorithmus by Paul Bourke
* Last Changes: 06.05.2018
* Author: manitoo , C++/Qt Subclassing QOpenGLWidget , QOpenGLFunctions , GLSL Shading
*/
#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
QApplication app(argc,... |
C | UTF-8 | 12,849 | 2.703125 | 3 | [] | no_license | //
// Created by Dylan La Frenz on 9/27/16.
//
int line=1;
//timers tcp protocol
//rtt = estimated rtt + estimated volatility
//rtt = 1 - alpha + sample rtt alpha - .125
//offered load
#include "includes.h"
//creating a struct for sphere camera and plane
#include "parse.h"
int next_c(FILE* json) {
int c = fgetc(js... |
Markdown | UTF-8 | 973 | 2.6875 | 3 | [] | no_license | ---
layout: page
title: The First Amendment
permalink: /learn/first-amendment.html
left_navigation: learn
related:
- title: "Learn more about the related laws and policies"
url: "https://www.ucsc.edu/"
- title: "Report hate and bias"
url: "https://reporthate.ucsc.edu/"
---
The First Amendment to the U.S. C... |
Python | UTF-8 | 75 | 2.796875 | 3 | [] | no_license | from turtle import*
a = int(input())
shape("turtle")
circle(a)
mainloop() |
C++ | WINDOWS-1251 | 3,057 | 3.09375 | 3 | [] | no_license | #include <SFML/Graphics.hpp>
#include <vector>
#include "functions.hpp"
using namespace std;
using namespace sf;
class Background
{
Texture texture;
int starsCount, lowerScaleLimit, upperScaleLimit, windowWidth, windowHeight;
float speedMult;
RenderWindow &window;
public:
/... |
JavaScript | UTF-8 | 1,228 | 3.59375 | 4 | [] | no_license | const LinkedList = require('./linkedlist');
const Node = require('./node');
module.exports = class Graph {
constructor(vertices) {
this.vertices = vertices;
this.list = [];
var it;
for (it = 0; it < vertices; it++) {
let temp = new LinkedList();
this.list.push(temp);
}
}
addEd... |
JavaScript | UTF-8 | 895 | 3.90625 | 4 | [] | no_license | // ** Leetcode: Arrays Reps Challenge ~ Traversal Edition ~
// ** --> { #94 Binary Tree Inorder Traversal }
// T A SK !!!
// Given the root of a binary tree, return the inorder traversal of its nodes' values
// * first attempt ~
// * time complexity: O(N)
// * space complexity: O(N)
const inorderTraversal = (root, ... |
PHP | UTF-8 | 2,813 | 3.34375 | 3 | [] | no_license | <?php
class FileModifier {
private $inputFile;
private $outputFile;
private $replaceLines = array();
private $optionalReplaceLines = array();
private $addAfterLines = array();
private $optionalAddAfterLines = array();
private $deleteLines = array();
private $optionalDeleteLines = array();
private $missin... |
JavaScript | UTF-8 | 153 | 3.859375 | 4 | [] | no_license | // Defining the function
function greeting_three(string) {
console.log("Hello " + string + "!");
}
// Calling the function
greeting_three("World");
|
Go | UTF-8 | 408 | 2.59375 | 3 | [] | no_license | package model
import (
"finalProject/cmd/service/grpc-model/user"
)
type User struct {
Id int32 `gorm:"primary_key"`
Name string
Email string
Password string
}
func (p *User) Set(in *user.CreateUserReq) {
p.Name = in.Name
p.Email = in.Email
p.Password = in.Password
}
func (p *User) Fill(in *use... |
Python | UTF-8 | 734 | 3.15625 | 3 | [] | no_license |
# A very simple Flask Hello World app for you to get started with...
from flask import Flask, render_template
from os import environ
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello from Flask!'
@app.route('/asw')
def hello_from_me():
return 'Hello from me'
@app.route("/hello/<name>"... |
Java | UTF-8 | 2,234 | 2.234375 | 2 | [] | no_license | package com.avatar.maintenance.service.impl;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.... |
Markdown | UTF-8 | 4,026 | 3.640625 | 4 | [] | no_license | # 作用
> 用来匹配符合某种规则的字符串 , **字符串匹配**
>
> 是一个对象
# 创建
## 字面量方式创建
```js
let reg = /+86\d{11}/g
```
## 构造函数方式创建
麻烦,但正则规则可通过字符串拼接,有些场景不得不用
```js
let reg = new RegExp('+86\d{11}','g')
```
## 修饰符
| 修饰符 | 含义 |
| ------ | ---------- |
| g | 全局搜索 |
| i | 忽略大小写 |
| m | 多行搜索 |
# 常用方法
## test... |
C | UTF-8 | 15,328 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "contents.h"
#include "filecontents1.h"
#include "filecontents2.h"
#include "filecontents3.h"
#include "filecontents4.h"
#include "filecontents5.h"
#include "filecontents6.h"
int writ() {
char ch1[50];
char file1[50];
char file2[50];
ch... |
Markdown | UTF-8 | 17,445 | 2.953125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: rocketmq系列-2
subtitle: rocketmq系列
date: 2021-09-07
author: CodingAndLiving
header-img: img/com01.jpg
catalog: true
tags:
- rocketmq
- 原理
- 底层
---
# 前言
> 在繁杂的世界,能够沉下心来,梳理下知识体系,其实是一件很放松的诗意。
# 使用案例
1. 生产者发送消息方式:
1. 同步发送
2. 异步发送
3. 单向发送
4. 具体案例可以参考rocketmq源码的... |
Java | UTF-8 | 1,665 | 2.453125 | 2 | [] | no_license | package com.certiorem.microservices.ModelDataService;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.... |
Markdown | UTF-8 | 274 | 2.625 | 3 | [] | no_license | # Spring-Boot-Login-Registration-With-Spring-Security
This is a Login Registration Spring boot project using Spring Security.
Database Name: springbootdb.
You have to Insert a row like this (INSERT into springbootdb.role value(1, 'ADMIN'); )
before registration.
|
Swift | UTF-8 | 871 | 3.0625 | 3 | [] | no_license | //
// Player.swift
// Bet Buddy
//
// Created by Jordan Lee on 2/2/21.
//
import Foundation
import UIKit
struct Player : Codable {
var name: String
var title: String
var profilePicture: Data?
var playerID: Int?
var initialBalance: Double?
var balance: Double?
var roundBet: Double?
v... |
Markdown | UTF-8 | 23,810 | 2.578125 | 3 | [
"CC-BY-4.0",
"MIT",
"CC-BY-3.0"
] | permissive | <properties
pageTitle="Cifrar el contenido con el cifrado de almacenamiento con la API de REST de AMS"
description="Obtenga información sobre cómo cifrar el contenido con cifrado de almacenamiento mediante las API de REST de AMS."
services="media-services"
documentationCenter=""
authors="Juliak... |
C++ | GB18030 | 2,149 | 3.8125 | 4 | [] | no_license | #include<iostream>
using namespace std;
//ĵһڵ
//ָ뷨
struct ListNode
{
int _data;
ListNode* _pNext;
ListNode(int x = 0)
:_data(x)
,_pNext(NULL)
{}
};
ListNode* Create(int arr[],int n)
{
ListNode* head = new ListNode(arr[0]);
ListNode* prev = head;
ListNode* cur = prev;
for(int i = 1; i < n; ++i)
{
cur = ne... |
Python | UTF-8 | 2,063 | 4 | 4 | [] | no_license | # Exercise 27 Memorizing logic
# Truth Tables
# NOT
not False # True
not True # False
# OR
True or False # True
True or True # True
False or True # True
False or False # False
# AND
True and False # False
True and True # True
False and True # False
False and False # False
# NOT OR
not (True or False) # Fal... |
Markdown | UTF-8 | 418 | 3.03125 | 3 | [] | no_license | # Hello World! (when the document is ready)
You have to take the first steps in every frontend app:
* Connect `jQuery` - located in `bower_components` to the `index.html` file
* Connect `app.js` to the `index.html` file
* Alert a message, using `alert(message)`, when the document is ready!
In order to understand wet... |
C# | UTF-8 | 1,148 | 2.859375 | 3 | [] | no_license | using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Mvvm;
using System;
using System.Windows;
using System.Windows.Input;
using WpfExperiments.Interceptors;
namespace WpfExperiments.ViewModels
{
public class FirstViewModel : BindableBase
{
private string _name;
private r... |
Java | GB18030 | 3,037 | 3.1875 | 3 | [] | no_license | package behavior.pattern.command2.main;
import behavior.pattern.command2.Delete;
import behavior.pattern.command2.Edit;
import behavior.pattern.command2.OrderList;
/**
* <PRE>
ģʽ
ģʽCommand PatternһģʽΪģʽ
ʽڶУööѰҿԴĺʵĶѸӦĶöִ
ͼ
һװһӶʹòͬԿͻв
Ҫ
ϵͳУΪΪʵͨһֽϵĹϵijЩϣҪΪм¼ȴʱ
仯ĽϵƾͲ̫ʡ
ʱʹã
ijЩϣҪΪ"¼/"ȴ仯ĽDz... |
Markdown | UTF-8 | 8,398 | 2.90625 | 3 | [] | no_license | # 6/18~6/24 の学習目標
## Progate で React の学習をする
## 6/18 ReactⅢ
1. コンポネートを作ろう
| 学習項目 | どんなことをやるか | わかったこと | 疑問 その他 |
| ----------------------- | -------------------------------------------------------- | --... |
C | UTF-8 | 401 | 3.515625 | 4 | [] | no_license | /*
* Daniel Goncalves > 1151452@isep.ipp.pt
* SCOMP - Turma 2DD
*
* programa1.c
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
/*
* PL 2 - Exercise 16 - Programa 2
*/
int main(void)
{
int temp = 0, sum = 0;
do
{
scanf("%d*c", &temp);
if (temp > 0)
{
printf("%d\n", temp);
sum +... |
C++ | UTF-8 | 425 | 2.875 | 3 | [] | no_license | #include <cstdio>
#include <cmath>
using namespace std;
int N;
void dfs(int pos, int curr){
if(pos == N){
printf("%d\n", curr);
return;
}
for(int d=1; d<10; d+=2){
int next = curr*10 + (pos==0 && d==1 ? 2 : d);
bool prime = true;
for(int i=2; i<=round(sqrt(next)); i++){
if(next%i == 0){
prime = f... |
Markdown | UTF-8 | 751 | 2.859375 | 3 | [
"MIT"
] | permissive | 
# InverterRemote
Control a chinese inverter On/Off/Reset switch with arduino nano, ethernet shield and Android app.
The "worker" controls the inverter with a relay contected to th... |
TypeScript | UTF-8 | 2,402 | 2.515625 | 3 | [] | no_license | import { Next, Request, RequestHandler, Response } from 'restify';
import * as errs from 'restify-errors';
import { Service, ServiceMetadata } from '../../../core';
import { SessionService, LoginData } from '../_service/session.service';
export const USER_DATA_KEY = 'user-data';
export { LoginData as UserData } fro... |
C | UTF-8 | 228 | 2.921875 | 3 | [] | no_license | #include<stdio.h>
main()
{
int n,r=0,rem;
while(n!=0)
{
rem=!=0;
r=r*10+rem;
n=n/10;
}
if(n==r)
{
printf("\n num is palindrome");
}
else
{
printf(" the num is not a palindrome");
}
return 0;
}
|
Shell | UTF-8 | 264 | 2.84375 | 3 | [] | no_license | #!/bin/bash
# Build the application with Maven
./canner.sh
REQUIRES="quinzical.jar run.sh README.md src/ categories/ wiki/"
for R in $REQUIRES; do
if [[ ! -e "$R" ]]; then
echo "No \`$R\` found" >& 2
exit 1
fi
done
zip -r quinzical28.zip $REQUIRES
|
Java | UTF-8 | 1,420 | 2.546875 | 3 | [] | no_license | package com.example.springmongoexample;
import com.example.springmongoexample.model.Person;
import com.example.springmongoexample.repository.PersonRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplicat... |
Java | UTF-8 | 2,765 | 2.359375 | 2 | [] | no_license | package com.starshine.test.waterprogress.activity;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.starshine.test.waterprogress.R;
import com.starsh... |
C | UTF-8 | 2,543 | 2.890625 | 3 | [] | no_license | #include "comm.h"
/*
typedef enum {
MESSAGE_KEY_ready, // Status of the communication
MESSAGE_KEY_Index = 0, // Index of data chunk in whole array
MESSAGE_KEY_DataLength, // Length of the array being transmitted
MESSAGE_KEY_DataChunk, // The chunk of image data
MESSAGE_KEY_ChunkSize, // Size... |
Java | UTF-8 | 2,772 | 2.046875 | 2 | [] | no_license | package org.leesia.median;
import org.apache.commons.lang3.StringUtils;
import org.leesia.dataio.service.IntDataService;
import org.leesia.dataio.service.impl.IntDataServiceImpl;
import org.leesia.median.schedule.Schedule;
import org.leesia.median.util.LeesiaUtil;
import org.leesia.median.util.SpringUtil;
impo... |
JavaScript | UTF-8 | 2,405 | 2.8125 | 3 | [] | no_license | class Bullet {
constructor(plane) {
this.plane = plane;
this.buffetBullet = false;
this.allShots = [];
this.shotBuffer = []
this.maxIdProccessed = 0;
this.reloadTime = 4;
this.rayCollider = new THREE.Raycaster(new THREE.Vector3(), new THREE.Vector3(),0,500);
this.hittedShotsBuffer = [];
}
loop() {
... |
Ruby | UTF-8 | 375 | 3.15625 | 3 | [] | no_license | # Using the DIR class in Ruby#
#Display the current working directory
puts path = "#{Dir.pwd}"
# Create a new directory temp under working directory
Dir.mkdir("#{path}/tmp")
# change working directory to tmp
Dir.chdir("#{path}/tmp")
# display current directory
puts "#{Dir.pwd}"
# go back to current directory
Dir.chdir... |
Java | UTF-8 | 3,539 | 2.515625 | 3 | [] | no_license | /**
*
*/
package it.unical.mat.moviesquik.model.business;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import it.unical.mat.moviesquik.pe... |
C++ | UTF-8 | 1,405 | 2.546875 | 3 | [] | no_license | #ifndef _SIFT
#define _SIFT
#define SQARTPI 0.39894228 //根号2 pi
#include<opencv2/opencv.hpp>
using namespace cv;
enum Channels{B, G, R};
//自定义的矩阵
struct xjMat
{
unsigned char* data;
int rows, cols, channels;
public:
xjMat(const Mat& M);
xjMat(unsigned char* ,int inrows, int incols, int inc);
i... |
Markdown | UTF-8 | 1,927 | 2.953125 | 3 | [] | no_license | 续 [上文](https://zhuanlan.zhihu.com/p/339033162),对重复引用的各种方式作了更多测试,基于当前理解作一小结。
简言之,由于每次引用模块都对其执行(exec)一次,在多处引用同一模块的情况下,引用顺序和模块位置不同会导致不同结果。暂没想到此种行为的应用场景。
比如在 TypeDef 模块中定义一个类:
```
type Type1 { ; }
```
在同层目录下 Instance1 模块中声明一个个体:
```
using * in TypeDef
instance1 = Type1()
```
那么在另一模块中,先后引用 TypeDef 和 Instance1,如下的 isa 判... |
C# | UTF-8 | 2,853 | 2.90625 | 3 | [] | no_license | using Spike3.DBObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using AccessAssistant;
namespace Spike3.Controllers
{
public static class VehicleControl
{
public static int PURCHASE_RATE = 100;
public static void AddVehicle(Vehicle v)
{
DBController.Save(v,... |
Markdown | UTF-8 | 11,387 | 3.015625 | 3 | [] | no_license | ---
title: RESTful接口版本管理
date: 2019-03-12 11:36:22
tags:
- java
- Java Web
- Spring Boot
- RESTful
categories:
- 工作笔记
- Java Web
- Spring Boot
keywords:
- rest
- restful
- version
- 接口版本管理
---
# REST简介
REST,全称是`Representational State Transfer`,译为表现层状态转化。REST并不是一个标准,而是一种软件架构风格。
在REST风格下,客户端通过url访问网络上的一个资源,通过HTTP动词请求服... |
Java | UTF-8 | 1,098 | 2.734375 | 3 | [] | no_license | package model;
public class Mensalidade {
private int Registro;
private double Valor_da_Mensalidade;
private String Serie, Forma_de_Pagamento;
public Mensalidade() {}
public Mensalidade(int Registro, double Valor_da_Mensalidade, String Serie, String Forma_de_Pagamento) {
this.Registro = Registro;... |
Java | UTF-8 | 938 | 1.804688 | 2 | [] | no_license | package io.pageobject.generator.element;
import io.pageobject.generator.GeneratorContext;
import io.pageobject.generator.locator.LocatorSources;
import org.jsoup.nodes.Element;
import java.util.List;
import java.util.Map;
import static com.google.common.collect.Lists.newArrayList;
import static io.pageobject.generat... |
Shell | UTF-8 | 713 | 3.421875 | 3 | [] | no_license | #!/bin/bash -ex
#get script location
SCRIPTDIR=`dirname $0`
SCRIPTDIR=`(cd $SCRIPTDIR ; pwd)`
#get working directory
TOP=`pwd`
isDelivery=`echo $1 | grep delivery` || true
# define version
cd ${TOP}/.repo/manifests
VERSION=`git describe --always --dirty --tags --long --abbrev=8 2>/dev/null`
cd ${TOP}
if [ ! "$isDeliv... |
PHP | UTF-8 | 1,632 | 3.015625 | 3 | [
"MIT"
] | permissive | <?php namespace App;
use Illuminate\Database\Eloquent\Model;
class Message extends Model {
/**
* These fields could be mass assigned
*/
protected $fillable = ['user_id', 'body', 'senderid', 'senderprofileimage', 'sendername'];
/**
* A message belongs to Many Users.
*
* @return Collection
*/
public ... |
Python | UTF-8 | 2,555 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env python3
import os, glob, itertools
def add_line_prefix_to_file(fname, out_name, line_transform, validate):
with open(fname) as f_in:
with open(out_name, 'w') as f_out:
print('Write:', fname, '->', out_name)
for line in f_in:
line = line.strip()
... |
C | UHC | 924 | 3.921875 | 4 | [] | no_license | //α 6.5 Ʈ
// Ʈ
#include <stdio.h>
#include <memory.h>
typedef struct node_type * node_ptr;
typedef struct node_type
{
int data;
node_ptr link;
};
int length_list(node_ptr list);
void main()
{
node_ptr list, node1, node2, node3;
node1 = (node_ptr)malloc(sizeof(struct node_type));
node1->data = 100;
node1-... |
Python | UTF-8 | 880 | 2.609375 | 3 | [] | no_license | from lxml import html
from datetime import date
from datetime import timedelta
import requests
import sqlite3
conn = sqlite3.connect('testDB.db')
conn.execute("CREATE TABLE TITLES(Id INTEGER PRIMARY KEY NOT NULL, Title STRING NOT NULL, Date STRING NOT NULL)")
startDate = date(1999, 9, 6)
todayDate = date.today()
id ... |
JavaScript | UTF-8 | 401 | 3.28125 | 3 | [] | no_license | Array.prototype.removeNum = function(num){
let abc= this;
return new Promise(function(resolve,reject){
resolve(abc.filter(x=>x!=num))
});
}
async function processRemoveNum (){
try {
console.log(await [1,2,3,4,1].removeNum(1));
} catch (error) {
console.log(error)... |
Java | UTF-8 | 5,721 | 1.75 | 2 | [] | no_license | package com.mitkoindo.smartcollection.module.laporan.agenttracking;
import android.databinding.DataBindingUtil;
import android.databinding.Observable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayout... |
Java | UTF-8 | 1,267 | 2.015625 | 2 | [
"Apache-2.0"
] | permissive | package com.evolveum.midpoint.studio.action.environment;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.project.Proj... |
Swift | UTF-8 | 718 | 2.578125 | 3 | [] | no_license | //
// ViewController.swift
// CachVideoTest
//
// Created by Charanbir sandhu on 28/09/20.
// Copyright © 2020 Charan Sandhu. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var playerVw: UIView!
override func viewDidLoad() {
super.viewDidLoad()
... |
C# | UTF-8 | 1,014 | 3.421875 | 3 | [] | no_license |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ExampleProblem204_1
{
class Prgram
{
static void Main(string[] args)
{
//月を入力
Console.Write("月(1~12)を入力してください:");
int m = int.Parse(... |
JavaScript | UTF-8 | 2,939 | 3.390625 | 3 | [
"BSD-3-Clause"
] | permissive | function Dictionary() {
this.items = {};
};
Dictionary.prototype.containsKey = function(key) {
return exports.hasOwn(this.items, key);
};
Dictionary.prototype.set = function(key, value) {
this.items[key] = value;
};
Dictionary.prototype.get = function(key) {
return this.items[key];
};
Dictionary.pro... |
Java | UTF-8 | 898 | 2.25 | 2 | [] | no_license | package htos.common.util.swftools;
import htos.common.util.FileUtilBetas;
public class DocConverter {
private PDFConverter pdfConverter;
private SWFConverter swfConverter;
public DocConverter(PDFConverter pdfConverter, SWFConverter swfConverter) {
super();
this.pdfConverter = pdfConverter;
this... |
Python | UTF-8 | 1,986 | 2.9375 | 3 | [] | no_license | ## Neal Trischitta ##
#!/usr/bin/env python2.7
from sys import argv
from PIL import Image
import numpy
import math
import random
import argparse
# Return k centroids RGB triples.
def get_centroids(im,k):
cents=[]
for i in range(k):
x=random.randrange(im.size[0])
y=random.randrange(im.size[1])
cents.append(im... |
C++ | UTF-8 | 1,432 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <deque>
using namespace std;
deque<char> dq[5];
void move(int n, int d) {
if (d == 1) {
char ch = dq[n].back();
dq[n].pop_back();
dq[n].push_front(ch);
}
else {
char ch = dq[n].front();
dq[n].pop_front();
dq[n].push_back(ch);
}
}
void solve(int n, int d) {
if (n == 1) {
... |
Java | UTF-8 | 705 | 2.140625 | 2 | [
"MIT"
] | permissive | package com.sxu.permission;
import android.app.Activity;
/*******************************************************************************
* 自定义解释申请权限和引导用户开启权限的样式
*
* @author Freeman
*
* @date 2018/11/1
*
*******************************************************************************/
public interface AlertStyl... |
C++ | UTF-8 | 4,169 | 3.5 | 4 | [] | no_license | #include "pch.h"
#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <vector>
#include <list>
using namespace std;
template<typename Comparable>
class BST {
private:
//节点结构体
struct BinaryNode {
Comparable element;
BinaryNode *left;
BinaryNode *right;
BinaryNod... |
Java | UTF-8 | 1,963 | 2.625 | 3 | [] | no_license | package sample;
import leit.flug.Schedule;
import leit.flug.ScheduledFlight;
import leit.flug.DatabaseManager;
import leit.flug.Flight;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import java.io.FileReader;... |
Python | UTF-8 | 4,793 | 4 | 4 | [] | no_license | '''--- Day 10: Balance Bots ---
You come upon a factory in which many robots are zooming around handing small microchips to each other.
Upon closer examination, you notice that each bot only proceeds when it has two microchips, and once it does, it gives each one to a different bot or puts it in a marked "output" bin... |
Java | UTF-8 | 3,724 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | package org.jgrades.lic.service;
import com.google.common.collect.Lists;
import org.jgrades.lic.api.model.Licence;
import org.jgrades.lic.api.model.LicenceProperty;
import org.jgrades.lic.api.model.Product;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;
import java.util.List;
import s... |
PHP | UTF-8 | 1,164 | 2.828125 | 3 | [] | no_license | <?php
namespace Wead\ZipCode\WS;
use Wead\ZipCode\Contracts\ProviderContract;
class ApiCEP extends ProviderContract
{
public function getAddressFromZipcode($zipCode)
{
$zipCode = preg_replace('/[^0-9]/im', '', $zipCode);
$endPoint = "https://ws.apicep.com/cep/{$zipCode}.json";
$cont... |
PHP | UTF-8 | 3,485 | 2.578125 | 3 | [] | no_license | <?php
if (isset($_POST['addItem'])) {
//Category
$category = $_POST['itemCategory']; //Remove html tags
//Title
$title = strip_tags($_POST['itemTitle']); //Remove html tags
$title = ucfirst(strtolower($title)); //Uppercase first letter
//Item Name
$itemName = strip_tags($_POST['itemName'... |
Markdown | UTF-8 | 1,153 | 2.96875 | 3 | [] | no_license | # L'Usine
Site en production: [usine.ch](https://usine.ch)
Une version de développement est disponible: [dev.usine.ch](https://dev.usine.ch).
## Contribuer
[Comment contribuer au site de L'Usine](https://dev.usine.ch/contribuer)
## Développement local
**Prérequis**
- git
- php
**1. Cloner le site en local**
```... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.