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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 781 | 2.546875 | 3 | [] | no_license | import { Component, EventEmitter, OnInit, Output } from '@angular/core';
import { Task } from 'src/app/models/Task';
@Component({
selector: 'app-add-task',
templateUrl: './add-task.component.html',
styleUrls: ['./add-task.component.css']
})
export class AddTaskComponent implements OnInit {
text!: string;
dat... |
C++ | UTF-8 | 1,312 | 2.859375 | 3 | [] | no_license | class Solution {
struct node {
int in;
vector<node *> next;
node() : in(0), next(0) {
}
};
public:
int longestIncreasingPath(vector<vector<int>>& matrix) {
vector<vector<node>> m;
for (auto &v: matrix)
m.push_back(vector<node>(v.size()));
i... |
Rust | UTF-8 | 6,329 | 2.921875 | 3 | [
"MIT",
"Zlib"
] | permissive | use super::system_prelude::*;
#[derive(Default)]
pub struct LoaderSystem;
/// Loads loadable entities when they are within the camera.
impl<'a> System<'a> for LoaderSystem {
type SystemData = (
ReadExpect<'a, Settings>,
Entities<'a>,
Read<'a, LoadingLevel>,
Write<'a, World>,
... |
Markdown | UTF-8 | 3,679 | 3.265625 | 3 | [] | no_license | # xml2json2txt
## This mini tool with zero dependences and <200 lines of code, can convert data between XML, JSON and TXT and viseversa.
Is good for comunicate between multiple platforms heterogeneous, for example Cobol (TXT) <-> Node.js/Browser (JSON) <-> SOAP/REST API (XML).
Tested in production, working on.
## S... |
JavaScript | UTF-8 | 254 | 3.046875 | 3 | [] | no_license | function inicio(){
var styles = ["Jazz", "Blues"];
styles.push("Rock'n'Roll");
styles[1] = "Classic";
console.log(styles);
lastStyle = styles[styles.length-1];
console.log(lastStyle);
}
window.addEventListener("load", inicio); |
Markdown | UTF-8 | 1,584 | 3.0625 | 3 | [] | no_license | # ACSE-7 (Inversion and Optimisation) Coursework
This is the assessed coursework for module ACSE-7: Inversion and Optimisation for year 2020/21.
It consists of four parts:
Part-A (15 pts): covers lecture 1
Part-B (45 pts): covers lectures 2-7
Part-C (15 pts): covers lecture 8
Part-D (25 pts): covers lecture 9-11
... |
C | UTF-8 | 866 | 4.21875 | 4 | [
"CC0-1.0"
] | permissive | #include <stdio.h>
#include <string.h>
int main() {
int c = 1;
printf("while loop\n");
while (c <= 5) {
printf("%d\n", c);
c++;
}
printf("for loop\n");
for (int c = 1; c<=5; c++)
printf("%d\n", c);
printf("nested loops\n");
for (int i = 0; i < 10; i++)
for (int... |
Python | UTF-8 | 276 | 3.609375 | 4 | [] | no_license | sequence_of_values = list(map(float, input().split()))
values_count = {}
for value in sequence_of_values:
if value not in values_count:
values_count[value] = sequence_of_values.count(value)
[print(f"{key} - {value} times") for key, value in values_count.items()]
|
Java | UTF-8 | 2,503 | 2.390625 | 2 | [] | no_license | package flight.wizzair.entities;
import static flight.entities.refdata.Station.BARCELONA;
import static flight.entities.refdata.Station.BUDAPEST;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.Assert;
import org.junit.Test;
import flight.entities.Abstract... |
Java | UTF-8 | 636 | 3.765625 | 4 | [
"MIT"
] | permissive | import java.util.Scanner;
public class Exercise1 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int userInput, computer;
System.out.print("Enter 0 (Heads) or 1 (Tails): ");
userInput = input.nextInt();
double d = Math.random();
computer = (int... |
Java | UTF-8 | 2,322 | 2.59375 | 3 | [] | no_license | package com.tsi.aspects;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.anno... |
TypeScript | UTF-8 | 1,674 | 2.65625 | 3 | [] | no_license | import { AbstractControl } from '@angular/forms';
import { stringify } from '@angular/core/src/render3/util';
export function IDNumberValidator(control: AbstractControl) {
const currentValue = control.value;
if (isNaN(currentValue)) {
return { validIDNumber: true };
}
try {
const StringCurrentValue =... |
C | UTF-8 | 656 | 3.0625 | 3 | [] | no_license | #include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#define osAssert(cond, msg) osErrorFatal(cond, msg, __FILE__, __LINE__)
void osErrorFatal(bool cond, char* msg, char* file, int line)
{
if(!cond)
{
perror(msg);
fprintf(s... |
C++ | UTF-8 | 2,355 | 3.203125 | 3 | [] | no_license | #include <chrono>
#include <vector>
#include "data_sorting.h"
std::vector<long long> radix_sort(std::vector<int> data){
//index 0 = swaps; index 1 = comparisons; index 2 = time;
std::vector<long long> results;
results.resize(3);
int cycles = 0;
int size_data = data.size();
while(size_data != 0){
... |
Python | UTF-8 | 499 | 3.484375 | 3 | [] | no_license | # coding=utf-8
# --- Day 2: Password Philosophy ---
f = open('input.txt', 'r')
valid_first, valid_second = 0, 0
for line in f:
tokens = line.strip().split(' ')
fr, to = map(lambda x: int(x), tokens[0].split('-'))
let = tokens[1][0]
passwd = tokens[2]
if passwd.count(let) in range(fr, to + 1):
... |
Java | UTF-8 | 2,386 | 2.671875 | 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 byui.cit260.treeOfLife.model;
import java.io.Serializable;
import java.util.Objects;
/**
*
* @author gradygb
... |
SQL | UTF-8 | 41,648 | 3.390625 | 3 | [] | no_license |
ALTER TABLE `invdb`.`dc_request_audit`
ADD COLUMN `product` VARCHAR(50) NULL AFTER `id`,
ADD COLUMN `mode` VARCHAR(20) NULL AFTER `product`;
USE `invdb`;
DROP procedure IF EXISTS `dc_request_auditrial`;
DELIMITER $$
USE `invdb`$$
CREATE PROCEDURE `dc_request_auditrial`(
in p_id numeric(10),
in p_product varchar(50)... |
C# | UTF-8 | 1,518 | 3 | 3 | [] | no_license | using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace SaturnsTurn5
{
class Projectile
{
//projectile image
public Texture2D Texture;
public Vector2 Position;
public bool Active;
public int Damage { get; set; }
Viewport v... |
C++ | UTF-8 | 9,412 | 3.015625 | 3 | [] | no_license | #pragma once
#include "Point.hpp"
#include "Plane.hpp"
#include "Polygon.hpp"
#include <Exceptions.hpp>
// #include "PolyGroup.hpp"
#include <CollisionGJK.hpp>
namespace angem
{
template <typename Scalar>
bool collision(const Plane<Scalar> & pl1,
const Plane<Scalar> & pl2,
Line<3,Scalar... |
SQL | UTF-8 | 3,651 | 3.296875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 05, 2018 at 02:31 PM
-- Server version: 5.7.23-0ubuntu0.18.04.1
-- PHP Version: 5.6.37-1+ubuntu18.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4010... |
PHP | UTF-8 | 3,242 | 2.671875 | 3 | [] | no_license | <?php
// wcf imports
require_once(WCF_DIR.'lib/form/AbstractForm.class.php');
require_once(WCF_DIR.'lib/data/user/UserEditor.class.php');
/**
* Shows the user activation form.
*
* @author Marcel Werk
* @copyright 2001-2009 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/... |
Python | UTF-8 | 5,630 | 3.3125 | 3 | [] | no_license | '''Create Gender Data Picture'''
def genderData(file):
import numpy as np
genotypes=np.load(file)
# Create a new PCA object.
pca = PCA(n_components=3)
# Find three principal components, and project the dataset onto them.
# This outputs an array of three-dimensional vectors, one per sample.
genotypes_fit = pc... |
C++ | UTF-8 | 3,746 | 2.59375 | 3 | [
"MIT"
] | permissive | #define _USE_MATH_DEFINES
#include <DataStructures.h>
#include <vector>
#include <array>
#include <math.h>
#include <cmath>
#include <string>
#include <iostream>
void CameraData::AccelerateCamera(float acc[3]) {
for (int i = 0; i < 3; i++)
acceleration[i] += acc[i] * acc_mul;
}
void CameraData::RotateCame... |
Java | UTF-8 | 4,683 | 2.1875 | 2 | [] | no_license | package is.hi.g.hikersicelands.hikersicelands.Controllers;
import is.hi.g.hikersicelands.hikersicelands.Entities.Achievement;
import is.hi.g.hikersicelands.hikersicelands.Entities.Hike;
import is.hi.g.hikersicelands.hikersicelands.Entities.Item;
import is.hi.g.hikersicelands.hikersicelands.Entities.Profile;
import is.... |
Java | UTF-8 | 3,341 | 2.21875 | 2 | [] | no_license |
package com.social.tmdb.model;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.bui... |
JavaScript | UTF-8 | 4,605 | 4.40625 | 4 | [] | no_license | //Await a Minute! Async/Await and a new syntax for Promises
//The await and async keywords have been added to javascript to indicate asynchronous functions and they have the following effects:
//By adding the async keyword, you make the result of that function a Promise, even if it would normally be completed synchron... |
Java | UTF-8 | 735 | 1.890625 | 2 | [] | no_license | package org.shop.model.vo;
import lombok.Data;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
@ToString
public class ProductSpecAddVO {
@NotEmpty(message = "product spec name cannot be empty")
private String name;
@NotEmpty(messa... |
PHP | UTF-8 | 953 | 2.828125 | 3 | [] | no_license | <?php
namespace Acar\Post\Command;
use Acar\Post\Command\AbstractCommand;
/**
* Customize class
*
* @author Cem AÇAR <myceykiii@gmail.com>
*/
class Customize extends AbstractCommand
{
/**
* The namespace.
*
* @var string
*/
protected $namespace = "customize";
/**
* Create So... |
Java | UTF-8 | 841 | 3.265625 | 3 | [] | no_license | package OOP_Encapsulation;
public class Company {
private String name;//IBM
private int empCount;//1000
private String hq;
public String ceoName;
public String getCompyInfo() {//getter of getting all comp information
String info = name + empCount + hq;
return info;
}
// setter and getter methods --> p... |
Java | UTF-8 | 1,999 | 2.1875 | 2 | [] | no_license | package br.una.laboratorio.sgate.controller;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframewo... |
Java | UTF-8 | 3,588 | 2.75 | 3 | [
"LicenseRef-scancode-commercial-license",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown",
"LGPL-3.0-only",
"GPL-3.0-only"
] | permissive | /*
* Copyright (c) 2010-2021 Haifeng Li. All rights reserved.
*
* Smile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Smi... |
PHP | UTF-8 | 508 | 3.203125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: KAB1VX2
* Date: 24/11/2017
* Time: 16:19
*/
class Calculator
{
public static function addition($a,$b){
return $a+$b;
}
public static function soustraction($a,$b){
return $a-$b;
}
public static function multiplication($a,$b){
ret... |
Python | UTF-8 | 2,628 | 3.875 | 4 | [] | no_license | #!/usr/bin/python
#coding:utf-8
# // 面试题34:二叉树中和为某一值的路径
# // 题目:输入一棵二叉树和一个整数,打印出二叉树中结点值的和为输入整数的所
# // 有路径。从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 层次遍历
def levelOrder(self, root):
... |
C++ | UTF-8 | 819 | 2.921875 | 3 | [] | no_license | //
// main.cpp
// Lab8
//
// Created by Георгий Круглов on 11.02.2021.
//
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;
int main(int argc, const char * argv[]) {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
int n;
cin >> n;
... |
Shell | UTF-8 | 1,098 | 2.625 | 3 | [] | no_license | #!/bin/bash
s1=cow;s2=dog;
echo ${s1}_${s2}
cat result_${s1}_${s2}.txt | awk '{sum+=$4} END {print "avg = ", sum/NR}'
s1=cow;s2=human;
echo ${s1}_${s2}
cat result_${s1}_${s2}.txt | awk '{sum+=$4} END {print "avg = ", sum/NR}'
s1=cow;s2=mouse;
echo ${s1}_${s2}
cat result_${s1}_${s2}.txt | awk '{sum+=$4} END {print "a... |
C# | UTF-8 | 1,019 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using LeaderboardAPI.Models;
using LeaderboardAPI.Database;
namespace LeaderboardAPI.Repositories
{
public class ScoreRepository : IScoreRepository
{
private readonly LeaderAPIDbContext _LeaderAPIDbContex... |
Java | UTF-8 | 3,122 | 2.0625 | 2 | [] | no_license | package com.example.myapplication.Models;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.example.myapplication.R;
public class Config... |
PHP | UTF-8 | 10,017 | 2.59375 | 3 | [] | no_license | <?php
/**
* The kevindeviceModel
*
* @copyright Kevin
* @author kevin<3301647@qq.com>
* @package kevindevice
*/
?>
<?php
class kevindeviceModel extends model {
/**
* Create a user.
*
* @access public
* @return void
*/
public function devcreate() {
$device = fix... |
PHP | UTF-8 | 4,134 | 2.609375 | 3 | [] | no_license | <?php
if(isset($_GET['p_id'])){
$edit_post_id = $_GET['p_id'];
// Show posts from database
$edit_post_query = "SELECT * FROM posts WHERE post_id = $edit_post_id ";
$edit_query_result = mysqli_query($connection,$edit_post_query);
while($row = mysqli_fetch_assoc($edit_query_result)){
$edit_title = $row['post_t... |
Shell | UTF-8 | 53,657 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
# -*- shell-script -*-
# Copyright (C) 2008-2013 Bob Hepple
# 2014 StudioEtrange
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Lic... |
C++ | UTF-8 | 767 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main(){
std::vector<int> v;
std::set<int> s;
std::list<int> l;
std::map<string,int> m;
v.push_back(5);
v.push_back(10);
v.push_back(15);
for(vector<int>::iterator it = v.beg... |
Shell | UTF-8 | 3,237 | 3.34375 | 3 | [] | no_license | #-------------------------
# Bash shopts.
#-------------------------
shopt -s histappend # appends to the history instead of overwriting it.
shopt -s cmdhist # bash attemps to save multiple line commands in one history entry.
shopt -s lithist # save multi-line commands using \n instead of ,
#shopt -s no_empty_cmd_compl... |
Python | UTF-8 | 410 | 3.46875 | 3 | [
"MIT"
] | permissive | import random
sayi = random.randint(1 , 99)
tahmin = 0
say = 0
while tahmin != sayi and tahmin != "exit":
tahmin = input("tahmin et?")
if tahmin == "exit":
break
guess = int(tahmin)
say += 1
if guess < sayi:
print("cok dusuk!")
elif guess > sayi:
pr... |
C | ISO-8859-1 | 635 | 3.609375 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include<ctype.h>
#include<locale.h>
#include<math.h>
int main()
{
setlocale(LC_ALL,"Portuguese");
int A, B, C, D, S, P;
A = B = C = D = S = P = 0;
printf("\nDigite o primeiro valor: \n>>> ");
scanf("%i", &A);
printf("\nDigite o segundo valor: \n>>> ");
scanf("%i", &B);
prin... |
Java | UTF-8 | 5,561 | 1.796875 | 2 | [] | no_license | //Auto Generated
package com.kootour.mapper.entity;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import com.kootour.common.BaseEntity;
public class ScheduleOptionEntity extends BaseEntity{
private String langId;
private String scheduleOptionIdentiNo;
private String... |
Java | UTF-8 | 964 | 2.828125 | 3 | [] | no_license | package Codechef;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
/**
* @author Aakansha Doshi
*
*/
public class SimpleEditor {
public static void main(String[] args) throws NumberFormatException, IOExce... |
Python | UTF-8 | 1,512 | 3.9375 | 4 | [] | no_license | Guardar = print ('Hola')
print (Guardar)
Guardar = round (14.2534897,2)
print (Guardar)
def linedesign (cantidad,simbolo):
print (simbolo*cantidad)
return None
linedesign (30,'#')
linedesign (10,'*')
linedesign (100,'🙃')
#----Muestre la lista ----#
def MostrarLista (ListaEntrada = []):
for elemento in ... |
SQL | UTF-8 | 2,014 | 3.015625 | 3 | [] | no_license | CREATE OR ALTER PROCEDURE TOTAIS_DMED
returns (
ra varchar(10),
razaosocial varchar(50),
vlr_mensal double precision,
valorrp1 double precision,
valor_total double precision,
valorr double precision,
pago double precision,
valorrps double precision,
valortre double precision,
fi... |
PHP | UTF-8 | 2,370 | 2.546875 | 3 | [] | no_license | <?php
// Damage Engine Copyright 2012-2015 Massive Damage, Inc.
//
// 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
//
// U... |
Java | UTF-8 | 5,265 | 2.421875 | 2 | [] | no_license | package CustomerServiceDepartmentworker;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import Users.LoginContol;
import client.ChatClient;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene... |
C# | UTF-8 | 1,827 | 3.453125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace mdfinder
{
public static class Extensions
{
/// <summary> Enumerates <paramref name="items"/> into bins of size <paramref name="binSize"/>. </summary>
/// <typeparam na... |
Python | UTF-8 | 1,305 | 3.359375 | 3 | [] | no_license | import base64
from Crypto.Cipher import AES
from Crypto import Random
#stackoverflow.com/questions/12524994/encrypt-decrypt-using-pycrypto-aes-256
#stackoverflow.com/questions/12562021/aes-decryption-padding-with-pkcs5-python
BS = AES.block_size
_pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
_unpad =... |
Java | UTF-8 | 858 | 2.359375 | 2 | [] | no_license | package com.gd.zhenghy.bean;
/**
* Created by zhenghy on 2016/7/14.
*/
public class MenuList {
private String title;
private int drawableId;
private int highlighter;
public MenuList() {
}
public MenuList(String title, int drawableId, int highlighter) {
this.title = title;
th... |
Markdown | UTF-8 | 3,753 | 2.875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | ---
title: Converting Spreadsheet Dates to Javascript
description: "Learn how to convert the {{ site.product }} Spreadsheet date column values from an Excel format to JavaScript."
type: how-to
page_title: Convert {{ site.product }} Spreadsheet Dates From MS Excel Date Format to JavaScript Date
slug: spreadsheet-dates-... |
Java | UTF-8 | 361 | 3.171875 | 3 | [] | no_license | package demo1;
import java.util.Scanner;
public class Findingfactors {
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("enter the number to find the factor\n");
int no = in.nextInt();
for(int i=1;i<=no;i++)
{
if(no%i==0)
S... |
Java | UTF-8 | 4,216 | 2.953125 | 3 | [] | no_license | package apitests;
import io.restassured.http.ContentType;
import io.restassured.path.json.JsonPath;
import io.restassured.response.Response;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import static io.restassured.RestAssured.baseURI;
import static io.restassured.RestAssured.given;... |
Python | UTF-8 | 1,486 | 2.578125 | 3 | [] | no_license | from django import template
from django.conf import settings
import os.path
register = template.Library()
@register.filter(name='split')
def split(value, key):
"""
Returns the value turned into a list.
"""
return value.split(key)
@register.filter(name='color')
def color(value):
tipo = value... |
JavaScript | UTF-8 | 1,117 | 2.96875 | 3 | [
"ISC"
] | permissive | "use strict";
var test = require("tape");
var mapDom = require("./");
var testContents = "<div data-foo='bar'>" +
"<div data-index='1' data-cats-are='cool'></div>" +
"<div data-index='2' data-cats-are='cool'></div>" +
"<div data-index='3' data-cats-are='cool'>Text is ignored! :D</div>" +
"<div data-index='4' data-... |
C# | UTF-8 | 2,685 | 3.453125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assignment_2
{
class Account
{
private int accountNumber = 1;
private static int myaccountnumber;
private string accountName;
private Double balance;
... |
C# | UTF-8 | 2,050 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace 建造者模式
{
public class ResourcePoolConfig
{
private String name;
public int maxTotal;
private int maxIdle;
private int minIdle;
public string Message { get; set; }
private ResourcePool... |
Python | UTF-8 | 935 | 3.0625 | 3 | [] | no_license | from PIL import Image, ImageFilter
import tkinter as tk
image = Image.open('atat.jpg')
image = image.filter(ImageFilter.FIND_EDGES)
image.save('new_name.png')
image = image.convert('1')
image.save('new_name2.png')
pixels = image.load()
width, height = image.size
all_pixels = []
coords = []
for x in range(width):
... |
SQL | WINDOWS-1250 | 1,418 | 2.90625 | 3 | [] | no_license | --------------------------------------------------------
-- DDL for Trigger TRG_HIS_PRODHERENCIA_COLECT
--------------------------------------------------------
CREATE OR REPLACE EDITIONABLE TRIGGER "AXIS"."TRG_HIS_PRODHERENCIA_COLECT"
BEFORE UPDATE OR DELETE
ON PRODHERENCIA_COLECT
FOR EACH ROW
DECLARE... |
JavaScript | UTF-8 | 549 | 2.65625 | 3 | [] | no_license | import World from "../world"
export default class HarshWorld {
constructor() {
this.world = new World(200, 100);
this.world.setRules((cell, neighborCount) => {
if (cell.alive) return neighborCount === 2 || neighborCount === 3;
else return neighborCount === 3;
});
... |
Java | UTF-8 | 3,283 | 1.882813 | 2 | [
"BSD-2-Clause"
] | permissive | package com.shinobicontrols.charts;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.MotionEvent;
import android.view.View.MeasureSpec;
import android.view.ViewGroup;
import com.shinobicontrols.charts.Annotation.Po... |
Go | UTF-8 | 387 | 3.515625 | 4 | [] | no_license | package main
import (
"bytes"
"fmt"
)
func main() {
fmt.Println(comma("100"))
}
func comma(s string) string {
sl := len(s)
if sl < 4 {
return s
}
var buf bytes.Buffer
buf.WriteString(s[:sl%3])
for i, c := range s[sl%3:] {
if i%3 == 0 {
buf.WriteString(",")
}
buf.WriteRune(c)
}
ret := buf.Stri... |
Java | UTF-8 | 6,615 | 1.71875 | 2 | [] | no_license | package com.acerosocotlan.entregasacerosocotlan.controlador;
import android.Manifest;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content... |
PHP | UTF-8 | 1,786 | 2.578125 | 3 | [] | no_license |
<html>
<head>
<title>data show</title>
<link rel="stylesheet" href="css/bootstrap.css"/>
</head>
<body>
<?php
include ('connection.php');
session_start();
if (isset($_POST['login'])) {
$email = $_POST['email'];
$password = $_POST['password'];
//$pass = md5($password);
/... |
JavaScript | UTF-8 | 2,623 | 2.734375 | 3 | [] | no_license | var mdns = require('mdns'),
util = require('util'),
EventEmitter = require('events').EventEmitter,
airAPI = require("./");
/**
* Returns a new AirLocator that is looking up for ZeptreonAir Devices (Airs) with help of mDNS on the Network and start scanning
* The AirLocator sents the following events:
* @... |
C# | UTF-8 | 2,707 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CSH_projekt
{
public partial class Form1 : Form
{
double zoomFactor = 1.5... |
Go | UTF-8 | 1,205 | 3.453125 | 3 | [] | no_license | package main
import "fmt"
func profitPairs(sp []int32, target int32) (total int) {
var pos int
var pairs [][]int32
for {
if pos == len(sp) {
// looped over every element in the array
// exit
break
}
var i, j int
var paired bool
Loop:
for i = pos; i < len(sp); i++ {
for j = i + 1; j < len(sp)... |
Python | UTF-8 | 1,222 | 2.546875 | 3 | [] | no_license | #%%
from sklearn.model_selection import train_test_split
import torch.utils.data as data
import torchvision
from torchvision import transforms
from PIL import Image
class Dataset(data.Dataset):
def __init__(self):
super().__init__()
transform = transforms.Compose([
transforms.Resize((2... |
C++ | UTF-8 | 3,513 | 3.109375 | 3 | [] | no_license | #ifndef PLAYER_PROCESSHITCONTROL_HPP
#define PLAYER_PROCESSHITCONTROL_HPP
#include "rtos.hpp"
#include "ADTs.hpp"
#include "IRunGameTask.hpp"
#include "Entities.hpp"
#include "DisplayControl.hpp"
#include "TransferData.hpp"
/// @file
/// \brief
/// Task for Registering Hits from other players
/// \details
/// the fun... |
Python | UTF-8 | 2,116 | 2.703125 | 3 | [] | no_license | #This was mostly a lot of testing.
#This wasn't used in production
#import busio
#import adafruit_amg88xx
#import board
import time
import socket
import matplotlib.pyplot as plt
import numpy as np
import random
import queue
#queues
#from dataclasses import dataclass, field
#from typing import Any
mAvgCreated = ... |
C++ | UTF-8 | 487 | 3.34375 | 3 | [] | no_license | /**
* class Tree {
* public:
* int val;
* Tree *left;
* Tree *right;
* };
*/
bool solver(Tree* root, int d, int &rd)
{
if (!root) return true;
if (!root->left && !root->right)
{
if (rd == -1)
rd = d;
else
{
if (d != rd)
return false;
}
ret... |
Java | UTF-8 | 1,737 | 2.359375 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package citbyui.cit210.hangman.miscellaneous;
/**
*
* @author Calvin
*/
public class HangmanGallows {
public static final String Gallows1 =
"\n\t\t |"
+ "\n\t\t |";
... |
Python | UTF-8 | 520 | 4.34375 | 4 | [] | no_license | # A série de Fibonacci é formada pela seqüência 0,1,1,2,3,5,8,13,21,34,55,... Faça um programa que gere a série até que
# o valor seja maior que 500.
termo = 1
f1= f2 = 0
while termo <= 610: # O laço está até 610 porque é o proximo número depois de 500 na sequencia de Fibonacci.
if termo == 610:
pri... |
Python | UTF-8 | 349 | 3.421875 | 3 | [] | no_license | #Grasshopper - Grade Book
#https://www.codewars.com/kata/55cbd4ba903825f7970000f5
def get_grade(s1, s2, s3):
mean = (s1+s2+s3)/3
if 100>=mean and mean>=90:
return 'A'
elif 90>mean and mean>=80:
return 'B'
elif 80>mean and mean>=70:
return 'C'
elif 70>mean and mean>=60:
... |
Python | UTF-8 | 10,085 | 3.015625 | 3 | [] | no_license | import numpy as np
import math
import pickle
class Connect4:
def __init__(self, width=7, height=6, player1='player1', player2='player2'):
self.__board = np.full((height, width), None)
self.__pos = width * [height - 1] # list of next available move in each column
self.__player1 = player1
... |
Shell | UTF-8 | 505 | 3.890625 | 4 | [] | no_license | #!/bin/bash
if [ "$#" -ne 1 ] ; then
echo "Please supply the domain name: $0 flamingcowpie.net"
exit -1
fi
DOMAIN=$1
CRT=$DOMAIN.crt
KEY=$DOMAIN.key
PFX="$DOMAIN".pfx
if [ ! -f $CRT ] ; then
echo "No $CRT found, have you actually copied-in the certificates you were issued?"
exit -1
fi
if [ ! -f $KEY ] ; then
e... |
Python | UTF-8 | 581 | 4.53125 | 5 | [] | no_license | #Exercício 35 – Analisando Triângulo v1.0
#Desenvolva um programa que leia o comprimento de três retas
#e diga ao usuário se elas podem ou não formar um triângulo.
print('Analisador de triângulos: ')
reta1 = float(input('Digite a 1° reta: '))
reta2 = float(input('Digite a 2° reta: '))
reta3 = float(input('Digite a 3°... |
Java | UTF-8 | 1,424 | 3.1875 | 3 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.GeneticProgramming.gp.symbolic.example;
/**
*
* @author Anna Dina
*/
import com.Genetic.gp.symbolic.ExpressionFitness;
import com.GeneticProgramming.gp.symbolic.interpreter.Context;
import com.GeneticProg... |
Rust | UTF-8 | 1,484 | 3.03125 | 3 | [] | no_license | use std::io::{Error as IoError, ErrorKind};
use std::string::ToString;
use futures::{Async, Poll};
use futures::future::Future;
use super::entity::{Todo, TodoStatus};
pub enum TodoRepository {
Error,
Create(Todo),
Read(usize),
Update(Todo),
Delete(usize)
}
impl Future for TodoRepository {
ty... |
Markdown | UTF-8 | 7,608 | 2.671875 | 3 | [
"MIT"
] | permissive | ---
title: "My Unrequited Love for Isolate Scope"
authors: johnnyreilly
tags: [Directives, TypeScript, javascript, UI Bootstrap, Isolated Scope, AngularJS]
hide_table_of_contents: false
---
[I wrote a little while ago about creating a directive to present server errors on the screen in an Angular application](http://ic... |
Swift | UTF-8 | 574 | 2.71875 | 3 | [] | no_license | //
// Course.swift
// DeepProProd
//
// Created by Mushtaque Ahmed on 1/23/18.
// Copyright © 2018 Mushtaque Ahmed. All rights reserved.
//
import Foundation
enum LevelNames : String, Codable {
case Basic
case Intermediate
case Advanced
// ...
}
struct LevelList: Codable {
struct Levels:... |
Java | UTF-8 | 3,144 | 2.09375 | 2 | [] | no_license | package com.yanpeng.website.service.manager.menu;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Criterion;
import org.hibernate.crit... |
Python | UTF-8 | 74 | 3.09375 | 3 | [] | no_license | n = int(raw_input())
if n == 1: print 2
elif n < 3: print 1
else: print 0
|
Python | UTF-8 | 33 | 2.796875 | 3 | [] | no_license | a=int("enter number")
print(a*a)
|
C++ | UTF-8 | 4,050 | 2.75 | 3 | [] | no_license | #pragma once
#include "Collidable.h"
#include "CollidableGroupBase.h"
#include <set>
#include <iostream>
#include "Visualizer.h"
template< typename C>
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> A Template Class that generates all the Collidable Gr... |
C# | UTF-8 | 1,108 | 2.703125 | 3 | [] | no_license | // <copyright file="Program.cs" company="ALCPU">
// Copyright (c) 2010 All Right Reserved
// </copyright>
// <author>Arthur Liberman</author>
// <email>Arthur_Liberman@hotmail.com</email>
// <date>04-14-2010</date>
// <summary>Holds the entry point function.</summary>
namespace SolutionConverter
{
using System;
... |
Java | UTF-8 | 944 | 2.578125 | 3 | [] | no_license | package com.aitorgonzalez.challenge.service;
import java.util.List;
import java.util.Optional;
import org.springframework.messaging.Message;
import com.aitorgonzalez.challenge.vo.PokemonVO;
import me.sargunvohra.lib.pokekotlin.model.Pokemon;
/**
* Service to manage Pokemons.
*
* @author aitor
*/
public interf... |
PHP | UTF-8 | 11,797 | 2.84375 | 3 | [] | no_license | <html>
<head>
<!-- 1er test -->
<meta charset="utf-8" />
<title>Dictionnaire Francais/tiếng Việt</title>
<link rel="stylesheet" href="includes/style.css" />
</head>
<body>
<?php $current = "bd"; session_start(); include("includes/menu.php"); $mot=''; ?>
... |
Java | UTF-8 | 2,823 | 2.671875 | 3 | [] | no_license | package com.test.demo.service;
import com.test.demo.entity.Stock;
import com.test.demo.repository.StockRepository;
import org.hibernate.StaleStateException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.a... |
JavaScript | UTF-8 | 187 | 2.578125 | 3 | [] | no_license | const toggle = document.querySelector('.toggler');
const collapse = document.querySelector('.nav-collapse');
toggle.addEventListener('click', ()=>{
collapse.classList.toggle('show')
}); |
C++ | UTF-8 | 813 | 3.140625 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode() : val(0), next(nullptr) {}
* ListNode(int x) : val(x), next(nullptr) {}
* ListNode(int x, ListNode *next) : val(x), next(next) {}
* };
*/
class Solution {
public:
ListNode* addTwoNumbe... |
Java | UTF-8 | 1,057 | 3.25 | 3 | [] | no_license | package ru.examples.fileIOExample;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
public class FileExampleNIO {
public static void main(String[] args) throws IOException {
StringBuilder data = new StringBuilder();
Ran... |
Python | UTF-8 | 547 | 2.796875 | 3 | [] | no_license | from matplotlib import pyplot as plt
import numpy as np
import argparse
import cv2
# fetching the arguments and save in dictionary
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required = True, help = "Enter path to the image")
args = vars(ap.parse_args())
# loading and converting the image into num... |
Python | UTF-8 | 778 | 3.390625 | 3 | [] | no_license | from typing import List, Tuple, TypeVar
T = TypeVar('T', int, float, str)
def min_max(array: List[T]) -> Tuple[int, int]:
isOdd: bool = len(array) % 2
min_el = float('inf')
max_el = -float('inf')
if isOdd:
min_el = array[0]
max_el = array[0]
else:
if array[0] < array[1]:
min_el = array... |
Java | UTF-8 | 1,523 | 2.5625 | 3 | [] | no_license | package com.mydomain.employeecontrol.api.repositories;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.Sprin... |
Swift | UTF-8 | 1,525 | 2.828125 | 3 | [] | no_license | //
// CurrencyService.swift
// Forex
//
// Created by Subedi, Rikesh on 14/01/21.
//
import SwiftUI
import Combine
protocol Service {
associatedtype T:Codable
var baseURL: URL {get}
var path: String {get}
var parameters: [String:Any] {get}
var headers: [String: Any]? {get}
}
extension Service {... |
C++ | UTF-8 | 878 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};
class Solution {
private:
vector<vector<int>> vec;
vector<int> mv;
public:
vector<vector<int> > FindPath(Tre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.