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 | 2,921 | 4.34375 | 4 | [] | no_license | /**************************************************
HW#: HW2-2 Merge Sort's Combine
Your name: Heriberto Bernal
Compiler: gcc compiler
File type: Combine program
**************************************************/
using namespace std;
#include <iostream>
#include <vector>
//Prototypes
void combine(vector<int> L1, vec... |
TypeScript | UTF-8 | 148 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /**
* API error.
*/
import {ApiErrorCode} from './api-error-code.enum'
export interface ApiError {
/**
* Code.
*/
code: ApiErrorCode
}
|
JavaScript | UTF-8 | 1,198 | 3.5625 | 4 | [] | no_license | var scrollEventHandler = function()
{
window.scroll(0, window.pageYOffset)
}
window.addEventListener("scroll", scrollEventHandler, false);
/*newstuffhere*/
const container = document.querySelector('.container');
const unsplashURL = 'https://source.unsplash.com/random/';
const rows = 500
for(let i=0; i < rows* 3;... |
JavaScript | UTF-8 | 431 | 2.9375 | 3 | [] | no_license | var imagem1 = document.getElementById('download');
const botao1 = document.getElementById('botao');
botao1.onclick = function(){
if (botao1.value === "estado1"){
imagem1.src= 'reforma-tributaria.jpg';
botao1.value = "estado2";
}
else {
imagem1.src= 'download.png';
... |
Rust | UTF-8 | 5,891 | 3.71875 | 4 | [] | no_license | /**
* If you're reading this, you must be very bored. There's not really much substantive in this pile of code
* I'm just learning rust syntax in my free time, and creating random puddles of code just for practice.
* check out https://doc.rust-lang.org/stable/rust-by-example/ if you want to learn rust, because this
* p... |
JavaScript | UTF-8 | 328 | 2.78125 | 3 | [
"MIT"
] | permissive | export const pick = (obj, props) => {
const newObj = {};
props.forEach(prop => {
if (obj.hasOwnProperty(prop)) {
newObj[prop] = obj[prop];
}
});
return newObj;
}
export const omit = (obj, props) => {
const newObj = { ...obj };
props.forEach((prop) => {
delete newObj[prop]
});
return n... |
Rust | UTF-8 | 4,108 | 3.28125 | 3 | [] | no_license | // http://adventofcode.com/2017/day/6
extern crate unicode_segmentation;
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::io;
use unicode_segmentation::UnicodeSegmentation;
fn main() {
let mut my_cursor = MyCursor::from_stdin();
println!("{}", solve(&mut my_cursor));
}
fn sol... |
Ruby | UTF-8 | 314 | 3.328125 | 3 | [] | no_license | class Rectangle
attr_accessor :width, height
def initialize(width, height)
@width, @height = width, height
end
def area
width * height
# we do not have to wite @width * @height
# we have declare width and height
end
end
# c = Rectangle.new(4,5)
# c.width = 20
# c.height = 5
# c.area
|
Python | UTF-8 | 1,728 | 3.375 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from error import error
from probability_plotter import normalise
from analytical_psi import psi as analytical_psi
norm=True # should wavefunction be plotted as normalised?
comparison=True # display comparison plot?
"""
Plots the wavefunction ... |
TypeScript | UTF-8 | 1,731 | 3 | 3 | [
"MIT"
] | permissive | import { Injectable } from '@angular/core';
import { Project } from '../services/classes/project';
import { projects } from '../services/collections/projects';
@Injectable()
export class ProjectsService {
public getAll(): Project[] {
let copy = JSON.parse(JSON.stringify(projects));
return copy;
}
publi... |
Java | UTF-8 | 852 | 3.5 | 4 | [] | no_license | import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author bslab102c
*/
public class ExeMod02 {
static void massa(float peso, float altura){
float imc = peso/(altura*altura);
System.out.println(imc);
i... |
Python | UTF-8 | 4,138 | 2.796875 | 3 | [] | no_license | # This code will build elasticube through API
import requests
import urllib3
import os
def buildEcube(ecube, usern, passw):
url = 'http://localhost:8083/api/v1/authentication/login' # URL to generate API token
header = {"accept": "application/json", "Content-Type": "application/x-www-form-urlencoded"} # H... |
Java | UTF-8 | 4,289 | 2.078125 | 2 | [] | no_license | package info.repy.tools;
import com.amazonaws.serverless.exceptions.ContainerInitializationException;
import com.amazonaws.serverless.proxy.model.AwsProxyRequest;
import com.amazonaws.serverless.proxy.model.AwsProxyResponse;
import com.amazonaws.serverless.proxy.model.Headers;
import com.amazonaws.serverless.proxy.spr... |
TypeScript | UTF-8 | 1,209 | 2.5625 | 3 | [] | no_license | module egret3d {
/**
* @class egret3d.FrameBuffer
* @classdesc
* FrameBuffer 类提供了用于呈现几何定义图形的上下文的帧缓冲对象。
*
* 渲染上下文包括一个绘图表面及其关联的资源帧缓冲对象
* 通过context creatFrameBuffer 来创建,不能直接使用 new 的方式实例化
* @see egret3d.base.Program3D
* @see egret3d.base.IndexBuffer3D
* @see egret3d.base.VertexBuffer3D... |
C++ | UTF-8 | 2,465 | 3.828125 | 4 | [] | no_license | /**
503. Next Greater Element II
Given a circular integer array nums (i.e., the next element of nums[nums.length - 1] is nums[0]), return the next greater number for every element in nums.
The next greater number of a number x is the first greater number to its traversing-order next in the array, which means you co... |
C++ | UTF-8 | 2,386 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include "Game_map.h"
#include "Cmove_direction.h"
#include "rang.hpp"
int menu(std::string &choice) {
if (choice == "up") return 1;
if (choice == "down") return 2;
if (choice == "right") return 3;
if (choice == "left") return 4;
}
int steps(){
int steps = 0;
std::cout << ... |
C++ | UTF-8 | 621 | 3.09375 | 3 | [] | no_license | #include<time.h>
#include<stdlib.h>
#include<iostream>
#include<iomanip>
using namespace std;
void Print(int *m, int size)
{
for (int i = 0; i < size; ++i, ++m)
cout <<setw(2)<< *m << " ";
cout << endl;
}
void func(int *m,int *n, int size)
{
int tmp;
for(int L=0,R=size-1;L<=R;++L,--R)
{
*(n+L) = *(m+L);
*(n+... |
JavaScript | UTF-8 | 8,364 | 2.5625 | 3 | [] | no_license | Page({
data: {
userid: '',
},
// 获取用户名
onLoad: function (options) {
var that = this
// 查看是否授权
wx.getSetting({
success(res) {
console.log(res)
if (res.authSetting['scope.userInfo']) {
// 已经授权,可以直接调用 getUserInfo 获取头像昵称
wx.getUserInfo({
succe... |
C | UTF-8 | 2,751 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /*
* SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
typedef void (* knob_cb_t)(void *, void *);
typedef void *knob_handle_t;
/**
* @brief Knob events
*
*/
typedef enum {
KNOB_LEFT = 0, ... |
C++ | UTF-8 | 856 | 3.015625 | 3 | [] | no_license | // Displacement
#include <iostream>
using namespace std;
int main(){
int x = 0,y = 0;
char ch;
ch = cin.get();
while(ch!='\n'){
if(ch == 'S'){
y--;
}
else if(ch == 'N'){
y++;
}
else if(ch == 'W'){
x--;
}
else{
x++;
}
ch = cin.get();
}
if(x>=0 && y>=0){
// Ist Quadrant
for... |
C++ | UTF-8 | 675 | 3.140625 | 3 | [] | no_license | #include <fstream>
#include <string>
int main() {
std::ifstream input1("input1.txt");
std::ifstream input2("input2.txt");
std::ofstream output("output.txt");
std::string buffer1;
std::string buffer2;
while (!input1.eof() && !input2.eof())
{
std::getline(input1, buffer1);
output << buffer1;
... |
C++ | UTF-8 | 1,079 | 2.578125 | 3 | [] | no_license | #include "code_gen/CConstructor.hh"
#include "code_gen/Internal/helpers.hh"
CConstructor::CConstructor(const arg_list& args):CAbstractFunction("","", args)
{
}
CConstructor::CConstructor(std::string, const arg_list& args) : CAbstractFunction("", "", args)
{
}
void CConstructor::mem_init(std::ostream& out) const... |
Python | UTF-8 | 497 | 4.5 | 4 | [
"MIT"
] | permissive | #! /usr/bin/env python3
# Adam Varden
# Calculate the square root of a number
def sqrt(x):
"""
Calculate the square root of argument x
"""
# lets check that x is positive
if x < 0:
print("Error: negative value was supplied")
return -1
# Initial guess for the square root
z = x / 2.0
# C... |
Java | UTF-8 | 676 | 2.234375 | 2 | [] | no_license | package com.example.greeting.service;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Service;
import com.example.greeting.domain.GreetingResponse;
@Service
@PropertySource("classpath:/application.pr... |
JavaScript | UTF-8 | 3,331 | 2.890625 | 3 | [] | no_license | // 微信认证模块
// 引入config模块
const config = require('../confing');
// 引入sha1加密模块
const sha1 = require('sha1');
// 引入数据处理模块
const {getUserData, parseXml2Js, getXmlData } = require('../utils/tool')
// 引入路由模块
const menuRouter = require('../router/menuRouter');
module.exports = ()=>{
return async (ctx,next )=>{
// ... |
Java | UTF-8 | 1,174 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | package ru.job4j.subsequentincr;
import org.junit.Test;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.*;
public class Task23Test {
public String ln = System.lineSeparator();
@Test
public void when10Then11And12And1... |
C++ | UTF-8 | 23,276 | 3.078125 | 3 | [] | no_license | #include "player.hpp"
#include <bits/stdc++.h>
#include <cstdlib>
#include <unordered_map>
#define Xfour 1000
#define Xthree 20
#define Xtwo 1
#define Ofour -1000
#define Othree -20
#define Otwo -1
#define draw 0
#define DEPTH 2
#define cSquares 64
namespace TICTACTOE3D
{
std::unordered_map<std::string, int> c... |
JavaScript | UTF-8 | 1,383 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive |
var methods = {
printDetectItVars: function (msgHeader) {
console.log(msgHeader);
console.log();
console.log('detectIt.deviceType: ' + detectIt.deviceType);
console.log('detectIt.hasMouse: ' + detectIt.hasMouse);
},
// test the update function to see if it alters
// default values
// detec... |
Java | UTF-8 | 329 | 2.96875 | 3 | [] | no_license | package java_lvl1.Lesson4;
/**
* Created by Izotov V.A. on 24.11.2019.
*/
public class Cat extends Animal{
public Cat(String name){
super("Кот: " + name);
setRunLimit(200);
setJumpLimit(2);
}
public void Swim(int range) {
System.out.println("Кот не плавает");
}
}
|
Java | UTF-8 | 2,959 | 2.625 | 3 | [] | no_license | package vista;
import javax.swing.JFrame;
import controlador.Coordinador;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import java.awt.Font;
public class Inicio {
... |
Python | UTF-8 | 7,206 | 3.390625 | 3 | [
"MIT"
] | permissive | from .sorting_utils import *
from tabulate import tabulate as table
'''
**************************************************
* Printing methods for League class *
**************************************************
'''
def printWeeklyScores(league, teamId):
''' Prints all weekly scores for a given t... |
TypeScript | UTF-8 | 693 | 2.5625 | 3 | [
"MIT"
] | permissive | import { Hookable } from '../../infrastructure/HookRunner';
export type KeyboardChar = string;
export type KeyboardKey = string;
interface KeyboardShared {
isCharDown(char: KeyboardChar): boolean;
isCharUp(char: KeyboardChar): boolean;
isCharPressed(char: KeyboardChar): boolean;
isKeyDown(key: Keyboar... |
Markdown | UTF-8 | 338 | 2.515625 | 3 | [] | no_license | ### Exploring Java 9,10,11,12
In this project we are exploring capabilities of Java 9+ version.
- [Simple usage of Java 9 Flow API](/src/main/java/com/reactive/stream)
- [Using Java 9 Flow API for twitter streaming API](/src/main/java/com/reactive/twitter)
- [Features that makes Java "little bit" non-verbose](/src/ma... |
Java | UTF-8 | 519 | 2.984375 | 3 | [] | no_license | import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
public class AfficheTexte {
private Texte text;
public AfficheTexte (Texte text) {
this.text=text;
}
public void paintComponent(Graphics g) {
int x1 = text.getx1();
int y1 = text.gety1();
int taille = text.gettaille... |
Java | UTF-8 | 1,065 | 2.0625 | 2 | [
"MIT"
] | permissive | package org.jenkinsci.plugins.additionalmetrics;
import static org.jenkinsci.plugins.additionalmetrics.Helpers.RUN_DURATION;
import static org.jenkinsci.plugins.additionalmetrics.Helpers.SUCCESS;
import static org.jenkinsci.plugins.additionalmetrics.Utils.stdDevDuration;
import hudson.Extension;
import hudson.model.J... |
Python | UTF-8 | 2,795 | 3.375 | 3 | [] | no_license | class Solution:
def stoneGameIX(self, stones: List[int]) -> bool:
# 不用管石子的值到底是多少,只需要关心模三的余数是 0、1、2 即可。
# 那么每一个状态其实就是当前模三余数为 0、1、2 的石子的数量。
# 于是第一反应就是类似 `LC913 猫和老鼠`,当然要比那个简单多了。
memoDic = {}
def memorize_search(currState):
if key := tuple(currState) in mem... |
Java | UTF-8 | 260 | 1.898438 | 2 | [
"MIT"
] | permissive | package com.kaylerrenslow.armaDialogCreator.gui.fxcontrol;
import javafx.scene.Node;
import javafx.scene.image.Image;
/**
Created by Kayler on 10/22/2016.
*/
public interface ImageContainer {
Image getImage();
ImageContainer copy();
Node getNode();
}
|
Python | UTF-8 | 2,922 | 3.828125 | 4 | [] | no_license | # add/minus/multiply/divide
# matmul
# pow
# sqrt/rsqrt
# round
import torch
a = torch.rand(3, 4)
b = torch.rand(4)
# + - * /
# broadcast机制会自动进行调整
# 可以直接用重载的运算符号来进行运算,替代指令
# print(a+b)
# print(torch.add(a,b))
print(torch.all(torch.eq(a+b, torch.add(a,b))))
# print(a-b)
# print(torch.sub(a,b))
print(torch.all(torch.e... |
Java | UTF-8 | 3,738 | 3.5625 | 4 | [] | 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 challenge;
/**
*
* @author castr
*/
public class ordenamientos {
//**----------------------------
public ... |
Java | UTF-8 | 1,769 | 2.0625 | 2 | [] | no_license | package com.foundation.service.disease.service;
import com.foundation.common.persistence.Page;
import com.foundation.dao.entity.disease.Disease;
import com.foundation.dao.entity.disease.DiseaseRelations;
import java.util.List;
import java.util.Map;
/**
* @Description:疾病-疾病信息服务
* @author wangsen
* @date 2016/12/1 ... |
Java | UTF-8 | 1,795 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | package it.cavallium.warppi.math.rules.dsl.frontend;
import it.cavallium.warppi.math.rules.dsl.DslError;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
/**
* Occurs when DSL source code contains a token which doesn't match the grammar.
*/
public class UnexpectedT... |
C++ | UTF-8 | 2,761 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "ModalTransition.h"
#include "../Loop/LoopManager.h"
#include "Modal.h"
#include "Context.h"
bool ModalTransition::transitionRunning = false;
bool ModalTransition::deleteOnPop = true;
ModalTransition::ModalTransition(Display& display, Context* context, Modal* modal, bool reverse)
: reverse(reverse), display... |
Java | UTF-8 | 608 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | package com.fishercoder.solutions;
public class _1910 {
public static class Solution1 {
public String removeOccurrences(String s, String part) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
sb.append(s.charAt(i));
if ... |
Java | UTF-8 | 1,359 | 3.1875 | 3 | [] | no_license | package com.Learning.stream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class Sample {
public static void main(String[] args) {
// TODO Auto-generated method stub
int arr[] = {2,3,4,5,1,7,9}; //j
//Arrays.sort(... |
Java | UTF-8 | 1,134 | 2.515625 | 3 | [] | no_license | package com.three.db;
public class Department {
private int department_id;
private String department_name;
private String department_manager;
private String department_content;
public int getDepartment_id() {
return department_id;
}
public void setDepartment_id(int department_id) {
this.department_id = depa... |
PHP | UTF-8 | 346 | 2.71875 | 3 | [] | no_license | <?php
namespace Enhancer\Enhancers;
/**
* Enhances PHP code
* Tastes best with EnhancerStream
*
* @author Jan Dolecek <juzna.cz@gmail.com>
*/
class DemoEnhancer implements \Enhancer\IEnhancer
{
public function enhance($code)
{
// here comes all the magic
$code = preg_replace('/(new\s+\w+)(<\w+>)/', '\\1 /... |
Markdown | UTF-8 | 11,696 | 3.171875 | 3 | [
"MIT"
] | permissive | ---
published: true
title: D3 course cheat sheet (html, css, js, d3)
layout: post
tags: [cheat, sheet, D3]
categories: [D3]
---
# HTML
comments:
{%highlight html%}
<!-- this is a comment. -->
{%endhighlight%}
open an element / html tag:
{%highlight html%}
</element>
{%endhighlight%}
close an ... |
Java | UTF-8 | 1,519 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | // Copyright FreeHEP, 2007-2009
package org.freehep.properties.test;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.freehep.properties.PersistentTypedProperties;
import org.junit.BeforeClass;
import org.junit.Test;
/**
*
* @author Mark Donszelmann (Mark.Donszelmann@gmail.com)
*/
... |
JavaScript | UTF-8 | 1,724 | 3.84375 | 4 | [] | no_license | //散列表
function HashTable(){
this.table = new Array(137);
this.simpleHash = simpleHash;
this.betterHash = betterHash;
this.put = put;
this.showDistro = showDistro;
this.get = get;
this.buildChain = buildChain;
}
//简单散列函数,ASCII码对数组长度取余
function simpleHash(data){
var total = 0;
for (var i = 0; i < data.l... |
Java | UTF-8 | 2,875 | 2.140625 | 2 | [] | no_license | package com.vish.talkback;
import java.util.ArrayList;
import android.app.Activity;
import android.app.ListActivity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.database.DataSetObserver;
import android.os... |
PHP | UTF-8 | 2,341 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files m... |
Markdown | UTF-8 | 2,087 | 2.96875 | 3 | [] | no_license | # 负载均衡配置
```ini
[lb]
default.balancer.name = WeightRobinRound
default.max.fails = 3
default.fail.time.window = 10s
default.fail.sleep.mode = seq
default.fail.sleep.x = 1,1,2,3,5,8,13,21
default.fail.sleep.max = 60s
log.selected.enabled = true
log.selected.all = false
```
`default`为全局默认标识,对于具体的服务配置可将`default`替换为服务id... |
C# | UTF-8 | 6,337 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet;
using BenchmarkDotNet.Logging;
using BenchmarkDotNet.Tasks;
namespace DynamicComparer.Benchmark
{
public struct Struct
{
private int m_a;
private double m_b;
private string m_c;
public in... |
Java | UTF-8 | 518 | 1.765625 | 2 | [] | no_license | package com.github.walterfan.potato.scheduler;
import com.github.walterfan.potato.common.dto.RescheduleRequest;
import com.github.walterfan.potato.common.dto.RemindEmailRequest;
import com.github.walterfan.potato.common.dto.RemindEmailResponse;
/**
* @Author: Walter Fan
**/
public interface ScheduleService {
R... |
Java | UTF-8 | 393 | 3.109375 | 3 | [] | no_license | package chapter1;
public class prac6 {
public static void main(String[] args) {
int addResult = (1+1);
System.out.println(addResult);
double divResult = (10.0/3.0);
System.out.println(divResult);
System.out.println('0' + '1');
int num1 = 31;
num1 ++;
System.out.println(num1);
int add = ... |
C | UTF-8 | 330 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
int x = 5;
void changeX(void);
int main(void)
{
printf("x is %d\n", x);
changeX();
printf("x is %d\n", x);
}
void changeX(void)
{
printf("x is %d\n", x);
x += 3;
}
/**********************************************
*** Output ***
x is 5
x is 5
x... |
C | UTF-8 | 4,780 | 3.09375 | 3 | [] | no_license |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
#include "console_thread.h"
typedef struct Playlist
{
struct Playlist* next;
struct Playlist* prev;
char* filename;
}Playlist;
void send_command(int command, const char* param, Communication* comm_head, pthread_mutex_t* mutex)
{
pthr... |
Python | UTF-8 | 32,255 | 2.515625 | 3 | [] | no_license | from bs4 import BeautifulSoup as Soup
import collections
from collections import OrderedDict
import cProfile
import json
import httplib
import re
import requests
import signal
import sys
import time
import urllib2
ANIMES_LISTS_FOLDER = 'animes_lists'
CLUBS_LISTS_FOLDER = 'clubs_lists'
USERS_LISTS_FOLDER = 'users_lists... |
Markdown | UTF-8 | 1,476 | 2.65625 | 3 | [
"MIT"
] | permissive | # Introduction
This script allows to automatically update CRL files installed locally on BIGIP.
It takes multiple CRLs endpoints URLs in crlupdate.ini and aggregates them in a single PEM file.
it has been tested on 11.5.4
## Prerequisites
* Access to F5 file filesystem (Administrator with advanced shell)
* BIGIP c... |
Java | UTF-8 | 867 | 3.71875 | 4 | [] | no_license | package com.tildev.c30.lv2.l42746;
import java.util.Arrays;
/**
* 가장 큰 수
* 정렬
*
* @author tildev
* @data 2021. 02. 05.
*/
class Solution {
public String solution(int[] numbers) {
String[] strArr = new String[numbers.length];
for (int i = 0; i < numbers.length; i++) {
strArr[i] ... |
JavaScript | UTF-8 | 15,286 | 2.96875 | 3 | [] | no_license |
const createDate = string => new Date(string);
const toSeconds = num => Math.floor(num / 1000);
const parseDate = string => d3.timeParse('%d-%m-%Y')(string);
const startDate = new Date('April 19, 2020 00:00:00');
const monthsNames = ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre'... |
C++ | UTF-8 | 451 | 3.109375 | 3 | [] | no_license | #include <wx/datetime.h>
/*
http://zetcode.com/gui/wxwidgets/helperclasses/
In wxWidgets, we have several classes for working with date & time.
The example shows current date or time in various formats.
*/
int main(int argc, char **argv)
{
wxDateTime now = wxDateTime::Now();
wxString date1 = now.Format();
wxStr... |
C++ | UTF-8 | 590 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
struct as{
int a[10];
};
vector <as> a;
int n;
int t[10];
void genans(int l) {
if (l == 10) {
//check then output answer
int m = 0;
for (int i=0;i<10;i++) m += t[i];
if (m == n) {
as tas;
for (int i=0;i<10;i++)tas.a[i] = t[i];
a.push_back(tas... |
Markdown | UTF-8 | 896 | 3.578125 | 4 | [] | no_license | # url_shortener
Visit the site [here](http://rallen-url-short.herokuapp.com/)
#Objective
The objective of the url_shortener is to be a clone of [Bitly](https://bitly.com/). The **learning objective** of the assignment was to learn how to show specific information to users, only if they give consent.
#Features
- A us... |
Python | UTF-8 | 2,163 | 2.546875 | 3 | [] | no_license | #!/bin/python3
import math
import os
import random
import re
import sys
import difflib
def main():
f =open("Stestcases.txt","r")
f1 = f.readlines()
n = int(f1[0])
count = 0
for t_itr in f1:
if t_itr == f1[0]:
continue
count = count +1
print(count,"=",end="")... |
Python | UTF-8 | 2,378 | 2.828125 | 3 | [] | no_license | from pymongo import MongoClient
def write_df_to_mongoDB( my_df,\
database_name = 'mydatabasename' ,\
collection_name = 'mycollectionname',
server = 'localhost',\
mongodb_port = 27017,\
chun... |
Markdown | UTF-8 | 5,683 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | # Testing
## White box testing
If you are unit testing your application you should stub all external services.
If you are using sttp client to send HTTP requests, and if the externals apis,
which your application consumes, are described using tapir, you can create a stub of the service by converting
endpoints to `... |
JavaScript | UTF-8 | 652 | 2.859375 | 3 | [] | no_license | const Levels = require('discord-xp')
module.exports = (client) => {
client.on('message', async(message) => {
if(!message.guild) return
if(message.author.bot) return
let number = [10,20,30]
let Number = number[Math.floor(Math.random()*(number.length))]
const hasLeveledUp = aw... |
Python | UTF-8 | 2,271 | 2.796875 | 3 | [
"MIT"
] | permissive | import re
from typing import List
from pptx import Presentation
from pptx.util import Cm, Pt
from slide import Slide
from slide_image import SlideImage
class ResultWriter:
def __init__(self):
self.lines = 0
def run(self, slides: List[Slide], out_file: str):
prs = Presentation()
prs.... |
JavaScript | UTF-8 | 217 | 3.484375 | 3 | [] | no_license | //Variables
var myName ="Polly G";
var x = 10;
var y = 11;
x+y;
//Arrays
var num = [20, 3 , 6, 8,10];
var numSorted = num.sort(function(x,y){return x-y});
for(var i = 0; i<numSorted.length;i++){console.log(num[i])}; |
Python | UTF-8 | 1,460 | 2.75 | 3 | [] | no_license | import csv
import triangle_closing as tc
import collections as coll
import webbrowser
listingfile = open('seattle_listings_14_07_2019.csv', newline='')
listing_reader = csv.reader(listingfile)
listing_header = next(listing_reader)
listing_records = list(listing_reader)
print(listing_header)
# print(len(listing_rec... |
Java | UTF-8 | 947 | 2.109375 | 2 | [] | no_license | package com.currency.exchange.service.Impl;
import com.currency.exchange.model.Gif;
import com.currency.exchange.service.GifService;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.... |
Python | UTF-8 | 446 | 2.75 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
parser = lambda text: tuple(map(int, (text.split(","))))
with open("d.txt") as infile:
# with open("step1e4_np9.txt") as infile:
raw = infile.read()
final = raw.replace(" ", "")
final = final.replace("(", "")
final = final.replace(")", "\n")
lst ... |
Java | UTF-8 | 393 | 2.921875 | 3 | [] | no_license | package program;
import java.io.File;
public class file2 {
public static void main(String args[])
{
File fileobj = new File("C:/Users/Mahesh/Desktop/Selenium");
boolean a = fileobj.exists();
if (a== true)
{
System.out.println("Folder exists");
}
else
{
System.out.printl... |
C | UTF-8 | 3,428 | 3.09375 | 3 | [] | no_license | #include "../inc/actions.h"
void res_error(ipc_t *ipc,uint16_t sender, int32_t code) {
res_error_t res = {
.type = ACTION_ERROR,
.code = code
};
ipc_send(ipc, sender, &res, sizeof(res));
}
void hand_error(res_error_t *err) {
switch (err->code) {
case ERR_NO_SUCH_MOVIE:
printf("%s Error: No such movie.%s... |
Java | UTF-8 | 2,068 | 2.1875 | 2 | [] | no_license | package ar.edu.undec.plantas.controller.endpoint;
import ar.edu.undec.plantas.controller.dtomodel.PlantaDTO;
import ar.edu.undec.plantas.core.dominio.Planta;
import ar.edu.undec.plantas.core.exception.*;
import ar.edu.undec.plantas.core.usecase.input.ICrearPlantaInpunt;
import org.springframework.beans.factory.annotat... |
Shell | UTF-8 | 890 | 3.890625 | 4 | [] | no_license | #!/bin/bash
SplitCorpus() {
#arg1: path of the single file corpus
echo "Splitting Corpus"
cd corpus
split -b 100M $1
python ../src/quantizing.py ../corpus #path of the single file corpus
}
MakePartialIndexes() {
#arg1: dir containing the split corpus
#arg2: dir to store partial indexes
echo "Cre... |
Java | UTF-8 | 10,189 | 2.09375 | 2 | [] | no_license | package com.example.demo.controller;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.P... |
Python | UTF-8 | 1,118 | 2.546875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
'''
A recent changed caused date sub-catalogs to be created, but there should not be any.
The row catalog should contain `item` links directly to the items, and not have any child
links to date catalogs.
This script fins date catalogs and removes the links to them
'''
import logging
import sys
... |
C | UTF-8 | 7,492 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "game.h"
#include "checkpoint.h"
#ifndef GL_CLAMP_TO_BORDER
#define GL_CLAMP_TO_BORDER 0x812F
#endif
checkpoint initCheckpoint(float x, float y, float r, int type)... |
JavaScript | UTF-8 | 1,344 | 2.59375 | 3 | [] | no_license | const produktsBtn = document.querySelector ('.bui');
const cartProductList = document.querySelector('.containertovarovjs');
const fullPrise = document.querySelector('.prais');
let prise = 0;
const randomId = () => {
return Math.random().toString(36).substring(2,15) + Math.random().toString(36).substring(2,15... |
Shell | UTF-8 | 706 | 3.015625 | 3 | [] | no_license | #!/bin/bash
############################################
############ BACKUP SCRIPT #################
############################################
# PWD: inside the main folder of an AI project. Should contain the main running script.
# Also in this main project folder, there will be checkpoints, and a logs/ folder. ... |
Swift | UTF-8 | 3,744 | 2.671875 | 3 | [] | no_license | //
// TJMutiSelectView.swift
// TJFramework
//
// Created by jing 田 on 2018/11/23.
// Copyright © 2018年 jing 田. All rights reserved.
//
import UIKit
protocol TJMutiSelectViewDelegate {
func didOk(selectData:[String]) -> Void
}
class TJMutiSelectView: UIView, UITableViewDelegate, UITableViewDataSource {
va... |
C# | UTF-8 | 1,053 | 2.6875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Fire : MonoBehaviour
{
public FireLevel fireLevel;
private GameController controller;
public enum FireLevel
{
Dead, Low, Roaring
}
// Start is called before the first frame update
... |
Java | UTF-8 | 2,037 | 2.4375 | 2 | [] | no_license | package com.fdmgroup.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
import org.springframework.beans.factory.annotation.Autowired;
import com.fdmgroup.entity.Role;
public class RoleDAO implements IStorage<Role>{
@Autowired
DBConnection dbConnect... |
Swift | UTF-8 | 5,495 | 2.515625 | 3 | [] | no_license | //
// TargetTableViewController.swift
// hackbu17ipapp
//
// Created by Charles DiGiovanna on 2/26/17.
// Copyright © 2017 Charles DiGiovanna. All rights reserved.
//
import UIKit
import SwiftyJSON
class TargetTableViewController: UITableViewController {
var data = [User]()
var alertTextField: UITextField... |
PHP | UTF-8 | 907 | 2.546875 | 3 | [
"Artistic-2.0"
] | permissive | <?php
/**
* MotivoDescontoService.class [ SEVICE ]
* @copyright (c) 2018, Leo Bessa
*/
class MotivoDescontoService extends AbstractService
{
private $ObjetoModel;
public function __construct()
{
parent::__construct(MotivoDescontoEntidade::ENTIDADE);
$this->ObjetoModel ... |
Shell | UTF-8 | 934 | 4.09375 | 4 | [] | no_license | #!/bin/bash
##The break command terminates the loop (breaks out of it), while continue causes a jump to the next iteration of the loop,
LIMIT=19 # Upper limit
echo
echo "Printing Numbers 1 through 20 (but not 3 and 11)."
a=0
while [ $a -le "$LIMIT" ]
do
a=$(($a+1))
if [ "$a" -eq 3 ] || [ "$a" -eq ... |
PHP | UTF-8 | 2,484 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
namespace SimpleBus\Message\Tests\Recorder;
use SimpleBus\Message\Bus\MessageBus;
use SimpleBus\Message\Message;
use SimpleBus\Message\Recorder\HandlesRecordedMessagesMiddleware;
use SimpleBus\Message\Recorder\ContainsRecordedMessages;
use SimpleBus\Message\Tests\Fixtures\NextCallableSpy;
class HandlesRecorded... |
PHP | UTF-8 | 324 | 2.9375 | 3 | [] | no_license | <?php
if(!function_exists('debug'))
{
/**
* Function for working with array data
* print out datas
* @param array $arr
* @param bool $die
* @return mixed
*/
function debug($arr, $die = false)
{
echo '<pre>';
print_r($arr);
echo '</pre>';
if($die) die;
}... |
Go | UTF-8 | 955 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | package aws
import (
"math"
"github.com/shopspring/decimal"
)
func strPtr(s string) *string {
return &s
}
func strVal(s *string) string {
if s == nil {
return ""
}
return *s
}
func intPtr(i int64) *int64 {
return &i
}
func intVal(i *int64) int64 {
if i == nil {
return 0
}
return *i
}
func decimalPt... |
TypeScript | UTF-8 | 921 | 2.65625 | 3 | [
"MIT"
] | permissive | import * as Koa from 'koa';
import * as jwt from 'jsonwebtoken';
import config from '../config';
/**
* 生成 token
*
* @export
* @param {string} userId
* @returns token
*/
export function signToken(userId: string) {
const jwtConfig = config.jwt;
const token = jwt.sign({ userId }, jwtConfig.secret, { expiresIn: ... |
Java | UTF-8 | 1,745 | 2.203125 | 2 | [] | no_license | /**
* @(#)SupportBankVo.java 1.0.0 2014年11月26日 上午11:20:18
*
* Copyright © 2014 善林金融. All rights reserved.
*/
package com.slfinance.shanlincaifu.vo;
/**
* 充值提现支持的银行
*
* @author kongxiong
* @version $Revision:1.0.0, $Date: 2014年11月26日 上午11:20:18 $
*/
public class SupportBankVo {
public static final ... |
JavaScript | UTF-8 | 10,714 | 3.046875 | 3 | [
"MIT"
] | permissive |
function newBook(title, author, numberOfPages,publishDate){
this.title=title;
this.author=author;
this.numberOfPages= numberOfPages;
this.publishDates= new Date(publishDate);
}
var library = function() {
}
library.prototype.myBookArray = new Array();
library.prototype.init = function(){
... |
Java | UTF-8 | 5,746 | 2.875 | 3 | [] | no_license | import java.io.IOException;
import java.util.LinkedList;
/**
* The class containing the main method.
* External Sort large files when stored on disk
*
* @author bshreyas and veerad
* @version 4/10/2021
*/
// On my honor:
//
// - I have not used source code obtained from another student,
// or any other unautho... |
Python | UTF-8 | 275 | 3.171875 | 3 | [] | no_license | #모음의 개수
s = list(input())
mo = ['a', 'e', 'i', 'o', 'u']
count = 0
while s[0] != '#':
for i in range(len(s)):
for j in range(len(mo)):
if s[i].lower() == mo[j]:
count += 1
print(count)
count = 0
s = list(input()) |
Java | UTF-8 | 1,123 | 2.234375 | 2 | [
"MIT"
] | permissive | package io.github.sridharbandi.ftl;
import freemarker.template.Template;
import freemarker.template.TemplateNotFoundException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Injec... |
Java | UTF-8 | 3,146 | 2.671875 | 3 | [] | no_license | package com.wolf.servlet;
import org.apache.commons.lang3.StringUtils;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
* Description:... |
TypeScript | UTF-8 | 1,647 | 3.0625 | 3 | [] | no_license | import { Readable } from "stream";
import { IGenerator } from "./generators/generator.interface";
import { SimpleBufferGenerator } from "./generators/simple-buffer.generator";
import { ThrottledBufferGenerator } from "./generators/throttled-buffer.generator";
type GeneratorType = "SIMPLE" | "THROTTLED";
type SimpleB... |
Markdown | UTF-8 | 5,805 | 2.515625 | 3 | [
"MIT"
] | permissive | ---
layout: page
title: VIBRATION CONTROL OF INDUSTRIAL ROBOT
permalink: /research/vibration-suppression.html
---
### Contents:
* [Introduction](#id1)
* [Motion Control of Flexible Joint Robot](#id2)
* [Vibration Suppression of Flexible End-Effector](#id3)
* [Learning Control for Task Specific Industrial... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.