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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 1,359 | 2.9375 | 3 | [] | no_license | **Purpose**
I was inspired to write this twitter bot after learning years ago that Google would offer support numbers for people who would search for suicide related terms. I wanted to do something similar for Twitter to put a little positiveness back into the global conversation. In practice I ran this application fo... |
JavaScript | UTF-8 | 5,028 | 3.296875 | 3 | [] | no_license | // 1. lancer une commande javascript pour attendre le chargement
window.onload = function() {
/* 2. première étape : je dois faire en sorte qu'un panel soit activé
par un onglet. donc je recupère les composants HTML des onglets
(les "a") et les panels ("div")
(utilisation de tableau pour le stockage des elements: d... |
Swift | UTF-8 | 1,618 | 3.296875 | 3 | [] | no_license | //
// String.swift
// iosBank
//
// Created by Sumit Desai on 12/25/1399 AP.
//
import Foundation
extension String{
func validateEmail() -> Bool {
let emailReg = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
return applyReg(regexStr: emailReg)
}
func validatePass(mini: In... |
Markdown | UTF-8 | 88 | 2.53125 | 3 | [] | no_license | # react-webpack-boilerplate
Boilerplate/practice for React Webpack build for future use
|
PHP | UTF-8 | 5,956 | 2.75 | 3 | [] | no_license | <?php
/**
* insere o ganhador do prêmio artilheiro do mês atual na tabela av_dashboard_titulos
* @param - objeto com uma conexão aberta
* @param - string com a data do último dia do mês
*/
function insereGanhadorDoPremioArtilheiro($db, $datas)
{
$query = "SELECT codigo_jogador FROM av_jogadores_avancao ORDER BY ... |
Python | UTF-8 | 491 | 2.671875 | 3 | [] | no_license | # coding=utf-8
# from UC Irvine
# 确定新数据集的规模
import urllib2
import sys
target_url = ("http://archive.ics.uci.edu/ml/machine-learning-databases/undocumented/connectionist-bench/sonar/sonar.all-data")
data = urllib2.urlopen(target_url)
xList = []
labels = []
for line in data:
row = line.strip().split(",")
xList.... |
Java | UTF-8 | 4,563 | 2.609375 | 3 | [] | no_license | package com.swe645;
import com.google.gson.Gson;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Pr... |
Java | UTF-8 | 201 | 2.375 | 2 | [] | no_license | package abstract_factory;
import abstract_factory.product.color.Color;
import abstract_factory.product.jewel.Jewel;
public interface PropertyFactory {
Color getColor();
Jewel getJewel();
}
|
Java | UTF-8 | 790 | 2.140625 | 2 | [] | no_license | package com.kingcontext.divolte.kafka.serializer;
import java.util.Map;
import io.divolte.server.DivolteIdentifier;
import org.apache.kafka.common.serialization.Serializer;
import org.apache.kafka.common.serialization.StringSerializer;
public class DivolteStringSerializer implements Serializer<DivolteIdentifier> {
... |
Java | UTF-8 | 6,092 | 3.40625 | 3 | [] | no_license | /* version = 0.7.0 */
import java.util.Scanner;
/**
* Главный класс консольной версии игрового приложения "Быки и коровы".
*/
public class BullsAndCowsMain
{
/**
* Количество цифр в числе заданное пользователем при выборе уровня сложности.
*/
private byte numberCount = 0;
/**
* Введенное... |
Ruby | UTF-8 | 1,765 | 3.390625 | 3 | [] | no_license | require_relative '../enumerable_cardio.rb'
require_relative '../data.rb'
require 'rspec'
context do "Enumerable Cardio!"
describe "#longest_quote" do
it "gets the longest quote on the list" do
correct_answer = {:text=> "“The critical ingredient is getting off your butt and doing something. It’s as simple a... |
Java | UTF-8 | 1,078 | 2.875 | 3 | [] | no_license | package sample;
import javafx.scene.image.Image;
import javafx.scene.paint.ImagePattern;
import javafx.scene.shape.Rectangle;
import java.io.Serializable;
import java.util.Random;
public class Choco implements Serializable {
public Rectangle choco;
public double x;
public double y;
pub... |
Ruby | UTF-8 | 624 | 3.375 | 3 | [] | no_license | #Mentorクラス定義
class Mentor
#インスタンス変数
attr_accessor :name
def initialize(name)
self.name = name
end
#インスタンスメソッド
def job
puts "#{self.name}です。私は現役のITプロフェッショナルです。"
end
end
#RailsMentorクラス定義(Mentorクラス継承)
class RailsMentor < Mentor
def job
puts "#{self.name}です。私はRubyとRailsでWebアプリケーションを作り... |
Python | UTF-8 | 885 | 3.0625 | 3 | [] | no_license | def decode_boarding_pass(bp):
binary = bp.translate(bp.maketrans('FBLR', '0101'))
id_ = int(binary, base=2)
row = id_ >> 3
col = id_ & int('111', base=2)
return row, col, id_
if __name__ == '__main__':
puzzle_input = [line for line in open('day_05.in').read().split('\n')]
# Part 1
ass... |
Python | UTF-8 | 586 | 2.53125 | 3 | [] | no_license | import socket
import argparse
parser=argparse.ArgumentParser()
parser.add_argument("IP",help="IP Addr",type=str)
parser.add_argument("Port",help="IP Addr",type=int)
parser.add_argument("file",help="IP Addr",type=str)
args=parser.parse_args()
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
host =args.IP
port =args.P... |
JavaScript | UTF-8 | 1,227 | 2.765625 | 3 | [] | no_license | import React, { useState } from 'react';
import classes from './FormInput.module.css';
const FormInput = (props) => {
const [enteredTodo, setEnteredTodo] = useState('');
const [isValid, setIsValid] = useState(true);
const inputChangeHandler = (event) => {
if (event.target.value.trim().length > 0) {
setIsVali... |
Markdown | UTF-8 | 936 | 3.125 | 3 | [] | no_license | ### Composite
###### Padrão Estrtutural
Este padrão tem como principio montar uma árvore onde objetos individuais (folhas) e grupos de objetos (compostos) sejam tratados de maneira igual, ou seja, através da aplicação do polimorfismo realizamos chamadas de objetos na árvore sem se preocupar se o objeto trata-se de u... |
Python | UTF-8 | 3,785 | 3.25 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
from docx import Document
import re
def get_html(url): # забираем страницу
r = requests.get(url) # проверяем доступ
r.encoding = 'cp1251' # применяем нужную кодировку ибо вместо русского случаются крякозябры
return r.text
def get_total_pages(html): # список ... |
Python | UTF-8 | 161 | 3.234375 | 3 | [] | no_license | mat=float(input('Whats your math score?'))
geo=float(input('Whats your geography score?'))
m=(mat+geo)/2
print('Your average between this notes is {}'.format(m)) |
SQL | UTF-8 | 1,745 | 3.234375 | 3 | [] | no_license |
INSERT INTO `regions`(`region_id`, `region_name`) VALUES (1,'Latinoamérica');
INSERT INTO `regions`(`region_id`, `region_name`) VALUES (2,'Europa');
INSERT INTO `countries`(`country_id`, `country_name`, `region_id`) VALUES (1,'Argentina',1);
INSERT INTO `countries`(`country_id`, `country_name`, `region_id`) VALUES (2... |
Java | UTF-8 | 679 | 2.296875 | 2 | [] | no_license | package com.rifat.storeapps.ui.view.Factory;
import android.content.Context;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import com.rifat.storeapps.Data.Model.User;
import com.rifat.storeapps.ui.view.ViewModel.UserViewModel;
public class UserViewModelFactory extends ViewModelPr... |
Java | UTF-8 | 2,901 | 1.828125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... |
Java | UTF-8 | 2,355 | 1.945313 | 2 | [] | 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 acoes.vista;
import acoes.entidades.ENVIOS;
import acoes.entidades.HISTORIAL_APADRINAMIENTO;
import acoes.entidades.J... |
Java | UTF-8 | 6,678 | 2.140625 | 2 | [] | no_license | package za.co.jericho.contractor;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.EJBException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;... |
Python | UTF-8 | 7,245 | 2.578125 | 3 | [] | no_license | import sys
import math
import random
from sklearn.svm import LinearSVC
from sklearn.metrics import balanced_accuracy_score
################ DATA PRE-PROCESSING ################
dataFile = sys.argv[1]
labelFile = sys.argv[2]
trainFile = sys.argv[3]
#data = open("/Users/pavanghuge/Downloads/ML/Assignme... |
Python | UTF-8 | 2,919 | 3.125 | 3 | [] | no_license | from urllib.request import urlopen
import pathlib
import zipfile
from corpus import *
def fetch_testcases(path) -> [(str, [(str, [Location])])]:
'''Returns completion test cases read from path.
path may be local or online.
A list of test cases is returned.
- Each test case is of the form: (query, ... |
Markdown | UTF-8 | 3,590 | 3.40625 | 3 | [] | no_license | Yarden Ne'eman
Web Science Lab 9
4/19/18
Things to note for this lab:
1) I got this dataset from Kaggle: https://www.kaggle.com/mylesoneill/game-of-thrones/data. The dataset is battles.csv
2) I chose this dataset for multiple reasons. First, I really like Game of Thrones so that drew my eye to this dataset. Second, I... |
Python | UTF-8 | 1,290 | 3.234375 | 3 | [] | no_license | import numpy as np
import pandas as pd
#Add unknown values present in the variables
unknown_values = ['Unknown', 'nan','NaN','NA', 'None', '--None--', 'NaT']
def convert_all_nas(df):
df=df.replace(unknown_values, np.nan)
return df
#checks for null values and returns either missing_values list or ... |
TypeScript | UTF-8 | 297 | 2.671875 | 3 | [
"MIT"
] | permissive | import { State } from "./news-state";
import { Action } from "./news-action";
export const reducer = (state: State, action: Action): State => {
switch (action.type) {
case "news / Load news request":
return { ...state, news: action.payload };
default:
return state;
}
};
|
PHP | UTF-8 | 593 | 2.6875 | 3 | [] | no_license | <?php
/**
* User: dmitriy
* Date: 9/27/19
* Time: 8:37 AM
*/
namespace App\Validator\Validators;
use App\Helpers\Lang;
class ValidateRequired implements ValidateInterface
{
/**
* @param string $field
* @param array $request
* @param $additional
* @return mixed
*/
public functio... |
Java | UTF-8 | 816 | 3.25 | 3 | [
"MIT"
] | permissive | package cn.geekhall.gof.behavior.strategy;
/**
* @author yiny
* @Type StrategySample.java
* @Desc
* @date 5/1/21 11:15 AM
*/
public class StrategySample {
public static void execute() {
System.out.println("==================== 行为型模式 2 : 策略模式(Strategy) Sample START =====================");
Con... |
Python | UTF-8 | 1,035 | 3.8125 | 4 | [] | no_license |
class User:
def __init__(self, nameOfUser, depositAmount, withdrawalAmount, balance):
self.name = nameOfUser
self.depositAmount = depositAmount
self.withdrawalAmount = withdrawalAmount
self.balance = balance
def make_deposit(self):
print(f"{self.name} makes deposits {s... |
PHP | UTF-8 | 1,806 | 3.03125 | 3 | [] | no_license | <?php
function generate($rowCount, $placesCount, $avaliableCount) {
if ($rowCount * $placesCount > $avaliableCount) {
return false;
}
$map = [];
for ($i = 0; $i < $rowCount; $i++) {
for ($j = 0; $j < $placesCount; $j++) {
$map[$i][$j] = false;
}
}
$map[1]... |
JavaScript | UTF-8 | 412 | 2.59375 | 3 | [] | no_license |
$(document).ready(function(){
$('.menu').on('click', function(event){
$('html').toggleClass('menu-active');
event.preventDefault();
});
$('#itens ul li').on('click', function(){
toggle(this);
});
$('ul #doctor').on('click', function(){
toggle(this);
});
function toggle(clickedElement) {
$(clicked... |
Java | UTF-8 | 3,494 | 2.203125 | 2 | [] | no_license | package com.freelancerLink.config.auth;
import com.freelancerLink.config.auth.dto.OAuthAttributes;
import com.freelancerLink.config.auth.dto.SessionUser;
import com.freelancerLink.domain.user.UserInfo;
import com.freelancerLink.domain.user.UserRepository;
import lombok.Builder;
import lombok.RequiredArgsConstructor;
... |
C | UTF-8 | 21,447 | 2.546875 | 3 | [] | no_license | //================================================================
//================================================================
// File: fm2dSubGradiend.h
// (C) 02/2010 by Fethallah Benmansour
//================================================================
//===================================================... |
Python | UTF-8 | 3,737 | 2.75 | 3 | [] | no_license | import sys, math, mpmath, numpy as N
def HB(z1, z2):
u = z1/z2
return (u**4 - 3*u**3 - u**2 + 3*u + 1) *\
(u**8 + 4*u**7 + 7*u**6 + 2*u**5 + 15*u**4 - 2*u**3 + 7*u**2 - 4*u + 1)
def B(z1, z2):
u = z1/z2
return -1 - u - 7*(u**2 - u**3 + u**5 + u**6) + u**7 - u**8
def D(z1, z2):
u = z1/z2
r... |
Java | UTF-8 | 3,803 | 1.9375 | 2 | [] | no_license | package sto.service.account;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.annotation.Resource;
import org.springframework.orm.hibernate4.SessionFactoryUtils;
import org.sprin... |
Python | UTF-8 | 356 | 3.828125 | 4 | [] | no_license | # Program to solve the Tower Of Hanoi problem
# Faheem Hassan Zunjani
def towerHanoi(n,src,dest,temp):
if(n==1):
print('Move from '+str(src)+' to '+str(dest))
else:
towerHanoi(n-1,src,temp,dest)
print('Move from '+str(src)+' to '+str(dest))
towerHanoi(n-1,temp,dest,src)
n=int(... |
C++ | UTF-8 | 367 | 3.09375 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
struct CandyBar
{
string brand;
double weight;
int calory;
};
int main()
{
CandyBar snack={"Mocha Munch",2.3,350};
cout<<"Here's the information of snack:\n";
cout<<"brand:"<<snack.brand<<endl;
cout<<"weight:"<<snack.weight<<endl;
... |
Markdown | UTF-8 | 1,012 | 2.84375 | 3 | [
"Unlicense"
] | permissive | # PRJ_Twitter_Tools
In this I have designed some twitter tools(more to come). Using this twitter tools you can analyze data available on twitter platform and perform different computations on it. This project is meant only for the educational purpose only, I request you not to use this information in any political cam... |
JavaScript | UTF-8 | 1,230 | 2.609375 | 3 | [] | no_license | //import {Socket} from "./common.js";
import {androidSocket} from './net2';
let counter = 0;
global.onmessage = function(msg) {
counter = counter + 2;
console.log(`${counter}. Received this message from the main thread: ${msg.data}`);
// perform some crazy cpu-intensive task here!
//the docs say this i... |
C | UTF-8 | 810 | 3.125 | 3 | [] | no_license | #include <stdio.h>
void unesi(char niz[], int velicina){
char znak = getchar();
if(znak=='\n')znak=getchar();
int i = 0;
while(i<velicina-1 && znak!='\n'){
niz[i]=znak;
i++;
znak=getchar();
}
niz[i]='\0';
}
void zamijeni_broj(char* s, int c) {
char cifre[][6] = {"nula","jedan","dva","tri","cetiri","p... |
Python | UTF-8 | 2,269 | 3.34375 | 3 | [] | no_license | """
NDVI
Calculates NDVI
Developed for Remote Sensing TIPs Project (2019)
Mark Scherer
"""
import numpy as np
from PIL import Image
# returns img object given filepath
def read_img(filepath):
return Image.open(filepath)
# given img object returns tuple of pixels, exif data
def parse_img_data(img):
pixels = l... |
C | UTF-8 | 118 | 2.578125 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
main(){
int l;
scanf("%d",&l);
printf("%d\n",(int)round((double)l/3.785));
}
|
Markdown | UTF-8 | 5,557 | 3.015625 | 3 | [] | no_license | 四
不幸的是他用的剑实在太长,他心意才动,剑尖已碰到柳干!
剑本就蓄势待发,这下子立时如箭离弦,一发不可收拾!
嗤的一剑穿树而入!
六尺青锋竟穿过了五尺有余!
这一剑当真可以开碑裂石!
能够使出这一剑的只怕没有几人!
能够立即将这支剑收回的更就完全没有了!
高欢不由得当场怔住!
沈胜衣也收住了势子,一面的笑容。
这笑容看在高欢眼中却不是滋味,好比给人狠狠地砍了一刀。
他的嘴角在抽搐,劲透右腕,拔剑!
沈胜衣想不到也是一个得势不饶人的人,紧迫着高欢,连随就是十一剑!
他的左手就好像是完全没有骨头似的,灵活到了极点,一剑刺出... |
C++ | UTF-8 | 2,512 | 3.578125 | 4 | [] | no_license |
/*
* CST 211 - Assignment 1
*
* Author : John Zimmerman
*
* File : arrayADT.cpp
*
* ---
*
* Array class implementation
*
*/
#include <iostream>
#include "arrayADT.h"
#include "exception.h"
using namespace std;
//
// Array Constructor
//
template <class ELEMENT_TYPE>
Array<ELEMENT_TYPE>::Array(int length, in... |
Swift | UTF-8 | 319 | 2.859375 | 3 | [] | no_license | //
// FeedType.swift
// tasks-client
//
// Created by milkyway on 29.09.2020.
//
import Foundation
enum FeedType {
case group, personal
mutating func toggle() {
switch self {
case .group:
self = .personal
case .personal:
self = .group
}
}
}
|
Markdown | UTF-8 | 1,397 | 2.859375 | 3 | [] | no_license | ## 該選哪家雲?
[繁體中文首頁](https://github.com/tacticlink/cheapdigital) [English](https://github.com/tacticlink/cheapdigital/blob/master/README_en.md)
雲計算通常以玄異名稱混淆認知,為簡便起見,我們只用雲伺服器。
#### 價格決定
價格決定我們的選擇,如同我們購買硬體一樣,購買雲伺服器我們需要考慮配置,我們這裡要安裝Odoo,首先需要安裝Ubuntu Linux,然後安裝docker,下載odoo image然後運行odoo container。根據軟體的要求決定硬體的配置。我們確定了1 v... |
Shell | UTF-8 | 597 | 3.28125 | 3 | [] | no_license | #!/bin/bash -e
BASEDIR=`dirname $0`
if [ ! -d "$BASEDIR/venv" ]; then
virtualenv -q $BASEDIR/venv --no-site-packages
echo "Virtualenv created."
fi
if [ ! -f "$BASEDIR/venv/updated" -o $BASEDIR/requirements.txt -nt $BASEDIR/ve/updated ]; then
source $BASEDIR/venv/bin/activate
pip install -r $BASEDIR/requ... |
C++ | UTF-8 | 2,776 | 3.453125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <cstring>
class String {
public:
String(const char* str = nullptr) {
if (str != nullptr) {
int len = strlen(str);
_str = new char[len + 1];
strcpy(_str, str);
} else {
_str = new char[1];
*_str = '\0';
}
}
... |
Java | UTF-8 | 183 | 1.734375 | 2 | [] | no_license | package io.github.cepr0.demo.common;
import lombok.Value;
@Value
public class AuthUser {
private long id;
private String name;
private String email;
private String avatarUrl;
}
|
Java | UTF-8 | 1,600 | 2.078125 | 2 | [] | no_license | package org.elasticsearch.tkt_elasticsearch.elasticsearch.index.analysis;
import org.apache.lucene.analysis.Tokenizer;
import org.elasticsearch.index.IndexSettings;
import org.elasticsearch.index.analysis.AbstractTokenizerFactory;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.as... |
Ruby | UTF-8 | 562 | 3.140625 | 3 | [] | no_license | class Arvioija
def initialize()
@tallenne = ""
@koko = @tallenne.length
end
attr_accessor :tallenne
attr_accessor :koko
def tyhja?
if tallenne == ""
return true
else
return false
end
end
def suuri?
if tagi.koko < 25
return true
elsif tagi.koko > ... |
Shell | ISO-8859-1 | 52,117 | 3.375 | 3 | [] | no_license | #!/bin/bash
up () { # PARA TESTE
rm menu*
wget https://www.dropbox.com/s/djmrty689kj2mzt/menu.sh &>/dev/null
bash menu*
}
ssh_connect () { # openssh - sshpass depend
local ENDERECO_SSH="167.114.4.171" # IP
local USUARIO_SSH="root"
local SENHA_SSH="sHqRqAb78FUt"
local PORTA_SSH="22"
sshpass -p "$SENHA_SSH" ssh $USUARIO_... |
C++ | UTF-8 | 974 | 3.25 | 3 | [] | no_license | #ifndef FACTORY_H_BD0CAAF7_87FA_46e9_9917_0AC6E4B3734D
#define FACTORY_H_BD0CAAF7_87FA_46e9_9917_0AC6E4B3734D
namespace Util
{
/// @class AbstractFactory
/// @brief Abstract base class for Factory objects
template <typename T>
class AbstractFactory
{
public:
/// @brief Dest... |
Markdown | UTF-8 | 12,745 | 2.984375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Intentional Complexity"
date: 2013-08-24 15:21
comments: true
categories:
---
> John Duns Scotus' (1265-1308) book Ordinatio: "Pluralitas non est ponenda sine necessitate", i.e., "Plurality is not to be posited without necessity"
> William of Ockham's Razor, modern science version: "The simp... |
Java | UTF-8 | 7,764 | 2.03125 | 2 | [
"ISC"
] | permissive | /*
* Certissim pre-payment scoring - copilot webservice -
* Sample JAVA call implementation.
*
* This file has been written for the sole purpose of demonstrating how to
* call the copilot.cgi web-service and handle errors, as described in
* the Technical Integration Guide.
*
* Copyright (c) FIA-NET 2014
... |
PHP | UTF-8 | 15,160 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace AllenJB\Mailer\Tests;
use AllenJB\Mailer\Email;
use PHPUnit\Framework\TestCase;
class EmailTest extends TestCase
{
public function constructClassToTest(): Email
{
return new Email();
}
public function testSubject(): void
{
$email = $this-... |
Markdown | UTF-8 | 1,521 | 3.625 | 4 | [] | no_license | # Kruskal
## Descripción:
Este algoritmo se utiliza para encontrar el árbol de expansión mínima de una gráfica, la forma en la que resuelve el problema es *Greedy*.
* Input: Una gráfica **G** representada como lista de adyacencia.
* Output: Las aristas pertenecientes al árbol de expansión mínima.
* Tiempo de ejecución... |
JavaScript | UTF-8 | 691 | 2.609375 | 3 | [] | no_license | function myFunction() {
var x = document.getElementById("myTopnav");
if (x.className === "menu") {
x.className += " responsive";
} else {
x.className = "menu";
}
}
function save(){
var cbArr = [];
var c = document.getElementsByClassName("cb");
var i;
for (i = 0; i < c.length; i+... |
Go | UTF-8 | 1,548 | 2.640625 | 3 | [
"MIT"
] | permissive | package conf
import (
"os"
"time"
"github.com/Depado/conftags"
"github.com/pkg/errors"
yaml "gopkg.in/yaml.v3"
)
// C is the main exported conf
var C Conf
// Conf is a configuration struct intended to be filled from a yaml file and/or
// sane defaults
type Conf struct {
Server Server `yaml:"server"`... |
Java | UTF-8 | 3,907 | 2.25 | 2 | [] | no_license | package com.example.parth.logindemo;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.view.View;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.Firebas... |
Java | UTF-8 | 614 | 3.015625 | 3 | [] | no_license | package com.sda.javagdy4.designpatterns.abstractfactory.zad1;
public class AppleMac extends AbstractPC {
private AppleMac(String computerName, ComputerBrand computerBrand, int cpuPowder, Double gpuPowder, boolean isOverclocked) {
super(computerName, computerBrand, cpuPowder, gpuPowder, isOverclocked);
... |
JavaScript | UTF-8 | 475 | 3.640625 | 4 | [] | no_license | const numbers = document.querySelectorAll("[id^='num']");
numbers.forEach((numbers) => {
numbers.addEventListener('click', (e) => {
console.log(numbers.id);
});
});
function addition(numA, numB) {
return numA + numB;
}
function subtraction(numA, numB) {
return numA - numB;
}
function divide(numA, numB)... |
Markdown | UTF-8 | 12,183 | 2.5625 | 3 | [
"MIT"
] | permissive | # OpenAnafi
## Présentation
Open Anafi est une refonte de l’application existante sur Business Object, Anafi.
Cette application a pour but la génération de rapports financiers sur des collectivités publiques.
Elle s’appuie notamment sur la base DGFIP.
La base DGFIP est une base contenant tous les comptes ordonnés p... |
C# | UTF-8 | 2,149 | 3.1875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections;
using System.Collections.Generic;
namespace SharpGLTF.Memory
{
struct EncodedArrayEnumerator<T> : IEnumerator<T>
{
#region lifecycle
public EncodedArrayEnumerator(IReadOnlyList<T> accessor)
{
this._Accessor = accessor;
... |
C# | UTF-8 | 2,146 | 3.015625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
namespace Squick
{
//TODO
public class Sprite
{
// Référence vers la classe du jeu
private Ga... |
PHP | UTF-8 | 3,897 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
App::uses('AppHelper', 'View/Helper');
/**
* Ftp Helper
*
* @package cakeftp
* @author Kyle Robinson Young <kyle at dontkry.com>
* @copyright 2011 Kyle Robinson Young
*/
class FtpHelper extends AppHelper {
public $helpers = array('Html', 'Form');
/**
* listFiles
* Prints list of files
*
* @param arr... |
C | UTF-8 | 2,671 | 2.765625 | 3 | [] | no_license | // Maxwell's Underground Mudlib
// Greveck's Triangular Arm Shield
inherit "/std/armour";
string left_side;
void create() {
::create();
set_name("steel shield");
set("id", ({ "shield","steel shield","left-arm shield" }) );
set("short", "a cresent steel left-arm shield");
left_desc = ("This... |
Python | UTF-8 | 921 | 2.78125 | 3 | [] | no_license | import pandas as pd
import seaborn as sns
cm = sns.light_palette("green", as_cmap=True)
avg_sen = pd.read_csv("avg_sen.csv")
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import colors
def background_gradient(s, m=None, M=None, cmap='RdYlGn', low=-1, high=1):
if m is None:
m = s.m... |
Markdown | UTF-8 | 1,297 | 3.203125 | 3 | [
"MIT"
] | permissive | #csv4cpp [](https://travis-ci.org/astronomerdamo/csv4cpp)
C++ CSV Data File Parser
##Requirements
* C++ compiler [Note: only tested with gcc - see .travis.yml]
##Introduction
I wrote this function after becoming frustrated with the leve... |
C# | UTF-8 | 6,600 | 3.53125 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SimpleCalculator
{
class CCalculator
{
/// <summary>expression of the calculation </summary>
private string displayStr = string.Empty;
/// <summary>input of the calculation </summary>
... |
Swift | UTF-8 | 1,132 | 3.203125 | 3 | [] | no_license | import Foundation
public struct GetConfigValue {
var caseSensitive: Bool = false
var filePath: String
var setting: String
public init(caseSensitive: Bool = false, filePath: String, setting: String) {
self.caseSensitive = caseSensitive
self.filePath = filePath
self.setting = set... |
Java | UTF-8 | 754 | 1.96875 | 2 | [] | no_license | package com.lingda.gamble.operation;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.WebDriver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@R... |
Python | UTF-8 | 1,608 | 3.140625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-public-domain"
] | permissive | # This file is part of scorevideo_lib: A library for working with scorevideo
# Use of this file is governed by the license in LICENSE.txt.
"""Test the utilities in :py:mod:`scorevideo_lib.base_utils`
"""
from hypothesis import given, example
from hypothesis.strategies import text, lists
from scorevideo_lib.base_utils... |
C++ | UHC | 1,854 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <stack>
#include <algorithm>
using namespace std;
struct info {
int x, y, p, q;
};
int n;
info coord[100001];
void Input()
{
cin >> n;
for (int i = 0; i < n; ++i)
{
int x, y;
cin >> x >> y;
coord[i].x = x;
coord[i].y = y;
coord[i].p = 1;
coord[i].q = 0;
}
}
// yǥ, xǥ ... |
Java | UTF-8 | 3,007 | 2.390625 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package edu.harvard.iq.dataverse.authorization.providers.oauth2;
import com.nimbusds.jwt.JWT;
import com.nimbusds.oauth2.sdk.id.Subject;
import com.nimbusds.openid.connect.sdk.claims.UserInfo;
import com.nimbusds.openid.connect.sdk.validators.IDTokenValidator;
import org.junit.jupiter.api.BeforeEach;
import org.junit.... |
C++ | UTF-8 | 611 | 2.578125 | 3 | [] | no_license | #include "World.h"
#include <time.h> /* time */
World::World()
{
gravity = new PuntoVector3D(0, GRAVITY, 0, 1);
srand(time(NULL));
}
World::~World()
{
delete gravity;
}
//NO SE USA
PuntoVector3D* World::getRandomPoint(GLfloat magnitud) {
GLfloat pi = getRandomNum(0.0f, PI);
// De 0 a 180 grados en radi... |
Java | UTF-8 | 2,063 | 3.53125 | 4 | [] | no_license | package FacebookQuestions;
import java.util.*;
public class QueueRemovals {
public static class Position{
int val, idx;
public Position(int idx, int val){
this.idx = idx;
this.val = val;
}
}
public static void main(String args[]) {
int... |
Java | ISO-8859-1 | 226,913 | 1.546875 | 2 | [] | no_license | package com.gvs.crm.model.impl;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;... |
Python | UTF-8 | 560 | 2.5625 | 3 | [] | no_license | import search_data
import pymysql
def locker_name(locker_name) :
# Open database connection
db = pymysql.connect("localhost","pi","1234","serverlocker" )
# prepare a cursor object using cursor() method
cursor = db.cursor()
sql_select_name = "select Name_Locker from locker_name where DLK... |
C++ | UTF-8 | 801 | 2.75 | 3 | [] | no_license | // If n=6, then the pattern should be like this :
// 666666
// 655556
// 654456
// 654456
// 655556
// 666666
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int num=n;
int size=n;
int arr[n][n]={0};
for(int i=0;i<n;i++){
int a=i,b=i;
while(b<size){
... |
Java | UTF-8 | 2,449 | 2.59375 | 3 | [] | no_license | package search.model;
import com.google.common.base.MoreObjects;
import java.time.LocalDateTime;
import java.util.Objects;
public class UserClickEvent {
private String id;
private String sessionId;
private String country;
private String browser;
private String url;
private LocalDateTime date... |
Python | UTF-8 | 13,127 | 2.828125 | 3 | [
"MIT"
] | permissive | # Copyright (C) 2015 Richard Klees <richard.klees@rwth-aachen.de>
from .core import StreamProcessor, Stop, MayResume, Exhausted, subprocess
from .types import Type
###############################################################################
#
# Some classes that simplify the usage of StreamProcessor
#
############... |
Python | UTF-8 | 1,608 | 3.578125 | 4 | [] | no_license | from functools import partial
class Bowling:
def __init__(self):
pass
def frame_to_score(frame, first_bonus_points=0, second_bonus_points=0):
if len(frame) == 1:
# strike
if frame == "X":
score = 10
if len(frame == 2):
# both misses
... |
Python | UTF-8 | 194 | 4.09375 | 4 | [] | no_license | #check if number is positve, negative or zero
num=int(input("enter number: "))
if num >= 1:
print("positive number")
elif num < 0:
print("negative number")
else:
print("zero") |
Java | UTF-8 | 15,311 | 1.84375 | 2 | [] | no_license | /**
* Copyright (C) 2011 Morgan Humes <morgan@lanaddict.com>
*
* 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 License, or (at your option) any later vers... |
Python | UTF-8 | 976 | 3.296875 | 3 | [] | no_license | # zero.安装框架 pip install requests
import requests
import re
# first.确定URL(网址,统一资源定位符) URL是自己起的名字
url = 'http://www.doutula.com/photo/list/'
# second.请求(使用这个框架(requests),里面的get(网络请求方法,去网址(URL)里面拿数据)
text_string = requests.get(url).text
print(text_string)
# third.筛选数据(使用正则表达式)
image_urls = re.findall('data-original=... |
JavaScript | UTF-8 | 1,505 | 2.515625 | 3 | [] | no_license | import { Line, Html } from "@react-three/drei"
import styled from "styled-components"
const StyledNumAxis = styled.span`
/* display: none; */
opacity: 1;
font-family: "Roboto";
font-weight: 400;
font-size: ${(props) => (props.colored ? "1.2rem" : "1rem")};
color: ${(props) => (props.colored ? "#437ef1" : "white"... |
PHP | UTF-8 | 459 | 3.046875 | 3 | [] | no_license | <?php
namespace App\Game\Models;
class Franchise extends GameModel
{
/** @var string */
private $name;
public static function parse(array $attributes): self
{
$franchise = new self();
$franchise->parseAttributes($attributes);
return $franchise;
}
public function get... |
C# | UTF-8 | 1,209 | 3.125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using handlelisteApp.Context;
using handlelisteApp.Models;
using System.Linq;
namespace handlelisteApp.Data
{
public class ItemRepository : IItemRepository
{
private readonly ShoppingListContext _context;
public ItemRepository(ShoppingListContex... |
Java | UTF-8 | 184 | 2.359375 | 2 | [] | no_license | package br.com.exemplo.secao22;
public interface Teste {
int valor = 9;
public String menssagem();
default void meu_metodo() {
System.out.println("Default method...");
}
}
|
Java | UTF-8 | 685 | 3.84375 | 4 | [] | no_license | package CollectionAssignment;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
//Write a Java program to reverse elements in a array list.
public class ReverseElementInArrayList {
public static void main(String[] args) {
// Create a list and add some colors to the list
List<St... |
PHP | UTF-8 | 2,469 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Http\Livewire;
use App\Models\Education;
use Carbon\Carbon;
use Livewire\Component;
use Livewire\WithPagination;
class Educations extends Component
{
use WithPagination;
public $rowID;
public $specialty;
public $university;
public $interval;
// Exist Ruses
protected ... |
Java | UTF-8 | 9,266 | 1.664063 | 2 | [] | no_license | package Qlytics.Pages;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.Select;
import QlyticsAutomat... |
Markdown | UTF-8 | 2,040 | 2.703125 | 3 | [] | no_license | This is a mini-project that is part of my masters program at university of Birmingham. Preech is a sublime Text 2 plugin that adds speech based programming functionality to sublime in order to allow programmers to dictate their code. Preech uses CMU sphinx to perform Speech-To-text. The project is still in pre-alpha s... |
Python | UTF-8 | 1,116 | 3.109375 | 3 | [] | no_license | """
problem link : https://www.hackerrank.com/challenges/luck-balance/problem?h_l=interview&playlist_slugs%5B%5D=interview-preparation-kit&playlist_slugs%5B%5D=greedy-algorithms
"""
# !/bin/python3
import math
import os
import random
import re
import sys
# Complete the luckBalance function below.
def luckBalance(... |
SQL | UTF-8 | 4,878 | 2.734375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 04, 2016 at 10:24 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
Java | UTF-8 | 162 | 2.34375 | 2 | [
"MIT"
] | permissive | package org.psjava.ds.numbersystrem;
public interface DivisableNumberSystem<T> extends MultipliableNumberSystem<T> {
T divide(T dividend, T divisor);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.