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 | 366 | 2.546875 | 3 | [
"MIT"
] | permissive |
# Python-tutorials
Hey enthusiasts,Welcome to Python Tutorials.
In this repo you can find:
Tutorials related to Python
Interesting projects to improve your skills
In short, this repo will help to land on the best resouces in a single click.
## Accessing the resources
Head towards the resources.md sectio... |
C# | UTF-8 | 380 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | using System;
namespace TypeCasting
{
class Program
{
static void Main(string[] args)
{
double myDouble = 74.87;
int myInt = (int) myDouble;
bool myBool = true;
Console.WriteLine(myDouble);
Console.WriteLine(myInt);
Conso... |
SQL | UTF-8 | 1,750 | 3.53125 | 4 | [
"MIT"
] | permissive | /**
* @version v1.9.4
* @signature b26f29a6bb5dbb3510b057632182d138
* @title Add properties field and drop 'resolved' state
*
* This patch drops resolved state and any associated statuses
*
*/
-- Move tickets in resolved state to the default closed status
SET @statusId = (
SELECT id FROM `%TABLE_PREFIX... |
Java | UTF-8 | 981 | 2.3125 | 2 | [] | no_license | package com.zx.hotnews.adapter;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import java.util.ArrayList;
import java.util.List;
import static android.os.Build.VERSION_CODES.M;
/**
* Created by zhangxin on 2017/3/10 0010.
* <p>
* Description :
* 试图来封装一个BaseAdapter,但是感觉自己封装的不是很好,暂时不用..... |
Markdown | UTF-8 | 3,401 | 3 | 3 | [] | no_license | # HDFS客户端操作 IO流操作
## HDFS文件上传
```java
@Test
public void putFileToHDFS() throws IOException, InterruptedException, URISyntaxException {
// 1 获取文件系统
Configuration configuration = new Configuration();
FileSystem fs = FileSystem.get(new URI("hdfs://hadoop102:9000"), configuration, "zhutiansama");
... |
PHP | UTF-8 | 3,729 | 2.609375 | 3 | [] | no_license | <?php
$link = mysqli_connect("localhost", "admin", "lightson100%", "emailcheck_db");
if (!$link) {
echo "Ошибка: Невозможно установить соединение с MySQL." . PHP_EOL;
echo "Код ошибки errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Текст ошибки error: " . mysqli_connect_error() . PHP_EOL;
exi... |
PHP | UTF-8 | 716 | 2.6875 | 3 | [] | no_license | <?php
include_once "model/AuthModel.php";
class RegisterController
{
public $model;
public function __construct()
{
$this->model = new AuthModel();
if (isset($_SESSION['email'])) {
header("location:index.php");
} else {
if ($_SERVER["REQUEST_METHOD"] == "POST"... |
C | UTF-8 | 1,728 | 3.484375 | 3 | [] | no_license | #include "cenario.h"
#include <stdio.h>
#include <stdlib.h>
//declaracao funcoes do modulo
void swap(Letra * a, Letra * b);
void remover_letra(Letra * vet, int * tam, int ind);
//implementacao funcoes do modulo
Cenario *cenario_create(int max, float largura, float altura){
Cenario * cenario = malloc(sizeof(Cenar... |
C# | UTF-8 | 1,020 | 3 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace calling.Controllers
{
[Route("")]
public class DefaultController : ControllerBase
{
private readonly IHttpClientFactory _clientFactory;
public DefaultController(IHttpClientFactory... |
C++ | UTF-8 | 3,193 | 2.515625 | 3 | [] | no_license | #include "CradleMesh.h"
#include "CradleFileManager.h"
CradleMesh::CradleMesh(std::wstring _name, CradleFileManager* fm, CradleVertexDeclarations::VertexPosTex* verts, int numVerts /* */)
: CradleResource(_name, fm)
{
m_vertices = verts;
m_numVertices = numVerts;
m_indices = 0;
wprintf_s(L"Creating M... |
PHP | UTF-8 | 1,105 | 2.796875 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | <?php
$servername = "localhost";
$username = "root";
$password = "mysql";
$database ="TrumpUniversity";
session_start();
if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){
$studentUser = $_SESSION["username"];
}
else{
header("location: login.php");
exit;
}
// Create connection
$conn = new mysql... |
Java | UTF-8 | 2,257 | 2.5625 | 3 | [] | no_license | /*
* A set of classes to parse, represent and display Chemical compounds in
* .xyz format (see http://chem.leeds.ac.uk/Project/MIME.html)
*/
package magicbeans.sunw.demo.molecule;
class Atom {
private static java.awt.Component panel;
private static byte[] data;
private final static int R = 40;
priv... |
Java | UTF-8 | 549 | 2.203125 | 2 | [] | no_license | package acquire.protocol.description;
import java.util.ArrayList;
import java.util.List;
import acquire.basic.Action.ActionType;
import acquire.basic.HotelChainI.HotelName;
import acquire.state.player.PlayerStateI;
public class PurchaseDescription extends ActionDescription {
private final List<HotelName> _names;
... |
Python | UTF-8 | 11,972 | 2.640625 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive | from loginhashblock import *
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
DEBUG = False
def unittest_print(message):
print(bcolors.WARNING + message + bcol... |
Shell | UTF-8 | 423 | 3.09375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #! /usr/bin/env bash
# Encoded artist name.
ARTIST="$1"
# Encoded song title.
TITLE="$2"
#Encoded album name.
ALBUM="$3"
unquote () {
decoded_url=$(python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' "$1")
echo $decoded_url
}
UNQ_ARTIST=$(unquote "$ARTIST")
UNQ_TITLE=$(unquote "$TIT... |
Java | UTF-8 | 75 | 1.578125 | 2 | [] | no_license | package jpabook.jpashop.domain;
public enum OrderStatus {
ORDER, CANCEL
}
|
C++ | UTF-8 | 629 | 2.796875 | 3 | [] | no_license | /*
Author: Austin Henry
Date: 8/14/2018
Assignment: Final Project
This is the header file for the Trainer Class
*/
#include "Space.hpp"
#include "Monster.hpp"
#include <vector>
#include <string>
using std::vector;
using std::string;
#ifndef TRAINER_HPP
#define TRAINER_HPP
class Trainer
{
private:
Space * currentSp... |
Python | UTF-8 | 935 | 3.234375 | 3 | [] | no_license | class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
if not matrix or not matrix[0]:
return 0
row = len(matrix)
col = len(matrix[0])
heights = [0] * col
res = 0
for i in range(row):
for j in range(col):
... |
C | UTF-8 | 2,069 | 3.3125 | 3 | [] | no_license | /* BY SUBMITTING THIS FILE AS PART OF MY LAB ASSIGNMENT, I CERTIFY THAT
** ALL OF THE CODE FOUND WITHIN THIS FILE WAS CREATED BY ME WITH NO
** ASSISTANCE FROM ANY PERSON OTHER THAN THE INSTRUCTOR OF THIS COURSE
** OR ONE OF OUR UNDERGRADUATE GRADERS.
** getFloatFromUser.c created by Kohl Kuntze
*/
#incl... |
C | UTF-8 | 3,326 | 3.484375 | 3 | [] | no_license | /*
* Menu.h
*
* Created on: 17 abr. 2021
* Author: Maty
*/
#ifndef MENU_H_
#define MENU_H_
/** \brief Muestra las opciones del menu y retorna la respuesta del mismo
*
* \return int retorna la opcion elegida
*
*/
int menu(void);
/** \brief toma los datos de tipo float y lo devuelve
*
* \return float... |
Java | UTF-8 | 1,212 | 2.234375 | 2 | [
"Apache-2.0"
] | permissive | package pi2schema.schema.providers.protobuf.personaldata;
import com.google.protobuf.Message;
import pi2schema.crypto.Decryptor;
import pi2schema.crypto.Encryptor;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Stream;
public class PersonalMetadata {
private final ... |
TypeScript | UTF-8 | 829 | 2.875 | 3 | [] | no_license | import { Pipe, PipeTransform } from '@angular/core';
// Angular Pipe developed by Sahana P
@Pipe({
name: 'orderBy'
})
export class OrderByPipe implements PipeTransform {
noManipulationTypes = ['number', 'boolean'];
transform(array: any, field?: any, type?: any): any[] {
array.sort((a: any, b: any) => {
... |
Python | UTF-8 | 525 | 3 | 3 | [] | no_license | import random
def pali():
x=raw_input("write n: ")
while x!="n" :
x=raw_input("try again: ")
z=raw_input("probabilliy for heads: ")
z=int(z)
while int(z) >= 101:
z=raw_input("don't insert more than 100,try again: ")
ht=random.randint(0,100)
if ht >= (100-z):
print "H"
else:
print "T"
def etz():
z=raw... |
C++ | UTF-8 | 494 | 2.546875 | 3 | [] | no_license | /*
* File: Complex.h
* Author: Tauan
*
* Created on September 3, 2013, 12:10 AM
*/
#ifndef COMPLEX_H
#define COMPLEX_H
class Complex {
private:
double real;
double imag;
public:
Complex();
~Complex();
void imprime();
void set(double,double);
Complex operator+(Complex... |
C++ | UTF-8 | 7,817 | 3.515625 | 4 | [] | no_license | #pragma once
#include <forward_list>
#include <vector>
#include <algorithm>
#include <stdexcept>
#include <list>
#include <utility>
template<class KeyType, class ValueType, class Hash = std::hash<KeyType>>
class HashMap {
public:
using KeyValuePair = std::pair<const KeyType, ValueType>;
using const_iterator ... |
JavaScript | UTF-8 | 1,078 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | /**
* Author: Davide Alocci
* Version: 0.0.1
*/
import {Enum} from 'enumify';
export default class DonorPosition extends Enum {
getDonorPosition(value) {
switch (value){
case 1: return DonorPosition.ONE;
case 2: return DonorPosition.TWO;
case 3: return DonorPosition... |
C++ | UTF-8 | 6,683 | 2.796875 | 3 | [] | no_license | //
// Created by sooda on 16/6/6.
//
#include "common/util.h"
#include <vector>
#include <string>
#include <functional>
#include <iostream>
#include <fstream>
#include "cppjieba/Unicode.hpp"
#include "limonp/StringUtil.hpp"
#include "limonp/Logging.hpp"
namespace cppmary {
std::vector<std::string> split(const std... |
Java | UTF-8 | 1,487 | 2.90625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package fr.philippefichet;
/**
*
* @author glopinous
*/
public class ProgressBar {
private long value;
private long max;
... |
PHP | UTF-8 | 524 | 2.53125 | 3 | [] | no_license | <?php
namespace SBL\Action;
use SBL\Library\AbstractAction;
use Slim\Psr7\Request;
use Slim\Psr7\Response;
class LogoutAction extends AbstractAction
{
/**
* @param Request $request
* @param Response $response
* @param array $args
*
* @return Response
*/
public function __inv... |
Python | UTF-8 | 174 | 3.34375 | 3 | [] | no_license | import itertools
def possible_permutations(arg):
for per in itertools.permutations(arg):
yield list(per)
[print(n) for n in possible_permutations([1, 2, 3])]
|
PHP | UTF-8 | 894 | 2.625 | 3 | [
"MIT"
] | permissive | <?php namespace App\Http\Controllers;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
//四脚猫隐式控制器
class UsersController extends Controller {
/**
* 响应/users的GET请求
*/
public function getIndex(Request $req)
{
return 'getindex';exit;
$input = $req-... |
JavaScript | UTF-8 | 3,029 | 3.109375 | 3 | [] | no_license | import { ROWS, COLS, NUM } from './config.js';
import random from './random.js';
export const memory = new Uint8Array(ROWS * COLS);
export const pages = [Uint8Array.from(memory)];
export const loadMemory = test => {
reset();
const lines = test.split('\n');
let ctr = memory.length - 1;
for (let i = lines.lengt... |
Python | UTF-8 | 151 | 2.984375 | 3 | [] | no_license | def main():
pair = (1, 2)
print pair
if 3 in pair:
print True
else:
print False
if __name__ == '__main__':
main()
|
C++ | UTF-8 | 2,281 | 2.5625 | 3 | [] | no_license | #include "GameManager.hpp"
#include "Services/DataManager.hpp"
namespace simpleGL
{
Window* GameManager::s_pWindowService;
INodeMgrPtr GameManager::s_pNodeService;
ISceneMgrPtr GameManager::s_pSceneService;
IDataMgrPtr GameManager::s_pDataService;
// Should be called before anyt... |
Java | UTF-8 | 1,272 | 2.40625 | 2 | [] | no_license | package com.zhoujixing.logic;
import com.zhoujixing.entity.DateStatisticsModel;
import com.zhoujixing.service.CustomerService;
import com.zhoujixing.service.DateStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Calendar;... |
Markdown | UTF-8 | 1,841 | 2.84375 | 3 | [
"MIT"
] | permissive | # World of Warcraft Auction
The goal of this project is to analyse auction house trends.
## Parts
The project is made of two major parts.
### Crawler
It contains the crawler which is a node application. The goal here is to crawl
auction dump from the [Blizzard's API](https://dev.battle.net/).
In the futur, it will als... |
TypeScript | UTF-8 | 1,597 | 3.125 | 3 | [
"MIT"
] | permissive | import { globalAgent } from "http";
class FriendList {
friend = [];
addFriend(name) {
this.friend.push(name);
this.announceFriendShip(name)
}
announceFriendShip(name) {
global.console.log(`${name}is now a friend`);
}
removeFriend(name) {
const idx = this.friend.i... |
Markdown | UTF-8 | 3,351 | 2.765625 | 3 | [
"MIT"
] | permissive | [<img src='media/logo.png' width='300px' />][github-repo]
=========================================================
[![Build Status][shield-travis]][travis]
[![Coverage Status][shield-coveralls]][coveralls]
[![Downloads][shield-downloads]][npm]
[![Version][shield-version]][npm]
> Javascript implementation of simple ... |
TypeScript | UTF-8 | 560 | 3.6875 | 4 | [] | no_license | class User {
public name: string;
public email: string;
public age: number;
constructor(name: string, email: string, age: number){
this.name = name;
this.email = email;
this.age= age;
console.log("User Is Created with Name = "+ this.name+ " Email = "+ this.email + ' and... |
PHP | UTF-8 | 1,414 | 2.53125 | 3 | [] | no_license | <?php
namespace App\DataFixtures;
use App\Entity\Coaches;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
class CoachesFixture extends Fixture
{
private Coaches $coachFixture;
public const COACH_FIXTURE = 'coach-fixture';
public function load(ObjectManager $manager):... |
JavaScript | UTF-8 | 6,259 | 2.71875 | 3 | [] | no_license | const Discord = require("discord.js");
const genUtils = require("../../command_utilities/general_utilities");
module.exports.run = async (bot, message, args) => {
if (args.length == 0) {
message.channel.send(`You have to provide a password, ${genUtils.getRandomNameInsult(message)}`);
return;
... |
Python | UTF-8 | 1,930 | 3.65625 | 4 | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-other-permissive",
"SMLNJ"
] | permissive | import gc
import timeit
import time
class TimeMe:
"""Small class to time portions of the code.
It has two main usages:
1. In a with block, of the type:
t = TimeMe()
with t:
doMyThings()
print("Took {} seconds".format(t.interval)
2. With multiple ticks and tocs:
... |
Python | UTF-8 | 5,223 | 2.796875 | 3 | [] | no_license | """
Loads the raw data files and dumps the intermediate ones.
If no golden files exist, copies them into place.
If golden files exist, compares the data and reports on differences.
You should run this once to populate new golden files before making any
changes to the raw data parsers.
"""
import argparse
import diffl... |
JavaScript | UTF-8 | 1,325 | 2.703125 | 3 | [] | no_license | // document.getElementById("bio").innerHTML = "Selam gençler"
// var intro1 = document.getElementById("intro1");
// var mesaj = document.getElementById("mesaj");
// mesaj.innerHTML = intro1.innerHTML;
// var tumListeler = document.getElementsByTagName("ul");
// var sehirler = tumListeler[0];
// var sehirElemanlari = ... |
Java | UTF-8 | 1,373 | 1.8125 | 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.tremorvideo.sdk.android.richmedia;
import com.tremorvideo.sdk.android.videoad.aw;
public class l
{
public com.tremorvideo.sdk.... |
Java | UTF-8 | 387 | 1.867188 | 2 | [] | no_license | package com.welove520.qzoneemojiparser.emoji;
import android.support.annotation.NonNull;
import com.welove520.qzoneemojiparser.emoji.category.QzoneCategory;
public final class IosEmojiProvider implements EmojiProvider {
@Override
@NonNull
public EmojiCategory[] getCategories() {
return new Emoji... |
PHP | UTF-8 | 904 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNewsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::defaultStringLength(191);
... |
Java | UTF-8 | 1,718 | 2.265625 | 2 | [] | no_license | package ru.job4j.passport.controller;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import ru.job4j.passport.model.Passport;
import ru.job4j.passport.service.PassportRestService;
import java.util.List;
@RestController
@Re... |
Shell | UTF-8 | 473 | 3.765625 | 4 | [] | no_license | #!/bin/bash
#######
# script used to verify that the user has correctly execute the exercise
#
# Produce a file with the count of the 'WARN' occurences in all the 'log' files
# `find target/ -name "*.log" -print | xargs grep WARN | wc -l > count-warn`
#
#######
result=1
checkCount(){
if [ -e /root/count-warn ]
... |
JavaScript | UTF-8 | 3,055 | 2.875 | 3 | [] | no_license | //Imported the request Module
var request = require('request');
var async = require('async')
function wrapperObject(affId,affToken)
{
this.affId = affId;
this.affToken = affToken;
}
function categoryProcessor(item,callback)
{
var categoryObj = {
name:item['apiName'],
get:item['availableVariants']['v1.1.0']['... |
Markdown | UTF-8 | 4,112 | 2.515625 | 3 | [] | no_license | # Cut to the chase
Everyone (alone) write a haiku about your story. 5-7-5. What's the most important thing? The essence?
# Backing up Gists
<http://amandabee.github.io/CUNY-data-skills/hands-on/advanced_gist.html>
# Surveys
Make a google survey; Look at the results in a spreadsheet; Think about how much you actually... |
C | UTF-8 | 10,464 | 3.328125 | 3 | [] | no_license | #include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <inttypes.h>
#include "seq-tree.h"
SEQNode *SEQ_NewNode(uint32_t val)
{
SEQNode *root = malloc(sizeof(struct SEQ_Node));
root->parents = T;
root->left = T;
root->right = T;
root->value = val;
root->color = RB_RED;
root->siz... |
C# | UTF-8 | 505 | 2.84375 | 3 | [] | no_license | using Microsoft.VisualBasic.FileIO;
...
var path = @"C:\YourFile.csv";
using (var parser = new TextFieldParser(path))
{
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(",");
string[] line;
while (!parser.EndOfData)
{
try
... |
Markdown | UTF-8 | 8,324 | 3.296875 | 3 | [] | no_license | ---
layout: page
title: 'Denoising: wavelet thresholding'
date: 2011-01-23 14:25:48.000000000 -05:00
category: course-material
topic: imaging
comments: true
---
We have seen a naïve way to perform denoising on images by a simple <a href="http://blancosilva.github.io/course-material/2011/01/18/convolution-with-gaussian... |
PHP | UTF-8 | 5,381 | 3.3125 | 3 | [
"MIT"
] | permissive | <?php
$input = file('input.txt', FILE_IGNORE_NEW_LINES);
foreach ($input as $i => $row) {
$input[$i] = str_split($row);
}
// Part 1
$changes = null;
while ($changes !== 0) {
$changes = 0;
$seatsOccupied = 0;
$resultingInput = $input;
foreach ($input as $y => $row) {
foreach ($row as $x =... |
Python | UTF-8 | 7,440 | 2.765625 | 3 | [] | no_license |
import os
import json
import pdb
import sys
import pandas as pd
from gensim.models import TfidfModel
import numpy as np
from corextopic import corextopic as ct
from corextopic import vis_topic as vt
import matplotlib.pyplot as plt
import itertools
import shutil
import os
from shutil import copyfile
print("-" * 80 +... |
Java | UTF-8 | 2,198 | 2.921875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tarea_.modulo_7;
public class procesos_calculadora {
private double Valor_1;
private double Valor_2;
p... |
Markdown | UTF-8 | 3,732 | 3.046875 | 3 | [] | no_license | # 利用`#undef`实现特定模块的调试输出
## Preface
在平时的编程中肯定会用到打印功能来调试自己的程序,调试的时候将打印函数取消注释,在调试完成后将打印函数注释掉。不知大家是如何处理的,我以前可一直是这么干的。这样处理第一太繁琐,第二影响程序的美观性。后面想了一个用`#if ... #endif`语法来封装`printf`函数的做法:
```c
#if DEBUG_MOUDEL
print("debug moudel\n");
#endif
```
需要调试特定模块的时候只需在该模块文件的开头添加`#define DEBUG_MOUDEL`即可。但这样给写程序添加了很大的负担。
对于`#undef`,在这... |
Swift | UTF-8 | 2,969 | 2.90625 | 3 | [] | no_license | //
// AppDomain.swift
// PhotoSlider
//
// Created by Ivan Quintana on 15/03/21.
//
import Foundation
import ComposableArchitecture
enum UIState: Hashable {
case auth
case home
}
struct AppState: Equatable {
var uiState: UIState = .auth
var authState: AuthState = .init()
var sliderState: Slide... |
PHP | UTF-8 | 2,680 | 2.5625 | 3 | [] | no_license | <html>
<body>
<center><h1> Agregar pasos para contratacion</h1></center>
<form enctype="multipart/form-data" id = "formaAgregar" method="POST" >
<button onclick="agregarPaso(); return false">Agregar Paso</button><br>
<button type="button" onclick="sendData()">Agregar</bu... |
Python | UTF-8 | 315 | 2.921875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 8 22:18:46 2021
@author: 009671631
"""
import psutil
def format_memory(info):
return round(info/(1024*1024*1024), 2)
disco = psutil.disk_usage('.')
total = format_memory(disco.free)
print(f"Disco(armazenamento disponível): {total} GB")
|
Java | UTF-8 | 299 | 2.875 | 3 | [] | no_license | package Beverge;
/**
* 具体的浓缩咖啡
* Created by jimersylee on 17-8-19.
*/
public class Espresso extends Beverage {
public Espresso() {
description="Espresso";//description变量继承自Beverage
}
@Override
public double cost() {
return 1.99;
}
}
|
Python | UTF-8 | 2,518 | 2.609375 | 3 | [] | permissive | from contextlib import contextmanager
from threading import local
from django import urls
from django.http import HttpRequest
# Get a pointer to Django's reverse and resolve because we're going to hijack
# them after we define our own.
# As we're using a url prefixer to automatically add the locale and the app to
# ... |
C++ | UTF-8 | 2,599 | 2.515625 | 3 | [
"MIT"
] | permissive | // Copyright 2021, James S. Wang, All rights reserved.
#pragma once
#include "Blueprint/UserWidget.h"
#include "CoreMinimal.h"
#include "MainMenuInterface.h"
#include "LSWidget.generated.h"
class IMainMenuInterface;
/**
* @brief The base widget class for all UI widgets.
* It contains lifecycle methods like Creat... |
Markdown | UTF-8 | 1,080 | 2.734375 | 3 | [] | no_license | # D3-Biodiversity-Dashboard
An interactive dashboard to explore the Belly Button Biodiversity dataset,
which catalogs the microbes that colonize human navels.
The dataset reveals that a small handful of microbial species
(also called operational taxonomic units, or OTUs, in the study) were present
in more than 70% of... |
Python | UTF-8 | 754 | 3.921875 | 4 | [] | no_license | # Python Data Structure Dictionaries
# Unlike sequences (Lists, Strings etc.), which are indexed by a range of numbers,
# dictionaries are indexed by keys, which can be any immutable type;
# strings and numbers can always be keys.
tel = {'jack': 4098, 'sape': 4139}
tel['guido'] = 4127
tel ... |
Java | UTF-8 | 1,538 | 2.359375 | 2 | [
"Apache-2.0"
] | permissive | /**
* File generated by the ThingML IDE
* /!\Do not edit this file/!\
* In case of a bug in the generated code,
* please submit an issue on our GitHub
**/
package org.thingml.generated.messages;
import no.sintef.jasm.*;
import no.sintef.jasm.ext.*;
import java.util.*;
import java.nio.*;
public class DrawRectva... |
Python | UTF-8 | 1,192 | 3.0625 | 3 | [] | no_license | import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
import tensorflow as tf
import tensorflow.keras.backend as K
x = np.array([1,2,3,4,5,6,7,8]).astype('float32')
y = np.array([1,2,3,4,5,6,7,8]).astype('float32')
def custom_mse(y_true,y_pred):
return tf.math... |
C++ | UTF-8 | 648 | 2.8125 | 3 | [] | no_license | #include <list>
#include <string>
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
std::list<std::string> g_list;
void* push_thread(void*)
{
int count = 100000;
while (count--)
{
g_list.push_back("husdhaisdhu");
::usleep(20);
}
}
int main()
{
pthread_t tid;
pthread_create(&ti... |
JavaScript | UTF-8 | 1,181 | 2.796875 | 3 | [] | no_license | var search = location.search.slice(8);
var xhr = $.get("https://api.giphy.com/v1/gifs/search?q=" + search +"&api_key=53WYlS1SZqJ1NOEAgZeQlD6sddrUA013&limit=25", function(data){
var images = document.querySelectorAll("img");
for(var i = 0; i < images.length; i++){
images[i].src=data["data"][i]["images"]["fixed_he... |
C# | UTF-8 | 991 | 2.78125 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace VbPowerPacksDrawLine2CS
{
public partial class DrawLine2 : Form
{
public DrawLine2()
{
I... |
Python | UTF-8 | 559 | 3.859375 | 4 | [] | no_license | import sys
def insertion_sort(array):
for index in range(1, len(array)):
while 0 < index and array[index] < array[index -1]:
array[index], array[index-1] = array[index-1], array[index]
index -= 1
return array
if __name__ == "__main__":
if sys.version_info.major < 3:
... |
C | UTF-8 | 12,395 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifdef __cplusplus
extern "C"
{
#endif
//TODO: finish the ports for BSD and windows based platforms
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "permTables.h"
#include "desEncrypt.h"
#if defined(_WIN32) || defined(_WIN64)
#elif defined (__linux__)
#in... |
Python | UTF-8 | 2,879 | 2.59375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Unlicense"
] | permissive | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# from __future__ import unicode_literals, division, absolute_import, print_function
import sys
from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QLabel,
QApplication, QHBoxLayout, QVBoxLayout,
QCh... |
Markdown | UTF-8 | 3,818 | 3.421875 | 3 | [] | no_license | # Coherent Subtyping with Typing
This works extends Linus' work "Subtyping with Typing" with disjointness.
The syntax for abstractions and products are extended with a disjoint constraint.
The environments now associates a variable to its respective type and constraint.
## Typed Subtyping
Typed subtyping contains t... |
JavaScript | UTF-8 | 5,276 | 2.609375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | require(['jquery', 'jira/lib/class'], function($, Class) {
var NotificationEditor = Class.extend({
init: function (options) {
var instance = this;
instance.$editor = options.editor;
instance.$toolbar = options.toolbar;
instance.$toolbar.find("div.aui-button... |
C++ | UTF-8 | 739 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
string checkMonth(float n);
int main() {
cout << "Podaj liczbe, dla ktorej chcesz poznac odpowiednik miesiaca" << endl;
float n;
cin >> n;
cout << "Twoja liczba: " << n << " to odpowiednik miesiaca: " << checkMonth(n) << endl;
system("paus... |
Java | UTF-8 | 4,558 | 2.4375 | 2 | [] | no_license | package com.sj.at.customview;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.sj.at.customFour.CustomFour;
import com.sj.at.customOne.CustomOne;
import com.sj.at.customThree.CustomThree;
import com.sj.at.customTwo... |
Python | UTF-8 | 8,096 | 2.625 | 3 | [] | no_license | #! /usr/bin/env python
"""This module imports XML and converts it to a plist-compatible format.
The primary method here is xml_to_dict. It iterates over the XML tree and looks
for these terms as tags, attributes, and as children elements of the parent. It
compares these terms to the correct dictionary for the elemen... |
JavaScript | UTF-8 | 778 | 2.71875 | 3 | [] | no_license |
function checkHidden(cols, rows){
var arr = [];
var sum = 0;
var se = document.getElementById("weight");
var p = document.createElement("P");
for(var i = 0; i < cols.length; i++){
var weight = [];
if(cols[i].style.display != "none" && cols[i].clas... |
Java | UTF-8 | 6,343 | 2.546875 | 3 | [] | no_license | package com.atguigu.springboot04.controller;
import com.atguigu.springboot04.bean.Goods;
import com.atguigu.springboot04.bean.Kinds;
import com.atguigu.springboot04.bean.Users;
import com.atguigu.springboot04.bean.Words;
import com.atguigu.springboot04.dto.Page;
import com.atguigu.springboot04.service.GoodsService;
im... |
Java | UTF-8 | 397 | 1.664063 | 2 | [] | no_license | package com.officego.commonlib.common.model;
import com.google.gson.annotations.SerializedName;
/**
* Created by shijie
* Date 2021/3/24
**/
public class AlipayBean {
@SerializedName("orderInfo")
private String orderInfo;
public String getOrderInfo() {
return orderInfo;
}
public void ... |
Java | UTF-8 | 169 | 2.203125 | 2 | [] | no_license | class N
{
public static void main(String agrs[])
{
int a,b;
a=Integer.parseInt(agrs[0]);
b=Integer.parseInt(agrs[1]);
int c=a+b;
System.out.println(c);
}
}
|
C | UTF-8 | 4,191 | 3.578125 | 4 | [] | no_license | /*
* Created by Ben Gustafson on 10/9/2017
*/
#include "input.h"
void SolveMaze(struct ReadMaze maze)
{
struct Solver crawler;
int endRow = maze.end[1];
int endCol = maze.end[0];
char nullChar = 'X'; /* Represents possible empty space on maze edge */
char up, dn, rt, lf;
crawler.row = maze.start[1];
crawler... |
Java | UTF-8 | 2,999 | 1.875 | 2 | [] | no_license | package com.wyu.iwork.view.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.wyu.iwork.R;
import com.wyu.i... |
Python | UTF-8 | 2,234 | 3.015625 | 3 | [] | no_license | #encoding:UTF-8
from __future__ import division #ensure that float number when divide
import random
import cal_chrofitness
def sumfitness(fitlist): #种群中全部个体的fitness之和
total=0
for i in range(len(fitlist)):
total=total+fitlist[i]
return total
def cumcomfit(fitlist): #将种群中每个fitness标准化,得... |
Shell | UTF-8 | 484 | 2.859375 | 3 | [] | no_license | if [ "$#" -ne 3 ]; then
echo "usage: ./whatever experiment_name num_threads name_suffix";
exit 1;
fi
assets=20
set -ex
make singlenode_validator -j 8
make generate_zeroblock -j 8
make xdrpy_module -j 8
EXPERIMENT_DATA_FILE=experiment_data/$1
DEFAULT_AMOUNT=10000000000
#./clean_persisted_data.sh ${assets} keep
... |
Python | UTF-8 | 1,057 | 2.875 | 3 | [
"MIT"
] | permissive | from bot.models import Earning, CategoryEarning, CategoryConsumption
def make_text_earning(session, earning):
category = session.query(CategoryEarning).get(earning.category_id)
return f'Доход {earning.amount_money} руб. {category.category} {earning.get_str_time_creation()} - ' \
f'/del_e{earning.id}\n... |
Java | UTF-8 | 3,644 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package edu.pdx.cs410J.huanhua;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.navigation.fragment.NavHostFragment;
import... |
Java | UTF-8 | 682 | 2.109375 | 2 | [] | no_license | package com.troopar.trooparapp.adapter.viewholder;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.troopar.trooparapp.R;
/**
* Created by barry on 16/07/2016.
*/
public class InvitePeopleViewHolder extends Recy... |
Markdown | UTF-8 | 1,766 | 2.609375 | 3 | [] | no_license | <a href="https://truyentiki.com/chung-ta-yeu-nhau-di-sai-ga-the-hon-tong-tai.30798/" title="Chúng Ta Yêu Nhau Đi: Sai Gả Thế Hôn Tổng Tài"><h1>Chúng Ta Yêu Nhau Đi: Sai Gả Thế Hôn Tổng Tài</h1></a><div style="display:table"><img align="right" style="float: left; padding: 10px;" src="https://truyentiki.com/a/img/str/src... |
Java | UTF-8 | 421 | 2.640625 | 3 | [] | no_license | package entities;
public class Error {
private Boolean hasError;
private String message;
public Error() {
setHasError(false);
setMessage("");
}
public Boolean getHasError() {
return hasError;
}
public void setHasError(Boolean hasError) {
this.hasError = hasError;
}
public String getMessage() {
r... |
Markdown | UTF-8 | 1,030 | 3.71875 | 4 | [] | no_license | # Article Word Count
- Inside the file ["input/article.txt"](input/article.txt) is an article that we would like to know the number of times each word has been shown.
## Your Tasks
### Write codes to:
- Read the file *(I'm not asking you to read the file literally)*
- Perform a count on the number of occurences fo... |
JavaScript | UTF-8 | 1,045 | 2.5625 | 3 | [
"MIT"
] | permissive | var assert = require('chai').assert;
var format = require('../formatter.js').format;
describe('format', function () {
it('should handle empty input', function () {
assert.equal("\n", format("", true, false, false));
});
it('should handle simple headers', function () {
assert.equal("Key: Value\n\n", forma... |
C++ | UTF-8 | 3,024 | 2.515625 | 3 | [
"MIT"
] | permissive | /* Copyright (C) 2010-2019, The Regents of The University of Michigan.
All rights reserved.
This software was developed as part of the The Vulcan project in the Intelligent Robotics Lab
under the direction of Benjamin Kuipers, kuipers@umich.edu. Use of this code is governed by an
MIT-style License that can be foun... |
SQL | UTF-8 | 15,946 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | DROP DATABASE IF EXISTS scholar_tool;
CREATE DATABASE scholar_tool DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
USE scholar_tool;
GRANT SELECT, INSERT, UPDATE, DELETE ON scholar_tool.* TO 'www-data'@'localhost'
IDENTIFIED BY 'www->R&daD6xZM6283n3-data';
GRANT SELECT, SHOW VIEW, LOCK TABLES, TRIGGER on scholar_to... |
Markdown | UTF-8 | 3,760 | 2.6875 | 3 | [] | no_license | # 如何在CentOS 7上安装Nginx
### 关于Nginx
Nginx是一款高性能的Web服务器软件。它比Apache HTTP Server更灵活轻便。
本教程将教您如何在CentOS 7服务器上安装并启动Nginx。
## 先决条件
本教程中的步骤要求用户拥有root权限。您可以通过[使用CentOS 7](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7)教程的[初始服务器设置](https://www.digitalocean.com/community/tutorials/initial-... |
PHP | UTF-8 | 709 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace Core\Ajax\Commands\Dom;
/**
* CssCommand.php
*
* @author Michael "Tekkla" Zorn <tekkla@tekkla.de>
* @copyright 2016
* @license MIT
*/
class CssCommand extends AbstractDomCommand
{
/**
* Constructor
*
* jQuery($selector).css($property, $value)
*
* @param string $selec... |
Java | UTF-8 | 2,623 | 2.421875 | 2 | [] | no_license | /*
Software Testing Club Android application
Stefan Klaener
sklaener@gmail.com
*/
package com.echo.stc;
import java.util.ArrayList;
import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widg... |
Java | UTF-8 | 1,903 | 2.046875 | 2 | [] | no_license | package vn.fpt.fsoft.group3.repository;
import vn.fpt.fsoft.group3.entity.Customers;
import vn.fpt.fsoft.group3.entity.Orders;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.