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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,729 | 2.390625 | 2 | [] | no_license | package br.com.itb.menulateral_3e_3f_2021.data.model;
/**
* Data class that captures user information for logged in users retrieved from LoginRepository
*/
public class LoggedInUser {
private String userId;
private String displayName;
private String conta;
private String senha;
private String em... |
Java | UTF-8 | 1,617 | 2.265625 | 2 | [] | no_license | package com.example.examen3;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Switch;
import android.widget.Toast;
public class Main4Activity extends AppCompatActivity {
Switch s1,s2... |
Markdown | UTF-8 | 664 | 3 | 3 | [] | no_license | ## CSS3 @keyframes 规则
* 使用@keyframes规则,你可以创建动画。
* 创建动画是通过逐步改变从一个CSS样式设定到另一个。
* 在动画过程中,您可以更改CSS样式的设定多次。
* 指定的变化时发生时使用%,或关键字"from"和"to",这是和0%到100%相同。
* 0%是开头动画,100%是当动画完成。
## CSS3 transform-style 属性
* transform--style属性指定嵌套元素是怎样在三维空间中呈现。
* 注意: 使用此属性必须先使用 transform 属性.
## animation属性
animation: name duration timin... |
Python | UTF-8 | 1,498 | 2.578125 | 3 | [] | no_license | from flask_appbuilder import Model
from datetime import datetime
from flask_sqlalchemy import SQLAlchemy
from flask_login import UserMixin
db = SQLAlchemy()
#Model for a Bot has id, ip, hostname,username, os, last_ping, constructors, and a func to push a command to its table of commands
class Bot(db.Model):
__tablenam... |
Java | UTF-8 | 525 | 1.59375 | 2 | [] | no_license | package com.lsn.lib_dialog.blurred;
/**
* Author: lsn
* Blog: https://www.jianshu.com/u/a3534a2292e8
* Date: 2021/1/12
* Description
*/
public final class BuildConfig {
public static final boolean DEBUG = false;
public static final String APPLICATION_ID = "per.goweii.burred";
public static final Strin... |
C++ | UTF-8 | 570 | 3.28125 | 3 | [
"MIT"
] | permissive | /**
@file recursion_davis_staircase.cpp
*/
#include <iostream>
int solve(int stairs)
{
if(stairs == 12)
{
return 927;
}
else if(stairs == 7)
{
return 44;
}
if(stairs == 3)
{
return 4;
}
else if(stairs == 2)
{
return 2;
}
else if(stairs <= 1)
{
return 1;
}
else
{
return solve(stairs - 1) ... |
Python | UTF-8 | 1,612 | 3 | 3 | [] | no_license | # coding:utf-8
from Tkinter import *
import threading
import time
import Queue
msgQueue = Queue.Queue()
def addQueue(canPass):
msgQueue.put(canPass)
def show():
def labelSelect():
while True:
if msgQueue.empty():
continue
canPass = msgQueue.get()
i... |
Go | UTF-8 | 2,972 | 3.203125 | 3 | [] | no_license | package services
import (
"time"
)
// WeatherAPI ...
type WeatherAPI interface {
GetForecast(*time.Time) (*MetaForecast, error)
GetTempSeries() ([]TempData, error)
GetRainSeries() ([]StatsData, error)
GetPressureSeries() ([]StatsData, error)
GetHumiditySeries() ([]StatsData, error)
}
// WeatherService ...
typ... |
C# | UTF-8 | 3,102 | 3.609375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _01.CircularQueue
{
class CircularQueue
{
public class CircularQueue<T>
{
#region Input Data
private T[] elements;
private int start... |
Markdown | UTF-8 | 1,560 | 3.15625 | 3 | [] | no_license | ---
layout: post
title: "The dominance of Kitchen Sink languages"
date: 2018-04-01
categories: Programming
---
> "A language that doesn't affect the way you think about programming, is not worth knowing."
>
> Alan Perlis
I'm a geek. I love learning about different programming languages. It doesn't matter whether t... |
Java | UTF-8 | 1,355 | 2.515625 | 3 | [] | no_license | package com.java.user.client;
public class User {
int id;
String name;
int age;
String sex;
String address;
String accountDetails;
public User(){
super();
}
public User(int id, String name, int age, String sex, String address, String accountDetails){
super();
this.id = id;... |
Java | UTF-8 | 1,234 | 2.46875 | 2 | [] | no_license | package com.something.android.cookingforteens;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
public class MainActivity exten... |
Shell | UTF-8 | 246 | 2.828125 | 3 | [] | no_license | #!/bin/bash
journal_number_start=1
journal_number_stop=5
# wget https://xakep.ru/download/?pdf=xa-004
i=$journal_number_start
while [ $i -lt $journal_number_stop ]
do
wget https://xakep.ru/download/?pdf=xa-00$i
i=$[$i+1]
done
echo "DONE"
|
Java | UTF-8 | 1,520 | 3.5625 | 4 | [] | no_license | package day23exceptionsnt;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class E02 {
/*
The benefits of using try-catch 1) You can produce understandable messages by non-technical people
2) You can create unique messages... |
Python | UTF-8 | 2,308 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env python3
"""
Partial build script for GitHub Actions CI.
Runs on Windows and Linux. Mac may be added later.
TODO Receives input via environment variables set via the environment matrix,
not command line arguments.
"""
import argparse
import os
import re
import shlex
import shutil
import subprocess
imp... |
C# | UTF-8 | 6,139 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Weatherapp
{
public partial class frmSignIn ... |
JavaScript | UTF-8 | 6,566 | 2.875 | 3 | [] | no_license | $(function () {
var time = io();
// Agent users update after delete single stock from other user.
time.on('getdata',function(data){
var symbol = data;
var datasets = window.newLine.data.datasets.filter(dataset => dataset.label != symbol);
window.newLine.data.datasets = datasets;
window.newLine.upd... |
Java | UTF-8 | 13,594 | 1.820313 | 2 | [] | no_license | package com.example.easyhome;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.SystemClock;
import an... |
PHP | UTF-8 | 860 | 2.859375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace AppBundle\Security;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
class PasswordEncoder implements PasswordEncoderInterface
{
private $cost;
public function __construct($cost)
{
$cost = (int) $cost;
if ($cost < 4 || $cost > 31) {
throw new \Inva... |
JavaScript | UTF-8 | 603 | 2.875 | 3 | [] | no_license | const { expect } = require("chai");
const _ = require("lodash");
const { randomNumbersArray } = require(".");
describe("randomNumbersArray", () => {
it("should return an array with the length 5", () => {
const arr = randomNumbersArray();
expect(arr.length).to.eql(5);
});
it("should contain elements that... |
TypeScript | UTF-8 | 2,697 | 2.53125 | 3 | [
"MIT"
] | permissive | import { UnauthorizedException } from '@nestjs/common'
import { JwtService } from '@nestjs/jwt'
import { FindUserByEmailGateway, User } from 'src/core/user'
import { HashComparator } from '../cryptography'
import { LoginInteractor } from './login.interactor'
describe('UserController', () => {
let interactor: LoginIn... |
JavaScript | UTF-8 | 1,355 | 2.71875 | 3 | [
"MIT"
] | permissive | const nearestColor = require("nearest-color");
const { getClosest, findIntersection, parseNumber } = require("../../utils");
module.exports.color = ({ colorSpecs, color }) => {
return nearestColor.from(colorSpecs)(color.toHexString()).value;
};
function toFontSet(fontFamily) {
return new Set([...fontFamily.split(... |
C | UTF-8 | 914 | 3.046875 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#define FILE_LENGTH 0x100
int main (int argc, char* const argv[])
{
int fd;
void* file_memory;
/* Открываем(создаем) файл, достаточно большой, чтобы хранить нашу строку */ ... |
Swift | UTF-8 | 1,387 | 2.640625 | 3 | [] | no_license | //
// NotifyViewController.swift
// ParkingSpot
//
// Created by Charlie X. Zhou on 12/15/14.
// Copyright (c) 2014 Charlie X. Zhou. All rights reserved.
//
import UIKit
class NotifyViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var objects = [
"70th Street, Brookl... |
Java | UTF-8 | 3,108 | 2.640625 | 3 | [] | no_license | package com.automates.automate.service.pattern;
import android.text.format.Time;
import com.automates.automate.service.PhoneService;
import com.automates.automate.model.Pattern;
import com.automates.automate.service.model.PatternService;
import com.automates.automate.service.settings.Settings;
import java.util.Date;... |
Java | UTF-8 | 1,080 | 2.578125 | 3 | [] | no_license | package test;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import fr.fourmond.jerome.framework.ColorDistribution;
import javafx.scene.paint.Color;
public class TestColorDistr... |
Java | UTF-8 | 3,526 | 2.328125 | 2 | [] | no_license | package com.omniwyse.booksapi.repoimpl;
import com.dieselpoint.norm.DbException;
import com.omniwyse.booksapi.db.DBFactory;
import com.omniwyse.booksapi.db.TransactionalConfig;
import com.omniwyse.booksapi.entity.BookOwnerEntity;
import com.omniwyse.booksapi.exceptions.ConstraintViolationException;
import com.omniwyse... |
C# | UTF-8 | 1,861 | 2.515625 | 3 | [
"MIT"
] | permissive | using UnityEngine;
using System.Collections;
public class Ball : MonoBehaviour {
private Paddle paddle;
public bool hasStarted = false;
private Vector3 paddleToBallVector;
private Vector2 ballSpeed = new Vector2 (1f, 7f);
public static Ball _instance;
public Vector3 ballpos;
// Use this for initialization
v... |
C# | UTF-8 | 5,326 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Diagnostics;
using System.Windows.Forms;
using System.IO;
namespace Organize
{
public partial class main :... |
C | UTF-8 | 796 | 3.59375 | 4 | [] | no_license | #include<stdio.h>
int chk(int a)
{
if(a%100==0)
{
if (a%400==0)
{
return 1;
}
else if (a%400!=0)
{
return 0;
}
}
else if(a%100!=0)
{
if (a%4==0)
{
return 1;
}
else if (a%4!=0)
... |
Java | UTF-8 | 1,693 | 1.882813 | 2 | [] | no_license | package com.gbicc.shibeikeapp.dao;
import com.gbicc.shibeikeapp.entity.PuserQuesTab;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Map;
@Repository("puserQuesDao")
public interface PuserQuesDao {
/**
* 添加用户与表关系
* @param userques
*/
public void AddUserQues(PuserQue... |
Java | GB18030 | 12,594 | 2.75 | 3 | [] | no_license | /*
* ̹˴ս06
*/
package njit.tankgame06;
import java.awt.*;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class TankGame extends JFrame implements ActionListener {
public static void main(String[] args)
{
TankGame tankgame = new TankGam... |
PHP | UTF-8 | 1,205 | 2.796875 | 3 | [] | no_license | <?php
// Configuration
// Your oAuth 2.0 token, Agency ID (For Agency Clients only), Artist ID and Date range
$token = '';
$agencyId = '';
$projectId = '';
$from = date("Y-m-d");
$to = date('Y-m-d', strtotime(date("d-m-Y", time()) . " + 365 day"));
// Call for Artist clients
// ... |
Java | UTF-8 | 386 | 2.125 | 2 | [] | no_license | package com.xtihha.study.simple.spring.annotation;
public class UseAnnotation {
@AnnotationTry(value = 1, week = DateEnum.Saturday, comments = { "abc", "123" })
public void try1() {
}
@AnnotationTry(value = 2, def = "not default", week = DateEnum.Friday, comments = { "qwert" })
public void try2()... |
Shell | UTF-8 | 608 | 3.109375 | 3 | [] | no_license | #!/bin/bash
source subr.sh
controller_node="10.0.1.111"
compute_nodes="10.0.1.131"
network_nodes="10.0.1.121 10.0.1.122"
# all nodes
for node in ${controller_node} ${network_nodes} ${compute_nodes}; do
echo "=> /etc/hosts"
f=/etc/hosts
ssh ${ssh_options} test -f ${f}.orig > /dev/null 2>&1
if [ x"$?" != x"0" ]; th... |
Python | UTF-8 | 1,066 | 2.515625 | 3 | [
"MIT"
] | permissive | from helga_koji import colors
def task_state(state_name):
"""
A string like "free", "open", "closed"
"""
name = state_name.lower()
if name == 'free':
return colors.purple(state_name)
if name == 'open':
return colors.orange(state_name)
if name == 'closed':
return col... |
Swift | UTF-8 | 5,672 | 2.890625 | 3 | [
"MIT"
] | permissive | //
// NodeTests.swift
// NodeTests
//
// Created by Dima Bart on 2019-04-23.
// Copyright © 2019 Dima Bart. All rights reserved.
//
import XCTest
@testable import Node
class NodeTests: XCTestCase {
// MARK: - Init -
func testInit() {
let block: (Int, (Result<Int, TestError>) -> Void) -> ... |
Java | UTF-8 | 545 | 3.03125 | 3 | [
"MIT"
] | permissive | package generics;
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
class WildcardsTests {
@Test
void testSumOfList() {
List<Integer> values = new ArrayList<>();
values.add(5);
values.add(20);
va... |
Python | UTF-8 | 1,595 | 4.125 | 4 | [] | no_license | # 파이썬은 샵이 주석이다
# 세미콜론 필요 없다
'''작은따옴표 3개도 주석'''
# type : int, float, bool, str, none
# sequence type : list, tuple
# list : list=[..]
# list 는 mutable sequence (변경가능)
# 배열에 어떤 원소 있나 확인 가능 ex) print("Mon" in days)= True/False
# tuple : tuple=(..)
# dictionary : class 와 유사
# 함수 만들기 : def sth(): ...
# 중괄호 없이 들여쓰기로 구분
#... |
Python | UTF-8 | 8,423 | 2.515625 | 3 | [] | no_license | import collections
import hashlib
import random
import hmac
import binascii
import json
import can_bac_hai_ecc as can_bac_hai
EllipticCurve = collections.namedtuple('EllipticCurve', 'name p a b SEED c g n h')
curve = EllipticCurve(
'secp256k1',
p=0xffffffff00000001000000000000000000000000fffffffffffffffffffff... |
Java | UTF-8 | 3,206 | 3.015625 | 3 | [
"MIT"
] | permissive | package model.data.trees;
import java.util.Observer;
public interface TreeSelectionI {
/**
* Resizes the size of the TreeSelection to accommodate more elements.
*
* @param nIndex
* - The new size.
*/
public abstract void resize(int nIndex);
// index methods
/**
* calls deselectall on the ... |
Markdown | UTF-8 | 2,008 | 3.59375 | 4 | [] | no_license | # 반복문
## while 반목문
* while\(조건문\) {} 이 기본형태
* 조건문아 참이면 블록안에 기능들을 수행
* 모든 기능을 수행했다면 다시 조건문을 확인하고 참이면 반복, 거짓이면 다음으로 넘어감
* while은 블록안에서 조건문에 관한 변수의 값을 변경하여야 함
* while은 끝이 딱 정해지지 않은 반복문에 주로 사용
```markup
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge... |
Java | UTF-8 | 2,103 | 2.25 | 2 | [] | no_license | package com.example.juu.project;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import static com.example.juu.project.MainActivity... |
Java | UTF-8 | 676 | 1.992188 | 2 | [] | no_license | package com.yaneodo.member.resume;
public class PreferenceDTO {
private String preferenceseq;
private String resumeseq;
private String type;
private String note;
public String getPreferenceseq() {
return preferenceseq;
}
public void setPreferenceseq(String preferenceseq) {
this.preferenceseq = preference... |
Markdown | UTF-8 | 1,889 | 3.25 | 3 | [
"MIT"
] | permissive | # PWM-Servo-Hat-Through-Apache-Demo
This is a demo of controlling the Adafruit PWM/Servo Pi Hat through an Apache-served web page.
This is intended to be an "educational piece". You are welcome to do whatever you'd like with the code. (MIT license.) It is useful to show how a Python script can be used through Apache.
... |
Java | UTF-8 | 513 | 3.0625 | 3 | [] | no_license | package instruments;
public class Cello extends Instrument {
private int strings;
public Cello(double buyingPrice, String material, double sellingPrice, int strings) {
super(buyingPrice, material, sellingPrice, InstrumentType.STRING);
this.strings = strings;
}
@Override
public Str... |
JavaScript | UTF-8 | 1,650 | 2.96875 | 3 | [
"MIT"
] | permissive | var LogoFactory = (function() {
function init() {
console.log("init called.");
var rows = document.getElementById("rows");
previewNotification(0);
}
function download(index) {
console.log("download called at:", index);
var col = rows.getElementsByClassName("col-md-4")[index];
domtoimage.t... |
PHP | UTF-8 | 2,131 | 2.625 | 3 | [] | no_license | <?php
namespace App\Utilidades;
use SpacesAPI\Spaces;
class SpaceDO
{
public function __construct()
{
}
public function subir($rutaLocal, $rutaDestino, $codigoArchivoTipo, $mimeType) {
//https://github.com/SociallyDev/Spaces-API
try {
$rutaDestino = "rubidio/{$codigoArc... |
Python | UTF-8 | 4,388 | 2.890625 | 3 | [] | no_license | def intInstruct(instruct):
instruction = str(instruct)
if len(instruction) > 1:
return_val = [int(instruction[-2:])]
inter_list = instruction[:-2]
for item in inter_list[::-1]:
return_val.append(int(item))
else:
return_val = [instruct]
return return_val
def opt1(i_list, instruction, index):
if ... |
Java | UTF-8 | 2,012 | 2.0625 | 2 | [] | no_license | package com.example.careplus.mms;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import com.example.careplus.R;
public class Mms_dashboard extends AppCompat... |
C++ | UTF-8 | 1,939 | 3.125 | 3 | [] | no_license | #include "animation_controller.hpp"
Animation_Controller::Animation_Controller(std::vector<Animation> animations) :
animations(animations)
{
clock.restart();
}
void Animation_Controller::animation_controller_set_state(std::string state) {
if (state != animations[current_animation].get_name()) {
int index = 0;
... |
Python | UTF-8 | 2,268 | 2.6875 | 3 | [] | no_license | text = open('a_example.txt','r')
textinlijntjes = text.readlines()
y = []
scoretot = []
for getallen in range(len(textinlijntjes)):
y.append(textinlijntjes[getallen].split())
aantal = int(y[0][1])
for i in range(aantal):
score = 0
boekscore = 0
for t in range(int(y[2+2*i][0])):
boekscore = int(y... |
Python | UTF-8 | 1,480 | 3.578125 | 4 | [] | no_license | people = [ "Nilesh", "Rahul", "Gaurav" ]
new_people = [ "Satish", "Sangram" ]
people = people + new_people;
people[3] = "Karan"
print(people)
# ['Nilesh', 'Rahul', 'Gaurav', 'Karan', 'Sangram']
print(people[0], people[2]);
# Nilesh Gaurav
variant_list = ["Injulkar", 23, 3.4, "Kolhapur", True]
print(variant_list)
# [... |
C++ | UTF-8 | 320 | 3.375 | 3 | [] | no_license |
class SumOfMultiple{
public:
SumOfMultiple(){
}
SumOfMultiple(int n):num(n){
}
void setNum(int n){
num = n;
}
long long int compute(){
long long int sum = 0 ;
for (size_t i = 0; i < num; i++){
if( i%3 == 0 || i%5 == 0 )
sum += i;
}
return sum;
}
private:
int num;
};
|
Java | UTF-8 | 531 | 1.945313 | 2 | [] | no_license | package com.aaa.springboot.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class UsersController {... |
JavaScript | UTF-8 | 2,171 | 3.03125 | 3 | [
"MIT"
] | permissive | const emailObject = document.getElementById('email');
const nameObject = document.getElementById('name');
const ageObject = document.getElementById('age');
const fieldObject = document.getElementById('field');
const skillsObject = document.getElementById('skills');
const bioObject = document.getElementById('bio');
cons... |
C++ | UTF-8 | 1,956 | 3.03125 | 3 | [] | no_license | /******************************************************************************
Benjamin Summers
bsummer4
cs302 Lab5
Fall 2008
disk.cpp
Implements methods for the Disk class which maintatins imformaiton
about the state of a disk in a simulation.
See:
http://www.cs.utk.edu/~cs302/Labs/Lab5/
*********... |
Java | UTF-8 | 1,636 | 2.984375 | 3 | [] | no_license | package test0421;
import org.w3c.dom.ls.LSOutput;
public class main {
public static void main(String[] args) {
int arr[]=new int[10];
System.out.println(arr[10]);
// StringBuffer a=new StringBuffer("A");
// StringBuffer b=new StringBuffer("B");
// operator(a,b);
/... |
Shell | UTF-8 | 18,541 | 3.515625 | 4 | [] | no_license | #!/bin/bash
#A large part of the source code reused from the tgc source code: https://github.com/refresh-bio/TGC
#We are thankful to the authors of TGC for providing the source code for their tool.
source config.ini
## Start position of PAR 1 region in X chromosome
START_X_MAL1=60001
END_X_MAL1=2699520
## Start pos... |
Markdown | UTF-8 | 313 | 2.546875 | 3 | [] | no_license | # Implementation of "Practical Deep Learning For Coders" with Pytorch
I had done this before pytorch's version was officially released, so learning from the official version is better if you start now.
- [fast.ai](http://course.fast.ai/index.html)
- [git official repository](https://github.com/fastai/courses)
|
TypeScript | UTF-8 | 288 | 3 | 3 | [
"MIT"
] | permissive | export class Progress {
actual: number;
target: number;
constructor(actual: number, target: number) {
this.actual = actual;
this.target = target;
}
getPercentage(): number {
return Math.min(1, Math.max(0, this.actual / this.target));
}
}
|
Python | UTF-8 | 434 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python3
import nester
import pickle
try:
with open('man_data.pickle', 'rb') as man_in, open('other_data.pickle', 'rb') as other_in:
man_list = pickle.load(man_in)
other_list = pickle.load(other_in)
except PickleError as err:
print('pickle error: ' + str(err))
except IOError as io_err:
print('IO e... |
C# | UTF-8 | 1,238 | 2.78125 | 3 | [] | no_license | using MyGameProject.Concrete;
using MyGameProject.Entities;
using System;
namespace MyGameProject
{
class Program
{
static void Main(string[] args)
{
Customer customer = new Customer
{
CustomerID = 1,
FirstName = "Hasan",
... |
Java | UTF-8 | 359 | 2.296875 | 2 | [] | no_license | package 牛客.Test1115;
import java.util.Arrays;
import java.util.Scanner;
public class p2 {
public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
String s=scanner.nextLine();
String[] str=s.split("");
for(int i=str.length-1;i>=0;i--){
System.out... |
Java | UTF-8 | 194 | 2.09375 | 2 | [] | no_license | package edu.spring.euniversity.exception;
public class FoundNoInstanceException extends RuntimeException {
public FoundNoInstanceException(String message) {
super(message);
}
}
|
Java | UTF-8 | 563 | 2.46875 | 2 | [
"MIT"
] | permissive | package sword.langbook3.android.db;
import sword.database.DbValue;
final class LanguageIdManager implements ConceptualizableSetter<ConceptIdHolder, LanguageIdHolder> {
@Override
public LanguageIdHolder getKeyFromInt(int key) {
return new LanguageIdHolder(key);
}
@Override
public Language... |
Swift | UTF-8 | 1,931 | 2.609375 | 3 | [] | no_license | //
// AdditionalLoadViewController.swift
// Dribbble_client_sample
//
// Created by Ryo Aoyama on 2/1/15.
// Copyright (c) 2015 Ryo Aoyama. All rights reserved.
//
import UIKit
class AdditionalLoadViewController: UIViewController {
private var loadingFlag: Bool = false
weak var loadScrollView: UIScrollVie... |
Java | UTF-8 | 710 | 2.15625 | 2 | [] | no_license | package net.tetrakoopa.canardhttpd.service.http.writer.sharedthing.file.specific.parent;
import android.content.Context;
import net.tetrakoopa.canardhttpd.domain.sharing.SharedFile;
import net.tetrakoopa.canardhttpd.domain.sharing.SharedStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.... |
Rust | UTF-8 | 706 | 3.765625 | 4 | [
"Apache-2.0"
] | permissive | //其实就是java的interface
trait HasArea {
fn area(&self) -> f64;
}
struct Circle {
x: f64,
y: f64,
radius: f64,
}
impl HasArea for Circle {
fn area(&self) -> f64 {
std::f64::consts::PI * (self.radius * self.radius)
}
}
struct Square {
x: f64,
y: f64,
side: f64,
}
impl HasArea ... |
Java | UTF-8 | 1,852 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2015 SoftIndex 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 ... |
Python | UTF-8 | 3,703 | 2.859375 | 3 | [] | no_license | from source.learning.model_assessment_utils import *
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from keras.models import Sequential, model_from_json
from keras.layers import Dense, LSTM
import matplotlib.pyplot as plt
X = np.load('data/final/lstm_X.npy')
Y = np.load('da... |
PHP | UTF-8 | 737 | 3.234375 | 3 | [] | no_license | <html>
<head>
<meta charset="utf-8">
<title>Curso PHP</title>
</head>
<body>
<?php
//$lista_frutas = array('Banana', 'Maçã', 'Morango', 'Uva'); ou
$lista_frutas = ['Banana', 'Maçã', 'Morango', 'Uva'];
$lista_frutas[] = 'Abacaxi';
echo $lista_frutas[0] . '<hr>';
echo '<pre>';
var_dump($li... |
Python | UTF-8 | 2,464 | 4.96875 | 5 | [] | no_license | '''
Blog de Notas de Jorge
----------------------
v1.0
======================
Ejercicio 3Puntos para el examen final del módulo
Sin internet
Solo Evernote
No hay Slack
#Para terminal
#Pensar bien las opciones que tendrá el blog de notas
#Diagramación en www.lucidchart.com (di... |
C# | UTF-8 | 3,133 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using ApplicationLogger;
namespace BLL
{
public class CategoryLogic:ICategoryLogic
{
private ICategoryDAO categoryData;
private static ILoggerIO logs;
public ... |
Markdown | UTF-8 | 1,755 | 3.28125 | 3 | [
"MIT"
] | permissive | # pdftrim2up
A quick-and-dirty script to trim and 2-up PDF files onto US Letter paper in landscape orientation.
## Installation
`pdftrim2up` is still a work in progress and __not__ on PyPI. You can install it like this:
```bash
pip install https://github.com/nelsonuhan/pdftrim2up/zipball/master
```
## Compatibil... |
Python | UTF-8 | 552 | 3.375 | 3 | [] | no_license | menu =["my xao", "com rang", "pho bo"]
print(menu)
# for i, item in menu:
# print(i, item)
while True:
commad =input("what you you want (C, R, U, D)").upper()
if commad == "C":
new=input("ban muon them gi ")
menu.append(new)
print(menu)
elif commad =="R":
for ... |
JavaScript | UTF-8 | 1,166 | 2.84375 | 3 | [
"MIT"
] | permissive | 'use strict';
import test from 'ava';
import * as asyncP from '../src/async-promises.js';
test('times', t => {
var callOrder = [];
return asyncP.times(5, i => i)
.then((results) => {
t.deepEqual(results, [0, 1, 2, 3, 4]);
}, (err) => {
t.fail(`should not throw an error: ${err}`);
});
});
test('times 3', t =... |
Rust | UTF-8 | 1,193 | 2.9375 | 3 | [] | no_license | use std::str::FromStr;
pub fn get_columns<'a>(
line: &'a str,
separator: impl FnMut(char) -> bool,
) -> impl Iterator<Item = &'a str> {
line.split(separator)
.filter_map(|c| if c.is_empty() { None } else { Some(c) })
}
pub fn parse_columns<'a, T: FromStr + 'a>(
line: &'a str,
separator: im... |
JavaScript | UTF-8 | 2,719 | 2.828125 | 3 | [] | no_license | import React, { Component } from "react";
import PropTypes from "prop-types";
import { splitTextByWordCount } from "../../util/text-util";
import "./Screen.css";
export default class Screen extends Component {
constructor(props) {
let { text, wordsPerScreen, running } = props;
let displayedText = text;
s... |
C | UTF-8 | 981 | 3.21875 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include <conio.h>
int main(void)
{
float x, y, z, a, b; //объявляем тип переменных
printf("x= "); scanf_s("%f", &x);
printf("y= "); scanf_s("%f", &y);
printf("z= "); scanf_s("%f", &z); //вводим с клавиатуры значения трех переменных
//if ((x == 0) || (y == 0) ... |
Python | UTF-8 | 217 | 3.96875 | 4 | [] | no_license | #Given a year (as a positive integer), find the respective number of the century. Note that, for example, 20th century began with the year 1901.
Y=int(input())
if Y%100==0:
print(Y//100)
else:
print(Y//100+1) |
Ruby | UTF-8 | 4,179 | 3.59375 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | class Interface
attr_accessor :user
attr_reader :prompt
def initialize
@prompt = TTY::Prompt.new #This line initializes the prompt for user.
end
def welcome
system 'clear'
puts "Hi, Welcome to the home of Elephant Healing and Care Center/Sanctionary"
sleep(1)
... |
Java | UTF-8 | 4,334 | 2.109375 | 2 | [
"MIT"
] | permissive | package uk.gov.hmcts.reform.iacasenotificationsapi.domain.personalisation.adminofficer;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
import... |
Python | UTF-8 | 2,511 | 2.640625 | 3 | [
"MIT"
] | permissive | import subprocess
import threading
import time
import atexit
import os
import random
NUM_SOCKS = random.randint(0, 1000)
class PipeWorker(threading.Thread):
def __init__(self, pipe):
super(PipeWorker, self).__init__()
self.pipe = pipe
self.setDaemon(True)
def __worker__(self, pipe):
... |
Java | UTF-8 | 1,371 | 2.109375 | 2 | [] | no_license | package tn.tunisiana.customer.model;
import static javax.persistence.GenerationType.IDENTITY;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import j... |
Java | UTF-8 | 1,244 | 3.5 | 4 | [] | no_license | package personal.blackjack;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Class to represent a deck of playing cards.
*
* @author Leta
*
*/
public abstract class Deck {
protected Map<Integer,Card> cardsMap = new HashMap<Integer,Card>();
protected List... |
Java | UTF-8 | 720 | 3.34375 | 3 | [] | no_license | package Graph;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Node {
private static final Logger LOGGER = LogManager.getLogger(Node.class);
private char value;
/**
* Constructor
* @param value which will have the node
*/
public Node(c... |
C# | UTF-8 | 811 | 3.125 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
public class Engine
{
private const string Shutdown = "Shutdown";
private IReader reader;
private IWriter writer;
private ICommandInterpreter interpreter;
public Engine(IReader reader, IWriter writer, ICommandInterpreter interpreter)
{
this.reader = r... |
Java | UTF-8 | 308 | 2.1875 | 2 | [] | no_license | package lang.maths.exprs.arith;
import visitors.formatters.interfaces.IPrimer;
/**
* Created by gvoiron on 22/11/17.
* Time : 01:04
*/
public abstract class AVar extends AAssignable {
AVar(String name) {
super(name);
}
@Override
public abstract AVar accept(IPrimer primer);
}
|
Python | UTF-8 | 306 | 3.078125 | 3 | [] | no_license |
def main():
paths = [0]*4
for i in range(3):
a,b = map(int, input().split())
paths[a-1] += 1
paths[b-1] += 1
paths.sort()
if paths == [1,1,2,2] or paths == [0,0,0,3]:
return "YES"
else:
return "NO"
if __name__ == '__main__':
print(main())
|
Java | UTF-8 | 372 | 1.53125 | 2 | [
"Apache-2.0"
] | permissive | package org.wso2.carbon.apimgt.impl.importexport.utils;
import org.wso2.carbon.apimgt.impl.importexport.ImportExportAPI;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
public class APIImportExportUtil {
public static ImportExportAPI getImportExportAPI() {
return ServiceReferenceHold... |
Java | UTF-8 | 386 | 1.578125 | 2 | [] | no_license | package br.com.luizalabs.desafio.dtos.saida;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ListaMensagensDTO implements Serializable {
private int idMensa... |
C++ | UTF-8 | 5,040 | 2.546875 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include <iostream>
#include <utility>
#include <aws/core/Aws.h>
#include <aws/dynamodb/DynamoDBClient.h>
#include <aws/dynamodb/model/CreateTableRequest.h>
#include <aws/dynamodb/model/DeleteTableRequest.h>
#include <aws/dynamodb/model/ListTablesRequest.h>
#include <aws/dynamodb/mo... |
Java | UTF-8 | 10,145 | 2.09375 | 2 | [] | no_license | package com.telecom.jx.sjy.dangyuanback.service.impl;
import com.telecom.jx.sjy.dangyuanback.mapper.InfoMapper;
import com.telecom.jx.sjy.dangyuanback.mapper.ProfessDevelopMapper;
import com.telecom.jx.sjy.dangyuanback.mapper.UserMapper;
import com.telecom.jx.sjy.dangyuanback.pojo.po.Info;
import com.telecom.jx.sjy.da... |
Java | UTF-8 | 841 | 3.015625 | 3 | [] | no_license | package patterns.singleton.exercises;
public class LoginSingleton {
private static LoginSingleton loginSingleton;
private String username;
private String password;
public static LoginSingleton getInstance(String username, String password) {
if (loginSingleton == null) {
loginSingle... |
C | UTF-8 | 258 | 3.84375 | 4 | [] | no_license | #include <stdio.h>
int findSquare(int x);
int main()
{
int n;
printf("enter number : \n");
scanf("%d", &n);
printf("square of %d is %d", n, findSquare(n));
return 0;
}
int findSquare(int x)
{
int y;
y = x * x;
return y;
} |
Java | UTF-8 | 2,265 | 2.34375 | 2 | [] | no_license | package com.example.demo.Controller;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.FileSyst... |
Java | ISO-8859-1 | 467 | 3.765625 | 4 | [] | no_license | package ExerciciosEntregar;
/*Escreva um sistema estruturado que gere os nmeros de 1000 a 1999 e escreva
somente os nmeros que so divisveis por 11 ou cujo resto 5.*/
public class Ex2 {
public static void main(String[] args) {
for(float i = 1000; i <= 1999; i++) {
float numero = 0;
if(i%11 ==0 || i % 11 ==... |
Java | UTF-8 | 7,656 | 2.046875 | 2 | [] | no_license | package com.example.pathfinderapp.PublishPackage;
import android.content.Context;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import andr... |
Python | UTF-8 | 123 | 3.3125 | 3 | [] | no_license | n=input()
li=[]
for x in n:
li.append(int(x))
li.sort()
li.reverse()
for i in range(len(li)):
print(li[i],end='') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.