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,154 | 2.515625 | 3 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | package edu.upenn.cis.ppod.model;
import static com.google.common.collect.Iterables.isEmpty;
import static com.google.common.collect.Lists.newArrayList;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertTrue;
import org.testng.annotations.Test;
import edu.upenn.cis.ppod.TestGroupDefs;... |
PHP | UTF-8 | 5,621 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
namespace Simplon\Payment\Skrill\Vo;
class CheckoutQueryResponseVo
{
protected $_postData = [];
protected $_customCallbackData = [];
// ##########################################
/**
* @return mixed
*/
protected function _getPostData()
... |
Markdown | UTF-8 | 2,591 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | In the current CodaLab competition model a competition is constructed with a set of Reference Data and a Scoring Program. The way competitions work currently the Reference Data is compared with a participants submission and the differences in the two are scored using the Scoring Program.
The program.zip bundle contain... |
Python | UTF-8 | 443 | 2.59375 | 3 | [] | no_license | def solution(land):
for i in range(1,len(land)):
a,b,c,d = land[i-1][0],land[i-1][1],land[i-1][2],land[i-1][3]
for j in range(4):
if j == 0:
land[i][j] += max(b,c,d)
elif j == 1:
land[i][j] += max(a,c,d)
elif j == 2:
... |
Java | UTF-8 | 593 | 1.734375 | 2 | [
"Apache-2.0"
] | permissive | package com.eudemon.ratelimiter.rule.source;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.eudemon.ratelimiter.rule.source.FileRuleConfigSource;
import com.eudemon.ratelimiter.rule.source.RuleConfigSource;
import com.eudemon.ratelimiter.rule.source.UniformRuleConfigMapping;
/**
* TODO(zhe... |
C++ | UTF-8 | 6,669 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include<string>
#include<fstream>
#include <sstream>
#include <cmath>
using namespace std;
class Node
{
public:
string name;
double rating;
int votes;
Node *next;
Node()
{
next =nullptr;
}
Node(string n, float r, int v)
{
... |
PHP | ISO-8859-1 | 1,530 | 2.828125 | 3 | [] | no_license | <?php
include("../tool/header.php");
head("Tutorial Area - SQL");
?>
<h1> SQL </h1>
<h2> Requte SQL : Modifier une table </h2>
<h4> Ajouter une entrée </h4>
<p> Les requtes suivantes sont les requtes brutes, je ne mettrais plus "$requete = ..." pour des raisons de simplicité </p>
<p> ... |
PHP | UTF-8 | 5,348 | 2.671875 | 3 | [] | no_license | <?php
/*
file path: http://localhost/projects/demo%20database/PHP/login.php
*/
?>
<?php
if(isset($_POST["submit"]))
{
$username=$_POST["user"];
$password=$_POST["pass"];
$u_fname=$u_mname=$u_lname=$u_gender=$u_dob=$u_mobile=$u_email=$u_address=$u_city=$u_state=$u_country="Not mentioned";
require "db_co... |
C# | UTF-8 | 2,601 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | // Copyright (c) Alexandre Mutel. All rights reserved.
// Licensed under the BSD-Clause 2 license.
// See license.txt file in the project root for full license information.
using System;
using System.Collections;
using System.Collections.Generic;
namespace Tomlyn.Model
{
/// <summary>
/// Runtime representati... |
Java | UTF-8 | 1,227 | 3.53125 | 4 | [] | no_license | package commands.client;
import server.models.cards.Card;
/**
* When a player passes without playing any card server draws a card to his hand and inform other players using this command.
*/
public class DrawCard extends ClientCommand {
/**
* PRIVATES
*/
private int seatNumber;
private String ... |
Python | UTF-8 | 2,786 | 2.625 | 3 | [] | no_license | from main.crawlers.main import Main
from main.helpers.price import convert_price
from bs4 import BeautifulSoup
class StoreMercadoLivre(Main):
store = "MercadoLivre"
url_domain_https = "https://produto.mercadolivre.com"
url_domain_http = "http://produto.mercadolivre.com"
def __init__(self, url):
... |
Java | UTF-8 | 969 | 2.453125 | 2 | [] | no_license | package com.fiuba.gaff.comohoy.model.purchases;
public enum RequestStatus{
WaitingConfirmation("Esperando confirmación"),
OnPreparation("En preparación"),
OnTheWay("En camino"),
Delivered("Entregado"),
CanceledByUser("Cancelado"),
CanceledByCommerce("Rechazado"),
Unknown("Indeterminado");
... |
Python | UTF-8 | 31,642 | 2.703125 | 3 | [] | no_license | import scraperwiki
import urllib2
import lxml.etree
'''
Code to pull data out of the timing related press releases issued by FIA for Formula One races.
This code is provided solely for your own use, without guarantee, so you can publish F1 timing data,
according to license conditions specified by FIA,
without having t... |
JavaScript | UTF-8 | 1,116 | 2.6875 | 3 | [] | no_license | const connectionFactory = require('./ConnectionFactory')
class ProdutosDAO{
constructor(){
this.connection = connectionFactory();
}
pegaTodosOsLivros(callback){
this.connection.query('SELECT * FROM livros', (errs, results) => {
this.connection.end();
... |
TypeScript | UTF-8 | 292 | 2.515625 | 3 | [] | no_license | import { User } from "../Models/Users";
export const userTypes = {
USER_PROFILE_UPDATE: 'USER_PROFILE_UPDATE'
}
export function updateProfileUser(loginUser:User|null){
return {
type: userTypes.USER_PROFILE_UPDATE,
payload:{
loginUser
}
}
}
|
Swift | UTF-8 | 1,978 | 2.921875 | 3 | [] | no_license | //
// ViewController.swift
// NewApp
//
// Created by apple on 1/27/20.
// Copyright © 2020 apple. All rights reserved.
//
import UIKit
class ViewController: UIViewController,UITableViewDataSource,UITableViewDelegate {
var imagename:[String] = ["A1","A2","A3","A4","A5"]
var imagedetails:[String] = ["... |
Markdown | UTF-8 | 6,395 | 3.28125 | 3 | [] | no_license | # Parser
The MiniLatex parser is written in Elm using
Evan Czaplicki's [parser combinator package](https://package.elm-lang.org/packages/elm/parser/latest/).
We will take a look at some of the top level parsers, then examine in detail
the parser for environments, which is both the most important and the most complex o... |
JavaScript | UTF-8 | 3,458 | 3.28125 | 3 | [] | no_license | var btn = document.getElementById('submit')
var new_btn = document.getElementById('final')
var total_expense = 0;
var total_income = 0;
//Declaration of total income and total expense
function expense_manager(){
//Program for calculation of save and expense
event.preventDefault()
var query = document.getEle... |
Java | UTF-8 | 617 | 2.640625 | 3 | [] | no_license | package com.tp.LeagueApp.persistance.postgres.mappers;
import com.tp.LeagueApp.models.Rune;
import org.springframework.jdbc.core.RowMapper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class RuneMapper implements RowMapper<Rune> {
@Override
public Rune mapRow(ResultSet resultSet, int i) t... |
Python | UTF-8 | 2,290 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #coding:utf-8
import gevent.monkey
gevent.monkey.patch_all()
from gevent.queue import Empty, Queue
import gevent
import requests
from urlparse import urlparse, parse_qs
from extract import extract, extract_all
from route import route
ua = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.1 (KHTML, like Gecko) Chrom... |
Shell | UTF-8 | 2,681 | 3.84375 | 4 | [] | no_license | #!/usr/bin/env bash
echo "*******************REED************************"
echo "Starting run_get_files_tests.sh"
date
# This script is run inside the Docker image, for single experiment (one project)
# Should only be invoked by the run_experiment.sh script
if [[ $1 == "" ]] || [[ $2 == "" ]] || [[ $3 == "" ]] || ... |
Java | UTF-8 | 2,865 | 2.5625 | 3 | [
"MIT"
] | permissive | package com.nemanjapetrovic.streaming.radio.player.Commands;
import com.nemanjapetrovic.streaming.radio.player.Data.Station;
import com.nemanjapetrovic.streaming.radio.player.Data.DataController;
import com.sun.jna.NativeLibrary;
import sun.audio.AudioPlayer;
import sun.audio.AudioStream;
import uk.co.caprica.vlcj.com... |
Python | UTF-8 | 181 | 3.171875 | 3 | [] | no_license | """
4 2 1 0
0 0 1 0 = number 1
0 1 0 0 = numer 2
&
0 1 0 0 = resulta o numero 1
Por isso que usar o & com o numero 1 vai dizer se o numero e par ou impar
"""
a = 2
print(a & 1) |
Java | UTF-8 | 1,424 | 2.71875 | 3 | [] | no_license | package org.cocina.util;
/**
* Clase con métodos generales para las diversas clases en la lógica de negocio.
*/
public class Utilitario {
@Deprecated
public static String obtenerSqlQueryCamareroSinJoins() {
StringBuilder sqlString = new StringBuilder();
sqlString.append("select c.id id_camarero, c.nombre nomb... |
Python | UTF-8 | 1,270 | 2.890625 | 3 | [] | no_license | Python 3.7.0b5 (v3.7.0b5:abb8802389, May 31 2018, 01:54:01) [MSC v.1913 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> list=[1,2,3,4]
>>> b=bytes(list)
>>> b
b'\x01\x02\x03\x04'
>>> for n in b:
print(n)
1
2
3
4
>>> b[0]=1
Traceback (most recent call last):
File "<pyshe... |
Markdown | UTF-8 | 6,987 | 3.921875 | 4 | [] | no_license | ---
title: 数组的基本方法
date: 2019-04-30 19:12:59
tags:
- javascript
- Array
categories:
- 笔记
---
### 数组基础知识
#### 数组基础结构和遍历
> 数组也是对象类型的 `typeOf [] -> 'object'`
> 数组也有属性名,只不过属性名是数字,我们把数字属性名称为它的索引:数组是以数字作为索引,索引从零开始。有一个length属性代表属性的长度
> 类数组:类似于数组但不是数组
> 1、通过getElementsByTagName获取的元素集合是类数组
> 2、函数中的实参集合arguments也是类数... |
PHP | UTF-8 | 3,763 | 2.734375 | 3 | [] | no_license | <?php declare(strict_types=1);
namespace TomasVotruba\Website\TweetPublisher;
use Symplify\Statie\Renderable\File\PostFile;
use TomasVotruba\Website\TweetPublisher\Exception\TweetImageNotFoundException;
use TomasVotruba\Website\TweetPublisher\Exception\TweetTooLongException;
final class PostTweetsProvider
{
/**
... |
TypeScript | UTF-8 | 1,598 | 2.6875 | 3 | [] | no_license | import jwt from 'jsonwebtoken';
import httpStatus from 'http-status';
import APIError from './apiError';
import {
GENERATE_TOKEN_ERROR,
JSON_WEB_TOKEN_ERROR,
TOKEN_EXPIRED,
} from '../constants/token';
import { ERROR } from '../constants/general';
const JWT_SECRET = process.env['JWT_SECRET'];
type PayloadType =... |
Markdown | UTF-8 | 2,732 | 2.8125 | 3 | [] | no_license | ## Jest-Puppeteer-Atm-Reporter:
This is a plugin for uploading test execution results in real time (during execution - per `describe` block) for JEST tests to Adaptavist Test Management tool (Kanoah).
One `describe` block is mapped to one ATM test (`Test case ID` for which can be set using reporter method). Each `tes... |
Java | UTF-8 | 9,209 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2001-present Stephen Colebourne
*
* 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 b... |
C# | UTF-8 | 583 | 2.90625 | 3 | [] | no_license | using System;
namespace Fight_for_The_Life.Domain.GameObjects
{
public class BirthControl : GameObject
{
private const double VelocityCoefficient = 1.5;
public BirthControl(int y, double spermVelocity)
{
HeightCoefficient = 0.16;
WidthCoefficient = 0.05958;
... |
Java | UTF-8 | 861 | 2.65625 | 3 | [] | no_license | package com.msg91.shubham.msg91;
import android.content.Context;
/**
* This class is use to verify the OTP from MSG91
*/
public class VerifyOTP {
/**
* This method is use to verify the OTP.
*
* @param context Current Context
* @param AuthKey Authentication key which is provided by MSG... |
Shell | UTF-8 | 829 | 2.65625 | 3 | [] | no_license | #!/bin/sh
source /etc/profile
cd /data/wwwroot/echo.adsense.cig.com.cn
PID=$(ps auxf|grep "echo-1.1.0-fat.jar" |grep -v grep|awk '{print $2}')
echo "kill $PID"
kill $PID
sleep 3
nohup java -Djava.net.preferIPv4Stack=true -server -Xms16g -Xmx16g -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:InitiatingHeapOccupancyPercent=70... |
PHP | UTF-8 | 89 | 3.046875 | 3 | [] | no_license | <?php
$valor = "ola";
$valor2 = sprintf("$valor %a", "aaaaaaaaaaaa");
printf ($valor2); |
Java | UTF-8 | 451 | 1.773438 | 2 | [] | no_license | package com.lhf.sportMeeting.facade.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/index")
public class IndexController {
@GetMapping
public String t... |
Python | UTF-8 | 548 | 3.140625 | 3 | [] | no_license |
class Solution:
def detectCapitalUse(self, word):
case_all_upper = True
case_all_lower = True
case_title = True
for i in range(0, len(word)):
c = word[i]
case_all_upper = case_all_upper and c.isupper()
case_all_lower = case_all_lower and not c.i... |
Java | UTF-8 | 765 | 3.03125 | 3 | [
"MIT"
] | permissive | package ru.alex9127.app.classes;
import androidx.annotation.NonNull;
import java.util.ArrayList;
public class Inventory {
private final ArrayList<InventoryItem> list;
private final int maxSize;
public Inventory(int maxSize) {
this.list = new ArrayList<>();
this.maxSize = maxSize;
}
... |
JavaScript | UTF-8 | 1,896 | 2.671875 | 3 | [
"MIT"
] | permissive | 'use strict';
const {PngImg} = require('../dist');
const RGBToString = require('../dist/utils').RGBToString;
const testData = require('./data');
describe('set', () => {
const rgbaTestRawImg = testData.readFileSync('rgba4x1.png');
let img;
beforeEach(() => {
img = new PngImg(rgbaTestRawImg);
}... |
Markdown | UTF-8 | 11,014 | 4.21875 | 4 | [
"MIT"
] | permissive | 数组去重的十四种方法
===
<!-- TOC -->
- [数组去重的十四种方法](#数组去重的十四种方法)
- [Methods 1: 定义一个新数组,并存放原数组的第一个元素,然后将元素组一一和新数组的元素对比,若不同则存放在新数组中。](#methods-1-定义一个新数组并存放原数组的第一个元素然后将元素组一一和新数组的元素对比若不同则存放在新数组中)
- [Methods 2: 利用sort()](#methods-2-利用sort)
- [Methods 3: 利用对象属性存在的特性,如果没有该属性则存入新数组。](#methods-3-利用对象属性存在的特性如果没有该属性则存入新数组)
- [Met... |
Java | UTF-8 | 5,925 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | /**
* IFT2905 : Interface personne machine
* Projet de session: FlibityBoop.
* Team: Vincent CABELI, Henry LIM, Pamela MEHANNA, Emmanuel NOUTAHI, Olivier TASTET
* @author: Emmanuel Noutahi, Vincent Cabeli
*/
package com.maclandrol.flibityboop;
import java.io.BufferedInputStream;
import java.io.IOException;
import... |
Python | UTF-8 | 12,946 | 2.875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 17:44:54 2019
@author: meliude
"""
import pygrib
import pandas as pd
years = ['1998.grib', '1999.grib', '2000.grib', '2001.grib', '2002.grib', '2003.grib', '2004.grib', '2005.grib', '2006.grib', '2007.grib', '2008.grib']
data = []
dp = [] #dewp... |
Python | UTF-8 | 9,647 | 3.15625 | 3 | [] | no_license | from pygame import draw, Vector2
from random import randint, random
from abc import abstractmethod, ABC
class BaseCreature(ABC):
def __init__(self, world, color, coord=None, radius=None):
self.world = world
self.color = color
self.energy = 3000
self._maxenergy = 3000
self.al... |
PHP | UTF-8 | 2,200 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | <?php
namespace anstiss\guias\cto_guiaOdontologia;
use anstiss\complexTypes\ct_procedimentoDados;
use anstiss\complexTypes\denteRegiao;
class procedimentosExecutados {
/**
*
* @var ct_procedimentoDados $procSolic
* @access public
*/
public $procSolic = null;
/**
*
* @var... |
PHP | UTF-8 | 1,704 | 3.125 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>PHP Lesson 17</title>
</head>
<body>
<?php
/* echo date_default_timezone_get();
echo "<... |
Java | UTF-8 | 1,570 | 2.765625 | 3 | [] | no_license | package com.hibernateTutorial.oneToOneRelationBidirectional;
import java.io.File;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class MainApp {
private static final String HIBERNATE_CONFIG_PATH = "/home/mehmetozanguven/eclipse-workspace/Hibernate... |
JavaScript | UTF-8 | 2,511 | 2.765625 | 3 | [] | no_license | const fetch = require('node-fetch');
const model = require('../utilities/parser')
const globalVariable = require('../constants/global')
module.exports = {
fetchTitlesFromUrl: async (req, res) => {
if (Object.keys(req.query).length > 0) {
let { address } = req.query
let myObj = { t... |
Java | UTF-8 | 548 | 1.882813 | 2 | [] | no_license | package com.proccorp.eventory.app;
import com.proccorp.eventory.app.configuration.ConfigurationModule;
import com.proccorp.eventory.controllers.RestController;
import com.google.inject.Guice;
import com.google.inject.Injector;
public class Application {
Injector injector;
public Application() {
this... |
PHP | UTF-8 | 5,892 | 2.71875 | 3 | [] | no_license | <?php
namespace Kriss\Nacos\DTO\Request;
use Kriss\Nacos\Model\InstanceModel;
use Kriss\Nacos\Support\Json;
class InstanceParams
{
/**
* 服务实例IP
* @var string
*/
private $ip;
/**
* 服务实例port
* @var int
*/
private $port;
/**
* 服务名
* @var string
*/
pri... |
Python | UTF-8 | 390 | 2.953125 | 3 | [] | no_license | import dateparser as dp
import sys
DUE = 'due'
ANY = 'any'
ONLY = 'only'
LIST = 'list'
arguments = sys.argv[1:]
print(arguments)
# testing dateparser
if DUE in arguments:
due_index = arguments.index(DUE)
due_date = ' '.join(arguments[due_index + 1:])
arguments = arguments[:due_index]
print(due_date)
pr... |
JavaScript | UTF-8 | 767 | 3.046875 | 3 | [] | no_license | const apiWeather = "https://api.openweathermap.org/data/2.5/weather?id=5604473&units=imperial&APPID=376518d3f8cbf59c812b2a2aebacf5d7";
fetch(apiWeather)
.then((response) => response.json())
.then((jsObject) => {
console.log(jsObject);
const wDescription = document.getElementById('descripti... |
C# | UTF-8 | 445 | 2.9375 | 3 | [] | no_license | using System;
namespace Isogram
{
public class Sentence
{
public static bool IsogramSentence(string word){
word = word.ToLower();
char[] arr = word.ToCharArray();
Array.Sort(arr);
for (int i = 0; i < word.Length -1 ; i++) {
if (arr[i] ==... |
Java | UTF-8 | 1,254 | 1.78125 | 2 | [] | no_license | /* (C) Copyright 2009 Hewlett-Packard Development Company, LP
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This li... |
Java | UTF-8 | 492 | 2.1875 | 2 | [] | no_license | package com.xiao.blog.constants;
/**
* Shiro 相关常量
* @author wangmx
* @date 2020-12-01
*/
public class ShiroConstants {
/**
* 分隔符
*/
public static final String NAMES_DELIMETER = ",";
/**
* 加密方式
*/
public final static String HASH_ALGORITHM_NAME = "MD5";
/**
* 循环次数
... |
JavaScript | UTF-8 | 1,813 | 2.703125 | 3 | [] | no_license | let totalPage = 0;
$(function () {
Load();
});
function Load() {
currentPage(1);
}
//查询当前页码的核心ajax逻辑
function currentPage(num) {
$.ajax({
url: "user",
type: "get",
data: {m: "page", currentPage: num},
dataType: "json",
//text类型 ajax直接接收字符串类型
success: functio... |
Python | UTF-8 | 1,087 | 3.09375 | 3 | [] | no_license | __author__ = 'Mike'
print("Gopnik Help Bot v.2.0 - GitHub version")
print("""
What do you need help with?
b. Show features and bug fixes
1. WiFi password
2. Why did you put this on GitHub?
3. What do i do when I see a Vadim?
4. Is DOOM as good as CS 1.6?
5. Is DOOM good on it's own?
6. Where's the name in... |
C++ | UTF-8 | 3,839 | 2.546875 | 3 | [
"MIT"
] | permissive | /***************************************************
Adafruit MQTT Library Arduino Yun Example
Make sure your Arduino Yun is connected to a WiFi access point which
has internet access. Also note this sketch uses the Console class
for debug output so make sure to connect to the Yun over WiFi and
open the ser... |
Ruby | UTF-8 | 410 | 3.390625 | 3 | [] | no_license | require 'pry'
def power_sumDigTerm(nth)
sequence = []
start_number = 81
until sequence.size == nth
digits_sum = start_number.to_s.chars.map {|x| x.to_i}.reduce(:+)
list = (0..nth).to_a.map {|x| digits_sum ** x}
if list.include?(start_number)
sequence << start_number
start_number += 1
... |
Java | UTF-8 | 18,001 | 1.890625 | 2 | [
"MIT"
] | permissive | package stream.com.streamapp.home;
import android.content.ContentValues;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.DefaultItemAnimator;
import android.support... |
C++ | UTF-8 | 7,839 | 2.75 | 3 | [] | no_license | /*
* Copyright (C) 2017 Edupals project
*
* Author:
* Enrique Medina Gremaldos <quiqueiii@gmail.com>
*
* Source:
* https://github.com/edupals/edupals-base-toolkit
*
* This file is a part of edupals-base-toolkit.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms ... |
Markdown | UTF-8 | 218 | 3.1875 | 3 | [] | no_license | # LogMessage
Python 3.6 class for logging to a text file.
To initialize LogMessage:
message = LogMessage('log.txt')
To read the log:
message.read()
To write to the log:
message.write('whatever you want to log.')
|
Markdown | UTF-8 | 4,369 | 2.890625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | ---
license: >
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
... |
JavaScript | UTF-8 | 2,192 | 2.828125 | 3 | [] | no_license | import React, { Component } from 'react';
import Entry from '../Entry/Entry.js';
import LetterHeader from '../LetterHeader/LetterHeader.js';
import './EntryList.css';
class EntryList extends Component {
compareEntryNames(entry1,entry2) {
var lastNameComparison = entry1.entryData.lname.localeCompare(entry2.entryDat... |
Java | UTF-8 | 1,710 | 2.140625 | 2 | [] | no_license | package bk.chat.web;
import bk.chat.model.ChatMessage;
import jakarta.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.MessageHeaders;
import org.springframework.messaging.handler.annot... |
C++ | UHC | 239 | 3.265625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main() {
int x;
cout << "ԷϽÿ>>";
cin >> x;
if (x > 10)
cout << x << " 10 ũ\n";
else
cout << x << " 10 ۰ų .\n";
return 0;
}
|
C++ | UTF-8 | 514 | 2.953125 | 3 | [] | no_license | #ifndef Topic_hxx
#define Topic_hxx
#include "Subject.hxx"
class Topic : public Subject{
protected: std::string _theme;
public:
Topic()
: _theme ("")
{
}
Topic(const std::string &theme)
: _theme(theme)
{
}
const std::string theme() {
return _theme;
}
void theme( const std::string &theme) {
... |
Java | UTF-8 | 940 | 2.96875 | 3 | [] | no_license | package enums;
public class Padding {
public float left, top, right, bottom;
public float getHorizontal() {
return left + right;
}
public float getVartical() {
return top + bottom;
}
public boolean isAllValueSame() {
if(left == top && right == bottom && left == right)
return true;
e... |
JavaScript | UTF-8 | 4,508 | 3.078125 | 3 | [] | no_license | var STATE;
(function (STATE) {
STATE[STATE["INDENT"] = 0] = "INDENT";
STATE[STATE["FUNC_NAME"] = 1] = "FUNC_NAME";
STATE[STATE["FUNC_NAME_END"] = 2] = "FUNC_NAME_END";
STATE[STATE["ARG_START"] = 3] = "ARG_START";
STATE[STATE["ARG_MIDDLE"] = 4] = "ARG_MIDDLE";
STATE[STATE["ARG_END"] = 5] = "ARG_E... |
TypeScript | UTF-8 | 1,870 | 2.546875 | 3 | [
"MIT"
] | permissive | import { Component } from '@angular/core';
import { User } from '../_models';
import { ficheService, AlertService, UserService } from '../_services/index';
// Composant qui permet de rajouter des frais forfait au mois en cours
@Component({
moduleId: module.id,
templateUrl: 'fraisForfait.component.html'
})
export... |
Python | UTF-8 | 2,090 | 3.328125 | 3 | [] | no_license | #when player presses 'c' to construct this menu will appear
import pyglet
from pyglet.gl import *
from pyglet.window import key
from Inventory import Inventory
from Property import Property
# import bankruptcy screen, auction screen, mortgage screen, board screen
class GameWindow(pyglet.window.Window):
"""Represent... |
Java | UTF-8 | 1,065 | 2.5 | 2 | [] | no_license | package ohtu;
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.control.TextField;
import javafx.stage.Stage;
import org.junit.*;
import static org.testfx.api.FxAssert.verifyThat;
import org.testfx.framework.junit.ApplicationTest;
import static org.testfx.matcher.base.NodeMatchers.ha... |
C++ | UTF-8 | 4,970 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <ros/package.h>
/* OpenCV 2 */
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <cv.hpp>
#include <math.h>
using namespace cv;
class voxelGrid {
public:
// Constructor setting all private parameters and projecting the voxels into the camera imag... |
JavaScript | UTF-8 | 498 | 2.734375 | 3 | [] | no_license | const btnEntrar = document.querySelector("#entrar")
const txtUsuario = document.querySelector("#usuario")
const txtSenha = document.querySelector("#senha")
btnEntrar.addEventListener("click",function(){
let usuario = txtUsuario.value
let senha = txtSenha.value
console.log(usuario,senha);
if(usuario==""... |
JavaScript | UTF-8 | 745 | 3.390625 | 3 | [] | no_license | let thesePpl=[], a;
function setup() {
// createCanvas(400, 400);
// person = new Student();
// p1 = new Student();
// p2 = new Student();
for(let i=0; i<200; i++)
{
thesePpl[i]=new Student(i);
}
// person.display();
// p1.display();
// p2.display();
}
function draw() {
background(... |
Java | UTF-8 | 361 | 1.984375 | 2 | [] | no_license | package com.rafaelmorales.colegio.repository;
import com.rafaelmorales.colegio.entities.Estudiante;
import com.rafaelmorales.colegio.enums.Estado;
import org.springframework.data.jpa.repository.JpaRepository;
public interface EstudianteRepository extends JpaRepository<Estudiante, Long> {
Estudiante findByEdadAndE... |
Java | UTF-8 | 5,699 | 3.53125 | 4 | [] | no_license | package application;
//That's probably necessary for JavaFX
import java.util.ArrayList;
import java.util.Random;
//I recall that arraylists are a kind of resizeable array.
public class Cell{
int destX;
int destY;
Cell[][] globalCell;
private final int GRID_WIDTH = 10;
private final int GRID_HEIGHT = 10... |
Rust | UTF-8 | 2,110 | 2.84375 | 3 | [
"MIT"
] | permissive | use chrono::DateTime;
use har;
use regex::RegexSet;
use std::fs;
use std::path::Path;
pub fn filter_har_and_calculate_time(data: &har::v1_2::Log, whitelist_file: &Path) -> (har::v1_2::Log, i64) {
let whitelist = read_whitelist(whitelist_file);
let filtered_entries = filter_entries(&data, &whitelist);
let e... |
PHP | UTF-8 | 1,095 | 3 | 3 | [] | no_license | <?php
require("inc/db.php");
function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','<',$htmlStr);
$xmlStr=str_replace('>','>',$xmlStr);
$xmlStr=str_replace('"','"',$xmlStr);
$xmlStr=str_replace("'",''',$xmlStr);
$xmlStr=str_replace("&",'&',$xmlStr);
return $xmlStr;
}
//Start XML file, create pare... |
C++ | GB18030 | 2,957 | 3.109375 | 3 | [] | no_license | #include "utility.h"
#include <limits>
#include <algorithm>
#include "vec3.h"
// ҳƵ½
int divUp(int a, int b) { return (a + b - 1) / b; }
aabb point_cloud_bounds(const std::vector<float3>& pc)
{
float3 lower, upper;
lower.x = std::numeric_limits<float>::max();
upper.x = std::numeric_limits<float>::min();... |
Markdown | UTF-8 | 369 | 2.59375 | 3 | [] | no_license | **Update Airport**
----
Update an airport
* **URL**
/rs/airport/:id
* **Method:**
`PUT`
* **URL Params**
**Required:** `id=[integer]`
* **Data Params**
**Required:** `airportcode=[string]`
**Required:** `city=[string]`
**Required:** `country=[string]`
**Required:** `name=[stri... |
Python | UTF-8 | 630 | 3.140625 | 3 | [] | no_license | class Solution:
def generateParenthesis(self, n):
"""
:type n: int
:rtype: List[str]
"""
def gen(left, right, size, current, result): # size is the number of left or right parentheses
if left == size and right == size:
result.append(current)
... |
Markdown | UTF-8 | 2,517 | 3.34375 | 3 | [] | no_license | # Minisql V2.0
*Скачать: https://t.me/joinchat/rZ1DR8YL7tsxNmJi*
В общем есть 6 функций: add, read, get, edit, sread. request.
Add - добавить значения в БД
Read - прочитать всю таблицу
Get - узнать какое-то значение из таблицы
Edit - изменить значения в таблице
Sread - прочитать всю таблицу и отсортировать её по како... |
C++ | UTF-8 | 9,648 | 2.9375 | 3 | [] | no_license | //
// Created by ravip on 8/6/2018.
//
#include <fstream>
#include<stdio.h>
#include <string.h>
#include <iostream>
#include<cmath>
#ifndef PROJECT2_IMAGESTUFF_H
#define PROJECT2_IMAGESTUFF_H
class Pixel{
public:
unsigned char R;
unsigned char G;
unsigned char B;
Pixel & operator =(co... |
Python | UTF-8 | 626 | 3.453125 | 3 | [] | no_license | import math
def find_primes_to_n(n):
primes_so_far = [2, 3]
num_to_check = 5
while num_to_check < n:
is_prime = True
for prime in primes_so_far:
if prime > math.sqrt(num_to_check):
is_prime = True
break
if num_to_check % prime == 0:
... |
C++ | UTF-8 | 1,111 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int L, B, T;
int dp[202][101][101];
bool can(int P, int TF, int TH){
int tB = B;
int tmp;
tmp = min(tB , P);
P -= tmp;
tB -= tmp;
tmp = min(tB, TF);
TF -= tmp;
tB -= tmp;
return (tB == 0) && (P + TH + (2 * TF) >= L);
}
int wow(int pinggir, int tengah_full, i... |
Java | UTF-8 | 650 | 3.546875 | 4 | [] | no_license | public class Edge implements Comparable<Edge>{
private int cost;
private int[] towns;
public Edge(int cost, int town1index, int town2index) {
this.cost = cost;
towns = new int[2];
towns[0] = town1index;
towns[1] = town2index;
}
public int compareTo(Edge o) {
return (this.cost - o.cost)... |
Swift | UTF-8 | 539 | 3.4375 | 3 | [] | no_license | class Solution {
func maxArea(_ height: [Int]) -> Int {
var maxS: Int = 0
var left: Int = 0
var right: Int = height.count - 1
while left < right{
maxS = max(maxS, min(height[left], height[right]) * (right - left))
if height[left] < height[right]{
... |
Java | UTF-8 | 2,868 | 1.953125 | 2 | [] | no_license | package test.order;
import static org.junit.Assert.assertEquals;
import org.apache.commons.httpclient.methods.PostMethod;
import org.junit.BeforeClass;
import org.junit.Test;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import test.BaseTest;
public class AddorderTest extends BaseTest ... |
Java | UTF-8 | 1,280 | 2.84375 | 3 | [
"MIT"
] | permissive | package qword.repositories;
import qword.domain.Player;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.util.Comparator.comparingDouble;
import static java.util.Comparator.comparingInt;
import static java.util.stream.Collectors.toList;
public class InMemoryPlayerRepository ... |
Python | UTF-8 | 7,998 | 3.734375 | 4 | [] | no_license | #
# @lc app=leetcode id=1286 lang=python3
#
# [1286] Iterator for Combination
#
# https://leetcode.com/problems/iterator-for-combination/description/
#
# algorithms
# Medium (64.96%)
# Likes: 88
# Dislikes: 10
# Total Accepted: 4.5K
# Total Submissions: 7K
# Testcase Example: '["CombinationIterator","next","hasN... |
Python | UTF-8 | 808 | 2.5625 | 3 | [] | no_license | from marshmallow import Schema, fields, validate
class EventBody:
def __init__(self, eventName, metadata, timestampUTC):
self.eventName = eventName
self.metadata = metadata
self.timestampUTC = timestampUTC
class EventSchema(Schema):
eventName = fields.String(
required=True,
... |
Java | UTF-8 | 6,309 | 2.21875 | 2 | [] | no_license | package arbell.research.peripheral.usb;
import android.app.Activity;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Typeface;
import android.hardware.usb.*;
import an... |
Python | UTF-8 | 5,395 | 2.765625 | 3 | [] | no_license | import numpy
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.backend_bases import key_press_handler
from matplotlib.figure import Figure
from tkinter import *
from pygraphviz import *
from parse import Parse
class MainFor... |
C# | UTF-8 | 1,696 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.SqlServerCe;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;
using Dapper.Contrib.Extensions;
using SpeechToSpeech.Models;
using SpeechToSpeech.Services;
namespace SpeechToSpeech.Repositories
{
public class WebServic... |
Java | UTF-8 | 11,055 | 2.234375 | 2 | [] | no_license | package alienrabble.logging;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.jme.util.Timer;
... |
JavaScript | UTF-8 | 2,774 | 2.765625 | 3 | [
"MIT"
] | permissive | var cart = {
items : [],
itemsTotal: 0,
shipping: [],
formatCurrency: function (total) {
var neg = false;
if(total < 0) {
neg = true;
total = Math.abs(total);
}
return (neg ? "-" : '') + parseFloat(total, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString();
},
ge... |
Java | UTF-8 | 29,576 | 2.390625 | 2 | [] | no_license | package src;
import java.awt.event.KeyListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.awt.Graphics; //for graphics
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.RenderingHints;
import javax.swing.JFrame; //to render the frame
im... |
Go | UTF-8 | 5,292 | 2.765625 | 3 | [
"MIT"
] | permissive | package beanstalk
import (
"crypto/sha1"
"encoding/hex"
"strconv"
"github.com/hashicorp/terraform/helper/schema"
)
type integrationType struct {
Name string
Attributes map[string]*schema.Schema
WriteOnlyAttributes []string
}
// The Beanstalk API has "integration" as a concept, but it ... |
Python | UTF-8 | 1,835 | 3.046875 | 3 | [
"MIT"
] | permissive | def broken_dist(dist):
"""count=0
for i in xrange(dist):
if '3' not in str(i):
count+=1
return count"""
#return len([i for i in xrange(dist) if '3' not in str(i)])
count=0
for i in xrange(dist):
while i!=0:
rem=i%10
if rem==3: break
... |
Markdown | UTF-8 | 2,550 | 2.71875 | 3 | [
"BSD-3-Clause"
] | permissive | <a id="group__intmapentry__words"></a>
# Integer Map Entries
Generic integer map entries are key-value pairs. Type-specific entries extend this generic type with implementation-dependent data.
**Requirements**:
* Map entry words use one single cell.
* Map entries must store at least a key and a value.
**P... |
Markdown | UTF-8 | 31,733 | 2.9375 | 3 | [] | no_license | Byron Trial Notes, Day 21 (Week 5)
==================================
(Late start because judge had sentencing)
* Anderson takes stand.
* C: Dr. Anderson wants to clarify something from yesterday.
* When asked about the subway bombings, what the approximate amount of explosives used in the bomb and said it was 2-3kg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.