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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 324 | 1.578125 | 2 | [] | no_license | package com.my.hermes.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ReplyVO {
private int board_num;
private int reply_num;
private String user_id;
private String reply_content;
private String reply_inputdate... |
Ruby | UTF-8 | 4,082 | 3.015625 | 3 | [] | no_license | require "json"
require "cinch"
require "spell"
require_relative "persistent_hash"
$word_list = PersistentHash.new
$annoyed = PersistentHash.new("annoyed")
$spell = Spell::Spell.new($word_list)
$bot = Cinch::Bot.new do
configure do |c|
config = JSON.parse(File.read("settings.json"))
fail "Upgrade t... |
C++ | UTF-8 | 5,411 | 2.921875 | 3 | [] | no_license | #pragma warning(disable:4996)
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
string arr[20];
int check[20][20];
int mem;
bool flag;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
void solve(int y, int x, int dir, int count)
{
if (flag)
return;
... |
Java | UTF-8 | 310 | 1.78125 | 2 | [
"MIT"
] | permissive | package com.puboot.common.config.properties;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Data
@ConfigurationProperties(prefix = "static")
public class StaticizeProperties {
private String accessPathPattern = "/html/**";
private String folder;
}
|
C++ | UTF-8 | 909 | 3.03125 | 3 | [
"MIT"
] | permissive | #include "LED.h"
#include "Arduino.h"
#include "adp5350.h"
LED::LED(ADP5350 &adp, int ldo, int loop_speed): _adp(adp) {
_ldo = ldo;
_loop_speed = loop_speed;
_flashing = false;
_speed = 0;
_count = 1;
_status = false;
}
String LED::set(bool val) {
_adp.enableLDO(_ldo, val);
_status = v... |
Java | UTF-8 | 1,904 | 3.21875 | 3 | [] | no_license | package io.egen.rentalflix;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* Service implementing IFlix interface
* You can use any Java collection type to store movies
*/
public class MovieService implements IFlix {
private ArrayList<Movie> list;
private HashMap<Integer, String... |
Markdown | UTF-8 | 5,174 | 3.015625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 10,000 Words for 2021
category: "Rovani in C♯"
tags:
- writing
- goals
---
As the new year starts, so does a good time for a new set of goals. Having recently transferred from the delivery side of BlueBolt to the sales side (in a Sales Engineering capacity), I bring into the new year an a... |
JavaScript | UTF-8 | 8,804 | 2.953125 | 3 | [] | no_license | /* Рахівник калорійності страв 2.0
Визначити які функції знадобляться
*/
//При завантаженні сторінки або оновлені - заповнювати поля останнім рецептом.
//vars
const container = document.querySelector('.container');
const linesLive = document.getElementsByClassName('line');
const results = document.getElementById('resu... |
Java | UTF-8 | 2,992 | 1.945313 | 2 | [] | no_license | package obj_repository.inv_mngt;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class PickEditObj {
WebDriver webdriver;
By TxtBoxIDLocator = By.xpath(".//input[starts-wit... |
Ruby | UTF-8 | 288 | 3.515625 | 4 | [] | no_license | def hashes(name, option = {})
if option.empty?
puts "Hi, my name is #{name}"
else
puts "Hi, my name is #{name} and I'm #{option[:age]}" +
" years old and I live in #{option[:city]}."
end
end
hashes("Balaji")
hashes("Bala", {age: 23, city: "Virdhunagar"}) |
C | ISO-8859-2 | 979 | 3.703125 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
/*
Suponha que um caixa disponha apenas de cdulas de R$ 100, 10 e 1. Escreva um programa para ler o
valor de uma conta e o valor fornecido pelo usurio para pagar essa conta, e calcule e troco.
Calcular e mostrar a quantidade de cada tipo de cdula que o caixa deve fornecer como tro... |
Shell | UTF-8 | 613 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env bash
export PACKET_PROJECT_ID=746ea6dd-1e0a-4126-89d6-728784671fbf
export DEVICE_HOSTNAME=osie-test-{{plan | replace("_", "-") | replace(".", "-")}}-{{os | replace("_", "-")}}
export DEVICE_PLAN={{plan}}
export DEVICE_FACILITY={{facility}}
export DEVICE_IPXE_SCRIPT_URL=http://blob1-nrt1.packet.net/osie-... |
Java | UTF-8 | 2,427 | 2.328125 | 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 myBean;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
/**
*
* @aut... |
PHP | UTF-8 | 1,506 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Cache;
/**
* Class PaymentStatus
* Model Table Referencing payment_status
*/
define('CACHE_PARAM_PAYMENT_STATUS', 'payment_status');
class PayStatus extends Model
{
protected $table = 'payment_status';
... |
Python | UTF-8 | 9,756 | 2.796875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
# Copyright (c) 2014-2016 Adrian Rossiter <adrian@antiprism.com>
# 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 without restriction, including without limitation the ... |
Java | UTF-8 | 279 | 2.9375 | 3 | [] | no_license | package com.javaex.practice;
public class Ex08 {
public static void main(String[] args) {
int x, y = 0;
char grade = 'A'; // 작은 따음표 사용
int salary = 2000000; //숫자만 사용
int n = 1000; //128 이상이므로 int 사용
}
}
|
C++ | UTF-8 | 365 | 2.765625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
main()
{
int i=0;
char znak;
system("cls");
printf("Podaj litere: ");
scanf("%c",&znak);
if(znak>='a' and znak<='z')
{
printf("%4c\n",znak-32);
}
if(znak>='A' and znak<='Z')
{
printf("%4c\n",znak+32);... |
C# | UTF-8 | 2,797 | 2.90625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace ActorDemo.ActorSystem {
//两种方式
//一种,类似Unity的Update,一直执行发送,接收事件的方法,内部处理
//一种,就是现在这个,我发消息,对方才执行处理方法,处理完所有消息,就不占用线程资源
public class Dispatche... |
C++ | UTF-8 | 543 | 2.796875 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int k, n;
cin >> k >> n;
long long low = 1;
long long high = 0;
vector<long long> v(k, 0);
for (int i = 0; i < k; ++i) {
cin >> v[i];
high = max(high, v[i]);
}
long long res = 0;
while (low <= high) {
long lo... |
Java | UTF-8 | 1,123 | 3.15625 | 3 | [] | no_license | package funtions;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
/**
* Function for showing the image Tiff as an ImageIcon
*
* @author Yolanda
*
*/
public class ShowTiff {
private static int width = 700;
p... |
Java | UTF-8 | 1,783 | 2.46875 | 2 | [] | no_license | package HibernateProyect.HibernateProyect.modelo;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name="C_AUD")
public class Coche {
@Id
@Gen... |
C# | UTF-8 | 3,388 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BP13Exercise2
{
public partial class Form1 : Form
{
bool operatorStatus = fals... |
C# | UTF-8 | 2,529 | 4.03125 | 4 | [] | no_license | public static class MyExtensions
{
/// <summary>
/// Sets an individual bit inside a byte, based on the bit number.
/// </summary>
/// <param name="aByte">The byte where a bit is to be changed.</param>
/// <param name="bitNumber">The bit number to read (between 0 and 7).<... |
C# | UTF-8 | 4,197 | 2.515625 | 3 | [] | no_license | using System;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration.Configuration;
namespace ImPinker.Models
{
public class ExternalLoginConfirmationViewModel
{
[Required]
[Display(Name = "用户名")]
public string UserName { get; set; }
}
public ... |
PHP | UTF-8 | 389 | 3.40625 | 3 | [] | no_license | <?php
// Produtos
$omega_3 = 58;
$dipirona = 2;
$sacolas = 5;
echo "Valor sem desconto: ".$total = ($omega_3 + $dipirona + $sacolas);
echo "<br>";
if(($total > 50) and ($total < 60))
{
$discount = 20;
$total = $total * (100 - $discount) / 100;
}elseif ($total > 60) {
$discount = 30;
$total = $total ... |
Markdown | UTF-8 | 2,588 | 2.921875 | 3 | [] | no_license | Quattor Web Site
================
The site is hosted through GitHub pages and can be modified by cloning this
repository, making changes, and pushing the changes back into the repository.
Generally, you should only add new articles to the \_posts subdirectory or one
of the documentation category (directory starting by... |
PHP | UTF-8 | 3,980 | 2.984375 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class API extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->helper(array('url'));
$this->load->database();
$this->load->model(array('data_model'));//database handler
... |
PHP | UTF-8 | 2,228 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers\Site;
use App\Category;
use App\Contracts\ObjectRepository;
use App\Http\Controllers\Base\BaseController;
use App\Post;
use App\Services\BaseService;
use App\Tag;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Auth;
class PostsController extends BaseCont... |
JavaScript | UTF-8 | 28,804 | 3.015625 | 3 | [] | no_license | //built at Sat 28 Mar 2015 10:01:26 PM EDT
var game = function(){
this.width=window.innerWidth||800;
this.height = window.innerHeight||600;
this.container = document;
this.contexts = {};
this.screens={};
this.events = {};
this.proto={};
this.objects={}
this.keys={
"left1":37,
"right1":39,
"left2":65,... |
Markdown | UTF-8 | 809 | 2.5625 | 3 | [] | no_license | # DangCatFeeder
Dang Family Automated Cat Feeder, spins servo motor / send and recieves emails
Credited functions to storiknow.com / Sam Storino!
I started this project to solve a problem, our cat was gaining too much weight.
We fed him too much, so I suggested we try to feed him in smaller doses at
more time periods... |
C++ | UTF-8 | 2,842 | 2.65625 | 3 | [
"MIT"
] | permissive | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#ifndef GLOBALS_H
#include"globals.h"
#endif
static int WINWIDTH = 700;
static int WINHEIGHT = 500;
static int LOOPCOUNT = 1000000;
//Arbitrary value
static quint32 INITIALSTATE = 0x0A1B2C3D;
class MaxTaps;
// This program creates a list of 4 taps wh... |
Python | UTF-8 | 3,842 | 3.328125 | 3 | [] | no_license | #!/usr/bin/python3
"""Module for testing the Base class"""
import unittest
from models.base import Base
from models.rectangle import Rectangle
from models.square import Square
import json
class TestBaseClass(unittest.TestCase):
"""Tests the Base class"""
def setUp(self):
"""Resets the base class to p... |
Markdown | UTF-8 | 4,502 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | ---
title: Organization Actions
---
<!--[[ preview('org-accounts') ]]-->
# Operations
This section describes the actions that can be performed
within an organization account.
!!! note
All actions assume an authorized user has logged into their account.
## Organization actions
#### Create an organization
*Act... |
Java | UTF-8 | 704 | 2.765625 | 3 | [] | no_license | package fr.anzymus.spellcast.core.gestures;
public enum Gesture {
fingers("F"), //
palm("P"), //
wave("W"), //
snap("S"), //
digit_pointing("D"), //
clap("C"), //
nothing(" "), //
stab("stab"),
anything("anything", false);
private String description;
private boolean pl... |
Java | UTF-8 | 561 | 2.0625 | 2 | [] | no_license | package com.example.accountback.repository;
import com.example.accountback.entity.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.data.jpa.repository.Query;
import java.util.Optional;
import static javax.persisten... |
Java | UTF-8 | 2,916 | 1.898438 | 2 | [] | no_license | package br.gov.pbh.prodabel.hubsmsa.endpoint.impl;
import java.util.List;
import javax.ejb.EJB;
import javax.ws.rs.core.Response;
import br.gov.pbh.prodabel.hubsmsa.dto.EntityDTO;
import br.gov.pbh.prodabel.hubsmsa.dto.PaginacaoPublicaDTO;
import br.gov.pbh.prodabel.hubsmsa.dto.ResponseDTO;
import br.gov.pbh.prodabel.... |
Java | UTF-8 | 1,829 | 2.46875 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package records;
import reservationPortalSystem.Payment;
import java.util.Date;
import java.util.HashMap;
/**
*
* @author ahmed
*/
public class CreditCard implements Payment
{
private int cardNumber;
privat... |
C# | UTF-8 | 1,657 | 2.640625 | 3 | [] | no_license | using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using Bg_Fishing.Data;
using Bg_Fishing.Models;
using Bg_Fishing.Services.Contracts;
using Bg_Fishing.Utils;
using Bg_Fishing.Services.Models;
namespace Bg_Fishing.Services
{
public class NewsService : INewsService
{
priva... |
Java | UTF-8 | 1,124 | 3.234375 | 3 | [] | no_license | package practice1;
public class mergebyarray {
public static void main(String args[]){
String A = "abcd";
String B = "acde";
String C ="";
String m = "aabccdde";
//System.out.print(merge(A,B,C));
System.out.print(merge(A,B,m));
}
public static boolean merge(String A,String B,String m){
if(A.length() + B.len... |
C++ | UTF-8 | 460 | 3.65625 | 4 | [] | no_license | #include <iostream>
#include <vector>
class MultiStream {
public:
MultiStream& add(std::ostream& s)
{
streams.push_back(&s);
return *this;
}
template<typename T> MultiStream& operator<<(const T& item)
{
for (std::ostream* s : streams)
{
*s << item;
}
return *this;
}
private... |
Java | UTF-8 | 1,387 | 3.046875 | 3 | [] | no_license | package com.billsplit.billsplit_app;
import java.util.ArrayList;
import com.billsplit.billsplit_app.Menu.*;
public class Billsplitter {
private Bill bill;
private ArrayList<Menu> menuList = new ArrayList<Menu>();
private int numMenus;
private Menu curMenu = null;
Billsplitter() {
bill = new Bill();
initi... |
Python | UTF-8 | 218 | 3.578125 | 4 | [] | no_license | def is_same(string1, string2):
s1 = list(string1)
s2 = list(string2)
if sorted(s1) == sorted(s2):
return True
else:
return False
print(is_same("yes", "sey"))
print(is_same("uy", "ui")) |
Markdown | UTF-8 | 823 | 2.765625 | 3 | [] | no_license | # So Pekocko
Sixth project of the new web developer course at Openclassrooms.
**So-Pekocko** wants to develop an app for evaluating its hot sauces, called "**Piquante**".
The goal is to create an API with **NodeJS**, **Express** and **MongoDB** that will deliver all the functionalities to the frontend already in p... |
Java | UTF-8 | 6,191 | 1.960938 | 2 | [] | no_license | package com.sendmethen;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import ... |
Go | UTF-8 | 396 | 2.640625 | 3 | [
"MIT"
] | permissive | package gitbot
import "fmt"
// PayloadFork when someone forks a repo
type PayloadFork struct {
Forkee *Repository `json:"forkee"` // The created repository.
Repo *Repository `json:"repository"` // Repo
Sender *User `json:"sender"` // Sender
}
func (s PayloadFork) String() string {
return fmt.Spri... |
C++ | UTF-8 | 736 | 2.5625 | 3 | [] | no_license | #ifndef NAMED_PIPE_HPP_
#define NAMED_PIPE_HPP_
#include "FileDescriptorCommunicable.hpp"
class NamedPipe : public FileDescriptorCommunicable
{
public:
NamedPipe();
virtual ~NamedPipe();
virtual bool write(IMessage const &) const;
virtual bool read(IMessage &);
virtual void configureClient();
virtual voi... |
PHP | UTF-8 | 629 | 4.5 | 4 | [] | no_license | <?php
class Pessoa {
private $dados = array();
public function __set($nome, $valor) {
$this->dados[$nome] = $valor;
}
public function __get($nome) {
return $this->dados[$nome];
}
public function __toString() {
return "Tentei imprimir o objeto!";
}
public function... |
Python | UTF-8 | 316 | 2.78125 | 3 | [] | no_license | from npy_balltree import BallTree
import numpy as np
import cPickle as pickle
X = np.random.random((10,3))
ball_tree = BallTree(X, 2)
ind, dist = ball_tree.query(X[0], 3)
print ind
print dist
s = pickle.dumps(ball_tree)
ball_tree2 = pickle.loads(s)
ind2, dist2 = ball_tree2.query(X[0], 3)
print ind2
print dist2
|
Java | UTF-8 | 2,243 | 4.25 | 4 | [] | no_license | package com.nola;
public class MathClass {
public static void mathClass(String[] args) {
//Math.round()
int result = Math.round(1.1F);
System.out.println("Round " + result);
// output will be : 1
//Math.ceil() - returns smallest integer
// that is greater or equal... |
C# | UTF-8 | 2,661 | 2.953125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace Fredrick.src
{
[Serializable]
public class RectangleF : Transform
{
protected Vector2 _currentPosition;//current pos... |
JavaScript | UTF-8 | 742 | 4.09375 | 4 | [] | no_license | // ************************************************************ STRING METHODS
let name = ' Cesar Jimenez ';
// Length property
console.log(name.length);
// Convert to upper case
console.log(name.toUpperCase());
// Convert to lower case
console.log(name.toLowerCase());
// Includes method
let password = 'abc123pas... |
Java | UTF-8 | 1,041 | 1.75 | 2 | [] | no_license | /*
* Copyright 2014 Alex Curran
*
* 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 ... |
Java | UTF-8 | 401 | 3.15625 | 3 | [] | no_license | package helloworld;
/**
* @author Luke Hodinka
*/
public class HelloWorld
{
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
//Print to the screen
System.out.print("Hello World, my GitHub account name is MaddLu\n");
... |
Markdown | UTF-8 | 1,934 | 2.625 | 3 | [] | no_license | ---
layout: blog_by_tag_sketchnotes
category: sketchnotes
title: IWMW17
homepage: true
tag: iwmw17
meta: IWMW17 Blog Post and Sketchnotes
image: /iwmw17/iwmw17-intro-thumb.png
homepage: true
---
### Round up
The conference was excellent again this year - given the challenges of Brexit, and broader changes to the HE s... |
Python | UTF-8 | 585 | 2.96875 | 3 | [] | no_license | import sys
class Responder:
def __init__(self):
#hello words to check
self.helloWords = ["ciao", "salve"]
self.aboutWords = ["chi sei", "che fai"]
def get_message (self, text):
for hw in self.helloWords:
if hw in text.lower():
return "Ciao s... |
JavaScript | UTF-8 | 2,314 | 2.546875 | 3 | [] | no_license | #!/usr/bin/env node
import * as yargs from "yargs";
yargs
.scriptName("Bottom translator [JavaScript] 0.3.0")
.version("0.3.0")
.usage("$0 <cmd> [args]")
.command(
"$0",
"Nadir <chowdhurynadir0@outlook.com>\nFantastic (maybe) CLI for translating between bottom and human-readable text",
(yargs) => ... |
Java | UTF-8 | 4,243 | 1.992188 | 2 | [] | no_license | package smartphone_specs.restuibu.com.smartphone_specs.activity;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
imp... |
Java | UTF-8 | 385 | 2.015625 | 2 | [
"MIT"
] | permissive | package stories.deleteselectedprofile;
import framework.ModelContext;
public class DeleteSelectedProfileModelContext extends ModelContext {
private final String profileName;
public DeleteSelectedProfileModelContext(String profileName) {
super();
this.profileName = profileName;
}
publ... |
Java | UTF-8 | 1,510 | 2.484375 | 2 | [] | no_license | package hr.fer.rassus.firsthomework.client;
import hr.fer.rassus.firsthomework.client.model.Measurement;
import hr.fer.rassus.firsthomework.client.model.SensorDescription;
import hr.fer.rassus.firsthomework.client.model.UserAddress;
import org.springframework.http.ResponseEntity;
import org.springframework.http.conver... |
PHP | UTF-8 | 1,158 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class Elections extends Model
{
use HasFactory;
protected $fillable = [
'tittle',
'start_dt',
'finish_dt',
... |
PHP | UTF-8 | 2,719 | 3.21875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: standard
* Date: 4/26/18
* Time: 2:36 PM
*/
namespace App\Sorter;
class NewsSorter
{
/**
* News Entities to sort
*/
private $news;
/**
* Field to sort by
*/
private $criterion;
/**
* Direction to sort
*/
private $d... |
Ruby | UTF-8 | 32 | 2.578125 | 3 | [] | no_license | puts 'Hello, world!'
puts 1 + 2
|
Java | UTF-8 | 2,934 | 2.4375 | 2 | [] | no_license | package com.other;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import org.apache.hadoop.mapredu... |
Markdown | UTF-8 | 1,596 | 3.328125 | 3 | [] | no_license | # Diabetic-Retinopathy
# Code
DR.py is a python script that tries to automatically detect and grade the severity of Diabetic Retinopathy from Fundus images. I am using images from the publicly available kaggle dataset. Please click on the link to download the dataset:
https://www.kaggle.com/c/diabetic-retinopathy-de... |
Python | UTF-8 | 381 | 4.34375 | 4 | [] | no_license | # exercise 1
first_last_letter=input("Enter the first and last letters of you name please: ")
print("Your name starts with {} and ends with {}.".format(first_last_letter[0],first_last_letter[1]))
# exercise 2
txt="Dear {}, Your current balance is {}$"
name=input("Enter your full name please: ")
balance=float(input("En... |
Java | UTF-8 | 8,810 | 2.046875 | 2 | [
"MIT"
] | permissive | package com.mmadu.registration.documentation;
import com.mmadu.registration.entities.FieldType;
import com.mmadu.registration.providers.RegistrationProfileFormFieldsManager;
import com.mmadu.registration.repositories.FieldTypeRepository;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annot... |
C++ | UTF-8 | 1,065 | 2.96875 | 3 | [
"MIT"
] | permissive | // Compilation Command: g++ "Simple Socket - Client.cpp" -o "Simple Socket - Client" -lwsock32
#include <iostream>
#include <winsock2.h>
const char* server_address = "127.0.0.1";
const u_short server_port = 8888;
int main()
{
std::cout << "Initialising Winsock...\n";
WSADATA wsa;
if (WSAStartup(MAKEWORD(2, 2), &w... |
Markdown | UTF-8 | 1,140 | 2.5625 | 3 | [] | no_license | # Article L1221-13
Les conditions dans lesquelles les employeurs sont assujettis à un versement destiné au financement des services de mobilité
sont fixées :
1° Hors de la région Ile-de-France : par les articles L. 2333-64 à L. 2333-71, L. 5722-7 et L. 5722-7-1 du code général des
collectivités territoriales et par ... |
Markdown | UTF-8 | 4,918 | 2.796875 | 3 | [] | no_license | # Trunks-core
Trunks-core is the view part of trunks, its goal is only to add/modify or destroy components according to the JSON Component Declaration it receives.
It also exposes a global object wich is used to receive components specifications and also send the events to the client application.
This package is not ... |
JavaScript | UTF-8 | 1,285 | 3.140625 | 3 | [] | no_license |
/* Does your browser support geolocation? */
if ("geolocation" in navigator) {
$('.js-geolocation').show();
} else {
$('.js-geolocation').hide();
}
/* Where in the world are you? */
$('.js-geolocation').on('click', function() {
navigator.geolocation.getCurrentPosition(function(position) {
loadWeather(pos... |
C++ | UTF-8 | 561 | 2.578125 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;
const int N=2222;
int up[N], l[N], r[N];
int main() {
int n, m, k;
cin>>n>>m>>k;
char c;
for(int i=0;i<n;i++) for(int j=0;j<m;j++) {
scanf(" %c ", &c);
if(c == '.' || c == 'D') continue;
if(c == 'U') {
if(i... |
C++ | UTF-8 | 1,672 | 3.453125 | 3 | [] | no_license | /**
* 算法训练 拦截导弹
*/
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
int main()
{
int n, dmax = -1;
vector<int> dp, vec;
/* 获取导弹依次飞来的高度 */
do
{
cin >> n;
vec.push_back(n);
}
while (getchar() != '\n');
/* 初始化 */
for (size_t i = 0; i ... |
PHP | UTF-8 | 1,368 | 2.875 | 3 | [
"MIT"
] | permissive | <?php
/**
* Send a message via SendTalk.
*
* @param string $api_key API key from SendTalk.
* @param string $phone Recipient's phone number (must start with country code).
* @param string $message_type The message type ("otp", "text", or "image").
* @param string $body The message b... |
C++ | UTF-8 | 3,826 | 2.71875 | 3 | [] | no_license | /*
Project Title: randomWalker
Description:
©Daniel Buzzo 2020
dan@buzzo.com
http://buzzo.com
https://github.com/danbz
*/
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofEnableAlphaBlending();
ofSetBackgroundColor(0);
//Audio?
int ... |
Python | UTF-8 | 1,966 | 3.421875 | 3 | [] | no_license | import time
from collections import OrderedDict
from typing import Dict
class Timer(object):
def __init__(self, name, start=False, log=False):
"""
:param str name: The name of the timer
:param bool start: start the timer now?
:param bool log: log time when exiting the context manag... |
C | UTF-8 | 2,428 | 3.40625 | 3 | [] | no_license | // Ian Schweer
// 22514022
// Simple implementation of bankers algorithm.
// Program only needs to determine the state of a resource allocation.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int arrayLessThan(int *X, int *Y, int P) {
int i = 0;
for (i = 0; i < P; i++)
if (Y[i] < X[i])
return 0;
re... |
Python | UTF-8 | 670 | 3.734375 | 4 | [] | no_license | class SnakeNode(object):
def __init__(self,position,direction):
self.position = position
self.direction = direction
self.next()
def turn(self,direction):
self.direction = direction
self.next()
def next(self):
#up
if self.direction == 0:
self.nextPosition = (self.position[0],self.position[1]-1)
... |
Java | UTF-8 | 311 | 2.15625 | 2 | [] | no_license | package pl.sda.issuers.model;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;
@Component
@AllArgsConstructor
public class IssuerFacade {
private IssuerDetector detector;
public String identifyIssuer(String cardNo) {
return detector.detect(cardNo);
}
}
|
Markdown | UTF-8 | 1,463 | 2.609375 | 3 | [] | no_license | # Floating License Server
**WARNING**: DO NOT USE IN PRODUCTION
> Floating license servers should be stable and reliable. They often require
> manual intervention to restart, so you should avoid using them in a container
The paradigm used here has:
- a single Dockerfile to build many images
- a build arg for `PROD... |
JavaScript | UTF-8 | 1,090 | 3.71875 | 4 | [] | no_license | const Deque = require('collections/deque');
const string_case_permutations = (str) => {
let permutations = [];
permutations.push(str);
for(let i = 0; i < str.length; i ++) {
if (isNaN(parseInt(str[i], 10))) {
const n = permutations.length;
//Loop through all p... |
C++ | UTF-8 | 3,519 | 2.5625 | 3 | [] | no_license | #include "Globals.h"
#include "Vectors.h"
#include "Memory.h"
#include "Overlay.h"
#include <iostream>
#include <time.h>
#include <Psapi.h>
#include "Helpers.h"
#include "Input.h"
HWND gameWindow = FindWindow(NULL, L"Rainbow Six");
//Defining our globals
namespace Global {
HANDLE GameHandle = 0x0;
... |
JavaScript | UTF-8 | 4,485 | 3.203125 | 3 | [
"MIT"
] | permissive | /**
* @classdesc Utilities for re-shaping matrices
* @class matrix/shaping
* @hideconstructor
*/
var u = require('./mUtils');
var matrix = require('../matrix');
function matrix_cat_horizontal(A,B)
{
var M = [];
if(A.length != B.length)
{
throw 'Must have same number of rows'
}
... |
Python | UTF-8 | 15,565 | 2.640625 | 3 | [] | no_license | #!/usr/bin/env python3
MAX_SIZE = 18
MAT_FILE = 'gbs_arr.pkl'
#MAT_FILE = 'genbound_arr.pkl'
BG_CUTOFF = 0.01
import argparse, pickle, pathlib, logging
import multiprocessing as mp
from itertools import combinations, accumulate
from operator import mul
import numpy as np
from fatgraph.fatgraph import Fatgraph
def f... |
Ruby | UTF-8 | 853 | 3.671875 | 4 | [] | no_license | puts 'Hello, now you can play the game "Rock, paper, scissors"'
print "Choose one of them: "
player_choice = gets.chomp
def random_choice
["rock", "paper", "scissors"].sample
end
pc_choice = random_choice
puts "The PC choice is #{pc_choice}."
if player_choice == pc_choice then puts "It's a tie!" end
if player_cho... |
Python | UTF-8 | 86 | 3.390625 | 3 | [] | no_license | def silnia(x):
if x==0:
return 1
return x*silnia(x-1)
print(silnia(4)) |
C | UTF-8 | 1,546 | 3.6875 | 4 | [] | no_license | #include <stdio.h>
typedef struct Book{
char author[255];
char title[255];
char code_ISBN[255];
int price;
}Book;
int main(void){
Book bkdata[3];
int i;
for(i=0;i<3;i++){
printf("input author\n");
scanf("%s",bkdata[i].author);
printf("author= %s\n",bkdata[i].author)... |
Java | UTF-8 | 9,167 | 2.640625 | 3 | [
"MIT"
] | permissive | package service.entity;
import domain.CustomerOrder;
import domain.enums.EGuarantee;
import dto.*;
import exception.AppException;
import lombok.RequiredArgsConstructor;
import mapper.ModelMapper;
import repository.abstract_repository.entity.*;
import repository.impl.*;
import java.math.BigDecimal;
import java.time.L... |
Markdown | UTF-8 | 1,385 | 3 | 3 | [] | no_license |
**一、引用aar的好处:**
为了**减少apk体积**和**加快gradle编译速度**,比起依赖module,引用**aar**更为友好。
<br>
**二、如何生成aar?**
**1.** 使用Terminal命令 gradlew 模块名:clean 以及 gradlew 模块名:assemble,会在模块名/build/outputs/aar文件夹下生成aar文件。
**2.** 直接运行一下项目也可以在上述文件夹生成aar文件。
<br>
**三、如何在library模块中正确引用aar?**
**1.** 在**application**所在模块的build.gradle文件中**al... |
Java | UTF-8 | 780 | 2.796875 | 3 | [] | no_license | package helpers;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
public class Screensho... |
C++ | UTF-8 | 1,718 | 2.828125 | 3 | [] | no_license | #include "serverMapIndex.h"
ServerMapIndex::ServerMapIndex()
{
mServerId = 0;
mRunning = false;
}
ServerMapIndex::~ServerMapIndex()
{
stop();
}
int ServerMapIndex::start(char const* filename)
{
int rc;
printf("TODO: ServerMapIndex::load\n");
mServerId = 0; // Read assigned serverid from... |
Python | UTF-8 | 185 | 3.609375 | 4 | [] | no_license | while True:
number = int(input())
answer = number % 2
print (answer)
if answer == 0:
print("number is even")
if answer == 1:
print("number is odd")
|
Markdown | UTF-8 | 1,208 | 2.8125 | 3 | [] | no_license | # 코루틴
코루틴 자체에 의해서 제어되는 다중 진입점을 갖는 부프로그램
### 코루틴 매커니즘
- 호출과 피호출 부프로그램은 주-종속 관계라기보다는 대등관계
- 대칭적 단위 제어 모델 (symmetric unit control model)
- 다중 진입점을 가지며, 활성화 사이에 상태를 유지하여 두 번째 실행은 처음이 아닌 다른 지점에서 시작 가능
- 코루틴의 시작을 호출이 아닌 리쥼(resume)이라고 부른다.
### 코루틴의 실행
코루틴은 부분적으로 실행되고, 제어를 다른 곳으로 이동
코루틴 리쥼시, 제어를 다른 곳으로 전달한 문자 다음부터 시작한다.
... |
C++ | UTF-8 | 3,372 | 2.765625 | 3 | [] | no_license | int g_maxValue = 6;
void PrintProbability(int number)
{
if (number < 1)
return;
int maxSum = number * g_maxValue;
int* pProbabilities = new int[maxSum - number + 1];
for (int i = number; i <= maxSum; ++i)
pProbabilities[i - number] = 0;
Probability(number, pProbabilities);
... |
Java | UTF-8 | 5,582 | 2.5 | 2 | [] | no_license | package com.ipn.mx.controller.servlets.admin;
import com.ipn.mx.model.dao.UsuarioDAO;
import com.ipn.mx.model.entities.Usuario;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import javax.json.Json;
import javax.json.JsonArrayBuilder;
import javax.j... |
Java | UTF-8 | 1,311 | 3.53125 | 4 | [
"Apache-2.0"
] | permissive | package com.twu.biblioteca;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
class Options {
private final Scanner sc;
private final PrintStream os;
private final String prompt;
private final List<String> keys = new ArrayList<>();
private fi... |
Java | UTF-8 | 733 | 1.710938 | 2 | [] | no_license | package com.zhihu.android.profile.p1838a;
import com.zhihu.android.api.model.People;
import java8.util.p2234b.AbstractC32237i;
/* renamed from: com.zhihu.android.profile.a.-$$Lambda$b$C76oLPL5ZOHJGIN4ADQAgx_z0Po reason: invalid class name */
/* compiled from: lambda */
public final /* synthetic */ class $$Lambda$b$C... |
C# | UTF-8 | 531 | 2.578125 | 3 | [] | no_license | namespace LoadBalancer.Domain.Storage.Request
{
/// <summary>
/// A queue for <see cref="Models.Entities.Request"/>.
/// </summary>
public interface IRequestQueue
{
/// <summary>
/// Push to queue.
/// </summary>
void Add(Models.Entities.Request request);
///... |
Java | UTF-8 | 1,129 | 2.96875 | 3 | [] | no_license | package com.algorithm.loadbalance.polling;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
public class LBPollingWeight {
private static AtomicInteger index = new AtomicInteger();
public static void main(String[] args) {
Map<String, Integer> serverMap = new HashMap<>();
... |
Shell | UTF-8 | 4,462 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an in... |
C | UTF-8 | 2,977 | 2.734375 | 3 | [
"MIT"
] | permissive | #ifndef _VIDEOG_H_
#define _VIDEOG_H_
/** @defgroup videog videog
* @{
*
* Functions for using the video graphics
*/
//CONVERSIONS
#define BYTES_PER_PIXEL(x ) ((x+7)/8)
//useful macros
#define INDEX 0x105
#define DIRECT 0x114
#define MAX_FR_RATE 60
//colors (mode 0x114)
#define BLACK 0x0000
#define LIGHT_BLUE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.