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 | 17,573 | 2.953125 | 3 | [] | no_license | /*
===========================================================================
Engine of Evil GPL Source Code
Copyright (C) 2016-2017 Thomas Matthew Freehill
This file is part of the Engine of Evil GPL game engine source code.
The Engine of Evil (EOE) Source Code is free software: you can redistribute it and/or mo... |
C++ | UTF-8 | 802 | 3.21875 | 3 | [] | no_license | //printing second largest number in a given array
#include<iostream>
using namespace std;
int main()
{
int t;
cin >> t;
while (t--)
{
int n=3;
int arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
int counter = 1;
{
w... |
Python | UTF-8 | 5,284 | 3.90625 | 4 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/7 8:51 PM
# @Author : Slade
# @File : binarySearchTree.py
class Node:
def __init__(self, element):
self.element = element
self.lchild = None
self.rchild = None
# 左树上所有结点的值均小于或者等于它的根结点的值
# 右树上所有结点的值均大于或者等于它的根结点的值
# 左右树也... |
Markdown | UTF-8 | 937 | 3.21875 | 3 | [] | no_license | # matrix-addition
#include <stdio.h>
int main()
{
int a[5][5],b[5][5],rows,columns;
printf("enter the rows and columns:");
scanf("%d%d",&rows,&columns);
printf("enter first array:\n");
for(i=0;i<rows;i++)
{
for(j=0;j<columns;j++)
{
scanf("%d",&a[i][j]);
}
... |
Swift | UTF-8 | 1,427 | 2.734375 | 3 | [] | no_license | //
// ItemTableViewCell.swift
// ToDoListApp
//
// Created by Admin on 9/27/17.
// Copyright © 2017 Sheeja. All rights reserved.
//
import UIKit
class ItemTableViewCell: UITableViewCell {
@IBOutlet weak var optionButton: UIButton!
@IBOutlet weak var itemNameLabel: UILabel!
var listIndex: Int?
var... |
C++ | UTF-8 | 522 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
vector<int> graph[1001];
int visited[1001];
void dfs(int start) {
visited[start] = 1;
for (auto a : graph[start]) {
if (visited[a] != 1)
dfs(a);
}
}
int main(void) {
int N, M;
scanf("%d %d", &N, &M);
int a, b;
for (int i = 1; i <= M; i++) {
s... |
Java | UTF-8 | 3,295 | 1.679688 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018 Red Hat, Inc, and individual contributors.
*
* 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 a... |
Markdown | UTF-8 | 2,574 | 4.34375 | 4 | [] | no_license | # 42 - 和为S的两个数字
## 题目描述
输入一个递增排序的数组和一个数字S,在数组中查找两个数,使得他们的和正好是S,如果有多对数字的和等于S,输出两个数的乘积最小的。
>输出:对应每个测试案例,输出两个数,小的先输出。
## 题解一:直接遍历
1. 遍历数组,检查当前数字与目标数字的差值是否在数组中,如果是,将这两个数放入结果中。
2. 继续向后遍历,每次发现和为S的两个数,都与结果中的两个数进行比较,将乘积较小的一组放到结果中。
3. 遍历结束后若找到符合条件的数则返回,否则返回空数组。
```python
# -*- coding:utf-8 -*-
class Solution:
def FindN... |
Java | UTF-8 | 474 | 2.9375 | 3 | [] | no_license | package holding;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
public class Statistics {
public static void main(String[] args) {
Random rand = new Random(47);
Map<Integer, Integer> map = new HashMap<Integer, Integer>();
for (int i = 0; i < 1000000; i++) {
int value = ra... |
PHP | UTF-8 | 1,395 | 2.75 | 3 | [] | no_license | <?php
namespace App\Repositories\Mysql;
use App\Core\Database;
use App\Core\Model;
use App\Repositories\ApplicationInterface;
use App\Repositories\UserInterface;
class MySQLApplicationRepository implements ApplicationInterface
{
protected $db;
public function __construct(Database $db)
{
$this->... |
Markdown | UTF-8 | 1,250 | 3.125 | 3 | [] | no_license | # Auto loggin to Huji's moodle
An auto login chrome extension to huji's moodle.
Feel free to send pull request if you want to contribute in any way.
## Warning!
Before you install the extension take in mind that it will save the moodle password as plain text, meaning anyone with access to your computer will be able ... |
Java | UTF-8 | 2,953 | 2.46875 | 2 | [] | no_license | package com.chocolate.chocolateQuest.builder.decorator.rooms;
import com.chocolate.chocolateQuest.builder.decorator.RoomBase;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
public class RoomStairs extends RoomBase {
public v... |
SQL | UTF-8 | 1,156 | 3.640625 | 4 | [] | no_license | create database PruebaModulo2 ;
use PruebaModulo2;
create table Producto (
idProducto int auto_increment,
NombreProducto varchar (30),
Descripcion int,
Precio int,
Stock int,
primary key (idProducto)
);
alter table Producto modify Descripcion varchar (100);
insert into Producto (NombreProducto, Descripcion, Precio, ... |
C++ | UTF-8 | 4,600 | 3 | 3 | [] | no_license | #include "GLFW/glfw3.h"
#include "bits/stdc++.h"
#include "DrawUtil_2.h"
using namespace std;
const double INITIAL_DECAY_RATE = 0.91;
const double INITIAL_DECAY_DELTA = 0.7;
const double INITIAL_LENGTH = 105;
const double MAX_GENERATIONS = 6;
const double ROTATE_ANGLE = 25.12;
// define the variables in the rule stri... |
C# | UTF-8 | 3,388 | 2.59375 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | //-------------------------------------------------------------------------------
// <copyright file="CheckCompatibilityWithModel.cs" company="KriaSoft, LLC">
// Copyright (c) 2011 Konstantin Tarkus, KriaSoft LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file e... |
Python | UTF-8 | 4,804 | 2.515625 | 3 | [
"MIT"
] | permissive | from __future__ import annotations
from typing import Any, Dict, List, Optional
import attrs
import humanize
from tabulate import tabulate
from .. import settings
from ..error import Error
from ..errors import ReportTaskError
from ..exception import FrictionlessException
from ..metadata import Metadata
from . import... |
Java | UTF-8 | 2,636 | 2.078125 | 2 | [
"MIT"
] | permissive | package de.uniks.networkparser.ext.petaf;
/*
The MIT License
Copyright (c) 2010-2016 Stefan Lindel https://www.github.com/fujaba/NetworkParser/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software wi... |
C# | UTF-8 | 2,498 | 2.9375 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
namespace SharpCrawler
{
public class ClickableText
{
//FIELDS
private SpriteFont textFont;
private string text;
private Vector2 textPos... |
Java | UTF-8 | 2,918 | 3.40625 | 3 | [] | no_license | package aquarium;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class AquariumTests {
private Aquarium aquarium;
private Fish fish1;
private Fish fish2;
@Before
public void setUp(){
this.aquarium = new Aquarium("Water", 15);
this.fish1 =... |
Markdown | UTF-8 | 500 | 2.75 | 3 | [] | no_license | # Stats 507 HW6
This git repo is for Stats 507 HW 6.
This repo contains code from [Problem Set 2 Question 3](./PS2Q3.py)
This code reads in dental and demographic data from NHANES and cleans it up in the following ways:
- Only stores relevant columns
- Renames column headers to plain english
- Makes data categorica... |
Go | UTF-8 | 611 | 2.546875 | 3 | [] | no_license | package demo04
import (
"github.com/garyburd/redigo/redis"
"learn/redis/pool"
)
// 批量插入
func BatchAdd(start, end int) bool {
key := getKey()
fun := func (conn redis.Conn) (interface{}, error){
for i:= start;i<=end; i++ {
conn.Do("PFADD", key, i)
}
return nil, nil
}
pool.Execute(fun)
return true
}
//... |
PHP | UTF-8 | 981 | 2.625 | 3 | [] | no_license |
<?php
require_once('Net/SSH2.php');
if (isset($_POST['powerDown'])){
$ssh = new Net_SSH2('109.255.194.19:3003');
if (!$ssh->login('pi', 'pi')) {
exit('Login Failed');
}
// echo $ssh->exec('pwd');
echo $ssh->exec('/home/pi/robot/stopStream.sh');
die;
}
session_start();
if (i... |
Java | UTF-8 | 897 | 2.84375 | 3 | [] | no_license | package com.excilys.cdb.ui;
import java.util.Arrays;
import java.util.List;
import com.excilys.cdb.exceptions.UnsupportedActionException;
public enum UpdateActions {
NAME(1, "Nom"),
INTRODUCED(2, "Introduced"),
DISCONTINUED(3, "Discontinued"),
COMPANY(4, "Company");
private int myCode;
private String myMessag... |
Markdown | UTF-8 | 701 | 2.546875 | 3 | [
"MIT"
] | permissive | # TodoMVC
[](https://travis-ci.org/xogeny/vada-todo)
This is an implementation of TodoMVC that uses React, TypeScript,
Redux and a module I developed called
[`vada`](http://github.com/xogeny/vada).
To run the application, simply clone this repository:
```
g... |
Python | UTF-8 | 3,662 | 2.90625 | 3 | [] | no_license | import numpy as np
from numpy import cos,sin
import argparse
class ForwardKinematicsHandler:
def __init__(self, initial, link_translation, rotational_axes, joint_cuboid_positions, joint_cuboid_orientations):
self.num_joints = initial.shape[0]
if self.num_joints != link_translation.shape[0] or self... |
Python | UTF-8 | 1,102 | 3.5625 | 4 | [] | no_license | # -*- encoding: utf-8 -*-
def heap_minimum(A):
return A[0]
def min_heapify(A, i):
# 维护最小堆的性质
l = 2 * i
r = 2 * i + 1
if l <= len(A) and A[l - 1] < A[i - 1]:
smallest = l
else:
smallest = i
if r <= len(A) and A[r - 1] < A[smallest - 1]:
smallest = r
if smallest ... |
Markdown | UTF-8 | 8,171 | 3.09375 | 3 | [] | no_license | 第十回 九州铸铁终成错 一着棋差只自怜(3)
想不到的是,有一天她忽然见到了她的前夫云浩。乡居的生活中,她每天清早都要到屋后的松林练武。有时侄儿陪着她,但更多的时候却是她独自一人。因为龙成斌不习惯起这么早,初时为了讨她喜欢,一早陪她练武,渐渐就只是十天之中只陪三两天了。这一天又是她独自一个人。
练完了一趟剑术,忽地隐隐听到一声叹息。声音细得几乎难以察觉,但却又是何其熟悉!这轻轻的叹息之声,听入她的耳中,竟是有如晴天霹雳了!
这一瞬间,她心乱如麻,但却已无暇思索。怔了一怔,立即循声觅迹,追上前去。在密林深处,果然发现了她所熟悉的人。
这是在做梦么?她咬咬手指,很痛,并不是梦!
她几乎不... |
Java | UTF-8 | 372 | 1.789063 | 2 | [] | no_license | package org.loopring.crawler.repos;
import org.loopring.crawler.models.SelectorItem;
import org.loopring.crawler.util.CrawlerCrudRepo;
public interface SelectorItemRepo extends CrawlerCrudRepo<SelectorItem> {
//SelectorItem findByKeyAndSiteNameAndIsRoot(String key, String siteName, String isRoot);
SelectorIt... |
C++ | UTF-8 | 2,622 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file sgd_server_handle.h
* @brief server handles for sgd
*/
#include "base/monitor.h"
#include "ps/blob.h"
namespace dmlc {
namespace linear {
/**
* \brief FTRL updater
*
* my_val is a length-3 vector, 0: weight, 1: z, 2: square rooted cumulatived
* gradient
*/
template <typename K, typename V>
struc... |
PHP | UTF-8 | 1,594 | 2.765625 | 3 | [] | no_license | <?php
namespace Ostric;
use Ostric\Util\Inflector;
abstract class Component extends Object
{
private $storage;
protected $id;
protected $components = array();
public function __construct($id)
{
$this->id = $id;
$this->storage = Storage::getInstance();
$this->load... |
PHP | UTF-8 | 1,517 | 2.84375 | 3 | [] | no_license | <?php
/** Absolute path to the site directory. */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
/**
* Get current working directory
*
* @access public
* @param none
* @return string
*/
function curr_dir() {
$curr_dir = explode("\\", ABSPATH);
$curr_dir = "/" . $curr_dir[count($... |
Rust | UTF-8 | 11,689 | 3.265625 | 3 | [] | no_license | use crate::vector_math;
use crate::vector_math::{Point, Vector, PointNormal};
use crate::shape::{Shape, IntersectResult, BoundingBox};
pub struct Polygon {
pub vertices: Vec<PointNormal>
}
impl Shape for Polygon {
fn bounding_box(&self) -> BoundingBox {
let mut min_x = self.vertices[0].point.x;
... |
Java | UTF-8 | 3,343 | 3.5 | 4 | [] | no_license | import orderAlgorithms.HeapSort;
import orderAlgorithms.InsertionSort;
import orderAlgorithms.MergeSort;
import orderAlgorithms.QuickSort;
import java.io.*;
import java.util.Random;
import java.util.Scanner;
public class Main {
/*Algorithms:
Merge Sort
Quick Sort
Heap Sort
Hybrid: Quick e Heap */
... |
PHP | UTF-8 | 2,317 | 2.953125 | 3 | [] | no_license | <?php
//フォームからデータを受け取る
$name = $_POST["name"];
$lid = $_POST["lid"];
$lpw = $_POST["lpw"];
$address= $_POST["address"];
//DB接続します
require "funcs.php";
$pdo = db_con();
//既存のnameかぶっていないかを確認========================================================
//データ取得
$stmt = $pdo->prepare("select * From user_table ... |
C | UTF-8 | 228 | 3.6875 | 4 | [] | no_license | /* Rewrite code in exercise 1 to be more readable */
#include <stdio.h>
int x,y;
int main() {
printf("\nEnter two numbers\n");
scanf("%d %d", &x, &y);
printf("\n\n%d is bigger",(x > y) ? x : y);
return 0;
}
|
SQL | UTF-8 | 5,555 | 3.234375 | 3 | [] | no_license | -- MySQL Script generated by MySQL Workbench
-- Thu Feb 20 13:37:15 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... |
Markdown | UTF-8 | 2,163 | 3.34375 | 3 | [
"MIT"
] | permissive | # multi-download
> Download multiple files at once in the browser

It works by abusing the `a`-tag [`download` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download).
## [Demo](https://sindresorhus.com/multi-download/)
## Install
```sh
npm install multi-download
`... |
Java | UTF-8 | 2,330 | 3.09375 | 3 | [] | no_license | package com.sirma.itt.javacourse.networkingAndGui.task1.calculatorGui.listeners;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import org.apache.log4j.Logger;
import com.sirma.itt.javacourse.desingpatterns.task7.calculator.commands.Command;
import ... |
Java | UTF-8 | 929 | 2.046875 | 2 | [] | no_license | package amq.controller;
import com.alibaba.fastjson.JSON;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springf... |
PHP | UTF-8 | 142 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
function pascalsTriangleRows(int $rowCount)
{
throw new \BadFunctionCallException("Implement the pascalsTriangleRows function");
}
|
C++ | UTF-8 | 15,488 | 2.984375 | 3 | [
"MIT"
] | permissive | #include "pch.h"
#include "PlaneFinding.h"
using namespace DirectX;
namespace PlaneFinding
{
const float ROTATING_CALIPERS_EPSILON = 0.01f; // a small epsilon value to handle rounding errors when calculating rotation angles
vector<pair<XMFLOAT2, UINT32>> FindConvexHull(_In_ function<bool(XMFLOAT2*, UINT32*)>... |
PHP | UTF-8 | 1,987 | 2.59375 | 3 | [] | no_license | <?php
session_start();
$error = '';
if (isset($_POST['submit']))
{
if (empty($_POST['userName']) || empty($_POST['Password']))
{
$error = "Username or Password is Empty";
$_SESSION['ERR'] = $error;
?> <script> location.replace("index.php"); </script><?php
}
else
{
$userName = $_POST['userName'];
$Password... |
C++ | UTF-8 | 1,064 | 2.625 | 3 | [] | no_license | #ifndef __UNBOUNDEDFIFO_H__
#define __UNBOUNDEDFIFO_H__
#include "../SoCINModule.h"
#include "../SoCINDefines.h"
#include <queue>
class UnboundedFifo : public SoCINModule {
public:
// System signals
sc_in<bool> i_CLK; // Clock
sc_in<bool> i_RST; // Reset
// FIFO interface
sc_in<... |
Python | UTF-8 | 2,768 | 3.78125 | 4 | [] | no_license | import time
numbers = ["zero one two three four five six seven eight nine".split()]
irregular = "ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen".split()
numbers.append("twenty thirty forty fifty sixty seventy eighty ninety".split())
power = "hundred thousand million billion trillion qua... |
Markdown | UTF-8 | 1,300 | 3 | 3 | [] | no_license |
# Project Shell
## Introduction
## Requirements
Shell minimum criteria:
- Using your tokenizer and the system calls fork(), exec(), and wait() create a simple shell that:
- prints a command prompt which is "$ " and waits for the user to enter a command
- parse the command using your tokenizer
- create a child ... |
Ruby | UTF-8 | 730 | 2.734375 | 3 | [] | no_license | # frozen_string_literal: true
require './lib/assets/nlp/nlp_ms'
require './lib/assets/nlp/nlp_gcp'
def nlp_handler(nlp_type, text, langcode, is_test_mode)
if nlp_type == 'MS'
entities, sentiment = analyze_text_ms(text, langcode)
elsif nlp_type == 'GCP'
entities, sentiment = analyze_text_gcp(text, langcode... |
C++ | UTF-8 | 3,389 | 2.859375 | 3 | [
"MIT"
] | permissive | //
// Context.cpp
// GfxPrototype
//
// Created by Samir Sinha on 9/26/15.
//
//
#include "Context.hpp"
#include "Texture.hpp"
#include "Material.hpp"
#include "Mesh.hpp"
#include "Animation.hpp"
#include "Light.hpp"
#include "ModelSet.hpp"
namespace cinek {
namespace gfx {
Context::Context(const Resource... |
Java | UTF-8 | 4,158 | 3.109375 | 3 | [] | no_license | package finalLeapP3;
import java.util.LinkedList;
import java.util.Queue;
public class ZombieMatrix {
public static void main(String[] args) {
ZombieMatrix s = new ZombieMatrix();
System.out.println(s.solution().toString());
}
public String solution() {
// int[][] world = new int[][] {{0, 1, 1, 0, 1},
//... |
PHP | UTF-8 | 1,925 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Controller\Admin;
use Sifoni\Controller\Base;
use App\Model\Article;
use App\Model\Category;
use App\Model\Contact;
/**
*
*/
class ArticleController extends Base
{
public function listAction()
{
$data = array();
$data['title'] = 'Trang Admin | List Article';
$data['title_page'] = 'Danh ... |
JavaScript | UTF-8 | 2,057 | 2.609375 | 3 | [] | no_license | var peopleMagazine = (function(entityId) {
return {
'makeStatChart': function (ctx, labels, data) {
return new Chart(ctx, {
type: 'radar',
data: {
labels: labels,
datasets: [
{
backgroundColor: "rgba(255,99,132,0.2)",
borderColor: "rgba(255,99,132,1)",
pointBackgroun... |
Java | UTF-8 | 1,060 | 1.953125 | 2 | [
"MIT"
] | permissive | package pl.poznan.put.external.dssr;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Optional;
import org.immutables.value.Value;
import pl.poznan.put.pdb.ImmutablePd... |
Python | UTF-8 | 2,894 | 3.25 | 3 | [] | no_license | '''
This Program creates randomly sampled Training, Validation and Testing Set from folders of different classes. Such as "house" and "not house".
'''
import shutil
import random
import numpy as np
import sys, os
# Constants needed for sampling
TRAIN_SIZE = 20000
VAL_SIZE = 1000
TEST_SIZE = 1000
# check for enough a... |
Java | UTF-8 | 7,595 | 2.171875 | 2 | [] | no_license | package hh;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import config.LocalApplicationConfig;
import dto.NewResumeDto;
import dto.ResumeDto;
import dto.UserDto;
import org.eclipse.jetty.server.Server;
import org.hibernate.SessionFactory;
import org.junit.Te... |
Java | UTF-8 | 410 | 3.296875 | 3 | [] | no_license | package day5_1;
public class DefaultClassEx1 {
public static void main(String[] args) {
System.out.println("접근제한자 : public");
DefaultClassEx2.main(null);
}
}
//제한자가 Default이므로 같은 패키지나 같은 클래스에서 불러올 수 있다.
class DefaultClassEx2 {
public static void main(String[] args) {
System.out.println("접근제한자 :... |
Python | UTF-8 | 502 | 4.125 | 4 | [] | no_license |
a = int(input("Give me an integer"))
b = int(input("Give me another integer"))
for a in range(a,b+1):
if a % 7 == 0 and a % 3 != 0:
print(a)
x = int(input("Enter a number to find its factorial. Enter a negtive number to stop the program"))
while(x>=0):
m=1
z=1
for z in range(z, x+1):
m... |
PHP | UTF-8 | 439 | 2.921875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace App\Exceptions\Crawler;
use RuntimeException;
class CrawlerSetupException extends RuntimeException implements CrawlerException
{
public function __construct(string $message)
{
parent::__construct($message);
}
public static function forSetupExce... |
PHP | UTF-8 | 429 | 2.65625 | 3 | [] | no_license | <?php
namespace app\Http\Consts\UrlInfo\SideMenu;
/**
* SideMenuページに用いるURLを用いるクラス.
*/
class SideMenuUrlInfo
{
/**
* sidemenuのurl情報を取得する.
*
* @return array sidemenuのurl情報
*/
public function getSideMenuUrlInfo()
{
return [
'SIDEMENU' => [
'URL' => '... |
Markdown | UTF-8 | 6,409 | 2.578125 | 3 | [] | no_license | ---
description: "How to Prepare Speedy Easy Stuffed Mushrooms (Vegan/Vegetarian)"
title: "How to Prepare Speedy Easy Stuffed Mushrooms (Vegan/Vegetarian)"
slug: 489-how-to-prepare-speedy-easy-stuffed-mushrooms-vegan-vegetarian
date: 2020-04-29T02:08:59.556Z
image: https://img-global.cpcdn.com/recipes/b9a4adc17f11e455/... |
Python | UTF-8 | 10,223 | 3 | 3 | [
"BSD-2-Clause"
] | permissive | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Simple calendar using ttk Treeview together with calendar and datetime classes.
Added functionality:
Selection mode: Day or Week.
Based on:
http://pydoc.net/Python/pytkapp/0.1.0/pytkapp.tkw.ttkcalendar/
@author:Guilherme Polo, 2008.
'''
import calendar
import tkinte... |
C++ | UTF-8 | 4,431 | 2.53125 | 3 | [
"BSD-2-Clause"
] | permissive | #include "icsneo/platform/stm32.h"
#include <dirent.h>
#include <cstring>
#include <iostream>
#include <sstream>
#include <fstream>
#include <map>
#include <algorithm>
#include <termios.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <sys/select.h>
using namespace icsneo;
bool STM32::open() {
i... |
Java | WINDOWS-1252 | 531 | 2.75 | 3 | [] | no_license | package Model;
import java.util.Date;
public class Simulation {
// Simulation Information
public Date date = new Date();
public Graph graph ;
public boolean etat = false;
public int walksCounter=0 ;
//
public Simulation (Graph parGraph ,String startVertex,int walks)
{
// completer
graph=parGraph;
e... |
JavaScript | UTF-8 | 3,314 | 2.78125 | 3 | [] | no_license | const canvasSketch = require("canvas-sketch");
const random = require("canvas-sketch-util/random");
const palettes = require("nice-color-palettes");
const goodSeeds = [
93329,
5028,
98293,
816054,
102449,
575738,
165791,
609544,
40808,
947080,
799294,
647391,
861120,
846607,
515460,
587... |
PHP | UTF-8 | 2,952 | 2.515625 | 3 | [] | no_license | <?php
header('Content-type: application/json');
include './helpers.php';
include './MyDB.php';
// 实例化数据库查询媒介类
$database = new MyDB();
if (isset($database->errmsg)) {
print_r(ResponseJson([], $database->errmsg));
exit();
}
// 验证
if (!isset($_POST['token'])) {
$_POST['token'] = '';
}
if (trim(htmlentities($... |
Python | UTF-8 | 1,730 | 2.75 | 3 | [] | no_license | import threading
import requests
import json
from time import time
from decimal import Decimal
class BITTREX_ORDER_BOOK(threading.Thread):
def __init__(self, threadID, name, order_book):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.order_book = orde... |
Java | UTF-8 | 1,045 | 2.984375 | 3 | [] | no_license | package Controller;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
public class ExcelExporter {
/*
* Constructor
*/
public ExcelExporter() {}
public void export(ArrayList<Application> apps, File file) thr... |
Java | UTF-8 | 143 | 1.726563 | 2 | [] | no_license | package com.example.week3day5.service;
public interface FeedbackService {
int addFeedback(int quizTypeId, int rating, String feedback);
}
|
C++ | UTF-8 | 254 | 3.25 | 3 | [] | no_license | #include<iostream>
using namespace std;
int x = 1; // global
int main()
{
int x = 2; // local
{
int x = 3; // very local
}
cout << "global x = " << ::x << endl; // 1
cout << "local x = " << x << endl; // 2
return 0;
} |
Python | UTF-8 | 79 | 3.171875 | 3 | [] | no_license | a,b=eval(input("Enter two numbers, separated by commas:"))
print("sum:",a+b)
|
Java | UTF-8 | 6,966 | 2.140625 | 2 | [] | no_license | package fructuoso.speechtotext;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Handler;
import android.os.Message;
import android.su... |
Markdown | UTF-8 | 4,893 | 2.65625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
title: "How to: Set Icons for the Windows Forms TreeView Control | Microsoft Docs"
ms.custom: ""
ms.date: "03/30/2017"
ms.prod: ".net-framework"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "dotnet-winforms"
ms.tgt_pltfrm: ""
ms.topic: "article"
dev_langs:
- "jsharp"
helpviewer_keywords:
- "examples [Wind... |
TypeScript | UTF-8 | 717 | 2.53125 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-main',
templateUrl: './main.component.html',
styleUrls: ['./main.component.css']
})
export class MainComponent implements OnInit {
title: string = "Uplifting Story on Upper East Side (Wholesome Feels)"
imagePath: string = "/assets/im... |
Markdown | UTF-8 | 1,108 | 3.125 | 3 | [
"MIT"
] | permissive | # Interactive Regression Models with Interreg Package
The goal of interreg package is to provide a fast and friendly way to create an interactive shiny app for fitting simple linear, multiple linear, and stepwise regression models.

Image by Gred Altmann from Pixabay
# Details
In the shiny app, ther... |
Python | UTF-8 | 788 | 3.375 | 3 | [] | no_license | '''
@Author: rishi
'''
from collections import defaultdict
n, edge_len = map(int, input().split())
# Get edge list
edges = []
for i in range(edge_len):
edges.append(list(map(int, input().split())))
graph = defaultdict(list)
for i, j in edges:
graph[i].append(j)
# print(graph)
visited = {}
for... |
Python | UTF-8 | 952 | 3.1875 | 3 | [] | no_license | """
test.py contains various tests for the functions in functions.py
"""
import functions #import functions modules
print('Test display_board()')
test_board = ['#','O','O','O','X','O','X','O','X','O']
functions.display_board(test_board)
print('Test display_guide()')
functions.display_guide()
print('Test choose_... |
Python | UTF-8 | 1,161 | 2.90625 | 3 | [] | no_license | #! /usr/bin/env python3
from PIL import Image
import glob, os
tiff_dir = '/home/student-03-32beb94feb5b/supplier-data/images/'
def change_images(dir, from_ext, to_ext, resize=(600,400)):
'''
Search the given path for all image files with the from_ext and
convert them to the to_ext format while also re-si... |
Python | UTF-8 | 642 | 2.671875 | 3 | [] | no_license | import tkinter as tk
from tkinter import ttk
class SetupPage(ttk.Frame):
def __init__(self, parent, controller):
ttk.Frame.__init__(self,parent)
self.grid_columnconfigure(0, weight=1)
self.grid_columnconfigure(1, weight=1)
button_manual = tk.Button(
... |
Java | UTF-8 | 574 | 2.265625 | 2 | [] | no_license | package com.gly.redisdemo.exception;
import com.gly.redisdemo.enums.ResultEnum;
import lombok.Data;
/**
* @author: create by ggaly
* @version: v1.0
* @description: com.gly.redisdemo.exception
* @date:2019/6/13
**/
@Data
public class SellException extends RuntimeException{
private Integer code;
public Se... |
Java | UTF-8 | 946 | 1.875 | 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 roadsign;
/**
*
* @author Julia
*/
public class Dictionary {
public static final String NE = "NE";
public static f... |
Python | UTF-8 | 208 | 3.125 | 3 | [] | no_license |
import numpy as np
import pandas as pd
personaje = {"Nombre": ['David Martinez','Fernanda Castro'],
"Edad": ['26',31]}
df = pd.DataFrame(personaje)
df['Apellido'] = df.Nombre.str.split(" ",1).str[1]
print(df) |
C# | UTF-8 | 8,656 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
namespace TranslatorHost
{
class TranslatorService
{
bool bReady = false;
Translator.DeepL Translator;
Dictionary<string, string> Cach... |
C | UTF-8 | 1,120 | 3.53125 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
void printDurchschnitt(double durchschnitt){
printf("Der Notendurchschnitt betraegt %.2lf.\n", durchschnitt);}
int main()
{
int notenAnzahl,zaehler;
float note;
printf("Bitte geben Sie die maximale Anzahl an Noten an, deren Durchschnitt es zu berechnen gilt.: ");
... |
C++ | UTF-8 | 883 | 3.359375 | 3 | [] | no_license | #include "MovieValidator.h"
using namespace std;
MovieException::MovieException(std::vector<std::string> _errors) : errors{ _errors } {}
std::vector<std::string> MovieException::getErrors() const
{
return this->errors;
}
std::string MovieException::getErrorAsString() const
{
string err;
for (auto e : this->error... |
Python | UTF-8 | 1,258 | 3.90625 | 4 | [] | no_license | """
@Author George Shen
@Title employee
@Version 1
"""
class Employee():
def __init__(self, name, leader=None, salary=0):
"""
Establish new employee
:param name: Str - Name of new employee
:param leader: Str - Name of new employee's leader
:param salary: Float - Amount earne... |
Python | UTF-8 | 3,238 | 2.96875 | 3 | [
"MIT"
] | permissive | import re
import logging
log = logging.getLogger('tyggbot')
class PyramidParser:
data = []
going_down = False
regex = re.compile(' +')
def __init__(self, bot):
# Keep an instance of TyggBot so we can send messages from here!
self.bot = bot
def parse_line(self, msg, source):
... |
Java | UTF-8 | 13,852 | 2.359375 | 2 | [
"BSD-2-Clause"
] | permissive | /**
* Copyright (c) 2020, Regents of the University of California
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright... |
Java | UTF-8 | 712 | 3.546875 | 4 | [] | no_license | package com.barton;
public class ExceptionHandled {
public static void main(String[] args) {
//Array to add
int marks[] = {40, 70, 87};
System.out.println("Hello 1");
//try this code
try {
int m1 = marks[0];
int m2 = marks[1];
int m3 = m... |
Markdown | UTF-8 | 2,673 | 2.515625 | 3 | [] | no_license | # ARIM-analysis
Analysis of oil and gas development on sagebrush in the Atlantic Rim project area, BLM, Wyoming
# Data compilation
00-Data_wrangle.R - Compiles data for analysis to produce Data_compiled.RDATA (requires access to Bird Conservancy internal database; not necessary to run if this file has already been com... |
JavaScript | UTF-8 | 3,496 | 3.359375 | 3 | [
"MIT"
] | permissive | function AjaxManager()
{
var req = new XMLHttpRequest(),
serverURL = 'http://localhost/laravel/public',
defaultHeaders = {'Content-Type': 'application/x-www-form-urlencoded'},
errors = {
timeout: "Se ha superado el tiempo máximo de envio.(timeout)",
url: "No se pudo conectar con la url proporcionada... |
C | UTF-8 | 288 | 2.9375 | 3 | [] | no_license | #define N 10
#include <stdio.h>
int main()
{int a[N] = {3,5,2,9,7,4,8,1,0,6}, i, j, t;
for(i=1; i<=N-1; i++)
{
t=a[i];
for(j=i-1; t<a[j]&&j>=0; j--)
a[j+1]=a[j];
a[j+1]=t;
}
for(i=0; i<=N-1; i++)
printf("%3d", a[i] );
printf("\n");
getch();
return 0;
}
|
Java | UTF-8 | 832 | 2.078125 | 2 | [] | no_license | package com.clearent.sample;
import android.util.Log;
import com.clearent.idtech.android.PublicOnReceiverListener;
public class PostReceiptTaskResponseHandler {
private PublicOnReceiverListener publicOnReceiverListener;
public PostReceiptTaskResponseHandler(PublicOnReceiverListener publicOnReceiverListene... |
Shell | UTF-8 | 329 | 2.75 | 3 | [] | no_license | #!/bin/bash -e
d=$(uptime -p| awk -F, '{print$1}' | awk '{print$2}')
h=$(uptime -p| awk -F, '{print$2}' | awk '{print$1}')
up=$((d*24+h))
(
date +%Y-%m-%d\ %H:%M | tr -d '\n'
echo -n ,$up,
cat /proc/net/dev | grep enp5s0 | sed -e 's/:/ /' | awk '{printf("%.2f,%.2f\n", $2/1024/1024/1024,$10/1024/1024/1024)}'
) >> ~/n... |
Markdown | UTF-8 | 22,972 | 3.265625 | 3 | [] | no_license | # Android组件之service
[developers-service](https://developer.android.com/guide/components/services.html?hl=zh-cn)
[使用清单文件声明服务](https://developer.android.com/guide/components/services.html?hl=zh-cn#Declaring)
# 1.简介
Service 是一个可以在后台执行长时间运行操作而不提供用户界面的应用组件。服务可由其他应用组件启动,而且即使用户切换到其他应用,服务仍将在后台继续运行。 此外,组件可以绑定到服务,以与之进行交互,甚至是执行进... |
Java | UTF-8 | 228 | 1.882813 | 2 | [
"Apache-2.0"
] | permissive | package com.bvtech.toolslibrary.interfaces;
import android.graphics.Bitmap;
/**
* Created by Konstantin on 12.01.2015.
*/
public interface ScreenShotable {
public void takeScreenShot();
public Bitmap getBitmap();
}
|
Ruby | UTF-8 | 565 | 3.46875 | 3 | [] | no_license | class Die
attr_reader :probability, :sides
def initialize(sides)
@sides = sides.to_i
if(@sides <= 0) then
throw "Error, die must have more than 0 sides"
end
@probability = Rational(1, @sides)
end
def values
@values ||= (1..@sides)
end
def get... |
Markdown | UTF-8 | 1,072 | 3.1875 | 3 | [
"MIT"
] | permissive | # This vs That
*An automated Google search, which appends commonly used conjunction keywords, (i.e. "vs"), and chains the resulting Google autocomplete suggestions.*
### Available to view [here](https://rawgit.com/VitaC123/This-vs-That/master/index.html) via Raw Git
---
### Detailed description
The app searches thr... |
Python | UTF-8 | 5,651 | 2.984375 | 3 | [] | no_license | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from Strategy import *
# the states in the Q table:
# history in the last n rounds - mine and oppo's
# e.g. state - (my C, oppo's C)
# with or without information of the whole history
# sequential action pairs and frequency of sequential cooperation
class SequentialRL(Str... |
C++ | UTF-8 | 593 | 2.8125 | 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.
*/
/*
* File: main.cpp
* Author: RazerKrait
*
* Created on February 29, 2016, 7:14 PM
*/
#include <iostream>
using namespace st... |
C | UTF-8 | 214 | 2.90625 | 3 | [] | no_license | //exercicio A
#include <stdio.h>
extern int quadrado (int n );
int main(){
int n;
printf("Introduza n:" );
scanf( "%d", &n );
printf( "quadrado(%d) = %d\n", n, quadrado(n));
return 0;
}
|
PHP | UTF-8 | 1,869 | 2.78125 | 3 | [] | no_license | <?php
class Data_model extends CI_Model{
function __construct(){
parent::__construct();
}
/**
*
* Used for fetching from the database, the small data sets which are
* stored as id, name, title, description.
*
* @return [type] [description]
*/
function getDataItem($sItemName, $format='id-name') ... |
JavaScript | UTF-8 | 2,900 | 2.796875 | 3 | [] | no_license | import getJquery from './../utilities/getJquery';
function displayResTableHeading(parentEle, displayMessage) {
setTimeout(() => {
const parentEleSafe =
parentEle === undefined ? document.getElementsByTagName('BODY')[0] : parentEle;
// console.log('parentEleSafe: ', parentEleSafe);
getJquery().then(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.