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 | 343 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
char ch;
printf("enter any character \n");
scanf("%c",&ch);
switch(ch)
{
case'a':
printf("vowel");
break;
case'e':
printf("vowel");
break;
case'i':
printf("vowel");
break;
case'o':
printf("vowel");
break;
case'u':
printf("vowel");
break;
default:
printf("consonen... |
Java | UTF-8 | 1,038 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | package com.rbkmoney.fraudbusters.management.service;
import com.rbkmoney.damsel.fraudbusters.Command;
import com.rbkmoney.fraudbusters.management.converter.TemplateModelToCommandConverter;
import com.rbkmoney.fraudbusters.management.domain.TemplateModel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf... |
JavaScript | UTF-8 | 2,687 | 2.65625 | 3 | [
"MIT"
] | permissive | const BASE_URL = "http://localhost:4000";
// Action Creators
const setUser = payload => ({ type: "SET_USER", payload });
const setLogOut = () => ({ type: "LOG_OUT" });
// Methods
export const logUserOut = () => dispatch => {
fetch(`${BASE_URL}/logout`, {
method: "delete",
headers: {
"Content-Type": ... |
Python | UTF-8 | 258 | 2.984375 | 3 | [] | no_license | # LeetCode 53
def maxSubArray(L):
n = len(L)
curr_sum = max_sum = L[0]
for i in range(1, n):
curr_sum = max(L[i], curr_sum + L[i])
max_sum = max(max_sum, curr_sum)
return max_sum
nums = eval(input())
print(maxSubArray(nums)) |
C++ | UTF-8 | 2,430 | 3.265625 | 3 | [] | no_license | #include "common.h"
// TODO:
// a) 简化代码,四个变量即可
// b) 划分区间法
class Solution {
public:
int maxProfit(vector<int>& prices) {
const int len = prices.size();
if (len < 2) return 0;
array<int, 4> dp[2]; // 持有,没有,持有,没有
dp[0][0] = -prices[0];
dp[0][1] = 0;
dp[0][2] = -prices... |
JavaScript | UTF-8 | 365 | 2.859375 | 3 | [] | no_license | function setup() {
createCanvas(750, 750);
noStroke();
rectMode(CENTER);
}
function draw() {
background(0000);
fill(250,170,35);
rect(mouseX, height/2, mouseY/2+10, mouseY/2+10);
fill(215,130,40);
var inverseX = width-mouseX;
var inverseY = height-mouseY;
rect(inverseX, height/2, (inverseY/2)... |
Python | UTF-8 | 5,023 | 3.765625 | 4 | [
"MIT"
] | permissive | from __future__ import annotations
from .currency import Currency
import operator
import math
class Money:
def __init__(self, amount: int, currency: Currency):
self.__assert_amount(amount)
self.__amount = amount
self.__currency = currency
def instance(self, amount: int) -> Money:
... |
Python | UTF-8 | 480 | 2.625 | 3 | [] | no_license | #!/Library/Frameworks/Python.framework/Versions/3.7/bin/python3
import pyperclip as p
def fullStackPaste():
stack = open("/Users/scottmolloy/Desktop/.alfredWork/stack/stack.txt", "r").read().split("\t\t∴\n")
paste = ""
for i in range(len(stack)):
paste = paste + "\n" + stack[i]
open("/Users/scottmolloy/Desktop... |
PHP | UTF-8 | 3,173 | 2.65625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | <?php
/**
* This is the model class for table "user_module".
* It holds all activated user modules.
*
* When user_id is set to 0 the record defines the user default setting.
*
* The followings are the available columns in table 'user_module':
* @property integer $id
* @property string $module_id
* @property ... |
Java | UTF-8 | 226 | 1.882813 | 2 | [] | no_license | package server;
import mayflower.Actor;
public class ServerWeaponsActor extends Actor
{
public ServerWeaponsActor()
{
setImage("img/LaserCannon.png");
}
@Override
public void act()
{
}
}
|
Python | UTF-8 | 4,352 | 3.15625 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
import pygame
class WeaponFireSprite(pygame.sprite.Sprite):
def __init__(self, screen, last_direction, x, y):
super(WeaponFireSprite, self).__init__()
self.x, self.y = x, y
self.last_direction = last_direction
self.screen = screen
self.left, self.righ... |
Python | UTF-8 | 1,177 | 2.59375 | 3 | [] | no_license | from collections import OrderedDict
from slugify import slugify
def classification_to_extract(classification):
extract = OrderedDict()
for annotation in classification['annotations']:
if 'task_label' in annotation:
# we should really add a `short_label` on the workflow so this name can be ... |
Ruby | UTF-8 | 693 | 2.71875 | 3 | [] | no_license | require_relative './player'
class Enemy < Player
attr_reader :speed
OffscreenBuffer = 5
def initialize(initial_x, initial_y, ground, speed)
super(initial_x, initial_y, ground)
@speed = speed
end
def color
case speed
when 1
Gosu::Color::WHITE
when 2
Gosu::Color::GREEN
wh... |
PHP | UTF-8 | 2,766 | 2.59375 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use AccountKit;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7;
use GuzzleHttp\Exception\RequestException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
class CustomLoginController extends Controller
{
public function otpLogin(Request $request) {
// Initi... |
Java | UTF-8 | 525 | 2.125 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package edu.mum.model;
import java.time.LocalDate;
import java.util.List;
/**
*
* @author Tewodros Ayele Assefa
*/
public interfac... |
PHP | UTF-8 | 2,104 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
/**
* Model for the GROUPS table. Includes USER_GROUPS data.
*
*
*/
class GroupModel implements \JsonSerializable
{
private $id;
private $adminId;
private $name;
private $description;
private $members;
private static $rules = [
'name... |
Shell | UTF-8 | 139 | 2.875 | 3 | [] | no_license | #!/bin/zsh
# kills all apps using the isight camers
kill_camera() {
lsof | grep -i "AppleCamera" | awk '{ print $2 }' | xargs kill -9
}
|
Java | UTF-8 | 131 | 1.726563 | 2 | [] | no_license | package domain;
/**
* Class depends of Artist
* @see Artist
* @author Taras
*/
public class TechnicalWriter extends Artist {
}
|
Markdown | UTF-8 | 10,999 | 2.9375 | 3 | [] | no_license | # Data Analysis
### Table of Contents
- [Data Exploration](https://github.com/meehadjawwad/Premier-League-Analysis/blob/master/analysis.md#data-exploration)
- [Attack](https://github.com/meehadjawwad/Premier-League-Analysis/blob/master/analysis.md#attack)
- [Goals Scored](https://github.com/meehadjawwad/Premier-Leagu... |
C++ | UTF-8 | 830 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
#include "Decorator.h"
void outResult(int cost, string description)
{
cout << "Coffe: " << description << ", cost: " << cost << endl;
}
int main()
{
// oreilly book implementation
{
// only espresso
oreilly::Beverage *esp = new oreilly::coffe::Espresso... |
JavaScript | UTF-8 | 1,097 | 3.359375 | 3 | [] | no_license | // xorChar :: char -> char -> char
var xorChar = function (char1, char2) {
return String.fromCharCode(char1.charCodeAt(0) ^ char2.charCodeAt(0));
};
// xorString :: string -> string -> string
var xorString = function (s1, key) {
var xored = '', i;
for (i in s1) {
xored += xorChar(s1[i], key[i % key... |
SQL | UTF-8 | 501 | 3.140625 | 3 | [] | no_license | /*TRIGGERS DE VALIDACAO -- EMAIL, CPF*/
/*VALIDA EMAIL*/
CREATE OR REPLACE TRIGGER EMAIL_TRG
BEFORE INSERT OR UPDATE OF EMAIL ON USUARIO
FOR EACH ROW
BEGIN
IF VALIDA_EMAIL(:NEW.EMAIL) = 1 THEN
RAISE_APPLICATION_ERROR(-20001, 'Email Invalido!');
END IF;
END;
/
/*VALIDA CPF*/
CREATE OR REPLACE TRIGGE... |
Java | UTF-8 | 1,835 | 2.484375 | 2 | [] | no_license | package stepDefinitions;
import java.util.List;
import java.util.Map;
import org.testng.Assert;
import com.SDET8BDD.genericUtil.BaseUtil;
import com.SDET8BDD.genericUtil.WebdriverUtility;
import com.SDET8BDD.pagefactory.CreateOrganization;
import com.SDET8BDD.pagefactory.HomePage;
import com.SDET8BDD.pagefactory.Org... |
C# | UTF-8 | 2,959 | 2.546875 | 3 | [] | no_license | using System;
using System.Threading.Tasks;
using MediatrSampleApi.Handlers.Command;
using MediatrSampleApi.Handlers.Query;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using MediatrSampleApi.Handlers.Contracts;
using System.Collections.Generic;
using MediatrSampleApi.Exceptions;
namespace MediatrSampleApi.Control... |
Java | UHC | 1,858 | 2.46875 | 2 | [
"MIT"
] | permissive | package Minigames.RandomWeaponWar.Weapons;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.en... |
Java | UTF-8 | 2,854 | 2.234375 | 2 | [] | no_license | package dam.gala.damgame.activities;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import com.example.damgame.R;
import dam.gala.damgame.utils.GameUtil;
import static androidx.preference... |
Python | UTF-8 | 1,704 | 3.203125 | 3 | [] | no_license | size=input("Enter Number of Processes")
quantum=input("Enter Time Quantum : ")
time=0
burst_time=[0]*size
remaining_burst_time=[0]*size
arrival_time=[0]*size
process_id=[0]*size
waiting_time=[0]*size
turnaround_time=[0]*size
for i in range(size):
print " "
process_id[i]=input("Enter Process_Id")
... |
Java | UTF-8 | 8,315 | 2.140625 | 2 | [] | no_license | package com.example.patrick.outfitplanner;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
... |
PHP | UTF-8 | 2,365 | 2.640625 | 3 | [] | no_license | <?php
/**
* Customer XML unserializer test
*
* @since 1.0.0
*
* @package Pronamic/WP/Twinfield
*/
namespace Pronamic\WP\Twinfield\XML\Customers;
use PHPUnit\Framework\TestCase;
use Pronamic\WP\Twinfield\Customers\Customer;
/**
* Customer XML unserializer test
*
* @since 1.0.0
* @package Pr... |
C++ | UTF-8 | 4,765 | 3.640625 | 4 | [] | no_license | /***********************************************************************************************
** Program Name: Project1 (Langton Ant)
** Author: Jeremy Einhorn
** Date: July 7, 2017
** Description: This is the main file. The menu first pops up. If the user hits 1, the Langton
Ant begins. The menu will pop up... |
JavaScript | UTF-8 | 402 | 3.734375 | 4 | [] | no_license | /**
* @param {Function} fn
* @return {Function}
*/
var once = function(fn) {
var visited = false;
return function(...args){
if(!visited){
visited = true;
return fn(...args);
}else{
return undefined;
}
}
};
let fn = (a,b,c) => (a + b + c)
let onceFn = once(... |
Shell | UTF-8 | 3,878 | 3.609375 | 4 | [] | no_license | src="library.txt"
#ACCESNO/BOOKNAME/AUTHNAME/SUBJECT/PUBLICATION/NOCOPIES/YEARPUB
echo -e "\tMENU"
echo -e "1.Enter new books"
echo -e "2.Update subject of a book"
echo -e "3.List all books of some publication"
echo -e "4.Sort by Subject-Author Name-Publisher"
echo -e "5.Delete a book"
echo -e "6.Number of copies of ... |
JavaScript | UTF-8 | 1,197 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | var marked = require('marked'),
frontMatter = require('front-matter'),
renderer = new marked.Renderer(),
originalCodeRenderer = renderer.code,
heading = require('./heading'),
hr = require('./hr'),
getImages = require('./image'),
renderTemplates = require('./injectTemplate');
module.exports ... |
Java | UTF-8 | 1,679 | 2.578125 | 3 | [] | no_license | package com.profe.Profe.dao;
import com.profe.Profe.model.Lesson;
import com.profe.Profe.model.Student;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.UUID;
@Repository
public... |
Java | UTF-8 | 1,378 | 4.3125 | 4 | [] | no_license | package arithmaticoperator;
import java.util.Scanner;
/**
* Date-03/08/2019
*
* @author SANJAY
*
* Some Of The Arithmetic Operator Are (+,-,*,/,%)
*
*/
public class Example {
int a, b, c;
public void input() {
Scanner input = new Scanner(System.in);
System.out.println("Enter Th... |
C++ | UTF-8 | 1,163 | 3.203125 | 3 | [] | no_license | // Warning: Change mod and N according to the question
inline int add(int x, int y, int mod = ::mod) {
x += y;
if (x >= mod or x < 0) x %= mod;
if (x >= 0) return x;
return x + mod;
}
inline int mul(int x, int y, int mod = ::mod) {
if (x >= mod or x + mod < 0) x %= mod;
if (y >= mod or y + mod < 0) y %= m... |
Markdown | UTF-8 | 9,147 | 3.359375 | 3 | [] | no_license | # Your solution to E28
Performance analysis, comparing all four designs you have implemented
instead of Design 1 with Design 5 as the book says.
To do this evaluation (of E26, E28-E30), for each design create random instances and
then call each method many thousands of times, and then find the elapsed time in millise... |
Markdown | UTF-8 | 1,561 | 2.734375 | 3 | [] | no_license | This is repository for the Assignment 15 given by my respected teacher. This Assignment is solely made by me Everyday I work on this assignment and each day I am getting closer to complete this assignment. It helps me clearing my operating system conecpts in more advaced. I have not learn concept of os this deep.
Ques... |
C# | UTF-8 | 1,394 | 3.34375 | 3 | [] | no_license | using System;
namespace school_db {
class DateGenerator {
int year;
public DateGenerator(int year) {
this.year = year;
}
private int getRandomStudentYear() {
//return random year within 4 years of year
Random rand = new Random();
return year + rand.Next(0,4);
}
privat... |
JavaScript | UTF-8 | 2,173 | 2.859375 | 3 | [] | no_license | import { useEffect, useState } from "react";
import {
Button,
Typography,
Box,
Card,
TextField,
CardContent,
} from "@material-ui/core";
// import './App.css';
import { api } from "./data";
import { validateInput } from "./utlis/validators";
function App() {
const [cards, setCards] = useState([]);
con... |
Markdown | UTF-8 | 6,737 | 2.5625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Google Summer of Code | Coding Period | Week 4"
visible: true
---

This week — June 4 to June 10— was the fourth week of the coding period of [Google Summer of C... |
Java | UTF-8 | 3,387 | 2.90625 | 3 | [] | no_license | package com.thoughtworks.contraman;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import static java.util.Arrays.stream;
class Timetable {
private final List<Track> tracks = new LinkedList<>();
private final TalkConsumer talks;
private final... |
Java | GB18030 | 10,615 | 2.15625 | 2 | [] | no_license | package com.epay.aty;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONException;
import com.epay.aty.tools.Information;
import com.epay.aty.R;
import com.tt.accountInfo.AccountInfo;
import com.tt.json.JSONArray;
import com.tt.json.JSONObject;
import com.tt.moneyInfo.CardInfo;
import com.tt.too... |
Java | UTF-8 | 1,502 | 1.757813 | 2 | [] | no_license | /*
* Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software... |
C# | UTF-8 | 2,001 | 2.703125 | 3 | [
"MIT"
] | permissive | namespace SyncPro.UI.Converters
{
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
[ValueConversion(typeof(string), typeof(bool))]
public class StringToBooleanConverter : IValueConverter
{
public bool ReverseValue { get; set; }
publ... |
PHP | UTF-8 | 1,785 | 2.59375 | 3 | [] | no_license | <html>
<body>
<?php
if (isset($_POST['email']) && isset($_POST['pass']))
{
$email= $_POST['email']; $pass= md5($_POST['pass']);
include("connect.php");
$requete="select * from client where EmailClient = '$email' AND MdpClient = '$pass'";
... |
Python | UTF-8 | 7,900 | 3.109375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import re
import unittest
class taxCalculator(object):
items = []
taxedItems = []
salesTaxes = 0.0
total = 0.0
# 'Costants' for the taxes
salesTax = 0.1
importationTax = 0.05
def addItem(self, item):
self.items.append(item)
def clear(self):
self.items = []
self.taxedItems = []
self.salesTaxes = 0.0
... |
C++ | UHC | 1,393 | 3.265625 | 3 | [] | no_license | //Jennifer Soft - D
#include "bits_stdc++.h"
#define SIZE 12
using namespace std;
// üũϱ 迭
int idx[4] = { 0,0,1,-1 }, idy[4] = { 1,-1,0,0 };
// ġ,ġ ü
struct Now
{
int x, y, cnt;
};
int main()
{
//n = ũ, temp = ġ 迭.
int n, temp[SIZE][SIZE] = { 0 };
//
char arr[SIZE][SIZE] = { 0 };
scanf("... |
PHP | ISO-8859-1 | 1,533 | 2.734375 | 3 | [] | no_license | <?php
class Application_Model_WebServices_Photos extends Application_Model_WebServices_WebService
{
// ----- Dfinition des attributs -----
// ----- Dfinition des getters et setters ------
// ----- Dfinition des mthodes ------
public static function getAllPhotos(){
$liste_photos = array();
$liste_photos[1]... |
Java | UTF-8 | 1,814 | 2.703125 | 3 | [] | no_license | package util;
import context.ProductContext;
import db.TransactionManager;
import entity.Product;
import mapper.ContextMapper;
import javax.sql.DataSource;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
public class Basket {
private TransactionManager transactionManager;
privat... |
Markdown | UTF-8 | 5,127 | 2.578125 | 3 | [
"MIT"
] | permissive | ---
theme: "solarized"
#theme: "black"
transition: "zoom"
highlightTheme: "solarized-dark"
separator: "^\n\n\n"
verticalSeparator: "^\n\n"
#margin: 0.1
#minScale: 0.2
#maxScale: 1.5
#fig_width: 7
#fig_height: 6
title: "git primer"
author: Maximilian Konzack
date: February 20, 2020
output: revealjs::revealjs_presentatio... |
Markdown | UTF-8 | 5,110 | 2.609375 | 3 | [] | no_license | ---
description: "Recipe of Homemade A Certain Japanese Restaurant&#39;s Bestseller &#34;Squid Popo&#34; Bake (Squid Ark)"
title: "Recipe of Homemade A Certain Japanese Restaurant&#39;s Bestseller &#34;Squid Popo&#34; Bake (Squid Ark)"
slug: 576-recipe-of-homemade-a-certain-japanese-restaurant-a... |
Python | UTF-8 | 1,221 | 2.921875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from tkinter import *
from tkinter import font
import random
from tkinter import filedialog
pnc = Tk()
pnc.title("Prueba Rifa | Gustavo")
pnc.geometry("600x315+330+150")
pnc.resizable(False, False)
slinder1 = PhotoImage(file="fondo.png")
slinder = Label(image=slinder1, cursor="right_ptr")
slin... |
Java | UTF-8 | 9,746 | 1.953125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017 Sumo Logic
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
Shell | UTF-8 | 924 | 3.765625 | 4 | [] | no_license | #!/bin/bash
# shellcheck disable=SC2086
set -eou pipefail
config_file="${1:-}"
vendor_dir="${2:-}"
if [[ -z "$config_file" ]]; then
echo "Must pass config file as first argument"
exit 0
fi
if ! [[ -f "$config_file" ]]; then
echo "Must pass config file as first argument."
exit 0
fi
if [[ -z "$vendor_di... |
Swift | UTF-8 | 576 | 2.734375 | 3 | [
"MIT"
] | permissive | //
// TestLinearMap.swift
// SpaceKitTests
//
// Created by Yuhuan Jiang on 3/16/20.
// Copyright © 2020 Yuhuan Jiang. All rights reserved.
//
import XCTest
import SpaceKit
class TestLinearMap: XCTestCase {
func testComposingLinearMaps() {
let p1 = Polynomial(coefficients: [2, 3, 4, 5, 6 ])
... |
Java | UTF-8 | 232 | 1.773438 | 2 | [] | no_license | package com.hef.spittr.service;
import com.hef.spittr.domain.Spitter;
public interface AlertService {
void sendSpitter(Spitter spitter);
void sendMessage(String message);
void sendHandlerSpitter(Spitter spitter);
}
|
Markdown | UTF-8 | 5,627 | 3.546875 | 4 | [] | no_license | # Bookstore Project Instructions
## 05
Finished
## 06
### Rubric
Criteria Performance levels Score
#### Program Runs
Yes
Program compiles and runs
10
No
Program does NOT compile and run
0
#### Code is Clean
Yes
Code is easy to read (good commenting, variable names, indentation, etc.)
10
Some problems
Code ... |
Java | UTF-8 | 837 | 1.578125 | 2 | [] | no_license | package com.android.pplusaudit2.Report.StoreSummary;
/**
* Created by ULTRABOOK on 5/10/2016.
*/
public class StoreItem {
public int ID;
public int userID;
public int auditID;
public String auditName;
public String account;
public String customerCode;
public String customer;
public S... |
C++ | UTF-8 | 1,378 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
#include "Point.h"
#include "Size.h"
#include "Cell.h"
#include "Map.h"
#include "Player.h"
#include "PathSearchAI.h"
#include "AStar.h"
#define WIDTH 20
#define HEIGHT 10
char map[HEIGHT*WIDTH] =
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,... |
Markdown | UTF-8 | 1,280 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | # mathpractice
An app to help with practicing basic maths.
## Why?
To help my kids practice their basic math skills.
* Purposely a small app that doesn't deal with all the error states.
* Purposely doesn't have authentication.
* Simple in design & implementation.
> **Note:** I'm running this app on a Raspberry Pi... |
Python | UTF-8 | 191 | 3.640625 | 4 | [] | no_license | import functools
def max_in_list(list_of_nums):
# get the maximum number in a list using the reduce function
return functools.reduce(lambda x, y: x if (x > y) else y, list_of_nums)
|
C++ | UTF-8 | 1,239 | 2.875 | 3 | [] | no_license | //-*- coding:utf-8 -*-
// Generated by the Fetch-Leetcode project on the Github
// https://github.com/CJHMPower/Fetch-Leetcode/
// 210 Course Schedule II
// https://leetcode.com//problems/course-schedule-ii/description/
// Fetched at 2018-07-24
// Submitted 2 years, 1 month ago
// Runtime: 28 ms
// This solution defea... |
Java | UTF-8 | 107 | 2.25 | 2 | [] | no_license | package test;
public class Element {
public String appearance() {
return "OVERRIDE THIS METHOD";
}
}
|
JavaScript | UTF-8 | 2,848 | 2.703125 | 3 | [] | no_license | function noOp(){};
/**
* Creates a watcher for webpack
* @param {string} name a name to prepend to log output
* @param {webpack compiler} compiler
* @param {object} options an option of objects (must have been put through `makeWatcherOptions`)
*/
module.exports = function webpackWatcher(name,compiler,options){... |
C# | UTF-8 | 2,532 | 3.140625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
class F
{
static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
static (int, int) Read2() { var a = Read(); return (a[0], a[1]); }
static void Main() => Console.WriteLine(Solve());
static object Solve()
{
va... |
Python | UTF-8 | 2,378 | 2.59375 | 3 | [
"MIT"
] | permissive | import hashlib
from database.consent_form import ConsentForm
from database.database_util import connect_to_database, connect_to_anonymous_database, close_database_connection
from database.session import Session
def anonymize_database():
"""
Anonymises the currently connected database to the 'anonymous' datab... |
Java | UTF-8 | 2,423 | 2.984375 | 3 | [] | no_license | package com.allstate.training.view;
import java.io.*;
import com.allstate.training.pojo.*;
import java.util.Scanner;
public class TrainingApp {
public static void main (String args[])throws IOException,ClassNotFoundException
{Scanner sc=new Scanner(System.in);
Trainer t=new Trainer();
Course c=new Course();... |
C++ | UTF-8 | 947 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int t;
int n;
string t_str;
string n_str;
getline(cin, t_str);
getline(cin, n_str);
t = stoi(t_str);
n = stoi(n_str);
if (n<1 || n>1000)
cout<<"too many number of lines"<<endl;
string lines[n];
string temp;
string replace1("ent... |
JavaScript | UTF-8 | 34,064 | 2.515625 | 3 | [
"MIT"
] | permissive | function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
var data = ev.dataTransfer.getData("text");
//Target cell
var trgt_row = $(ev.target).parent().parent().index();
var trgt_col = $(ev.target).parent(... |
JavaScript | UTF-8 | 722 | 4.84375 | 5 | [] | no_license | /*
Strings
These exercises will test your knowledge of string functions, conditionals,
and arrays. For many of them, you will want to consult the JavaScript strings
reference to find useful string methods to call.
DrEvil
Create a function called DrEvil. It should take a single argument, an amount,
and return ' dolla... |
Java | UTF-8 | 461 | 1.726563 | 2 | [] | no_license | package my.spring.cloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
@EnableEurekaClient //启动EnableEureka客户端,进行服务注册
@SpringBootApplication
public class TestApplication01
{
... |
TypeScript | UTF-8 | 374 | 3.5 | 4 | [] | no_license | let data: number | string
data = '42'
data = 10
interface ICar {
color: string
model: string
topSpeed?: number // optional property
}
const car1: ICar = {
color: 'blue',
model: 'bmw'
}
const car2: ICar ={
color: 'red',
model: 'mercedes',
topSpeed: 100
}
const multiply = (x: number,... |
Java | UTF-8 | 3,722 | 2.1875 | 2 | [] | no_license | package xyz.pokeemon;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import xyz.pok... |
JavaScript | UTF-8 | 619 | 2.734375 | 3 | [] | no_license | class Drop{
constructor(x, y,) {
var options = {
'restitution':1,
'friction':1
}
this.body=Bodies.rectangle(x,y,2,2,options)
this.width=2;
this.height=2;
World.add(world,this.body)
}
updateY(){... |
TypeScript | UTF-8 | 693 | 2.625 | 3 | [] | no_license | import { getModule, VuexModule } from 'vuex-module-decorators'
declare type ConstructorOf<C> = {
new (...args: any[]): C
}
/**
* Получить модуль vuex-decarator для работы с Vuex
*/
export function getVuexDecaratorModuleByWindow<T extends VuexModule>(
vuexModule: ConstructorOf<T>
): T {
if (!process.browser)
... |
Java | UTF-8 | 1,007 | 2.0625 | 2 | [] | no_license | package com.cloudconfig.client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.con... |
PHP | UTF-8 | 1,022 | 2.53125 | 3 | [] | no_license | <?php
if( $_SERVER['REQUEST_METHOD']=='POST' ) {
$student_id = $_POST['student_id'];
$branch = $_POST['branch'];
$f = $_POST['f'];
$password = $_POST['password'];
$question_one =$_POST['question_one'];
$question_two= $_POST['question_two'];
... |
Java | UTF-8 | 594 | 2.1875 | 2 | [] | no_license | package com.db.bex.dbTrainingEnroll.dao;
import com.db.bex.dbTrainingEnroll.entity.Rating;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
@Repository
public interface RatingRepository extends JpaRepo... |
Java | UTF-8 | 6,193 | 2.140625 | 2 | [
"MIT"
] | permissive | package com.example.rodrigo.smartcar;
import android.content.Intent;
import android.graphics.Color;
import android.os.AsyncTask;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.maps.CameraUpdate;
import com.google.android.gms.maps.Camera... |
Python | UTF-8 | 13,418 | 2.6875 | 3 | [] | no_license | import random
import math
import matplotlib.pyplot as plt
import numpy as np
def cria_matriz(n_linhas, n_colunas, valor):
matriz = []
for l in range(n_linhas):
linha = []
for c in range(n_colunas):
linha.append(valor)
matriz.a... |
Python | UTF-8 | 444 | 3.796875 | 4 | [] | no_license | """
Пользователь вводит слово
Программа отвечает, палиндром или нет
!!! Регистр букв не должен влиять на ответ
Шалаш = шалаш = шАлАш
"""
word = input("скажи слово ").lower()
if word == word[:: -1]:
print("это является палиндромом")
else:
print("не является палиндромом")
|
Java | UTF-8 | 4,108 | 1.789063 | 2 | [] | no_license | package com.tencent.mm.plugin.gallery.stub;
import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
public abstract class a$a extends Binder
implements a
{
public a$a()
{
attachInterface(this, "com.tencent.mm.plugin.gallery.stub.Gallery_AIDL")... |
Python | UTF-8 | 424 | 3.515625 | 4 | [] | no_license | class Donkey:
def say(self):
print("I'm donkey")
def walk(self):
print("fjkghdig")
class Horse:
def say(self):
print(" I'm horse")
def run(self):
print("jhgjhkj")
class Moul(Donkey, Horse):
def hi(self):
print("Hi")
def say(self):
print("I'm moul")
donkey = Donkey()
horse... |
C++ | UTF-8 | 1,083 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define pii pair<int, int>
#define fi first.first
#define se first.second
#define th second
vector<int> par(101);
bool cmp(pair<pii, int> a, pair<pii, int> b){
return (a.th < b.th);
}
int getpar(int a){
if (par[a] == a) return... |
Markdown | UTF-8 | 862 | 2.703125 | 3 | [] | no_license | # Article 32-1
Les attachés des systèmes d'information et de communication sont principalement affectés à l'administration centrale et chargés des fonctions d'ingénierie, d'expertise et d'encadrement dans les domaines du chiffre, des communications et de l'informatique. A ce titre, ils assurent ou coordonnent les étud... |
Python | UTF-8 | 3,942 | 2.71875 | 3 | [] | no_license | import datetime
import os.path
import pickle
from googleapiclient.discovery import build
from googleapiclient import errors
SCOPES = ('https://www.googleapis.com/auth/calendar.readonly',
'https://www.googleapis.com/auth/gmail.readonly',
'https://www.googleapis.com/auth/fitness.activity.read')
def ... |
Java | UTF-8 | 3,936 | 2.453125 | 2 | [] | no_license | package moe.cnkirito.benchmark.dubbo.codec;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import moe.cnkirito.benchmark.dubbo.common.Bytes;
import moe.cnkirito.benchmark.dubbo.model.DubboRpcResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
imp... |
Python | UTF-8 | 409 | 3.125 | 3 | [] | no_license |
import matplotlib.pyplot as plt
import random
import math
tt = [ 2 * math.pi * random.random() for q in range( 100 ) ]
xx = [ math.cos( tt[q] ) for q in range( len( tt ) ) ]
yy = [ math.sin( tt[q] ) for q in range( len( tt ) ) ]
plt.scatter( xx, yy, label='circumference', color='c', s=100, marker='o' )
plt.xlabe... |
Java | UTF-8 | 3,147 | 1.882813 | 2 | [] | no_license | package com.infoklinik.rsvp.client.appt.view;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.ui.Button;
... |
C# | UTF-8 | 1,388 | 2.859375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MunOS
{
/// <summary>
/// Thread execution priority.
/// </summary>
public enum MunPriority : byte
{
/// <summary>
/// Highest priority - executed every FixedUpdate if possible.
/// ... |
Java | UTF-8 | 1,335 | 2.1875 | 2 | [] | no_license | package com.qutu.talk.adapter;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.qutu.talk.R;
import com.qutu.talk.bean.IncomeFragmentBean;
import java.util.List... |
Markdown | UTF-8 | 208 | 2.75 | 3 | [] | no_license | # Nice-Input
Simple and Easy to use labed input/select
Nice-Input is a style to use label inside of input, instead use placeholder, when the user click on input,
the label goes up e change his size to fit.
|
C++ | UTF-8 | 605 | 2.859375 | 3 | [] | no_license | // 2605Resort
#include <iostream>
#include <cstdio>
#include <list>
#include <iterator>
using namespace std;
int main()
{
list<int> order;
list<int>::iterator itor;
int n, input;
cin >> n;
cin >> input;
order.push_back(1);
for (int i = 2; i <= n; i++) {
int index = 1;
cin >> input;
if (input) {
for (... |
Python | UTF-8 | 5,616 | 2.921875 | 3 | [] | no_license | #!/usr/bin/env python
""" This is a script that walks through some of the basics of working with images
with opencv in ROS. """
import rospy
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import cv2
import numpy as np
from std_msgs.msg import String
from template_matcher import TemplateMatcher, ... |
Ruby | UTF-8 | 1,317 | 2.9375 | 3 | [
"MIT"
] | permissive | class RandomMoviePicker::Categories
BASE_URL = "https://www.rottentomatoes.com"
@@genres = {}
@@years = {}
def self.genres
if @@genres == {}
doc = Nokogiri::HTML(open("https://www.rottentomatoes.com/top/bestofrt/top_100_action__adventure_movies/"))
doc.css(... |
PHP | UTF-8 | 2,952 | 3.171875 | 3 | [
"MIT"
] | permissive | <?php
if (isset($_POST['submit'])) {
require '../config/db.config.php';
$error = 0;
$score = 0;
$age = $_POST['age'];
$sex = $_POST['sex'];
$body_temperature = $_POST['body-temperature'];
$symptoms_1 = $_POST['symptoms1'];
$symptoms_2 = $_POST['sy... |
PHP | UTF-8 | 233 | 2.96875 | 3 | [] | no_license | <?php
require_once '2.php';
class Man extends People{
public function __construct($age,$name){
parent::__construct($age,$name,'男');
}
public function hi(){
//parent::hi();
echo 'Man '.$this->getName().' say hi';
}
}
?> |
C++ | UTF-8 | 840 | 2.796875 | 3 | [] | no_license | #include "Pass.h"
#include "Sink.h"
#include "Source.h"
namespace rg
{
Source& Pass::GetSource(const std::string& source_name) const
{
for (auto& s : sources)
{
if (s->name == source_name)
return *s;
}
}
Sink& Pass::GetSink(const std::string& sink_name) const
{
for (auto& s : sinks)
{
if (s-... |
Markdown | UTF-8 | 2,416 | 2.75 | 3 | [
"Unlicense"
] | permissive |
# Seacera shareholders holding 2.5% stake propose appointment of six new directors
Published at: **2019-11-04T07:06:59+00:00**
Author: **Ahmad Naqib Idris**
Original: [The Edge Markets](https://www.theedgemarkets.com/article/seacera-shareholders-holding-25-stake-propose-appointment-six-new-directors)
KUALA LUMPUR ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.