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 |
|---|---|---|---|---|---|---|---|
Shell | UTF-8 | 430 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/sh
sleep 30
echo "Start as daemon."
cd $TALEND_CONTAINER_HOME/bin/
./trun daemon &
echo "Done starting as deamon, wait a half of a minute for start to complete."
sleep 30
echo "Done starting, configure and stop."
echo "Configure ports."
sshpass -p tadmin ssh -o StrictHostKeyChecking=no tadmin@localhost -p 8101 ... |
C++ | UHC | 2,280 | 2.953125 | 3 | [] | no_license | //DFSMatrix.cpp
#include "DFSMatrix.h"
#include<stdio.h>
#include<Windows.h>
#include<iostream>
#include<fstream>
using namespace std;
#define col GetStdHandle(STD_OUTPUT_HANDLE) // ܼâ ڵ ƿɴϴ.
#define WHITE SetConsoleTextAttribute(col, 0x000f) //
DFSMatrix::DFSMatrix(){
q = 0;
m = 20;
n = 30;
df... |
Java | UTF-8 | 401 | 3.84375 | 4 | [] | no_license | package week1.day1;
public class Factorial {
/*
* Goal: Find the Factorial of a given number
*
* input: 5
* output: 5*4*3*2*1 = 120
*/
public static void main(String[] args) {
int input = 5;
int factorial = 1;
int i=1;
for(i=1; i<=input; i++) {
factorial = factorial*i;
}
... |
PHP | UTF-8 | 898 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Core\OAuth\OAuthBase\Yandex;
use Core\OAuth\Exception\OAuthException;
use Core\OAuth\OAuthBase\Common\CommonTokenCodeResponse;
use Core\OAuth\OAuthBase\OAuthBase;
use Core\OAuth\OAuthBase\IOAuthBase;
/**
* Управление OAuth авторизацией для сайта Yandex
*/
class OAuthYandex ... |
SQL | UTF-8 | 660 | 3.328125 | 3 | [] | no_license | /* SELECT */
/* FUNCAO PARA VER O HORARIO E DATA NO BANCO DE DADOS */
SELECT NOW();
/* SELECT PARA DIGITAR QUALQUER DADO */
SELECT 'Banco de Dados'
/* ALIAS(APELIDOS) DE COLUNAS */
SELECT 'Paula Fernandes' AS PROFESSORA;
/* SELECIONANDO APENAS ALGUNS ATRIBUTOS DA TABELA */
SELECT NOME,CPF,SEXO FROM CLIENTE;
/* FIL... |
C++ | UTF-8 | 1,345 | 2.65625 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<map>
#include<vector>
#include<deque>
using namespace std;
int main(){
vector<bool>lookup(10000,true);
for(int i=2;i<10000;++i){
if(lookup[i]){
for(int j=2*i;j<10000;++j)if(j%i==0)lookup[j]=false;
}
}
map<int,int> indexOf;
int index=0;
printf("int... |
Python | UTF-8 | 1,630 | 2.84375 | 3 | [] | no_license | import matplotlib.pyplot as plt
import os
import numpy as np
import matplotlib.pyplot as plt
class plot():
@staticmethod
def createBarChart(fileName, data):
barWidth = 0.15
ghsProgram = data['ghsProgram']
ghsAlgo = data['ghsAlgo']
br1 = np.arange(len(ghsProgram))
... |
Python | UTF-8 | 540 | 4.5 | 4 | [] | no_license | #Написати функцію is_year_leap, приймає 1 аргумент - рік, і повертає True, якщо рік високосний, і False в іншому випадку.
def is_year_leap(year):
if year % 4 == 0:
return True
else:
return False
def main():
year = int(input("Введіть рік: "))
if is_year_leap(year) == True:
print("... |
Markdown | UTF-8 | 2,755 | 2.53125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Vytvoření účtu úložiště pro Azure Data Lake Storage Gen2
description: Naučte se vytvořit účet úložiště pro použití s Azure Data Lake Storage Gen2.
author: normesta
ms.topic: how-to
ms.author: normesta
ms.date: 08/31/2020
ms.service: storage
ms.reviewer: stewu
ms.subservice: data-lake-storage-gen2
ms.openlocf... |
SQL | ISO-8859-1 | 9,036 | 3.203125 | 3 | [] | no_license | -- Empresa : Supermercado So Roque Ltda.
-- Data :02/02/2013
-- Atualizado em : 24/04/2013
-- Desenvolvedor : Sandro Soares.
-- Solicitante : Solange Pinheiro
-- Descrio : Retorna as movimentaes de finalizadoras por dia e por loja.
-- Tambm incluido as devolucoes da agenda 21 por dia, enviar junto. ... |
C | UTF-8 | 2,117 | 2.96875 | 3 | [] | no_license | #ifdef sgi
/*
* Yellow pages utility routine to map client map names to names
* that are short enough to work with 14 character file names.
*/
/*
* Translation table for mapping dbnames.
*
* The mapped name must be short enough to remain unique
* after the addition of the suffixes ".t.dir" and ".t.pag".
* The ... |
SQL | UTF-8 | 892 | 3.25 | 3 | [
"MIT"
] | permissive | create user pizarra_user password 'pizarra_3323948812bdz';
create database pizarra_db owner pizarra_user;
\c pizarra_db
drop schema if exists piz cascade;
create schema piz authorization pizarra_user;
grant all on schema piz to pizarra_user;
create table piz.users(
username text primary key,
md5pass te... |
Java | UTF-8 | 978 | 2.46875 | 2 | [
"Apache-2.0"
] | permissive | package io.github.ketao1989.jdk8;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author tao.ke Date: 2017/7/23 Time: 下午10:02
*/
public class ProcessTemplate {
private static final Logger logger = LoggerFactory.getLogger(ProcessTemplate.class);
public static <T> T execute(TemplateProcessor<T> ... |
C++ | UTF-8 | 473 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
ll phi( ll n ) {
ll res = n ;
for ( ll i = 2 ; i * i <= n ; i++){
if( n % i == 0 ){
while( n % i == 0 ) n = n / i ;
res = res - res / i ;
}
}
if(n > 1) res = res - res / n ;
return res ;
}
int main()
{
ios_base::sync_with_... |
C | UTF-8 | 516 | 3.5 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
int main(void)
{
int a, b, c, t;
char str[4];
int i, izlaz[3];
scanf( "%d%d%d", &a, &b, &c );
if ( a > b ) { t = a; a = b; b = t; }
if ( a > c ) { t = a; a = c; c = t; }
if ( b > c ) { t = b; b = c; c = t; }
scanf( "%s", str );
for ( i=0; i<3; ++i ) {
if ( str... |
PHP | ISO-8859-1 | 2,531 | 2.53125 | 3 | [] | no_license | <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title></title>
</head>
<body >
</body>
<?php
$faire=1;
if (isset($_POST['seance_name']))
{
$seance_name=$_POST['seance_name'];
}
if (isset($_POST['sport_id']))
{
$sport_id=$_POST['sport_id'];
}
if (isset($_POST['da... |
Markdown | UTF-8 | 748 | 3.21875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "HTML"
comments: true
categories: HTML
---
### Box, Item
- BOX: header, footer, nav, aside, main, section, article: section 안에 들어가며, 재사용이 가능한, 혹은 반복되는 것을 묶어준 것, div: 다른 요소를 묶어서 스타일을 할때, span, form
- ITEM: a, button, input, label, img, video, audio, map, canvas, table
### Block, Inline
- bl... |
Python | UTF-8 | 651 | 3.984375 | 4 | [] | no_license | # Find and Replace
words = "It's thanksgiving day. It's my birthday,too!"
print words
result = words.find('day')
print(result)
string = words.replace('day','month')
print string
#Min and Max
x = [2,54,-2,7,12,98]
print min(x)
print max(x)
#First and Last
x = ['hello',2,54,-2,7,12,98,'world']
print 'List: ', x
print ... |
C++ | UTF-8 | 571 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include "CommonPair.h"
void CommonPair::copy(int key, double value)
{
Pair<int, double>::copy(key, value);
}
CommonPair::CommonPair()
{
}
CommonPair::CommonPair(int key, double value)
{
this->copy(key, value);
}
CommonPair::CommonPair(CommonPair const &other)
{
... |
Java | UTF-8 | 782 | 3.046875 | 3 | [] | no_license | package nl.utwente.plantcontroller.auth;
import java.security.SecureRandom;
import java.util.Random;
public class PasswordGenerator {
static final String allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public static String generatePass(){
Random rand = new Random();
... |
Python | UTF-8 | 216 | 3 | 3 | [] | no_license | from time import sleep
import sys
s = raw_input("Enter a recursive acronym: ")
for x in range(20000):
y = x**2
sleep(3)
sys.stderr.write("\nnot enough memory to perform this operation")
raw_input("")
sys.exit(1)
|
Markdown | UTF-8 | 3,471 | 2.75 | 3 | [] | no_license | # List pros / cons use docker-compose.yml on production
## "docker-compose.yml" vs "only docker"
See this examples:
* [Deploy Sentry only with Docker](examples/sentry-with-only-docker/)
* [Deploy Sentry with docker-compose](examples/sentry-with-docker-compose/)
Technically [docker-compose](https://docs.docker.com/c... |
Java | UTF-8 | 2,248 | 2.390625 | 2 | [] | no_license | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package com.google.zxing.client.android.encode;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
// Referenced... |
Java | WINDOWS-1250 | 2,807 | 2.53125 | 3 | [] | no_license | package br.com.fiap.resource;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.InternalServerErrorException;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
... |
Java | UTF-8 | 801 | 2.03125 | 2 | [] | no_license | package cn.geoportal.gmo.server.service;
import cn.geoportal.gmo.server.entity.SysMenu;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
*
*/
public interface SysMenuService extends IService<SysMenu> {
/**
* 1、根据用户id查询菜单列表
*
* @return
*/
List<SysMe... |
Markdown | UTF-8 | 750 | 2.609375 | 3 | [] | no_license | # 自定义Hook
State HOOK: useState
Effect HOOK: useEffect
自定义Hook:将一些常用的,跨越多个组件的HOOK功能,抽离出去形成一个函数,该函数就是自定义HOOK
由于其内部需要使用HOOK功能,所以它本身也需要按照HOOK规则实现:
1. 函数名必须以use开头
2. 调用自定义HOOK函数时,应该放到顶层
例如:
1. 很多组件都需要在第一次加载完成之后,获取所有学生的数据
2. 很多组件都需要在第一次加赞完成后,启动一个计时器,然后在组件销毁时卸载
> 使用hook的时候,如果没有按照hook的规则进行,eslint的一个插件会报出警告,eslint-plugin-react... |
Markdown | UTF-8 | 2,782 | 2.75 | 3 | [] | no_license | +++
title: "Tun Mustapha cannot be sworn in as Sabah Affairs Minister in early August unless unconstitutional pressure is applied to get the constitutional amendment to repeal Article 43(8) to become law"
date: "1993-06-18"
tags:
+++
_by Parliamentary Opposition Leader, DAP Secretary-General and MP for Tanjung,... |
Go | UTF-8 | 2,050 | 3.25 | 3 | [
"Apache-2.0"
] | permissive | // Package canonical provides a simple normalization for device identifiers. These
// identifiers have the form {prefix}:{id}/{service}/{ignored}, where only {prefix}
// and {id} are required.
package canonical
import (
"errors"
"fmt"
"regexp"
"strings"
"unicode"
)
// Id represents a normalized identifer for a ... |
C# | UTF-8 | 2,230 | 3.328125 | 3 | [] | no_license | using DeepSearch_Labyrinth.Services;
using System;
namespace DeepSearch_Labyrinth
{
class Program
{
static void Main(string[] args)
{
SearchService service;
while (true)
{
int opt = MapChoice();
switch (opt)
{
... |
Java | UTF-8 | 3,016 | 2.171875 | 2 | [] | no_license | package com.google.api.services.sheets.v4.model;
import com.google.api.client.json.GenericJson;
import com.google.api.client.util.Key;
import java.util.List;
public final class CellData extends GenericJson {
@Key
private DataValidationRule dataValidation;
@Key
private CellFormat effectiveFormat;
@... |
Java | UTF-8 | 339 | 1.9375 | 2 | [] | no_license | package tomining.java.json.jackson.jodatime.model;
import org.joda.time.DateTime;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Data;
/**
* Created by naver on 2017. 5. 4..
*/
@Data
@Builder
public class User {
private String id;
private String password;
private Date... |
C | UTF-8 | 1,988 | 2.921875 | 3 | [] | no_license | #include <sys/types.h>
#include <unistd.h>
//#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "runservice.h"
ssize_t getline(char **buf, size_t *n, FILE *fp) {
char c;
int needed = 0;
int maxlen = *n;
char *buf_ptr = *buf;
if (buf_ptr == NULL || maxlen == 0) ... |
Java | UTF-8 | 373 | 2.875 | 3 | [] | no_license | package Lista1;
public class Questao11 {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[][] matriz = new int[10][10];
for (int i = 0; i < matriz.length; i++) {
for (int j = 0; j < matriz.length; j++) {
System.out.print((i+1) + "-" + (j+1) + " ");
if(j==9) {... |
Python | UTF-8 | 812 | 2.59375 | 3 | [] | no_license | """
html转pdf
"""
import pdfkit
class Html2pdf(object):
__BASE_PATH = 'file/'
def __init__(self):
pass
@staticmethod
def handle():
options = {
'encoding': "UTF-8",
'no-outline': None,
'disable-smart-shrinking': None,
'no-pdf-compression'... |
Markdown | UTF-8 | 1,468 | 2.625 | 3 | [
"MIT"
] | permissive | <p align="center">
<img src="https://yasinates.com/counter-up.gif" width="400">
</p>
<h2 align="center">React Counter Up</h2>
[](https://badge.fury.io/js/react)
This project is basic counter up app via [React](https://github.com/facebook/react/).
T... |
JavaScript | UTF-8 | 5,032 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { View, Button, TextInput, Text, TouchableOpacity, StyleSheet } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
import { useState } from 'react';
import { useEffect } from 'react';
export default function SetRecipe({ route, navigation }) {
... |
C++ | UTF-8 | 788 | 2.65625 | 3 | [] | no_license | #ifndef SIMULATION_FRAMEWORK_SIMULATIONINITIALIZER_H
#define SIMULATION_FRAMEWORK_SIMULATIONINITIALIZER_H
#include <SDL.h>
#include "enums/SubSystems.h"
namespace sf {
/** Initialize SDL at construction and shutdown at destruction. */
class Initializer {
public:
/** Initialize SDL's provided subsy... |
Shell | UTF-8 | 1,254 | 2.71875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
INCLUDE_GLOB="include/*.sh"
source "$(dirname "$(readlink -f "$0")")"/../test.sh
start_test "Regression #31: double error reporting"
generate_test_fail_check 'assert_equals "$(false)" ""' <<EOF
[test.sh] pending_exception exception: Pending exception, probably a masked error in a command substitution
[tes... |
C# | UTF-8 | 1,997 | 3.109375 | 3 | [] | no_license | public static IEnumerable<T> MultisetIntersect(this IEnumerable<T> first,
IEnumerable<T> second, IEqualityComparer<T> comparer)
{
// Call the overload with the default comparer.
return first.MultisetIntersect(second, EqualityComparer<T>.Default);
}
public static IEnumerable<... |
JavaScript | UTF-8 | 1,441 | 4.4375 | 4 | [
"MIT"
] | permissive | // Implement the following operations of a queue using stacks.
//
// push(x) -- Push element x to the back of queue.
// pop() -- Removes the element from in front of queue.
// peek() -- Get the front element.
// empty() -- Return whether the queue is empty.
//
// Notes:
//
// You must use only standard o... |
Python | UTF-8 | 256 | 2.78125 | 3 | [] | no_license | def unpad(s):
if s[-1] == 0 or s[-s[-1]:] != bytes([s[-1]] * s[-1]):
return 'invalid'
return 'valid'
print(unpad(b'ICE ICE BABY\x04\x04\x04\x04'))
print(unpad(b'ICE ICE BABY\x05\x05\x05\x05'))
print(unpad(b'ICE ICE BABY\x01\x02\x03\x04'))
|
C++ | UTF-8 | 394 | 3.015625 | 3 | [] | no_license | #include<iostream>
#include<iomanip>
using namespace std;
int main(){
float x,y=10.5,average;
cin>>x;
while(x<0 || x>10.0){
cout<<"nota invalida"<<endl;
cin>>x;
}
cin>>y;
while(y<0 || y>10.0){
cout<<"nota invalida"<<endl;
cin>>y;
}
average = (x+y)/2.0;
... |
C# | UTF-8 | 1,788 | 3.15625 | 3 | [] | no_license | using System;
namespace SuperVisitor.Potato
{
public static class Potato
{
public static void DoStuff()
{
var sqlServer = new SqlServerConfig
{
Server = "cda-dev-db02.devid.local",
Database = "CDA-DEV",
Port = 1512
... |
Java | UTF-8 | 443 | 1.609375 | 2 | [] | no_license | package scripts;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;
import pom.EndocLoaded;
public class EnDocTest extends EnsuperTest {
@Test
public void doclodedTest()
{
Actions actions=new Actions(driver);
EndocLoaded d = new EndocLoade... |
C++ | UTF-8 | 1,367 | 4.0625 | 4 | [
"Unlicense"
] | permissive | #include <iostream>
//
// Code by: Jeremy Pedersen
//
// Licensed under the BSD 2-clause license (FreeBSD license)
//
using namespace std;
class Student {
// Data
private:
string name;
int age;
float score;
// Methods (functions inside the class)
public:
void setData(stri... |
C | UTF-8 | 9,236 | 3.25 | 3 | [] | no_license | #include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <strings.h>
#include <string.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/sendfile.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/errno.h>
#define MAXLINE 4096
#def... |
PHP | UTF-8 | 1,225 | 3.0625 | 3 | [] | no_license | <?php
class Usuario
{
private $_id;
private $_nombre;
private $_clave;
private $_ultimoLogueo;
private $_idEmpleado;
public function SetNombre($nombre)
{
$this->_nombre = $nombre;
}
public function SetClave($clave)
{
$this->_clave = sha1($clave);
}
publ... |
Python | UTF-8 | 1,008 | 4.28125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
A Generator Expression
So, a generator expression produces a generator
A generator expression can be understood as a lazy version of a list comprehension:
it does not eagerly build a list, but returns a generator that will lazily produce the items on demand.
In other words, if a list compr... |
Markdown | UTF-8 | 3,600 | 3.828125 | 4 | [] | no_license | #Types of Design Patterns
#Behavioral Patterns
Behavioral patterns are design patterns that are explain how the objects react. It describes how different objects and classes interact with each other by sending messages. They objects and classes talk to each other about how to do things and also how to divide a class a... |
Python | UTF-8 | 1,552 | 3.171875 | 3 | [] | no_license | from hex_to_base64 import hex_to_base64
from subprocess import Popen, PIPE
#confirmed = "false"
confirmed = "true"
port_number_information = "input port number (1~223): "
hex_string_information = \
"input hex string\n" + \
" Example: 12345678ABCDEF\n"
command_format_string = \
'mosquitto_pub -h 127.0.0.1' + \
... |
Java | UTF-8 | 8,739 | 3.8125 | 4 | [] | no_license |
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Arrays;
import java.util.Comparator;
/**
In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way:
High Card: Highest value card.
One Pair: Two cards of the same value.
Two Pairs: Two ... |
Java | UTF-8 | 1,537 | 2.703125 | 3 | [] | no_license | package com.example.android.clientintelligent.interpreter.tflite;
import com.example.android.clientintelligent.framework.pojo.Mission;
import java.io.IOException;
import java.nio.ByteBuffer;
public class FloatTFLiteClassifier extends TFLiteClassifier{
/** MobileNet requires additional normalization of the used i... |
Java | UTF-8 | 1,289 | 2.78125 | 3 | [] | no_license |
import static org.junit.Assert.*;
import org.junit.Test;
public class SudokuVerifierTest {
// A correct Sudoku string: 417369825 632158947 958724316 825437169 791586432 346912758 289643571 573291684 164875293
// An incorrect Sudoku string: 123456789912345678891234567789123456678912345567891234456789123345678912234... |
Python | UTF-8 | 1,749 | 2.78125 | 3 | [] | no_license | import unittest
import json
import errno
import os
from seprcph.json_loader import _objs_from_file
PATH = 'test.json'
class Foo(object):
def __init__(self, string, integer):
self.string = string
self.integer = integer
def obj_hook(kwargs):
return Foo(**kwargs)
class TestJsonFiles(unittest.T... |
Java | UTF-8 | 491 | 1.601563 | 2 | [
"Apache-2.0"
] | permissive | package com.qaplus.mapper;
import com.qaplus.entity.QaUser;
import com.qaplus.entity.QaUserExample;
import java.util.List;
public interface QaUserMapper {
int countByExample(QaUserExample example);
int deleteByExample(QaUserExample example);
int deleteByPrimaryKey(QaUser record);
int insertSelectiv... |
Java | UTF-8 | 790 | 2.734375 | 3 | [] | no_license | package com.idp.studentmanagement.objects;
import androidx.annotation.NonNull;
public class UserType {
private int id;
private String type;
public UserType(int id, String type) {
this.id = id;
this.type = type;
}
public UserType(String type) {
this.type = type;
s... |
Python | UTF-8 | 1,970 | 2.546875 | 3 | [] | no_license | import pandas as pd
base_path = 'G:/dataset/a3d6_chusai_a_train/dealt_data/'
trainset1_path = base_path + 'dataset_train_1/'
testset1_path = base_path + 'dataset_test_1/'
trainset2_path = base_path + 'dataset_train_2/'
testset2_path = base_path + 'dataset_test_2/'
trainset3_path = base_path + 'dataset_train_3/'
launc... |
Java | UTF-8 | 1,116 | 2.046875 | 2 | [] | no_license | package com.cebrail.app.domain;
import java.math.BigDecimal;
import java.time.LocalDate;
import javax.annotation.Generated;
import javax.persistence.metamodel.SetAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value = "org.hibernate.jpamo... |
C# | UTF-8 | 4,857 | 3.03125 | 3 | [
"MIT"
] | permissive | using System;
using static System.Console;
using Packt.CS7;
using Microsoft.EntityFrameworkCore;
using System.Linq;
using System.Xml.Linq;
namespace LinqWithEFCore
{
class Program
{
static void Main(string[] args)
{
using (var db = new Northwind())
{
var... |
SQL | UTF-8 | 3,262 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 15, 2019 at 11:52 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
JavaScript | UTF-8 | 5,184 | 2.953125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import Head from "next/head";
import Pokedex from "../components/Pokedex";
import styles from "../styles/Home.module.css";
export default function Home() {
const [imageUrl, setImageUrl] = useState("");
const [pokemonName, setPokemonName] = useState("");
const [... |
Python | UTF-8 | 5,009 | 3.859375 | 4 | [] | no_license | class Node:
def __init__(self, item):
self.val = item
self.left = None
self.right = None
class BTree:
def __init__(self):
self.head = Node(None)
self.in_order_list = []
self.pre_order_list = []
self.post_order_list = []
def add(self, item):
... |
C | UTF-8 | 888 | 3.359375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
bool checkRepe(unsigned long int arr[],int n,int num){
for(int i = 0; i < n; i++)
{
if(arr[i] == num){
return false;
}
}
return true;
}
int main()
{
srand(time(NULL));
int seed=1000;
int step = 10;
int n=10;
prin... |
Java | UTF-8 | 662 | 2.28125 | 2 | [] | no_license | package com.e.taskapp_1;
import android.app.Application;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import com.e.taskapp_1.room.MyDataBase;
public class App extends Application {
private MyDataBase myDataBase;
public static App instance;
@Override
public void onCreate() {
... |
Python | UTF-8 | 404 | 2.578125 | 3 | [] | no_license | from tornado.web import RequestHandler
class LoginHandler(RequestHandler):
def get(self):
self.render('login.html')
def post(self):
username = self.get_argument('username')
password = self.get_argument('password')
self.authentication(username,password)
def authentication(self,username,password):
if usern... |
JavaScript | UTF-8 | 1,997 | 2.734375 | 3 | [] | no_license | const express = require('express')
const app = express()
const cors = require('cors');
var floor_one = require('./floor_one');
var floor_two = require('./floor_two');
var port = process.env.PORT || 3000,
http = require('http'),
fs = require('fs'),
html = fs.readFileSync('index.html');
bodyParser = re... |
Markdown | UTF-8 | 779 | 2.8125 | 3 | [] | no_license | ---
title: "Confucius"
---
His doctrine of duty and public service had a great influence on subsequent Chinese thought and served as a code of conduct for government officials. Although his real name was Kongzi (551-479 B.C.E.).
Chinese philosopher (circa 551-478 BC)
(551-479 BCE) A Chinese philosopher known also as ... |
Java | UTF-8 | 171 | 2.703125 | 3 | [] | no_license |
public class CreateTest1 {
public static void main(String[] args) {
for (int i = 0; i < 200_000; ++i) { System.out.println(200_000 + " " + 10_000); }
}
} |
Java | UTF-8 | 944 | 2.140625 | 2 | [] | no_license | package utilities;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Utilities {
WebDriver driver;
WebDriverWait webDriverWait;
public Utilities(We... |
Java | UTF-8 | 245 | 1.953125 | 2 | [
"MIT"
] | permissive | //,temp,sample_7343.java,2,9,temp,sample_7500.java,2,10
//,3
public class xxx {
private void doChangeDirectory(String path) {
if (path == null || ".".equals(path) || ObjectHelper.isEmpty(path)) {
return;
}
log.info("changing directory");
}
}; |
TypeScript | UTF-8 | 2,895 | 2.765625 | 3 | [
"MIT"
] | permissive | rpio.init({gpiomem: false}); /* Use /dev/mem for i²c/PWM/SPI */
rpio.init({mapping: 'gpio'}); /* Use the GPIOxx numbering */
/* Configure P11 as input with the internal pulldown resistor enabled */
rpio.open(11, rpio.INPUT, rpio.PULL_DOWN);
/* Configure P12 as output with the initiate state set high */
rpio.open... |
Java | UTF-8 | 2,104 | 2.65625 | 3 | [] | no_license | package Mailman;
import Interfaces.IOpazovalec;
import Models.Aktivnost;
import Models.Oseba;
import javax.annotation.Resource;
import javax.ejb.Stateless;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddres... |
C | UTF-8 | 238 | 3.203125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
FILE *printer;
printer = popen("lp","w");
if( printer==NULL )
{
fprintf(stderr,"Unable to open `lp`\n");
return(1);
}
fprintf(printer,"Hello, Mr. Printer!\n");
pclose(printer);
return(0);
}
|
Shell | UTF-8 | 1,094 | 3.765625 | 4 | [] | no_license | #!/bin/sh
printf 'Enter username: '
read -r USERNAME
printf "Enter password: "
read -r PASSWORD
printf "Enter database name ${USERNAME}_[base]: "
read -r DB
if [ -z "$DB" ]; then
DB="base"
fi
DB="${USERNAME}_$DB"
echo ""
echo "Please confirm the following information:"
echo " Username: $USERNAME"
echo " Pa... |
C# | UTF-8 | 700 | 3.15625 | 3 | [] | no_license | using System.Collections.Generic;
namespace courseApp2.Models
{
public static class Repository //bu static sınıf uygulama içinde sadece 1 tane olucak ve new ile yeni obje üretilmicek veri tabanı rolünü üstlenicek sanal veritabanı oluşturduk bir nevi ramde geçici saklancak
{
public static List<Student> ... |
Markdown | UTF-8 | 938 | 2.640625 | 3 | [] | no_license | # registradores-de-uso-geral
Registradores de Uso Geral
Os 8 GPRs, ou Registradores de Uso Geral, são os seguintes (por ordem de introdução na pilha ao executar a instrução PUSHAD):
EAX - Acumulador. Usado em operações aritméticas.
ECX - Contador. Usado em loops.
EDX - Registrador de Dados. Usado em opera... |
Java | UTF-8 | 2,142 | 2.5625 | 3 | [] | no_license | package voter;
import java.util.List;
/**
* Created by xaviersilva on 09/05/17.
*/
public class PersonalBackup {
protected int carbsInMeal;
protected int carbsRatio;
protected int bloodSugarLevel;
protected int targetBloodSugar;
protected int physicalAct;
protected List<Integer> physicalSamp... |
Java | UTF-8 | 1,197 | 2.109375 | 2 | [] | no_license | package com.xy.DayTenGoods.ui.goods;
import android.content.Context;
import android.graphics.Color;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import com.xy.DayTenGoods.util.DisplayUtil;
import com.xy.DayTenGoods.util.recyclerview.RecyclerViewHeader;
/**
* Created by x... |
C++ | UTF-8 | 573 | 2.625 | 3 | [] | no_license | #pragma once
#include <map>
#include <vector>
#include <iostream>
class Statistics
{
public:
std::map<unsigned char, int> alpha;
unsigned char alphabet[256];
Statistics();
~Statistics();
void calculateStatistics(const std::vector<unsigned char>& text, std::map<unsigned char, int>& statistic... |
Shell | UTF-8 | 2,580 | 4.0625 | 4 | [] | no_license | #!/bin/bash
# Declare Colors
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# check distro and see if we are on ubuntu
DISTRO="$(cat /etc/lsb-release | grep DISTRIB_ID | cut -d'=' -f2)"
# function that creates ~/.config/awesome if not there or cd if there
function copyAwesomeConfig {
# check ~/.config
... |
Java | UTF-8 | 630 | 2.828125 | 3 | [] | no_license | package se.chalmers.krogkollen.vendor;
/**
* Created by Jonathan Nilsfors on 2014-08-25.
*/
public class Vendor implements IVendor {
private String name;
private double longitude;
private double latitude;
public Vendor(String name, double latitude, double longitude){
this.name = name;
... |
Shell | UTF-8 | 2,149 | 3.984375 | 4 | [] | no_license | #!/usr/bin/env bash
# bin/compile <build-dir> <cache-dir> <env-dir>
# Configure environment
set -e # fail fast
set -o pipefail # don't ignore exit codes when piping output
# set -x # enable debugging
# Functions
function indent() {
c='s/^/ /'
case $(uname) in
Darwin) sed -l "$c";... |
Java | UTF-8 | 3,583 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package com.store.web.front.controller;
import java.io.File;
import java.io.IOException;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.beans.... |
C++ | UTF-8 | 468 | 2.515625 | 3 | [] | no_license | #include "streamBuffer.h"
size_t bufferedStream::fread(void *dst, int siz, int C)
{
// TODO implement this method
// for now stubbed so that compilation is possible
return 0;
}
bufferedStream::~bufferedStream()
{
if(buffer != nullptr)
delete[] buffer;
}
int bufferedStream::appendDataToBuffer(... |
C# | UTF-8 | 1,995 | 3.875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _05.ClosestTwoPoints
{
class Program
{
static void Main(string[] args)
{
int numberOfPoints = int.Parse(Console.ReadLine());
Point[] points = ne... |
Java | UTF-8 | 9,006 | 2 | 2 | [] | no_license | package com.gratus.userapp.Fragment;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Linear... |
Python | UTF-8 | 814 | 3.78125 | 4 | [] | no_license | '''
Created on Apr 23, 2021
@author: Karthik
'''
def make_amount(rupees_to_make,no_of_five,no_of_one):
five_needed=0
one_needed=0
#Start writing your code here
#Populate the variables: five_needed and one_needed
five_needed = rupees_to_make // 5
if(five_needed>no_of_five):
... |
PHP | UTF-8 | 6,166 | 2.609375 | 3 | [] | no_license | <?php
include_once "conexion.php";
$op = $_POST["caso"];
switch($op)
{
case "agregar" :
AgregarPerro_bd();
break;
case "verificar":
VerificarPerro();
break;
case "traerBD":
TraerBD();
break;
case "eliminarPerro":
EliminarPerro();
... |
JavaScript | UTF-8 | 727 | 3.875 | 4 | [] | no_license | function even(arr) {
for (var i = 0; i < arr.length; i++)
{
if (Array.isArray(arr[i]))//判断是不是数组,是数组则递归
{
even(arr[i]);
}
else{
arrf.push(arr[i]);
}
}
return arrf;
}
var arrf = [];
let arr = [1, [2, [3, 4]]];
even(arr);
conso... |
Go | UTF-8 | 513 | 2.90625 | 3 | [] | no_license | package objects
import "testing"
func TestMakeDoc(t *testing.T) {
text := "The quick brown fox"
doc := MakeDoc(text)
if doc.Text != text {
t.Error("Given text and DocText not equal")
}
if len(doc.Tokens) != 4 {
t.Error("4 tokens expected for", text, "got", len(doc.Tokens))
}
}
func TestCountTokens(t *tes... |
Java | UTF-8 | 1,902 | 2.125 | 2 | [
"MIT"
] | permissive | package ru.test.struts2.action;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.Validations;
import com.opensymphony.xwork2.validator.annotations.ValidatorType;
import org.apache.struts2.con... |
Java | UTF-8 | 1,401 | 2.578125 | 3 | [] | no_license | package com.threerings.fisy.tools;
import java.util.Collections;
import java.util.List;
import java.io.IOException;
import com.bungleton.yarrgs.Positional;
import com.bungleton.yarrgs.Unmatched;
import com.bungleton.yarrgs.Usage;
import com.bungleton.yarrgs.Yarrgs;
import com.samskivert.io.StreamUtil;
import com.t... |
JavaScript | UTF-8 | 7,331 | 2.6875 | 3 | [] | no_license | import React from 'react';
class App extends React.Component{
constructor(props){
super(props);
this.state = {
index:0,
subIndex:0,
checked1:true,
checked2:true
};
this.changeState = this.changeState.bind(this);
this.subList= [... |
C++ | UTF-8 | 1,337 | 3.96875 | 4 | [] | no_license | //Lab9-1.cpp - circle calculations
//Created/revised by <your name> on <current date>
#include <iostream>
#include <cmath>
using namespace std;
//function prototypes
double getArea(double rad);
double getDiameter(double rad);
double getCircumference(double rad);
int main()
{
int choice = 0;
double radius = 0.0;
... |
Java | UTF-8 | 275 | 1.804688 | 2 | [] | no_license | package ui.tests;
import org.junit.Ignore;
import org.junit.Test;
public class RegistrationTest extends BaseUITestCase {
@Ignore
@Test
public void successfulRegistrationTest() {
homeSteps
.registerNewUser()
.verifyCorrectUserIsLoggedIn();
}
}
|
Python | UTF-8 | 10,129 | 2.53125 | 3 | [] | no_license | #!/usr/local/bin/python
import string,math,os,sys
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
def GetRequestedEvents(run_card_name):
name = ""
val = 0
nevt = 1000;
run_card=open(run_card_name,"r")
lines = run_card.readlines()
... |
Python | UTF-8 | 1,322 | 3.921875 | 4 | [] | no_license | import time
#From 100 million data, find target
data = list(range(1,100000000))
target = 1000
#Time check function
def time_take_chk(fname):
t1=time.clock()
if fname(data,target) == True:
t2=time.clock()
print((fname.__name__) + "method took ",(t2-t1)," seconds")
else:
print((fname._... |
C++ | UTF-8 | 5,146 | 2.609375 | 3 | [] | no_license | #include "ObjReader.h"
#include <cstdlib>
#include <cstdio>
#include <stdio.h>
#include <vector>
#include <fstream>
#include <string>
#include <sstream>
// #include <regex>
ObjReader::ObjReader(){
is_transformed = false;
}
ObjReader::~ObjReader(){
}
//Sources viewed/used: http://www.opengl-tutorial.org/beginners-t... |
C# | UTF-8 | 1,874 | 2.65625 | 3 | [] | no_license | using Microsoft.EntityFrameworkCore;
using SnookerTrainingCore.Domain.Entidades;
using SnookerTrainingCore.Domain.Repositorios.Interfaces;
using SnookerTrainingCore.Infra.Contexto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
namespace SnookerTra... |
Python | UTF-8 | 272 | 4.125 | 4 | [] | no_license |
for numero in range(0,61):
print(f"el cuadrado de {numero} es: {numero*numero}")
print("\n ############ CON METODO WHILE ##############")
numero = 0
while numero <=60:
cuadrado = numero*numero
print(f"el cuadrado de {numero} es: {cuadrado}")
numero+=1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.