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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 2,333 | 2.84375 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint = Matter.Constraint;
var mango1,mango2,mango3,mango4,mango5,mango6,mango7,mango8,mango9,mango10;
var ground1;
var tree1;
var boy;
var elasticBand;
var stone1;
function preload()
{
boyI... |
Python | UTF-8 | 3,043 | 2.734375 | 3 | [
"MIT"
] | permissive | """Visualise a generated SMAL type model, producing animations of changing key parameters"""
from smbld_model.config import SMPL_DATA_PATH, SMPL_MODEL_PATH, NEW_MODEL_PATH, NEW_DATA_PATH
from smbld_model.smbld_mesh import SMBLDMesh
import numpy as np
import torch
from matplotlib import pyplot as plt
from vis import p... |
Java | UTF-8 | 179 | 1.507813 | 2 | [] | no_license | package lt.vu.restapi.contracts;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class ForestDto {
private String name;
private String licenceType;
}
|
TypeScript | UTF-8 | 7,278 | 2.609375 | 3 | [
"MIT"
] | permissive | import { Constants } from '../constants';
import { Column } from '../interfaces/column.interface';
import { SharedService } from '../services/shared.service';
import { TranslaterService } from '../services';
import { getTranslationPrefix } from '../services/utilities';
import { Locale } from '../interfaces/locale.inter... |
PHP | UTF-8 | 3,323 | 3.21875 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<head>
<title>
Brian Fay Unit 4 Lab 2
</title>
<meta charset="utf-8">
<style type="text/css">
body{
margin-left: 10%;
font-family: Arial;
}
.description {
font-size: 12pt;
padding-right: 30%;
color: #000;
}
.phpOutput {
position: relative;
top: 0px;
left: 0p... |
C# | UTF-8 | 4,777 | 2.703125 | 3 | [] | no_license | using DataAccessLayer.Models;
using LogicLayer.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace UnitTests
{
[TestClass]
public class ProductTests
{
public TestContext TestContext { get; set; }
private static Test... |
Python | UTF-8 | 1,503 | 2.640625 | 3 | [
"MIT"
] | permissive | import copy, torch
import numpy as np
from deepq.memory import Memory
from deepq.utils import eps_greedy_action, preprocess
from deepq.wrapper_gym import SkipFrames
import gym
def play_atari(env_name, agent_history_length, Q, nb_episodes=10, eps=0.1):
'''
Input:
- environment (the environment is copied... |
Python | UTF-8 | 891 | 2.546875 | 3 | [] | no_license | from django.db import models
from django.contrib.auth.models import User
class Student(models.Model):
DISCIPLINES = (
('MINF', 'Medieninformatik'),
('WINF', 'Wirtschaftsinformatik'),
)
userid = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True, verbose_name="Benutzernam... |
C# | UTF-8 | 1,835 | 2.765625 | 3 | [] | no_license | using FluentAssertions;
using MyFish.Brain;
using MyFish.Brain.Moves;
using NUnit.Framework;
namespace MyFish.Tests.Primitives
{
[TestFixture]
public class PositionTests
{
[Test]
public void Invalid_position_member_is_not_valid()
{
Position.Invalid.IsValid.... |
Java | UTF-8 | 4,015 | 2.765625 | 3 | [] | no_license | package wise.semivariogram.fit;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.StringTokenizer;
public class SemivariogramFit {
//input from Semivariogram2D.java
private double[] semivar;
private double[] distance;
private double[] num;
priva... |
Shell | UTF-8 | 140 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/bin/bash
while true
do
read message
now=$(date +'[%F|%T]')
echo "$message -- $USER at $now" >> output.txt
done
|
C# | UTF-8 | 6,131 | 2.765625 | 3 | [] | no_license | using Microsoft.Extensions.Logging;
using Moq;
using System;
using System.Collections.Generic;
using System.Text;
using Xunit;
namespace pi1.Tests
{
public class RPNCalculatorTests
{
[Fact]
public void Tokenize_SingleOperation_SholdReturnThreeTokens()
{
//arrange
var calculator = new RPNCalculator()... |
Java | UTF-8 | 247 | 1.898438 | 2 | [] | no_license | package pl.sda.design.pattern.singleton;
import org.junit.Test;
/**
* Created by adam.
*/
public class FileSystemReaderTest {
@Test
public void testIfContentIsEmpty() {
FileSystemReader.INSTANCE.showDiskContent("d");
}
}
|
C | UTF-8 | 337 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n, i; // Size of the array
scanf("%d", &n);
int *a; // Label for the array
a = (int *) malloc(n*sizeof(int)); // Allocating memory for the array
for (i = 0; i < n; i++) // Taking array as input
scanf("%d", &a[i]);
printf("%d\n", find_max(n, a... |
C# | UTF-8 | 12,358 | 3.078125 | 3 | [
"MIT"
] | permissive | using System;
using System.Text;
using System.Security.Cryptography;
using System.IO;
using System.Text.RegularExpressions;
using System.Collections;
/// <summary>
/// MySecurity(安全类) 的摘要说明。
/// </summary>
public class MySecurity
{
/// <summary>
/// 初始化安全类
/// </summary>
public MySecurity()
{
///默认密码
key = "... |
Java | UTF-8 | 476 | 1.992188 | 2 | [] | no_license | package ems.v2.service;
import ems.v2.model.Attendance;
import ems.v2.model.Employee;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
public interface AttendanceService {
Map<String, String> addAttendance(Employee employee);
List<At... |
Python | UTF-8 | 3,136 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# MayCLabel.py
#
# Copyleft 2010 Informática al Alcance de Todos (CA)
#
# 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 Sof... |
Python | UTF-8 | 219 | 3.03125 | 3 | [] | no_license | # 딕셔너리 요소 삭제
a = {'name': 'Park ISeul', 'sex': 'female', 'position': 'student'}
print('a = ', a)
print("a.pop('position') = ", a.pop('position'))
print('a = ', a)
del a['name']
print("del a['name'] = ", a) |
Go | UTF-8 | 3,325 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | package server
import (
"net/http"
"plateau/store"
"sync"
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
)
// ServerName is the server name.
const ServerName = "plateau"
// Server is basically the *plateau* runtime.
type Server struct {
game Game
matchRuntimesMux sync.Mutex
matchRuntimes map[str... |
Java | UTF-8 | 1,022 | 2.96875 | 3 | [] | no_license | package com.plf.tool.common.normal;
import cn.hutool.core.collection.CollectionUtil;
import java.util.ArrayList;
import java.util.List;
/**
* 分割数组的工具类
*/
public class SpliceArrayList<T> {
/**
* 分割数组
* @param list 需要分割的列表
* @param num 分成多少列
* @return
*/
public static <T> List<List<... |
JavaScript | UTF-8 | 2,826 | 2.703125 | 3 | [] | no_license | import React from "react"
import moment from "moment"
import "./index.css"
export default class Event extends React.Component {
constructor(props) {
super(props)
this.state = {
eventInfo: {},
reply: "",
message: "",
show: false
}
}
componentDidMount() {
const { eventId }... |
Java | UTF-8 | 1,295 | 2.84375 | 3 | [] | no_license | package persistencia;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.ArrayList;
import modelo.IFacturacionDeVentas;
import modelo.Venta;
public class EnMemoriaIFacturacionDeVentas implements IFacturacionDeVentas {
private ArrayList<Venta> ventas = new ArrayList<Venta>();
@Override
... |
PHP | UTF-8 | 3,797 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | <?php
$file = $argv[1];
$json = [];
if (is_file($file)) {
$content = file_get_contents($file);
$tokens = token_get_all($content);
// Copied from phpcpd
$tokensIgnoreList = [
T_INLINE_HTML => true,
T_COMMENT => true,
T_DOC_COMMENT => true,
T_OPE... |
C# | UTF-8 | 3,432 | 2.765625 | 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.Threading.Tasks;
using System.Windows.Forms;
namespace Client
{
public partial class Login : Form
{
UserService userService = new Us... |
Java | UTF-8 | 1,954 | 2.28125 | 2 | [] | no_license | package com.itemconfiguration.export.bilder.block.itemfieldconfig;
import com.itemconfiguration.domain.Item;
import com.itemconfiguration.domain.ItemFieldConfig;
import com.itemconfiguration.domain.wrapper.ItemWithFieldsMap;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.... |
Markdown | UTF-8 | 14,882 | 3.328125 | 3 | [] | no_license | ---
title: K近邻法(KNN)原理小结
date: 2017-10-18 14:00:16
tags:
- KNN
---
K近邻法(k-nearst neighbors,KNN)是一种很基本的机器学习方法了,在我们平常的生活中也会不自主的应用。比如,我们判断一个人的人品,只需要观察他来往最密切的几个人的人品好坏就可以得出了。这里就运用了KNN的思想。KNN方法既可以做分类,也可以做回归,这点和决策树算法相同。
KNN做回归和分类的主要区别在于最后做预测时候的决策方式不同。KNN做分类预测时,一般是选择多数表决法,即训练集里和预测的样本特征最近的K个样本,预测为里面有最多类别数的类别。而KNN做回归时,一般是选择... |
Markdown | UTF-8 | 1,033 | 2.734375 | 3 | [] | no_license | ## Assignment 3- GO Implementation of RAFT's Leader Election, Log Replication and Safety Property <br/>
### Description
This is a Go implementation of the 3 major components of Raft distributed consensus protocol. Raft is a protocol by which a cluster of nodes can maintain a replicated state machine. The state machin... |
C# | UTF-8 | 578 | 2.875 | 3 | [] | no_license | using System;
namespace mcontrol
{
public class MComboboxItem
{
private string m_Display;
private object m_Value;
public MComboboxItem(string mDisplay, object mValue)
{
m_Display = mDisplay;
m_Value = mValue;
}
public string MDisplay
... |
TypeScript | UTF-8 | 2,064 | 2.5625 | 3 | [] | no_license | import { Test, TestingModule } from '@nestjs/testing';
import { TemplatesService } from './templates.service';
import { getRepositoryToken } from '@nestjs/typeorm';
import { Template } from './template.entity';
import { CreateTemplateDto } from './create-template.dto';
const mockTemplateRepository = {
find: jest.fn(... |
Markdown | UTF-8 | 808 | 2.5625 | 3 | [] | no_license | ## QLD AI NLP Fundamnetals
### 1.0 Overview
Slides, notebooks and a down-sampled datatset from the QLD AI NLP Fundamentals workshop (21.11.19).
#### 1.1 Up and Running
Clone repo and install dependencies via:
* `pip install -r requirements.txt`
Additionally, also install the spacy medium model via:
* `python -m spac... |
Python | UTF-8 | 548 | 2.875 | 3 | [] | no_license | #!/usr/bin/python3
#coding:utf-8
from socket import *
from threading import Thread
def single(c):
while True:
message = input("input a message for sending:")
if message == 'q':
break
else:
c.send(message.encode("utf-8"))
result = c.recv(1024)
print("re... |
Shell | UTF-8 | 421 | 3.578125 | 4 | [
"MIT"
] | permissive | #!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
for filepath in $(find $DIR -maxdepth 1 -name '*.kaos'); do
filename=$(basename $filepath)
testname="${filename%.*}"
rm "$DIR/$testname.out"
chaos "tests/$filename" > "$DIR/$testname.out"
echo "Updated: ${testname... |
C++ | UTF-8 | 667 | 3.484375 | 3 | [] | no_license | #include <array>
#include <memory>
#include <iostream>
class Base
{
public:
virtual void Print(void)
{
std::cout << "base" << std::endl;
}
int b;
};
class Derived
: public Base
{
public:
void Print(void) override
{
std::cout << "derived" << std::endl;
}
int d;
};
int main()
{
... |
Markdown | UTF-8 | 2,420 | 2.53125 | 3 | [
"MIT"
] | permissive | # Smart template export
## Description
1. It is a custom action that takes an XML based template file as input and generates formatted output file as dictated by the template
2. Refer to the documentation folder for sample templates and for template documentation - Release/DataCapSmartExport_v1.0.docx
## Build and ... |
Python | UTF-8 | 1,923 | 2.953125 | 3 | [] | no_license | from DBResponse import Response
class ERROR(Response):
def __init__(self, text = "No extra information given"):
self.internal = {
"type" : "ERROR",
"errorText": text
}
def __str__(self):
return "Error: " + self.internal["errorText"]
# ----------------------... |
Java | UTF-8 | 338 | 3.0625 | 3 | [
"MIT"
] | permissive | package jun.prospring5.ch3;
public class MessageProviderText implements MessageProvider {
private String message;
public MessageProviderText(String message, int number) {
this.message = Integer.toString(number) + "." + message;
}
@Override
public String getMessage() {
return this... |
JavaScript | UTF-8 | 2,926 | 2.75 | 3 | [] | no_license | import React from 'react';
import EventRow from '../../components/eventrow/eventrow';
import './dashboard.scss';
export default class Dashboard extends React.Component {
state = {
filteredEvents: this.props.events
};
//to make sure the filtered events are up to date with state in app.
componentDidUpdat... |
Python | UTF-8 | 3,272 | 2.875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
#usr/bin/python
import os
import copy
import cv2
import serial
import numpy as np
# constantes
ID_PORTA = "COM8" # numero porta COM do arduino.
ID_CAMERA = 0 #-1 qualquer camera
QUANT_COLUNAS = 640
QUANT_LINHAS = 480
QUANT_LIMIAR_PIXELS = 100
QUANT_FAIXAS_CORES = 3
# variavei... |
C# | UTF-8 | 2,478 | 2.5625 | 3 | [
"Unlicense"
] | permissive | using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
namespace Egzaminy.Models
{
// Możesz dodać dane profilu dla użytko... |
Python | UTF-8 | 991 | 4.4375 | 4 | [] | no_license | from typing import List
pets = ("dog", "cat", "rabbit", "fish", "salamander")
print(pets)
x = ("dog", 21, True)
print(x)
# ******************
# Indexing
print(pets[0])
print(pets[1])
print(pets[2])
# Range of Indexes
print(pets[1:2])
print(pets[:3])
print(pets[3:])
print(pets[-3:])
pr... |
C# | UTF-8 | 2,878 | 2.890625 | 3 | [] | no_license | using System;
namespace filtrsBMP
{
// delegate double[,] STRMOD();(*)
static class ChooseBMPclass
{//заполняем фильтры значениями
public static int n;
public static bool black;
public static bool bl;
public static int div;
public static double[,] fl;
stati... |
TypeScript | UTF-8 | 775 | 2.671875 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'Exercícios';
msg: string;
constructor() {
this.msg = 'Hello World!';
}
ngOnInit... |
TypeScript | UTF-8 | 1,220 | 2.828125 | 3 | [] | no_license | import { BooleanVerifier } from '../src/verifiers/boolean-verifier';
describe( 'Boolean', () => {
const booleanVerifier = new BooleanVerifier().verifyArgument;
it( 'parses booleans (true)', () => {
const result = booleanVerifier( '', true );
expect( result.valid ).toBe( true );
expect... |
Shell | UTF-8 | 541 | 2.671875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# Todo: Since i recently learned how to do it, make a docker-compose.yml out of it :D
echo "Kill existing Docker container"
docker stop terrastate-http \
&& docker rm terrastate-http
echo "Spin up new Docker container"
time docker build . -t terrastate-http \
&& docker run --detach \
--name terra... |
SQL | UTF-8 | 275 | 2.640625 | 3 | [] | no_license | CREATE DATABASE Login;
USE Login;
CREATE TABLE users (
id INT NOT NULL
name VARCHAR(255) NOT NULL
username VARCHAR(255) NOT NULL UNIQUE
email VARCHAR(255) NOT NULL UNIQUE
password VARCHAR(255) NOT NULL
PRIMARY KEY(id)
)
|
Java | UTF-8 | 301 | 1.960938 | 2 | [] | no_license | package com.example.shixi.dao;
import com.example.shixi.bean.People;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;
@Mapper
public interface PeopleDao {
@Select("select * from people")
public List<People> findAllPeople();
}
|
Java | UTF-8 | 2,385 | 2.8125 | 3 | [] | no_license | package com.wip._1._4;
import static com.wip.Utils.defineInputMethod;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
/**
* This Class may not be most optimized a... |
Markdown | UTF-8 | 1,831 | 2.515625 | 3 | [
"MIT"
] | permissive | # FreshBooks
It is a bookstore implemented using Apache Tomcat. It relies on a MYSQL database in order to pull information about anything from users to books and display it in the webpage.
The project took us a good long while and a lot of work so we hope you enjoy the experience of FreshBooks.
## Getting Started
... |
Java | UTF-8 | 566 | 2.703125 | 3 | [] | no_license | package rate.retriever;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
public class FileReader {
public static String readEntireFile(final String filePath) {
byte[] encoded = new byte[0];
try {
encoded = Files.read... |
SQL | UTF-8 | 396 | 3.359375 | 3 | [] | no_license | SELECT DISTINCT
cname,
legnum,
sname
FROM sponsors
JOIN affected_by USING(legnum)
JOIN contributes USING(sname, cname)
JOIN senators USING(sname)
JOIN corporations USING(cname)
WHERE
howafctd='Favorably'
AND corporations.stname != senators.stname
AND pa... |
C | UTF-8 | 849 | 2.90625 | 3 | [] | no_license | /*
* testjit.c
*
* Created on: Jul 9, 2013
* Author: PROGMAN
*/
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
#define FUNC_SIZE 0x40
typedef void (*FuncType)(void);
void test(void)
{
while(1)
{}
printf("th... |
SQL | UTF-8 | 2,617 | 2.671875 | 3 | [] | no_license | ALTER TABLE `users`
CHANGE `user_name` `user_name` VARCHAR(100) DEFAULT '',
CHANGE `user_company` `user_company` VARCHAR(100) DEFAULT '',
CHANGE `user_address_1` `user_address_1` VARCHAR(100) DEFAULT '',
CHANGE `user_address_2` `user_address_2` VARCHAR(100) DEFAULT '',
CHANGE `user_city` `user_city` VARCHAR(45) DE... |
Java | UTF-8 | 1,996 | 2.296875 | 2 | [] | no_license | package models;
import android.graphics.Bitmap;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
/**
* Created by LeeSan on 3/27/2016.
*/
public class PostItemModel implements Serializable {
private String _title;
private String _userName;
private Date _postDate;
priv... |
Markdown | UTF-8 | 3,135 | 3.109375 | 3 | [] | no_license | ---
layout: index
priority: 5
title: ChatbotTech's guide to choosing a chatbot building tool
image: /img/guide.png
summary: "Choosing a tool to build your chatbot can be tricky. We've chosen five
of the best and created a special infographic to help you find a
starting point in your search for the tool that's right for... |
JavaScript | UTF-8 | 1,909 | 2.671875 | 3 | [] | no_license |
import * as actionTypes from '../../../constants/action-types';
const initialState = {
restaurantDetails: null,
restaurantImages:[],
menuDetails: null,
reviewDetails:null,
mode: false,
save: false,
imagemode:false,
menumode:false,
reviewmode:false,
}
const restuarantReducer = (s... |
PHP | UTF-8 | 358 | 2.578125 | 3 | [] | no_license | <?php
namespace MolnApps\Testing\Form;
class Checkbox extends AbstractFormElement
{
public function setValue($value)
{
$value = $value ? 'checked' : null;
$this->domElement->setAttribute('checked', $value);
}
public function getValue()
{
return ($this->domElement->getAttribute('checked')) ? $this->domEle... |
JavaScript | UTF-8 | 1,694 | 2.71875 | 3 | [] | no_license | jQuery(document).ready(function ($) {
var stop = false;
var width = $(window).width();
var height = $(window).height();
var interval = 1600;
var startw = 0;
var delay = 0;
var fadeTime = 0;
var b=0;
//Flakes swing animation
function swing(defaultWidth, element) {
for(var... |
Python | UTF-8 | 2,013 | 3.078125 | 3 | [] | no_license | from PyQt5.QtWidgets import QLineEdit, QApplication, QPushButton, QLabel, QDialog, QGroupBox, QHBoxLayout, QVBoxLayout, QGridLayout, QCheckBox
import sys
from PyQt5 import QtGui
from PyQt5.QtCore import QRect
from PyQt5 import QtCore
from PyQt5.QtGui import QPixmap
class Window(QDialog):
def __init__(self):
... |
Java | UTF-8 | 494 | 2.296875 | 2 | [] | no_license | package io.homework;
import static org.junit.Assert.*;
import java.io.IOException;
import org.junit.Test;
public class CountingProcessTest {
Votes vote;
@Test
public void checkAllInavalidVotes() throws IOException {
CountingProcess counting = new CountingProcess( vote);
assertEquals(0, counting.invalidVot... |
Markdown | UTF-8 | 637 | 2.59375 | 3 | [] | no_license | # Proyecto XML
¡Buenas! Este es mi proyecto sobre XML en el que trabajaremos con la información de un fichero XML. Mi fichero XML trata sobre videojuegos, donde podrás preguntar por el nombre del mismo,las diferentes tiendas en las que se vende, género ,etc.
1. Muestra el nombre de todos los videojuegos.
2. Muestra ... |
Java | UTF-8 | 1,702 | 2.046875 | 2 | [] | no_license | package com.tech.smal.turkaf;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.view.View;
import com.tech.smal.turkaf.data.QuestionDetails;
public class FactoryActivity extends AppCompatActivi... |
Python | UTF-8 | 9,244 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | import copy
from typing import Callable, ClassVar, List, Optional, TypeVar
from typing_extensions import TypedDict
from ..configuration_support import Step, Configuration
from ..lib.ci_exception import SilentAbortException, StepException, CriticalCiException
from ..lib.gravity import Dependency, Module
from .output im... |
Java | UTF-8 | 1,782 | 2.59375 | 3 | [] | no_license | package com.atet.api.utils;
import android.text.TextUtils;
/**
* @description: 加解密工具类
*
* @author: LiuQin
* @date: 2015年7月18日 下午3:11:43
*/
public class EncryptUtilsBak {
public static String PUBLICKEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC1qSc4idfWls43XQp+HkF4enRu1iDCD3YKfbmIbiD6j257RfxBA3PLVWppWWRLmv1M+... |
TypeScript | UTF-8 | 557 | 2.796875 | 3 | [] | no_license | import { DirectionType } from "../utils/DirectionType";
import { LaserBullet } from "./bullets/LaserBullet";
import { Weapon } from "./Weapon";
class SingleLaserWeapon extends Weapon {
constructor(scene: Phaser.Scene) {
super(scene, LaserBullet);
this.fireRate = 200;
}
public shoot(direct... |
C++ | GB18030 | 3,005 | 2.875 | 3 | [] | no_license | #include "stdio.h"
#include "math.h"
#include <iostream>
#include <time.h>
#define SUPPORT_SIZE 2 // ˹˲ڰ뾶
#define IM_WIDTH 1920 // ͼ
#define IM_HEIGHT 1080
// ˹ϵ
void calGaussCoef(double *pGaussCoef)
{
int i, j, k;
int wlen = (SUPPORT_SIZE<<1) + 1;
double sum = 0;
if(pGaussCoef)
{
for(i = -SUPPORT_SIZE... |
C | UTF-8 | 859 | 3.65625 | 4 | [] | no_license | //keyword,variable and data type--------
#include<stdio.h>
int main(){
//keyword,variable and data type--------
int num1=10;
float num2=30.23467890;
double num3=40.6678888968;
char num4='x';
printf("This number is %d\n %f\n %lf\n %c\n",num1,num2,num3,num4);
//iteger data type-----
in... |
C++ | UTF-8 | 1,260 | 2.671875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int reward[6][6] = {
{-1,-1,-1,-1,0,-1},
{-1,-1,-1,0,-1,100},
{-1,-1,-1,0,-1,-1},
{-1,0,0,-1,0,-1},
{0,-1,-1,0,-1,100},
{-1,0,-1,-1,0,100},
};
int q[6][6];
int old[6][6];
int Max(int s){
int max = 0;
for(int i=0; i<6; i++){... |
Shell | UTF-8 | 7,015 | 3.9375 | 4 | [] | no_license | #!/bin/sh
set -euf
host="sunfire.comp.nus.edu.sg"
default_printqueue="psc008-dx"
default_script="/usr/local/bin/socprint.sh"
usage() {
cat <<EOF
NAME
socprint.sh - POSIX™-compliant, zero-dependency shell script to print stuff in NUS SoC
REQUIREMENTS
POSIX™-compliant sh, a sunfire account, and connection to So... |
C# | UTF-8 | 1,416 | 2.859375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | #region using
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#endregion
namespace Xigadee
{
/// <summary>
/// This is the standard service implementation.
/// </summary>
public interface IService
{
... |
Java | UTF-8 | 379 | 2.75 | 3 | [] | no_license | package FridayClassDay08;
class B1{
B1(){
System.out.println("Parent' deafult constructor");
}
B1(int a){
}
}
public class super_practices2 extends B1 {
// child parent class
super_practices2(){
// super( 1000 ); // we have to call Reason: #12
}
public static vo... |
Java | UTF-8 | 4,651 | 2.703125 | 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 custombrowser;
import java.io.File;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuc... |
Python | UTF-8 | 300 | 3.203125 | 3 | [] | no_license | # 该方法用来确认元素是否存在,如果存在返回flag=true,否则返回false
def isElementExist(self, element):
flag = True
driver = self.driver
try:
driver.find_element_by_xpath(element)
return flag
except:
flag = False
return flag
|
C | UTF-8 | 393 | 3.125 | 3 | [] | no_license | #include<stdio.h>
#include <stdlib.h>
int main()
{
int n,x,y,xd=0,yd=0,base=1,rem,sum=0;
scanf("%d",&n);
scanf("%d %d",&x,&y);
while(x>0)
{
rem=x%10;
xd=xd+rem*base;
x=x/10;
base=base*n;
}
while(y>0)
{
rem=y%10;
yd=yd+rem*base;
y... |
Java | UTF-8 | 270 | 1.679688 | 2 | [] | no_license | package com.google.ads.internal;
import java.net.HttpURLConnection;
import java.net.URL;
final class C0268s implements C0267t {
C0268s() {
}
public final HttpURLConnection mo114a(URL url) {
return (HttpURLConnection) url.openConnection();
}
}
|
Java | UTF-8 | 1,616 | 2.609375 | 3 | [] | no_license | package com.brainstation.bank.demo.controllers;
import com.brainstation.bank.demo.utils.CustomPasswordGenerator;
import com.brainstation.bank.demo.utils.Email;
import com.brainstation.bank.demo.utils.UserAge;
import com.brainstation.bank.demo.models.User;
import com.brainstation.bank.demo.services.UserService;
import ... |
C++ | UTF-8 | 196 | 2.53125 | 3 | [] | no_license | #include "vector4.h"
Vector4::~Vector4(void)
{
}
Vector4 operator + (const Vector4& A ,const Vector4& B) {
return Vector4(A.v[0] + B.v[0], A.v[1] + B.v[1], A.v[2] + B.v[2], A.v[3] + B.v[3]);
}
|
Shell | UTF-8 | 3,296 | 3.1875 | 3 | [] | no_license | #/var/bin/bash
# Make sure only root can run our script
if [ "$(id -u)" != "0" ]; then
echo "This install script must be run as root" 1>&2
exit 1
fi
pushd /var/tmp/
echo "1. Download and install dependencies"
rm -rf gzip_1.10_iphoneos-arm.deb
rm -rf unrar_5.5.8_iphoneos-arm.deb
rm -rf bzip2_1.0.6-2_iphoneos-arm.deb
rm... |
PHP | UTF-8 | 3,232 | 2.71875 | 3 | [] | no_license | <?php
include('db.php');
if(isset($_POST['update']))
{
$id = $_POST['id'];
$name=$_POST['name'];
$address=$_POST['address'];
$phone_number=$_POST['phone_number'];
$email=$_POST['email'];
if(empty($id) || empty($name) || empty($address) || empty($phone_number) || empty($email)) {
echo "D... |
Java | UTF-8 | 6,096 | 2.625 | 3 | [] | no_license | import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Scanner;
public class WePayU {
private int day;
private int month;
private int weekday;
public void payMenu(Calendar calendar,Database database)
{
Scann... |
C++ | UTF-8 | 551 | 3.609375 | 4 | [] | no_license | /**
* Copyright(C), 2018
* Name: cycle_list
* Author: Wilson Lan
* Description:
* Given a linked list, determine if it has a cycle in it.
*/
class Solution {
public:
bool hasCycle(ListNode *head) {
ListNode *slow = head, *fast = head;
while (fast != nullptr && fast->... |
Markdown | UTF-8 | 2,018 | 3.328125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | ---
layout: post
title: "Mental health is important"
date: 2021-01-18 17:14:36 +0000
permalink: mental_health_is_important
---
Taking care of yourself mentally is really important especially in the times we are in now. I think that it is easy to push the way we are feeling off as something we can deal wit... |
Java | UTF-8 | 2,668 | 3.28125 | 3 | [] | no_license | package com.epam.konstantin.frolov.java.lesson1;
import com.epam.konstantin.frolov.java.lesson1.task1.DZ1;
import com.epam.konstantin.frolov.java.lesson1.task2.DZ2;
import com.epam.konstantin.frolov.java.lesson1.task3.DZ3;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
... |
C# | UTF-8 | 326 | 2.78125 | 3 | [] | no_license | namespace PokerHandCalculator
{
public class Card
{
public enum Suit
{
Clubs, Diamonds, Hearts, Spades
}
public enum Face
{
Two=2, Three=3, Four=4, Five=5, Six=6, Seven=7, Eight=8, Nine=9, Ten=10, Jack=11, Queen=12, King=13, Ace=14
}
... |
C | UTF-8 | 400 | 2.875 | 3 | [] | no_license | #include "ft_list.h"
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
t_list *list;
list = ft_create_elem("toto\t");
printf("%s",list->data);
printf("%d\n",ft_list_size(list));
ft_list_push_back(&list,"tutu\t");
printf("%s",list->data);
printf("%d\n",ft_list_size(list));
ft_list_push_back(&list,"tata\t"... |
C++ | UTF-8 | 4,308 | 3.21875 | 3 | [] | no_license | #include "prog1.h"
/***************************************************************************
* Function: cmdnm
*
* Description: Displays the command string (name) that started the process
* for a user-specified process ID
*
*************************************************************************... |
Markdown | UTF-8 | 4,001 | 2.640625 | 3 | [] | no_license | ---
description: "Simple Way to Prepare Speedy Pasta"
title: "Simple Way to Prepare Speedy Pasta"
slug: 2863-simple-way-to-prepare-speedy-pasta
date: 2020-10-25T05:05:54.592Z
image: https://img-global.cpcdn.com/recipes/3f1dc5ef9670eb3e/751x532cq70/pasta-recipe-main-photo.jpg
thumbnail: https://img-global.cpcdn.co... |
C++ | UTF-8 | 547 | 3.640625 | 4 | [] | no_license | //wap to create array 10 elements accept 10 no. from the user and store it in an array
//then accept a no. from the user to search in an array.(linear search)
#include<stdio.h>
int main()
{
int num[10];
int cnt,notosearch;
for(cnt=0;cnt<10;cnt++)
{
printf("\n Enter any number : ");
scanf("%d",&num[cnt]);
}
pr... |
Ruby | UTF-8 | 947 | 4.4375 | 4 | [] | no_license | =begin
Exercise 5: Majority Element
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
Given assumption:
1) the array is non-empty
2) the majority element always exist in the array ( size of array >2 )
# @param {Integer[]} nums
# @return {I... |
Java | UTF-8 | 1,323 | 1.617188 | 2 | [
"BSD-3-Clause"
] | permissive | // Part of Measurement Kit <https://measurement-kit.github.io/>.
// Measurement Kit is free software under the BSD license. See AUTHORS
// and LICENSE for more information on the copying conditions.
package io.ooni.libndt.api;
import io.ooni.libndt.swig.Libndt;
public final class NDTConstants {
public static fi... |
C | UTF-8 | 3,899 | 3.09375 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
void encrypt(char *a)
{
int l=strlen(a);int i=0;
while(*a!='\0')
{
if(i%2==0)
*a+=2*(l/2-i);
else
*a+=3*(l/2-i);
if(*a==',')
*a='!';
a++;i++;
}
}
void decrypt(char *a){
... |
PHP | UTF-8 | 2,761 | 2.890625 | 3 | [] | no_license | <?php
/**
* LoginForm class.
* LoginForm is the data structure for keeping
* user login form data. It is used by the 'login' action of 'SiteController'.
*/
class LoginForm extends CFormModel {
public $username;
public $password;
/**
*
* @var UserIdentity usuario para autentica... |
Java | UTF-8 | 1,012 | 3.296875 | 3 | [] | no_license | package com.ymt.design.strategy;
import java.util.ArrayList;
/**
* @Description TODO
* @Author yangmingtian
* @Date 2019/3/15
*/
class Customer {
private final ArrayList<Integer> cloths = new ArrayList<>();
private PayStrategy payStrategy;
Customer(PayStrategy payStrategy) {
this.payStrategy... |
Java | UTF-8 | 835 | 3.59375 | 4 | [
"MIT"
] | permissive | package nperfeitos;
public class Main {
public static void main(String[] args) {
boolean divisivel;
long a = 2L, b = 2L, n = 0L, soma;
System.out.printf("\n-> The perfect numbers between 1 and 9223372036854775807 are:\n");
for (long i = 2L; i <= 9223372036854775807L; i++) {
soma = 0L;
// Esse for... |
Markdown | UTF-8 | 5,015 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # Private Comparison
Private Comparision library (prv_cmp) compare the magnitudes of 1-bit integers x and y while encrypting them.

* Decryptor only obtains numerical comparison results without knowing x and y
* Encryptor1 encrypts the integer x (Enc(x)) and sends it to Evaluator
* Encryptor... |
Ruby | UTF-8 | 3,549 | 3.140625 | 3 | [] | no_license | # Removes HTML, newlines and unneeded whitespace
# Whitespace removal from SO 7106964
def strip_html(text)
@name =
# Remove HTML from the text
Sanitize.clean(text).
# Replace newlines with a space
gsub(/\n|\r/, ' ').
# Replaces runs of spaces by a single space
squeeze(' ').
# Remove leadin... |
Python | UTF-8 | 1,682 | 3.46875 | 3 | [] | no_license | from golca import gameOfLife
from golca2 import *
from golca3 import *
from golca4 import *
def genericDriver():
try:
str1 = "Enter 1 for general linear algebra test,\n 2 for special linear"
str2 = " algebra test,\n 3 for orthogonal algebra test,\n and 4 for"
str3 = " symplectic algebra test... |
Markdown | UTF-8 | 1,022 | 3.140625 | 3 | [] | no_license | # Kaggle_Mercari_competition
This repository contains the solution developed for the Kaggle Mercari competition that finished 46th on Private Leaderboard.
# Solution hardware requirements
This solution was designed to run in a hardware constrained environment (Kaggle's kernels) with the following constraints:
* 4 C... |
C++ | UTF-8 | 6,683 | 2.59375 | 3 | [] | no_license | #include "chunk_renderer.hpp"
#include "../../common/world/world.hpp"
#include "../../common/world/world_generator.hpp"
#include "../../common/bounding_box.hpp"
#include "../debug/profiler.hpp"
#include "../constant/rendering.hpp"
#include <glm/gtc/matrix_transform.hpp>
#include <algorithm>
#include <iterator>
#includ... |
C++ | UTF-8 | 270 | 2.578125 | 3 | [] | no_license | //
// Created by kangdonguk on 2020/05/12.
//
// https://www.acmicpc.net/problem/2744
// 대소문자 바꾸기
#include <stdio.h>
int main() {
char s[101];
scanf("%s", s);
for (int i = 0; s[i]; i++)
printf("%c", s[i] += s[i] > 90 ? -32 : 32);
}
|
PHP | UTF-8 | 1,448 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Modules\Api\Controllers;
use App\Controller\ApiController;
use App\Models\admin\User;
class SingController extends ApiController
{
/**
* 初始化
* @author 一根小腿毛 <1368213727@qq.com>
* @return string
*/
public function initialize()
{
parent::initialize(); // TODO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.