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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 862 | 3.734375 | 4 | [] | no_license | using System;
namespace ejercicio_11
{
class Program
{
static void Main(string[] args)
{
// 13. Leer dos fechas en formato DDMMAAAA. Informar cuál de ellas es la menor o si son iguales.
int num = 0;
int acum = 0;
Console.WriteLine("ingrese un nu... |
Python | UTF-8 | 9,799 | 2.921875 | 3 | [] | no_license | # coding=UTF-8
'''
@author Gray
'''
import numpy as np
from sklearn.metrics import mean_squared_error, roc_curve, auc
from util.util import logLoss
from collections import defaultdict
class FM(object):
'''
implement a simple two-way interaction
'''
def __init__(self, num_factors, task, l2_reg_b=0.01,... |
Java | UTF-8 | 1,765 | 3.46875 | 3 | [] | no_license | package Task_2;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class MyMapTest {
MyMap<Integer, Character> myMap;
@Before
public void setUp() throws Exception {
myMap = new MyMap<>(1000);
myMap.put(0, 'a');
myMap.put(10, 'b');
myMap.put(20... |
Java | GB18030 | 518 | 3.453125 | 3 | [] | no_license | import java.util.Scanner;
/**
* ͣ
* : 1 2
* : a+b is 3
* @author zq
*
*/
public class ABAdd {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int a = 0;
int b = 0;
System.out.println("a b");
Scanner sc = new Scanner(System.in);
... |
C++ | UTF-8 | 4,483 | 2.8125 | 3 | [] | no_license | #include "stdafx.h"
namespace {
class slow_perm2sched_context
{
public:
slow_perm2sched_context(const task_t &task, const perm_t &perm);
const sched_t &calculate_sched ();
const sched_t &get_sched() const {return sched;}
private:
void move_jobs_list(moment_... |
Markdown | UTF-8 | 6,061 | 3.28125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 三十二 手机风波
tag: novel1
---
卢静大吃一惊,也去看了周峰一眼,说:“你有男朋友,谁啊?怎么没听你说起过?”<br />
我心里想,我曾经想说来着,可是你没兴趣听啊。但还是回答说:“大学的同学,现在还在读书呢。”<br />
卢静马上问到:“你怎么会收到手机的?啊,你曾说过五一不回家过节的,莫不是因为他来深圳了?”<br />
我不得不佩服她够聪明,说:“是啊。”<br />
卢静还要问下去:“那他住……”<br />
这时周峰突然站了起来,拿过去手机看了一下,笑着对卢静说:“看看,人家用的多漂亮啊,你赶紧换一个吧,不然就土掉渣了。”<br />
卢静当然受不了这... |
C | UTF-8 | 1,172 | 3.359375 | 3 | [] | no_license | /*************************************************************************
> File Name: 5.18test.c
> Author:
> Mail:
> Created Time: Wed 19 Apr 2017 07:21:08 PM PDT
************************************************************************/
#include<stdio.h>
#include<stdio.h>
//升序数列升序合并
#define N 20
int main()
{... |
C# | UTF-8 | 4,587 | 2.53125 | 3 | [] | no_license | using System.Collections;
using Svelto.Tasks;
using UnityEngine;
namespace Svelto.ECS.Example.Survive.Enemies
{
public class EnemyAttackEngine : SingleEntityViewEngine<TargetEntityView>, IQueryingEntityViewEngine
{
public IEntityViewsDB entityViewsDB { set; private get; }
public void Ready()
... |
Java | UTF-8 | 1,001 | 2.75 | 3 | [] | no_license | package task_3;
import task_3.essence.*;
import java.util.LinkedList;
public interface DAO {
/**
* @return list of all employees
*/
public LinkedList<Employee> getEmployees();
/**
* @param empId specific id of employee
*
* @return projects for specified employee
*/
p... |
Markdown | UTF-8 | 5,917 | 3.03125 | 3 | [
"CC-BY-4.0"
] | permissive | ## Web endpoint
Once an alias is [registered](Registration.md), it enables any web user to visit a web endpoint on the room server dedicated to that alias, for the purpose of telling the visitor what SSB ID does the alias resolve to, and with instructions on how to install an SSB app if the visitor doesn't have it yet... |
Markdown | UTF-8 | 7,641 | 2.734375 | 3 | [] | no_license | # Hardware
## SUMMARY
The cluster has 13 compute nodes including 2 GPU nodes, a login node, a high-availability storage server connected to a 512TB disk array and a fast scratch server with 40TB of storage. It's accessible to the CofC campus via a 10Gbps ethernet link. The specs are summarized below.
* [**Compute n... |
Markdown | UTF-8 | 3,682 | 3.140625 | 3 | [] | no_license | ## Activity File: Hashcat
You will continue your role as a security analyst working for the Hill Valley Police Department.
- You impressed Captain Strickland by logging into Detective Tannen's account. Unfortunately, the file you must access to prove Tannen is the Alphabet Bandit is encrypted on their computer.
- ... |
Python | UTF-8 | 9,620 | 2.828125 | 3 | [] | no_license | def ingestTemporalLine(filename):
# This function returns a cleaned up array from the FLIR temporal csv export
measurements = []
with open(filename) as file:
for index, line in enumerate(file):
# First we prepare the array of items
for index, line in enumerate(file):
... |
Markdown | UTF-8 | 1,121 | 2.609375 | 3 | [
"MIT"
] | permissive | # notificationBar
a simple js notificationBar for web and app , u can also filed it with ur own style
## how to use
### 1、u should download the cabar.js in lib and use it just like
```html
<script src="../lib/cabar.js"></script>
```
### 2、u can use in the way
```javascript
showBar('your words')
```
### or config it ... |
Java | UTF-8 | 5,306 | 2.109375 | 2 | [] | no_license | package aplikacija.apl.ofinger.navigationActivities;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recycler... |
Python | UTF-8 | 2,162 | 2.5625 | 3 | [] | no_license | from flask import Flask, render_template, request, redirect, url_for
import os
from flask_pymongo import PyMongo
from datetime import datetime
from bson.objectid import ObjectId
# from bson.objectid import ObjectId
app = Flask(__name__)
app.config["MONGO_DBNAME"] = os.environ.get('MONGO_DBNAME')
app.config["MONGO_UR... |
JavaScript | UTF-8 | 364 | 3.515625 | 4 | [] | no_license | var obj = {name: 'ISRO', age: 35, role: 'Scientist'};
function convertListToObject(obj) {
let keys=Object.keys(obj);
let ans=[];
for(let i in keys)
{
ans.push([keys[i],obj[keys[i]]]);
}
return ans;
}
let ans3=convertListToObject(obj);
console.log("PROBLEM 3....................... |
JavaScript | UTF-8 | 2,775 | 2.875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | $(function () {
let aList = [];
let locations = [];
let dict = {'amenities': [], 'cities': [], 'states': []};
$('.amenities li input[type=checkbox]').change(function () {
let amen = $(this).attr('data-name');
let id = $(this).attr('data-id');
if (this.checked) {
aList.push(amen);
dict['a... |
C++ | UTF-8 | 339 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int reverse(int x)
{
long res = 0;
while(x)
{
res = res*10 + x%10;
printf("%ld %d\n", res, x);
x /= 10;
}
return (res<INT_MIN || res>INT_MAX) ? 0 : res;
}
int main()
{
int a, b;
a = -12345;
b = reverse(a);
cout << b << endl;
cout <<... |
Markdown | UTF-8 | 12,321 | 3.265625 | 3 | [
"MIT"
] | permissive | ---
layout: pattern
title: Circuit Breaker
folder: circuit-breaker
permalink: /patterns/circuit-breaker/
categories: Behavioral
tags:
- Performance
- Decoupling
- Cloud distributed
---
## Intent
Handle costly remote service calls in such a way that the failure of a single service/component
cannot bring the who... |
Markdown | UTF-8 | 2,659 | 3.015625 | 3 | [] | no_license | # Elm MediumEditor
This repository contains the source code for MediumEditor bindings in Elm.
## Installation
Ensure *all* your source files live inside `/src`. Next up, add a `/vendor` folder in the
root of your project.
cd vendor
git clone https://github.com/paramanders/elm-medium-editor.git
And add ... |
Ruby | UTF-8 | 1,304 | 3.296875 | 3 | [] | no_license | class Board
attr_reader :grid
def initialize(size = 9, bombs = 1)
@grid = Array.new(size) { Array.new(size) }
populate_grid(bombs)
ready_tiles
end
def populate_grid(bombs)
safe_spaces = @grid.length ** 2 - bombs
bombs = Array.new(bombs) { Tile.new(true) }
empty_tiles = Array.new(safe_... |
Markdown | UTF-8 | 4,684 | 2.78125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"WTFPL"
] | permissive | ---
layout: post
title: Notes about Migrating from Flex 3 to Flex 4 (4.1 or 4.5 SDK)
created: 1311017177
author: charlie
permalink: /js/notes-about-migrating-flex-3-flex-4-41-or-45-sdk
tags:
- JS
- RTL
- migration
- flex 4
---
<p>The main incentive for the migration was to support RTL languages namely Hebrew and Japane... |
JavaScript | UTF-8 | 351 | 2.515625 | 3 | [] | no_license | $(document).ready(function () {
$("form#Submit").submit(function () {
var count = $(this).data("count") || 0;
if (count >= x) {
//user clicked more than you wanted to so do something here
}
$(this).data("count", ++count);
alert(1);
});
function save() ... |
Shell | UTF-8 | 245 | 3.421875 | 3 | [] | no_license | #!/bin/bash -x
for files in `ls *.log.1`
do
#removing names of files without extension
filename=`echo $files | awk -F . '{print $1}'`
now=$(date +"%d%m%Y")
#rename file with new name
cp $files $filename.$now.log.1
done
|
C++ | UTF-8 | 740 | 2.765625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int maxMoves(vector<vector<int>>& grid) {
const int m = grid.size();
const int n = grid[0].size();
int ans = 0;
// dp[i][j] := max # of moves you can perform from (i, j)
vector<vector<int>> dp(m, vector<int>(n));
for (int j = n - 2; j >= 0; --j)
for (int i = 0;... |
C# | UTF-8 | 599 | 3.203125 | 3 | [] | no_license | using System.Collections.Generic;
namespace DesignPatterns.Structural.Proxy
{
public class Events
{
private readonly Queue<string> _queue;
public Events()
{
_queue = new Queue<string>();
}
public void Add(string @event)
{
_queue.Enqueue... |
Markdown | UTF-8 | 1,630 | 2.5625 | 3 | [
"MIT"
] | permissive |
# Hi <img src="https://media.giphy.com/media/hvRJCLFzcasrR4ia7z/giphy.gif" width="32px">
I'm Alex, a full stack developer based in Devon, UK 🇬🇧 originally from Gibraltar 🇬🇮. I thrive on the challenge of problem-solving and finding creative solutions to complex issues. As a lifelong learner, I am always looking to... |
Python | UTF-8 | 474 | 4.0625 | 4 | [] | no_license | def lesser_of_two_evens(a, b):
if not(a % 2) and not(b % 2):
return min(a, b)
else:
return max(a, b)
def animal_crackers(s):
tmp = s.lower().split(' ')
if tmp[0][0] == tmp[1][0]:
return True
else:
return False
def makes_twenty(a, b):
return a + b == 20 or a =... |
JavaScript | UTF-8 | 597 | 3.671875 | 4 | [] | no_license | function ubahHuruf(kata) {
var alphabet = '';
var alphabetList = 'abcdefghijklmnopqrstuvwxyz';
var alphabetChanged = ''
var output = '';
for (var i = 0; i < kata.length; i++) {
alphabet = kata[i]
var index = alphabetList.indexOf(alphabet) + 1
var alphabetChanged = alphabetList.charAt(index)
output += alphab... |
Markdown | UTF-8 | 3,567 | 2.796875 | 3 | [] | no_license | ---
description: "Simple Way to Prepare Speedy Arugula Basil Pesto"
title: "Simple Way to Prepare Speedy Arugula Basil Pesto"
slug: 456-simple-way-to-prepare-speedy-arugula-basil-pesto
date: 2020-12-22T10:59:24.190Z
image: https://img-global.cpcdn.com/recipes/ebead05980728818/680x482cq70/arugula-basil-pesto-recipe-main... |
Markdown | UTF-8 | 16,406 | 2.609375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Cenni preliminari sugli oggetti Freezable
ms.date: 03/30/2017
dev_langs:
- csharp
- vb
helpviewer_keywords:
- Freezable objects [WPF], description
- unfreezing Freezable objects [WPF]
- classes [WPF], Freezable
ms.assetid: 89c71692-4f43-4057-b611-67c6a8a863a2
ms.openlocfilehash: 755240859829042e9790b9c89e47b... |
TypeScript | UTF-8 | 2,665 | 3.171875 | 3 | [] | no_license | import { Component } from '@angular/core';
import { shuffle } from 'lodash';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
places = [null,null,null,null,null,null,null,null,null];
availablePlaces = [0,1,2,3,4,5,6,7,8... |
Python | UTF-8 | 1,470 | 3.71875 | 4 | [] | no_license | x = input("Masukan besar langkah yang diinginkan: \n")
n = input("Banyaknya langkah yang akan dilewati: \n")
rep = input("Pengulangan yang diinginkan: \n")
import turtle
import random
cat = turtle.Turtle()
list1 = [0,1,2,3]
list2 = [0,1,2]
def random_walk_1(length, how_much):
"""This function takes p... |
C++ | GB18030 | 1,595 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <limits.h>
#include <string.h>
#include <algorithm>
#define LOCAL
using namespace std;
//f[i][j]ʾǰi豸СΪjʱС۸
int f[103][2000];
int mi[103];
struct node
{
int b;
int p;
};
int main()
{
... |
Java | UTF-8 | 1,171 | 2.578125 | 3 | [
"MIT"
] | permissive | package com.revature.controllers;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.annotation.WebServlet;
import com.revature.Reimbursem... |
Java | UTF-8 | 402 | 3.3125 | 3 | [] | no_license | public class J0001 {
//imprimendo textos
public static void main(String[] args) {
// 1) impriir o texto "ola mundo"
System.out.println("Olá mundo");
// 2) imprima o numero 522
System.out.println(522);
// 3) imprima uma linha em branco
System.out.println();
// imprima mais um texto
... |
Python | UTF-8 | 1,443 | 2.75 | 3 | [
"MIT"
] | permissive | import pytest
from html2ans.parsers.audio import AudioParser
@pytest.fixture
def parser():
return AudioParser()
@pytest.fixture(params=[
'<audio></audio>',
])
def valid_audio_tag(request):
return request.param
def test_empty(parser, make_tag):
tag = make_tag('<audio></audio>', 'audio')
assert ... |
PHP | UTF-8 | 9,486 | 2.53125 | 3 | [] | no_license | <?php
use App\Model\Projeto;
use App\Controller\ProjetoController;
use App\Util\Upload;
$projetoController = new ProjetoController();
$nome = "";
$status = 1;
$descricao = "";
$editando = false;
$cod = filter_input(INPUT_GET, "cod", FILTER_SANITIZE_NUMBER_INT);
if (filter_input(INPUT_POST, "txtNome", FILTER_SANITI... |
Java | UTF-8 | 243 | 2.203125 | 2 | [] | no_license | package main.java.common.utils.interfaces;
import main.java.common.model.Hand;
import main.java.common.model.Suit;
import java.util.HashSet;
public interface DistinctSuitsReturner {
HashSet<Suit> returnDistinctSuits(final Hand hand);
}
|
C++ | UTF-8 | 1,727 | 2.828125 | 3 | [] | no_license |
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int n,m;
int map[51][51];
int result=100000000;
int ho_c;
int ch_c;
typedef struct NODE{
int x;
int y;
int dis;
}node;
vector<node> ch;//치킨
vector<node> ho;//집
vector<int> v;
bool cmp(const node &a,const node... |
C++ | UTF-8 | 2,383 | 2.953125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <map>
#include <string>
class Interpreter
{
public:
Interpreter();
~Interpreter();
void LoadRom(const std::string& path);
void Initialize();
unsigned int* GetScreen();
bool Cycle();
private:
/* Systems memory map (total system memory is 4096 bytes)
0x000-0x1FF - Chip 8 interpreter (... |
Ruby | UTF-8 | 208 | 2.9375 | 3 | [] | no_license | class TwitterMessages
attr_reader :messages
def initialize message_array
@messages = message_array
end
def include_term?
messages.find {|m| m.include?("Wednesday's #RoundClue")}
end
end |
C++ | UTF-8 | 1,158 | 3.8125 | 4 | [] | no_license | // 543. Diameter of Binary Tree
/*
Given a binary tree, you need to compute the length of the diameter of the tree.
The diameter of a binary tree is the length of the longest path between any two
nodes in a tree. This path may or may not pass through the root.
Example:
Given a binary tree
1
/ \
... |
JavaScript | UTF-8 | 3,133 | 2.6875 | 3 | [] | no_license | $(document).ready(function() {
// // .mouseenter
// // .mouseleave
// // .click
$("#stream1_btn").on("click", function() {
$(".stream1").removeClass('highlight_stream');
$(".stream2").removeClass('highlight_stream');
$(".stream3").removeClass('highlight_stream');
$(".stream1").addClass('... |
PHP | UTF-8 | 1,257 | 2.859375 | 3 | [] | no_license | <?php
namespace FastNorth\PropertyMapper\Tests\Stubs;
/**
* To
*
* Description...
*/
class To
{
/**
* mapped foo
*
* @var string
*/
private $mappedFoo;
/**
* the mapped children
*
* @var array
*/
private $mappedChildren = '';
/**
* Constructor
... |
JavaScript | UTF-8 | 283 | 2.65625 | 3 | [] | no_license | "use strict";
document.addEventListener("DOMContentLoaded", init);
function init() {
document.querySelector('#arrow').addEventListener("click", goPageDown);
}
function goPageDown() {
document.querySelector('#content').scrollIntoView({
behavior: 'smooth'
});
} |
Java | UTF-8 | 5,929 | 3.234375 | 3 | [] | no_license | package TutorialQuestion;
import java.util.*;
import java.io.PrintWriter;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.EOFException;
pub... |
Java | UTF-8 | 167 | 1.710938 | 2 | [] | no_license | package ua.artcode.dao;
import ua.artcode.model.User;
/**
* Created by gorobec on 27.11.16.
*/
public interface IUserJsonDao {
boolean saveUser(User user);
}
|
JavaScript | UTF-8 | 1,258 | 2.765625 | 3 | [
"MIT"
] | permissive | import React, { Fragment, useState, useEffect } from "react"
import { string } from "prop-types"
const DisplayRemainingCharacters = props => {
const { tweet, url, username } = props
const [status, setStatus] = useState("success")
const [urlLength, setUrlLength] = useState(0)
const characterLimit = 280
const twee... |
Java | UTF-8 | 646 | 2.84375 | 3 | [] | no_license | package com.thirdcc.webapp.utils;
public class FishLevelUtils {
public static final String FIRST_YEAR_FISH_LEVEL = "Junior Fish";
public static final String SECOND_YEAR_FISH_LEVEL = "Senior Fish";
public static final String OLDER_YEAR_FISH_LEVEL = "Elder Fish";
public static String getFishLevelBySeme... |
Java | UTF-8 | 6,971 | 2.234375 | 2 | [] | no_license | /*
* Copyright (C) 2017 Joseph Nicklyn
*
* 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 3 of the License, or
* (at your option) any later version.
*
* This progra... |
Swift | UTF-8 | 1,539 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// CKStatusView.swift
// Browser
//
// Created by Blake Tsuzaki on 5/11/18.
// Copyright © 2018 Modoki. All rights reserved.
//
import UIKit
@IBDesignable class CKStatusView: UIView {
@IBInspectable var message: String = "" {
didSet {
label.text = message
}
}
@IBIns... |
PHP | UTF-8 | 4,367 | 2.984375 | 3 | [] | no_license | <?php
//Map should usually be stored elsewhere, such as in database
$map=array();
$map['1x1']['weight']=1.0;
$map['1x2']['weight']=100.0;
$map['1x3']['weight']=100.0;
$map['1x4']['weight']=100.0;
$map['1x5']['weight']=1.0;
$map['2x1']['weight']=1.0;
$map['2x2']['weight']=100.0;
$map['2x3']['weight']=1.0;
$m... |
JavaScript | UTF-8 | 2,615 | 2.625 | 3 | [
"MIT"
] | permissive | ////////////
// set up //
////////////
var express = require('express');
var app = express(); // create the app w/ express
var mongoose = require('mongoose'); // mongoose for mongodb
var port = process.env.PORT || 3000; // set the port
var dat... |
Java | UTF-8 | 666 | 2.265625 | 2 | [] | no_license | package it.akademija;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class RestServisas {
@Autowired
private ServiceC service... |
Markdown | UTF-8 | 1,842 | 2.546875 | 3 | [
"MIT"
] | permissive | # NVCapSimple_Linux
NVCapSimple is a simple example of capture (preview) software for our "SV series" board and other UVC camera.
This software supports "UYVY" and "YUY2" frame format, but other formats such as MJPG and RGB are not supported.
This example uses v4l2 driver to capture "raw" data of UYVY format and... |
C | UTF-8 | 1,268 | 2.625 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2021
** .
** File description:
** .
*/
#include "../include/my_rpg.h"
sound_t *init_one_se(char *filepath)
{
sound_t *se = malloc(sizeof(sound_t));
if (se == NULL)
return (NULL);
se->buffer = sfSoundBuffer_createFromFile(filepath);
if (se->buffer == NULL)
return... |
Java | ISO-8859-1 | 1,459 | 1.8125 | 2 | [] | no_license | package senior.erp.componentNames.controladoria;
/**
* @author ilana.sievert
*/
public final class Form640LLMComponentNames {
/**
* Boto <b>Processar</b>
*/
public static final String BT_PROCESSAR = "Processar";
/**
* Boto <b>Excluir</b>
*/
public static final Str... |
Markdown | UTF-8 | 1,572 | 3.4375 | 3 | [] | no_license | # Hit-or-Miss
This repository contains the code for a game I made in my Intro to OOP course at Oregon Tech (Fall 2015 - Sophomore Year).
<b>Game Description:</b><br />
The purpose of the game is to use the up arrow key to shoot a rectangle upward while a square moves horizontally across the screen. If the rectangle hi... |
Python | UTF-8 | 3,260 | 2.75 | 3 | [] | no_license | import pandas as pd
import lxml.html as lh
import logging
import argparse
import json
from google.cloud import storage
from google.cloud.storage import Blob
from urllib.request import urlopen, Request
logging.getLogger().setLevel(logging.INFO)
def table_to_dict(tr_elements):
# Create empty list
col = []
... |
Python | UTF-8 | 639 | 3.484375 | 3 | [] | no_license | #!/usr/bin/env python
# COPYRIGHT 2017
# ROBERT WOLTERMAN
# MODULE IMPORTS
import pyttsx
import threading
# THIS IS RIDICULOUS
block = threading.Event()
# FUNCTIONS
def say(engine, text):
block.set()
engine.say(text)
engine.runAndWait()
block.clear()
def get_data():
return raw_input("TYPE quit... |
Java | UHC | 1,155 | 2.96875 | 3 | [] | no_license |
public class KiwiJuiceEasy {
public static int[] pouring(int[] capacities, int[] bottles, int[] formId, int[] toId) {
for(int i=0; i<toId.length; i++) {
int left=capacities[i]-bottles[i];
if (left>0) {
left=capacities[i]-bottles[i+1];
capacities[i+1]+=left;
}
else if (lef... |
C | UTF-8 | 14,998 | 3.625 | 4 | [] | no_license | /*
* File Name : MemoryExc
* Author : KsGin
* Date : 11/07/2017
*/
#include "MemoryExc.h"
/*初始化空闲区,默认为一块,可以指定大小及起始地址*/
struct free_block_type *init_free_block(int mem_size) {
struct free_block_type *fb = (struct free_block_type *) malloc(sizeof(struct free_block_type));
if (fb == NULL) {
p... |
Markdown | UTF-8 | 601 | 2.796875 | 3 | [
"MIT"
] | permissive | # sentdebot
Code for Sentdebot in the Sentdex discord channel (discord.gg/sentdex)
Pull requests welcome for just about anything.
The "style" of using methods to interact with sentdebot should be retained.
sentdebot.search("text here") vs !search text here.
I understand this goes against the main method of maki... |
Java | UTF-8 | 807 | 2.96875 | 3 | [] | no_license | package pl.softie.homeworks.course2;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
public class Exercise18 {
public static void main(String[] args) {
Map<String, String> map = new HashMap<>();
map.put("key1", "val1");
map.put("key2", "val2");
map.pu... |
C++ | UTF-8 | 257 | 2.8125 | 3 | [] | no_license | #include "11050.h"
int factorial(int num) {
if (num <= 1) return 1;
else return num * factorial(num - 1);
}
void nojam11050::solution()
{
int n, k;
scanf("%d %d", &n, &k);
printf("%d", (int)(factorial(n) / (int)(factorial(k) * factorial(n - k))));
}
|
C++ | WINDOWS-1252 | 1,260 | 2.640625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright Robert Spangenberg, 2014.
// See license.txt for more details
#pragma once
#include "StereoCommon.h"
template <typename T>
class MyImage {
public:
MyImage() :m_data(NULL)
, m_width(0)
, m_height(0)
{};
MyImage(uint32 width, uint32 height) :
m_width(w... |
JavaScript | UTF-8 | 2,554 | 2.65625 | 3 | [] | no_license | 'use strict';
import { doHttpRequest } from '../../modules/httpRequest';
import { checkHeightBody } from '../../modules/checkHeight';
import { getTweetWordCount } from '../../modules/wordCount';
import { removeHideClassButton, addHideClassButton, displayProfile, hideProfile } from '../../modules/hideShowMethods';
impo... |
C# | UTF-8 | 2,933 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using Xamarin.Forms;
namespace Plugin.Controls.SegmentedControl
{
public class SegmentedControl : View, IViewContainer<SegmentedControlOption>
{
private static readonly string ItemsSourcePropertyName = "ItemsSource";
... |
Python | UTF-8 | 241 | 2.859375 | 3 | [] | no_license | # 럭키 스트레이트
N = input()
left = 0
for i in range(len(N)//2):
left += int(N[i])
right = 0
for i in range(len(N)//2,len(N)):
right += int(N[i])
if left == right:
print('LUCKY')
else:
print('READY')
# 123402
# 7755 |
C++ | UTF-8 | 631 | 2.75 | 3 | [] | no_license | /*problem link: https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1048
input:
1
3
4
60
70
50
2
output:
1
2
3
3
4
27
4
I have solved this using the noob way as the time limit was in favour. Sort and get the median*/
#include<bits/stdc++.h>
using namespace std;
#define ll long lo... |
Java | UTF-8 | 720 | 2.25 | 2 | [] | no_license | package ba.unsa.etf.dms.data.auth;
import com.google.gson.annotations.SerializedName;
/**
* Created by Hugsby on 12/25/17.
*/
public class AuthData {
@SerializedName("username")
private String username;
@SerializedName("password")
private String password;
public AuthData(String username, Strin... |
Python | UTF-8 | 1,710 | 2.65625 | 3 | [] | no_license | from itertools import product
from itertools import combinations
from dictionary import BaiduChineseWordDictionary, NULL_STORAGE
from search import search
chars = '窄踏碎织纱衫乞著愁询陶醉企权颠势凭职呈屈攻撤威衰滔途旋竖纹弦纤催促披娇恰齿柴杏焦躁汁' \
'禁茂旺昌咏眠赠宣眨饮浆递陆彼托帆辰均裹胶栽拣磨介绍肤摩律损逐渐痕迹征隐蔽侦莫乏滥赞审' \
'刘恨案套遵挨摄述援社捐款返贫魔择毅慰尚膜恢康聋遗签昔践宗旨旬抚源燃章凶脱... |
PHP | UTF-8 | 1,062 | 3.125 | 3 | [] | no_license | <?php
abstract class base{
protected $table='';
protected function lord(){
try{
$pdo_object= new PDO('mysql:host=localhost;dbname=object2;charset=utf8','imabe','ppu');
}
catch(PDOException $Exception){
die('接続に失敗しました:'.$Exception->getMessage());
}
$select="select * from $this->table";
$query=$pdo... |
C | UTF-8 | 396 | 3 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
void main()
{
int
int length = 0;
char s[500];
printf("Enter the string");
gets(s);
length = strlen(s);
for(int i=0;i<length;i++)
{
if((s[i] == (int)NULL )||(s[i] == ''))
{
printf("\n");
}
else
{
... |
Java | UTF-8 | 4,446 | 2.734375 | 3 | [] | no_license | package articlecreator.gui;
/**
* Copyright 1999-2002 Matthew Robinson and Pavel Vorobiev.
* All Rights Reserved.
*
* ===================================================
* This program contains code from the book "Swing"
* 1st Edition by Matthew Robinson and Pavel Vorobiev
* http://www.spindoczine.... |
Swift | UTF-8 | 547 | 2.796875 | 3 | [] | no_license | //
// Coordinator.swift
// Metaweather
//
// Created by Bassuni on 18/06/2021.
//
import UIKit
protocol Coordinator : class {
var navigationController: UINavigationController { get }
var childCoordinators: [Coordinator] { get set }
func start()
}
extension Coordinator {
func addCoordinator(... |
C++ | GB18030 | 1,092 | 2.875 | 3 | [] | no_license | ///*
//201833
//,double
//*/
//
//#include<iostream>
//#include<vector>
//#include<stdio.h>
//using namespace std;
//
//const double LIMIT = 1e-2;
//const double MIN_VALUE = 0;
//
//int n, k;
//vector<double> rec(10000);
//
//bool Check(const double &len) {
// int num = 0;
//
// if (len == 0) return ... |
Java | UTF-8 | 6,058 | 2.390625 | 2 | [] | no_license | package github.com.suitelhy.dingding.core.infrastructure.domain;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.springframework.lang.Nullable;
im... |
C# | UTF-8 | 982 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | using Demo.Core.Models;
using Demo.Mediatr.CommandLine.Models;
using MediatR;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Demo.Mediatr.CommandLine.Services
{
public class CustomerChargeService
{
private readonly IAsyncRequestHandler<GetCustomerChargeExactMatchRequest, Get... |
Python | UTF-8 | 1,552 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | import os
import sys
from os import path
def get_operational_system():
"""
Check which user's operating system
"""
os = sys.platform
if sys.platform == "linux":
return "Linux"
elif sys.platform == "win32":
return "Windows"
elif sys.platform == "darwin":
return "M... |
Java | UTF-8 | 195 | 2.28125 | 2 | [] | no_license | package com.designpattern.facade;
/**
* Created by Administrator on 2015/4/22.
*/
public class SubSystem2 {
public void methodTwo(){
System.out.println("this is method2");
}
}
|
Java | UTF-8 | 533 | 2.71875 | 3 | [] | no_license | package producer_consumer;
/**
* Created by codew on 2018/1/23.
*/
// 消费者
public class NVProducer implements Runnable{
private NVShareResource resource = null;
public NVProducer(NVShareResource resource)
{
this.resource = resource;
}
@Override
public void run() {
for (int... |
C | UTF-8 | 276 | 2.890625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "linkedlist.h"
int main(int argc, const char * argv[]){
int i;
struct list_node *list;
list = NULL;
for (i = 0; i < 10; i++){
list = append(list, i);
fprint_list(stdout, list, "->");
printf("\n");
}
return 0;
}
|
Java | UTF-8 | 4,728 | 1.945313 | 2 | [] | no_license | package com.tencent.mm.plugin.appbrand.widget.e;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.view.ViewGroup.LayoutParams;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import co... |
PHP | UTF-8 | 5,845 | 2.734375 | 3 | [] | no_license | <?php
class BrandsController extends AppController {
public $name = 'Brands';
public $uses = array('Brand', 'ItemType', 'ItemCategory');
public function beforeFilter()
{
AppController::beforeFilter();
// Basic setup
$this->Auth->authenticate = array('Form');
... |
Python | UTF-8 | 554 | 3.1875 | 3 | [] | no_license | def inv(k, p):
if k == 0:
raise ZeroDivisionError('division by zero')
if k < 0:
# k ** -1 = p - (-k) ** -1 (mod p)
return p - inv(-k, p)
# Extended Euclidean algorithm.
s, old_s = 0, 1
t, old_t = 1, 0
r, old_r = p, k
while r != 0:
quotient = old_r // r... |
JavaScript | UTF-8 | 2,712 | 3.859375 | 4 | [] | no_license |
const statusDisplay = document.querySelector(".game--status");
let gameActive=true;
let currentPlayer= "X";
let gameState= ["", "", "", "", "", "", "", "", ""];
const winningMessage = () => `Player ${currentPlayer} has won`;
const drawMessage = () => `Game ended in a draw`;
const currentPlayerTurn =... |
C# | UTF-8 | 1,347 | 2.59375 | 3 | [
"MIT"
] | permissive | using UnityEngine;
using UnityEngine.UI;
using Zenject;
using FSM.GameManager.States;
namespace FSM.GameManager
{
public class GameManager : MonoBehaviour
{
private GameStateFactory _gameStateFactory;
private GameStateEntity _gameStateEntity = null;
[SerializeField]
private G... |
Java | UTF-8 | 1,649 | 2.578125 | 3 | [] | no_license | package com.hydra.project.provider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.swt.graphics.Image;
import com.hydra.project.model.MyPropertyItem;
public class PropertyTableLabelProvider implements ITableLabelProvider{
... |
C++ | UTF-8 | 870 | 3.9375 | 4 | [] | no_license | #include <iostream>
using namespace std;
void check(float angle_1, float angle_2, float angle_3);
int main(void){
float angle_1;
float angle_2;
float angle_3;
cout<<"Enter the three numbers as space separated integers"<<endl;
cin>>angle_1>>angle_2>>angle_3;
check(angle_1, angle_2, angle_3);
}
void check(float... |
Python | UTF-8 | 825 | 3.34375 | 3 | [
"MIT"
] | permissive | import requests
while True:
pokemon = input("which pokemon do you want to choose?")
pokemon = pokemon.lower()
url = f"https://pokeapi.co/api/v2/pokemon/{pokemon}"
req = requests.get(url)
if req.status_code == 200 :
data = req.json()
print(f"Name is\t\t{data['name']}")
... |
Python | UTF-8 | 295 | 2.515625 | 3 | [] | no_license | import requests
import re
username ='natas1'
password = 'gtVrDuiDfck831PqWsLEZy5gyDz1clto'
url = 'http://%s.natas.labs.overthewire.org/' %username
responce=requests.get(url, auth = (username, password))
content = responce.text
print (content)
print (re.findall('<!--The password for natas2 is (.*) -->',content)[0]) |
C# | UTF-8 | 1,450 | 2.6875 | 3 | [
"MS-PL"
] | permissive | using System;
namespace SysadminsLV.PKI.Dcom {
/// <summary>
/// Contains enumeration of ADCS Certification Authority roles
/// <para>This enumeration has a <see cref="FlagsAttribute"/> attribute that allows a bitwise combination of its member values.</para>
/// </summary>
[Flags]
public enum ... |
Python | UTF-8 | 1,611 | 3.34375 | 3 | [] | no_license | import numpy as np
import scipy.misc as msc
import scipy.ndimage as img
# function used to read intensity images.
def readIntensityImage(filename):
f = msc.imread(filename, flatten=True).astype('float')
return f
# function to generate and save intensity images.
def writeIntensityImage(f,filename):
... |
C# | UTF-8 | 4,734 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Kalender
{
class Program
{
static void Main()
{
Console.Write("C:> ");
string Eingabe_des_Nutzer = Console.ReadLine();
string[] Get... |
Python | UTF-8 | 2,722 | 2.609375 | 3 | [] | no_license | #!/usr/bin/python3
# -*- coding: utf-8 -*-
print("Content-Type: text/html\r\n\r\n")
utf8stdout = open(1, 'w', encoding='utf-8', closefd=False)
with open('../htmls/template.html', 'r', encoding='utf-8') as file:
s = file.read()
print(s.format('Detalle Avistamiento', '''
<div class="caracteristicas">
<ul c... |
Java | UTF-8 | 1,335 | 2.109375 | 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.common.base;
import java.io.Serializable;
// Referenced classes of package com.google.common.base:
// Function, F... |
C# | UTF-8 | 362 | 3.09375 | 3 | [] | no_license | using static System.Console;
public abstract class Element
{
public Element(int x, int y)
{
X = x;
Y = y;
}
public int X { get; set; }
public int Y { get; set; }
public abstract void Prepare(Game game);
public abstract void Draw(Game game);
public void HomeCursor()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.