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 | 1,394 | 2.296875 | 2 | [] | no_license | package com.tecsup.gestion.dao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
im... |
TypeScript | UTF-8 | 982 | 2.5625 | 3 | [] | no_license | import { StateObjectType, StoreObjectType } from '@samsite/store/types';
import { TravelLocalityStateType } from '@samsite/store/handlers/travel/types';
import { getAllTravelLocalitiesSelector } from '@samsite/selectors/travel/localities';
export const getAllTravelLocalitiesGroupedByCountryCodeSelector = (
state: ... |
Python | UTF-8 | 159 | 3.8125 | 4 | [] | no_license | rev=0
num=int(input("Enter a number:"))
while(num>0):
dig=num%10
rev=rev*10+dig
num=num//10
print("the reverse of number is {0}".format(rev)) |
Java | UTF-8 | 520 | 1.875 | 2 | [] | no_license | package com.snaplogic.snaps.systempropertytest;
import com.snaplogic.account.api.AccountType;
import com.snaplogic.account.api.capabilities.AccountCategory;
import com.snaplogic.snap.api.capabilities.General;
import com.snaplogic.snap.api.capabilities.Version;
/**
* Created by Syed on 31/3/17.
*/
@General(title = "... |
Java | UTF-8 | 951 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | package org.openintents.cmfilemanager.compatibility;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
public class BitmapDrawable_Compatible {
private static boolean use_SDK_1_6 = true;
/**
* Replaces "new BitmapDrawable(context.... |
JavaScript | UTF-8 | 2,485 | 2.65625 | 3 | [] | no_license |
$(function () {
//获取验证码功能
$(".btn_vcode").on("click", function () {
//1. 只要点击了,先禁用按钮
var tel = $("#tel").val()
console.log(tel)
if(!tel){
mui.toast("请输入手机号")
return false
}
var $this = $(this);
$this.prop("disabled", true).addClass("disabled")
var count = 5;
var ti... |
Shell | UTF-8 | 568 | 3.34375 | 3 | [] | no_license | #!/usr/bin/env bash
# Break on error
set -e
# Get import dir
SCRIPT_DIR="$(dirname $(realpath "${BASH_SOURCE[0]}"))"
# Source shared files
source "${SCRIPT_DIR}/.environment"
source "${SCRIPT_DIR}/.functions"
# Log start
console_log "$0: Starting..."
# rsnapshot
console_log "Running rsnapshot..."
sudo rsnapshot -c... |
JavaScript | UTF-8 | 987 | 2.78125 | 3 | [] | no_license | import React, { useCallback, useEffect, useState } from 'react';
import '../02-useEffect/effects.css';
import { ShowIncrement } from './ShowIncrement';
export const CallbackHook = () => {
const [counter, setCounter] = useState(10);
// const increment = () => {
// setCounter(counter+1);
// }
... |
C++ | UTF-8 | 1,739 | 2.96875 | 3 | [] | no_license | #pragma once
#include <map>
#include "Commands.h"
#include "CommandsEnvironment.h"
class CommandsVisitorBase
{
public:
//virtual void onVisit(const Command& command) = 0;
virtual void onVisit(const SequentialCommand& ) = 0;
virtual void onVisit(const EmptyCommand&) = 0;
virtual void onVisit(const CallCommand& ca... |
Swift | UTF-8 | 2,244 | 2.890625 | 3 | [] | no_license | //
// ShopService.swift
// shishaLog
//
// Created by 宮本一成 on 2020/07/15.
// Copyright © 2020 ISSEY MIYAMOTO. All rights reserved.
//
import Firebase
struct ShopCredentials {
let shopName: String
let shopAddress: String
let shopImage: UIImage
}
struct ShopService {
static let shared = ShopSe... |
JavaScript | UTF-8 | 487 | 3.34375 | 3 | [] | no_license | //method overloading
class Maths{
add=()=>{
console.log("no arg method")
}
add=(no1)=>{
console.log("one arg method")
}
add=(no1,no2)=>{
console.log("two arg method")
}
}
var math=new Maths()
math.add(10) // will execute only recently implemented method
//method overriding
class ... |
TypeScript | UTF-8 | 645 | 2.71875 | 3 | [] | no_license | /**
* news model
*/
export class News {
/**
* news model
* @param created date
* @param description description
* @param link link too article
* @param title title
* @param url url
* @param enclosures img info
*/
constructor (
public created: number,
public description: string,
pub... |
Java | UTF-8 | 2,562 | 2.5 | 2 | [
"MIT"
] | permissive | package domain;
import java.io.Serializable;
public class Food implements Serializable{
private int code,hit=0;
private String name, maker, material, image;
private double supportpereat, calory, carbo, protein, fat, sugar, natrium, chole, fattyacid, transfat;
private String allergy;
public Food() {
supe... |
C# | UTF-8 | 3,241 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Users.BusinessLogic;
namespace Users.Data
{
public class UserRepository : IUserRepository
{
private readonly SqlConnection _connection;
public UserRepository(SqlConnection connection)
{
_con... |
Java | UTF-8 | 2,588 | 2.578125 | 3 | [] | no_license | package com.aaron.springweb.dao;
import org.apache.ibatis.jdbc.SQL;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* Created by Administrator on 2016/9/29.
*/
public class TestMybatis {
@Before
public void setUp() throws Exception {
}
@After
public void tearDown() ... |
Java | UTF-8 | 4,096 | 2.34375 | 2 | [] | no_license | package io.simondev.demoinflearnrestapi.configs;
import io.simondev.demoinflearnrestapi.accounts.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.security.servlet.PathRequest;
import org.springframework.context.annotation.Bean;
import org.spri... |
C++ | UTF-8 | 2,662 | 2.546875 | 3 | [] | no_license | #pragma once
#include "SUtils.h"
#include "SDxBasic.h"
class SArcBall
{
private:
D3DXMATRIXA16 m_mRotation; // Matrix for arc ball's orientation
D3DXMATRIXA16 m_mTranslation; // Matrix for arc ball's position
D3DXMATRIXA16 m_mTranslationDelta; // Matrix for arc ball's position
POINT m_Offset; // window o... |
C++ | UTF-8 | 1,141 | 3.234375 | 3 | [] | no_license | /*
链接:https://www.nowcoder.com/questionTerminal/f72adfe389b84da7a4986bde2a886ec3
来源:牛客网
求字典序在s1和s2之间的,长度在len1到len2的字符串的个数,结果mod 1000007。
输入描述:
每组数据包涵s1(长度小于100),s2(长度小于100),len1(小于100000),len2(大于len1,小于100000)
输出描述:
输出答案。
示例1
输入
ab ce 1 2
输出
56
*/
#include <iostream>
#include <string>
#include <math.h>
#include <vecto... |
PHP | UTF-8 | 2,339 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\DwhControl\Common\Traits;
use App\DwhControl\Common\Enum\HealthIndicatorStatusEnum;
use App\DwhControl\Common\Models\HealthIndicator;
use Illuminate\Database\Eloquent\Relations\MorphMany;
trait HasHealthIndicatorTrait
{
/**
* @return MorphMany
*/
public function health_indicato... |
C# | UTF-8 | 1,253 | 3.3125 | 3 | [] | no_license | using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
namespace remove_all_marked_elements_of_list
{
[TestClass]
public class TestFixture
{
[TestMethod]
public void Test1()
{
int[] integerList = new int[] { 1, 1, 2, 3, 1, 2, 3, 4 };
int[] val... |
Shell | UTF-8 | 1,519 | 3.5625 | 4 | [
"CC0-1.0"
] | permissive | #!/bin/bash
#Autora: Helena Moreda Boza
#Fichero: arpad.sh
#Versión:09-04-2015
#Resumen: script que comprueba cada 5 minutos si la mac de nuestro router ha cambiado y nos avisa mediante una ventana emergente en el caso de un posible caso de ataque Man in the Middle.
#Exportamos la pantalla para que puedan visualizars... |
JavaScript | UTF-8 | 1,143 | 2.796875 | 3 | [] | no_license | import { expect } from 'chai';
import Trip from '../src/Trip.js'
import TripRepo from '../src/TripRepo.js';
import sampleTripData from '../src/data/sampleTripData.js';
import destinationData from '../src/data/sampleDestinationData.js'
describe('Trip', () => {
let sampleTrip;
beforeEach(() => {
sampleTrip = ... |
C++ | SHIFT_JIS | 2,001 | 2.953125 | 3 | [] | no_license | #pragma once
#include "TDNLIB.h"
//===============================================
// At@xbge[u
//===============================================
static const char EP_AlphabetTable[]
{
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y'... |
JavaScript | UTF-8 | 1,196 | 2.71875 | 3 | [] | no_license | function searchBooks() {
document.querySelector('.dataSearch').addEventListener('click', function () {
let formSearch = document.forms['searchBook'];
let inputValue = formSearch.inputData.value;
new Promise(function (reject) {
let xhr = new XMLHttpRequest();
x... |
Java | UTF-8 | 3,523 | 2.109375 | 2 | [] | no_license | package com.gianghoang;
import com.gianghoang.core.Employee;
import com.gianghoang.core.Person;
import com.gianghoang.core.Student;
import com.gianghoang.db.EmployeeDAO;
import com.gianghoang.db.PersonDAO;
import com.gianghoang.db.StudentDAO;
import com.gianghoang.resources.*;
import io.dropwizard.Application;
import ... |
JavaScript | UTF-8 | 1,052 | 2.625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import axios from "axios";
import Weather from "./Weather";
const CountryDetail = ({ result }) => {
const [weatherData, setWeatherData] = useState([]);
useEffect(() => {
axios
.get(
`https://api.openweathermap.org/data/2.5/weather?q... |
Shell | UTF-8 | 281 | 2.90625 | 3 | [] | no_license | #!/bin/bash
### BEGIN INIT INFO
# Provides: jdk-8
### END INIT INFO
source /etc/os-release
case $ID in
debian|ubuntu|devuan)
apt-get update
apt install openjdk-8-jdk -y
;;
centos|fedora|rhel)
yum install java-1.8.0-openjdk -y
;;
*)
exit 1
;;
esac
|
Java | UTF-8 | 427 | 2.03125 | 2 | [] | no_license | package com.example.smartcomplaint.dao;
import java.util.ArrayList;
/**
* Created by Rakshith on 10/13/2015.
*/
public class ComplaintInfoList {
public ArrayList<ComplaintInfo> getComplaints() {
return complaints;
}
public void setComplaints(ArrayList<ComplaintInfo> complaints) {
this.... |
C# | UTF-8 | 230 | 3 | 3 | [] | no_license | using System;
class A
{
static void Main()
{
string s = "using System;class A{{static void Main(){{string s={0}{1}{0};char q='{0}';Console.Write(s,q,s);}}}}";
char q = '"'; Console.Write(s, q, s);
}
}
|
TypeScript | UTF-8 | 1,645 | 2.515625 | 3 | [] | no_license | import { Specification } from '../specification/specification';
import { ParamBuilder } from "../../query/param/param-builder";
import { HttpParams } from '@angular/common/http';
export class PreparedQuery {
limit: number;
offest: number;
specification: Specification;
ordersBy: Map<String, String>;
... |
JavaScript | UTF-8 | 645 | 2.578125 | 3 | [] | no_license | var GildedRose = function () {
console.log("OMGHAI!");
var items = [];
items.push(new Item("+5 Dexterity Vest", 10, 20));
items.push(new Item("Aged Brie", 2, 0));
items.push(new Item("Elixir of the Mongoose", 5, 7));
items.push(new Item("Sulfuras, Hand of Ragnaros", 0, 80));
items.push(new Item("Backstage... |
C# | UTF-8 | 2,719 | 2.953125 | 3 | [] | no_license | using Caliburn.Micro;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Wpf_MVVM.Models;
//ShellViewModel is Interface and This Acts Like The Backend Code where we write The Logic.
// I am doing this while watching the Tutorials of Iamtimcory on... |
PHP | UTF-8 | 3,268 | 2.59375 | 3 | [] | no_license | <?php
require_once __DIR__.'../services/ServiceInvoice.php';
$service = new InvoiceService;
if ($service->isDataValid())
{
$customerId = $_POST['customerId'];
$invoiceDate = $_POST['invoiceDate'];
$billingAddress = $_POST['billingAddress'];
$billingCity = $_POST['billingCity'];
$billin... |
Python | UTF-8 | 1,258 | 4.46875 | 4 | [] | no_license | # [조건문]
# if
people = 5
apple = 4
# 비교연산자
# print(people == apple) # false
# print(people >= apple) # false
# print(people <= apple) # true
# if(true):
# 이부분이 실행됩니다.
# if(false):
# 이부분은 실행되지 않아요.
# if people == apple:
# print('딱 맞다.')
# if people > apple:
# print('사과가 부족해')
# if people < apple:
# p... |
Python | UTF-8 | 4,642 | 2.9375 | 3 | [] | no_license | from tkinter import *
from tkinter import messagebox, Frame
from tkinter import ttk
import DataBaser
# Criar janela
jan = Tk()
jan.title('Painel de Acesso')
jan.geometry('300x600') # o tamanho da janela
jan.configure(background='white') # Configura a cor da janela
jan.resizable(width=False, height=False) # impede q... |
JavaScript | UTF-8 | 2,577 | 3.359375 | 3 | [
"MIT"
] | permissive | module.exports = class {
constructor( items ) {
this.items = items;
this.reset();
this.totalItems = this.items.length;
}
// ------------------------------------ API
// Go to the next item
next( loopOnOverShoot=false ) { this.incramentItemIndex(1, loopOnOverShoot); }
prev( loopOnOverShoot=fa... |
Java | UTF-8 | 655 | 2.59375 | 3 | [
"MIT"
] | permissive | package org.rfc8452.aead;
public class ByteOperations
{
static void inPlaceUpdate(byte[] b, final int n)
{
b[0] = (byte) n;
b[1] = (byte) (n >> 8);
b[2] = (byte) (n >> 16);
b[3] = (byte) (n >> 24);
}
static void inPlaceUpdate(byte[] b, final long n, final int offset)
... |
PHP | UTF-8 | 5,152 | 2.71875 | 3 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | <?php
namespace App\Game\Kingdoms\Builders;
use App\Flare\Models\GameUnit;
use App\Flare\Models\KingdomLog;
class KingdomAttackedBuilder {
/**
* @var KingdomLog $log
*/
private $log;
/**
* Sets the log.
*
* @param KingdomLog $log
* @return KingdomAttackedBuilder
*/
... |
PHP | UTF-8 | 350 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
session_start(); //Start a session
session_unset(); //Take all the session variable when you login and take all the userid/name are delete from the session variables
session_destroy(); //Destroy the session we're running from the current website
header("Location: ../index.php"); //Take pe... |
C# | UTF-8 | 5,709 | 2.6875 | 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 kevinlucasraimondinogueira3017102087
{
public partial class Form1 : Form
{
pub... |
C++ | UTF-8 | 343 | 2.515625 | 3 | [] | no_license | #ifndef ENDURANCE_H
#define ENDURANCE_H
#include "character/characteristics/skill/skill.h"
class Endurance : public Skill {
public:
Endurance(bool trndFlag = false);
~Endurance();
void addBonus(const Bonus * const bonus);
void subBonus(const Bonus * const bonus);
const char * toString() const;
};
... |
PHP | UTF-8 | 1,923 | 2.546875 | 3 | [] | no_license | <?php
/**
* List View Loop
* This file sets up the structure for the list loop
*
* Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php
*
* @package TribeEventsCalendar
* @since 3.0
* @author Modern Tribe Inc.
*
*/
if ( !defined('ABSPATH') ) { die('-1'); } ... |
Java | UTF-8 | 5,512 | 2.09375 | 2 | [] | no_license | package com.example.listacontactos;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import androi... |
Java | UTF-8 | 1,918 | 2.296875 | 2 | [] | no_license | package fr.jeanlouispiera.metier;
import java.util.List;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.query.Param;
import fr.jeanlouispiera.entities.Site;
import fr.jeanlouispiera.entities.SiteCotation;
import fr.... |
C# | UTF-8 | 5,171 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MySql.Data.MySqlClient;
using System.Windows.Forms;
using System.Data;
using System.IO;
using System.Drawing;
namespace Sixi
{
class DBconnect
{
MySqlConnection cnn;
public... |
Markdown | UTF-8 | 1,686 | 2.71875 | 3 | [] | no_license | ### 订单查询 酒店入住 日历选择功能
https://sunguangqing.github.io/calendar/calendar.html
### My97DatePicker日期控件地址:http://www.my97.net/demo/index.htm
>下载calendar文件夹放到根目录中,将WdatePicker.js文件引用到页面中即可 <br /><script src="calendar/WdatePicker.js"></script>
#### `HTML结构:`
#### >订单查询日历控件使用
>可选择的时间不能超过当前的时间,后面选择框的时间不能小于前面选定的时间并且不能大于当前的时... |
Python | UTF-8 | 1,113 | 3.609375 | 4 | [
"Unlicense"
] | permissive | import unittest
def is_subseq(a, b):
i = 0
for ch in b:
if ch == a[i]:
i += 1
if i == len(a):
return True
return False
class Solution:
def findLUSlength(self, strs):
"""
:type strs: List[str]
:rtype: int
"""
strs... |
C++ | UTF-8 | 2,478 | 3.375 | 3 | [] | no_license | //
// main.cpp
// HPEA2
//
// Created by Hasan Qureshi on 2/5/20.
// Copyright © 2020 Hasan Qureshi. All rights reserved.
//
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;
void deposit(double& bal);
void withdraw(double& bal);
void status(double& bal);
void menu... |
JavaScript | UTF-8 | 795 | 2.640625 | 3 | [] | no_license | // Import node module for mongo ORM
const mongoose = require("mongoose");
// define database for books
const Schema = mongoose.Schema;
// schema makes non-relational db(Mongo) like a relational db(MySQL)
// Each schema key is a db field and its datatype that will be validated.
// Also some fields are required when crea... |
C++ | UTF-8 | 1,450 | 2.71875 | 3 | [] | no_license | #include "Human.h"
#include <ctime>
#include <random>
#include <glm/gtx/rotate_vector.hpp>
#include <Engine/ResourceManager.h>
Human::Human()
{
}
Human::~Human()
{
}
void Human::init(float speed, glm::vec2 pos){
static std::mt19937 randomEngine(time(nullptr));
static std::uniform_real_distribution<float> ranD... |
C# | UTF-8 | 42,435 | 2.703125 | 3 | [
"MIT"
] | permissive | using System;
using Xunit;
namespace Freestylecoding.Math.CSharp.Tests {
// NOTE: The sanity tests are here to do low level tests of a few parts
// This lets me isolate those tests so I can use those parts in the rest of the tests
//
// In other words:
// IF ANY OF THE SANITY TESTS FAIL, DON'T TRUST ANY OTHER TE... |
TypeScript | UTF-8 | 2,730 | 2.546875 | 3 | [
"MIT"
] | permissive | import { slackAPI } from './slackAPI';
import {Channel} from './channelAPI';
import config from './config';
import { MessageAttachment } from '@slack/web-api/dist/methods';
const shuffle = require('shuffle-array');
const noticeTempl:[MessageAttachment] =
[{
"fallback": `Please, help me to keep our Slack workspac... |
Markdown | UTF-8 | 729 | 2.671875 | 3 | [] | no_license | # avatar-generator
A simple Vue project that generates random (but reproducible) avatars. A project to learn how SVG and paths work while using some of my artistic talent :).
Check online:
https://avatar-generator.netlify.app
Screenshot:

Video of usage:
![Scr... |
Java | UTF-8 | 497 | 2.265625 | 2 | [] | no_license | package ru.job4j.array.ru.job4j.array;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.is;
import junit.framework.TestCase;
public class SkipNegativeTest extends TestCase {
public void testSkip() {
int[][] in = {
{1, -2},
{1, 2}
};
... |
PHP | UTF-8 | 4,614 | 3.046875 | 3 | [] | no_license | <?php
namespace wishlist\controllers;
use Slim\Http\Request;
use Slim\Http\Response;
use wishlist\models\Utilisateur;
/**
* Class ControleurConnexion
* @package wishlist\controllers
*/
class ControleurConnexion
{
private $c;
/**
* Constructeur de la classe ControleurConnexion
* @param \Slim\C... |
C++ | UTF-8 | 2,213 | 2.6875 | 3 | [] | no_license | /*==========================================================================
*
* Copyright (C) 1999, 2000 Microsoft Corporation. All Rights Reserved.
*
* File: wavformat.h
* Content:
* This module contains the CWaveFormat class which is used to work with
* WAVEFORMATEX structures.
*
* Hist... |
Python | UTF-8 | 9,682 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | from twisted.internet.defer import inlineCallbacks
from twisted.internet.task import Clock
from vumi.components.window_manager import WindowManager, WindowException
from vumi.tests.helpers import VumiTestCase, PersistenceHelper
class TestWindowManager(VumiTestCase):
@inlineCallbacks
def setUp(self):
... |
JavaScript | UTF-8 | 1,879 | 2.984375 | 3 | [] | no_license | function logout (){
/* When the function is activated by onclick event the name and password are deleted
from localStorage */
localStorage.removeItem("username");
localStorage.removeItem("password");
/*Login page redirection*/
window.location.assign("../JB_admin.html");
}
function check_admin()... |
C++ | UTF-8 | 3,223 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <math.h>
#include <fstream>
#include <string.h>
#include "Parameterization.h"
#include "GlobalMacros.h"
using namespace std;
BoxProjection::BoxProjection(double radius) : Parameterization(radius) {
name = "BoxProjection";
Jmax = 20;
Kmax = 20;
Lmax = 1;
Gmax = 6;
x_lb = -radius + 0.00001e0;
... |
PHP | UTF-8 | 1,112 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Traits;
use App\Models\SystemSetting;
use App\Models\MemberCard;
use Carbon\Carbon;
trait MemberCardTrait
{
public function calculateDueDate()
{
$due = SystemSetting::where('field', 'member_card_due')->first()['value'];
return Carbon::now()->addMonths($due);
}
pub... |
Python | UTF-8 | 2,360 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
import matplotlib.pyplot as plt
import re
import urllib.request
import numpy as np
from datetime import datetime, timedelta
# In[2]:
def find_nearest_cell(array,value):
idx = (np.abs(array-value)).argmin()
... |
Ruby | UTF-8 | 193 | 3.453125 | 3 | [] | no_license | x = "hi there"
my_hash = {x: "some value"}
my_hash2 = {x => "some value"}
# The difference b/w the 2...
# my_hash uses a symbol, x, as the key
# my_hash2 uses the string 'hi there' as the key |
C++ | UTF-8 | 629 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<iterator>
using namespace std;
int main()
{
vector<int> vec;
vector<int>::iterator i;
for(int j=0;j<10;j++)
{
vec.push_back(j);
}
for(i=vec.begin();i!=vec.end();++i)
{
cout<<*i<<endl;
}
}
/*
//stl_cpp_2.cpp
#include <vector>... |
Python | UTF-8 | 669 | 3.75 | 4 | [] | no_license | class Student:
def __init__(self, firstname, lastname):
self.fistname = firstname
self.lastname = lastname
def getName(self):
fullname = self.fistname + " " + self.lastname
return fullname
def printName(self):
print(self.getName())
class Mediateknikstudent(Stu... |
C++ | UTF-8 | 1,088 | 3.578125 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include "invmenu.h"
using namespace std;
void invMenu()
{
//Info Storage
int selection;
//Output
cout << setw(40) << "Serendipity Booksellers" << endl;
cout << setw(37) << "Inventory Database" << endl;
cout << endl;
cout << "1. Look-Up a Book" << endl;
... |
Java | UTF-8 | 1,836 | 1.820313 | 2 | [] | no_license | package spring.testing.server.configuration;
import java.util.ArrayList;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import o... |
TypeScript | UTF-8 | 841 | 2.5625 | 3 | [] | no_license | import React from 'react'
import { Elements, HTMLSerializer } from 'prismic-reactjs'
import { HTMLSerializerElementMap } from './types'
function serializeElements(map: HTMLSerializerElementMap): HTMLSerializer<React.ReactNode> {
return function (type, element, content, children, key): React.ReactNode {
const no... |
C++ | UTF-8 | 576 | 3.015625 | 3 | [] | no_license | #include "../IOLib.hpp"
class Solution {
public:
Solution(vector<int> nums) {
numbers = nums;
}
int pick(int target) {
int res = 0, count = 0;
for(int i = 0; i < numbers.size(); i++){
if(numbers[i] == target){
count++;
if(rand() % coun... |
Java | UTF-8 | 293 | 1.90625 | 2 | [] | no_license | package com.omarmohamed.myvideogallery.ui.player;
/**
* Created by omarmohamed on 26/08/2016.
*/
public interface PlayerListener {
void onBufferingStart();
void onBufferingComplete();
void onSetDuration(long durationMs);
void onUpdateProgress(float percentComplete);
}
|
Markdown | UTF-8 | 12,626 | 2.53125 | 3 | [] | no_license | ---
title: 'Migrating a PostgreSQL DB to a new machine without doing a dump & restore'
author: Evan Hoffman
excerpt: rsync over NFS can be so fast.
layout: post
permalink: /2011/07/11/migrating-a-postgresql-db-to-a-new-machine-without-doing-a-dump-restore/
dsq_thread_id:
- 2949520998
categories:
- Uncategorize... |
C++ | UTF-8 | 6,278 | 3.203125 | 3 | [] | no_license | //Dan Siegel
//Project 4
//Implementation File for Catalog Class
#include <iostream>
#include <fstream>
#include <cstring>
#include "catalog.h"
#include "book.h"
using namespace std;
Catalog::Catalog(){ //constructor
numberOfBooks = 0;
ifstream libraryBooks("library.txt");
if(libraryBooks){ //if file opens corre... |
PHP | UTF-8 | 872 | 2.875 | 3 | [] | no_license | <?php
namespace Mrchimp\Chimpcom\Commands;
use Chimpcom;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Candyman!
* @action candyman
*/
class Candyman extends Command
{
/**
* Configure the command
*
* @return void
*/
prot... |
Java | UTF-8 | 2,936 | 1.914063 | 2 | [
"Apache-2.0"
] | permissive | package dev.gradleplugins.internal.plugins;
import dev.gradleplugins.GradlePluginDevelopmentCompatibilityExtension;
import dev.gradleplugins.GradlePluginDevelopmentTestSuite;
import dev.gradleplugins.internal.GradlePluginDevelopmentDependencyExtensionInternal;
import dev.gradleplugins.internal.GradlePluginDevelopmentT... |
Java | UTF-8 | 1,306 | 1.84375 | 2 | [] | no_license | /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later... |
Java | UTF-8 | 225 | 2.203125 | 2 | [
"MIT"
] | permissive | package cz.litvaluk.fit.adp.game.state;
import cz.litvaluk.fit.adp.game.model.gameobjects.cannon.Cannon;
public interface ShootingMode {
String getName();
void shoot(Cannon cannon);
ShootingMode nextMode();
}
|
C# | UTF-8 | 3,801 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
namespace KEditorExtensions
{
/// <summary>
/// Handle GUI color changes like EditorGUILayout's Horizontal and Vertical scopes!
/// </summary>
public static class ColorScope
{
//internal stack of prior colors to fall b... |
C# | UTF-8 | 4,342 | 2.625 | 3 | [
"MIT"
] | permissive | namespace Chr.Avro.Representation
{
using System.Text.Json;
using Chr.Avro.Abstract;
/// <summary>
/// Implements a <see cref="JsonSchemaWriter" /> case that matches <see cref="BytesSchema" />s
/// or <see cref="FixedSchema" />s with <see cref="DecimalLogicalType" />.
/// </summary>
public ... |
C++ | UTF-8 | 22,793 | 2.921875 | 3 | [] | no_license | #include "matrix4x4.h"
#include <cstring>
// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/
namespace fmormath
{
const Matrix4x4 Matrix4x4::ZERO(
0, 0, 0, 0 ,
0, 0, 0, 0 ,
0, 0, 0, 0,
0, 0, 0, 0
);
... |
PHP | UTF-8 | 2,648 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php session_start();
include 'header.php';
include 'Classes.php';
?>
<body>
<?php
/**
* User: OMAR BARA
* Date: 01/01/2018
* Time: 12:54 PM
*/
include "functions.php";
if (!empty($_SESSION)) {
if (isset($_GET['qty']) && !empty($_GET['qty']) && ($_GET['qty'] > 0) AND
isset($_GET['aldd']) && !empty($_G... |
Java | UTF-8 | 283 | 1.695313 | 2 | [] | no_license | package warehouseapp.warehouse.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import warehouseapp.warehouse.entity.Currency;
import warehouseapp.warehouse.entity.Supplier;
public interface SupplierRepository extends JpaRepository<Supplier, Integer> {
}
|
Java | UTF-8 | 2,221 | 2.359375 | 2 | [] | no_license | package com.example.restapimongodb.services;
import com.example.restapimongodb.models.UserModel;
import com.example.restapimongodb.models.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.c... |
Java | UTF-8 | 2,738 | 2.21875 | 2 | [] | no_license | package com.example.disasterrelief;
import android.content.Intent;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity implements View.OnClickListener{
@Override
p... |
Python | UTF-8 | 1,037 | 2.734375 | 3 | [] | no_license | import sys
sys.stdin = open("11_input.txt")
T = 10
for case in range(1, T+1):
long, start = map(int, input().split())
from_to = list(map(int, input().split()))
call_list = []
for i in range(len(from_to)//2):
k = [from_to[i*2]]
k.append(from_to[(i*2) + 1])
call... |
C++ | UTF-8 | 2,694 | 3.390625 | 3 | [] | no_license |
class CTimeKeeper
{
public:
CTimeKeeper();
void init();
void every_10_milliseconds_interrupt();
void every_100_milliseconds_interrupt();
void every_second_interrupt();
void callback_later(func_ptr function, word milliseconds);
private:
struct callback_info {
byte ticks_left: 7... |
Shell | UTF-8 | 1,836 | 3.375 | 3 | [] | no_license | #!/bin/bash
source /home/oracle/.bash_profile
function qywx_inform()
{
curl "${qywx_webhook}" \
-H 'Content-Type: application/json' \
-d "
{
\"msgtype\": \"text\",
\"text\": {
\"content\": \"${inform_content}\"
}
}"
}
if [ -z "$1" ]; then
echo "oracle system用户密码不能为... |
C++ | GB18030 | 788 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
class student
{
public:
student();
void print() const;
static int getCount();
private:
static int count;
int studentNo;
};
///**********************************************************
int student::count=0; ///ⶨ徲̬Ա
///***********************************... |
Ruby | UTF-8 | 649 | 3.546875 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | class Author
attr_accessor :name
@@post_count = 0
def initialize(name)
@name = name
@posts = []
end
def self.post_count=(song_count)
@@post_count=song_count
end
def posts #getter method to return @posts
@posts
end
def add_post(post_string)
post_string.author = self #say... |
Java | UTF-8 | 1,401 | 1.734375 | 2 | [] | no_license | package com.base.frame.generator.order.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModel... |
Markdown | UTF-8 | 1,031 | 3.78125 | 4 | [] | no_license | ---
description: 'https://leetcode.com/problems/perfect-squares/'
---
# 279. Perfect Squares
## Problem
Given a positive integer n, find the least number of perfect square numbers \(for example, `1, 4, 9, 16, ...`\) which sum to n.
**Example 1:**
```text
Input: n = 12
Output: 3
Explanation: 12 = 4 + 4 + 4.
```
*... |
Python | UTF-8 | 878 | 2.546875 | 3 | [] | no_license |
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(r"hafta3/opencv/haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(r"hafta3/opencv/haarcascade_eye.xml")
while True:
ret,frame = cap.read()
gray =cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
yuzle... |
Java | UTF-8 | 850 | 3.609375 | 4 | [] | no_license | import java.io.File;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
if(args.length > 0){
File f = new File(args[0]);
Buscador b = new Buscador();
b.buscar(f, args[1]);
}else{
System.out.println("Archivo donde se... |
Java | UTF-8 | 2,851 | 2.890625 | 3 | [] | no_license | package symtable;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Set;
import minijava.node.AVarDecl;
import minijava.node.PType;
import minijava.node.PVarDecl;
import minijava.node.TId;
import Tree.*;
import Arch.*;
import java.util.*;
/**
* A VarTable records name and type information ab... |
C# | UTF-8 | 1,892 | 2.859375 | 3 | [] | no_license | using System;
using System.IO;
using Niob.SimpleHtml;
namespace Niob.SimpleErrors
{
public static class ErrorExtensions
{
public static void SendError(this HttpResponse response, ushort code)
{
if (response == null) throw new ArgumentNullException("response");
... |
Markdown | UTF-8 | 1,955 | 3.1875 | 3 | [
"MIT"
] | permissive | # Jester
[Jokes dataset](http://eigentaste.berkeley.edu/dataset/)
consists of several datasets which contain joke ratings in
real values ranging from -10.00 to +10.00.
Texts of jokes are available too.
## Stats
### Dataset 1
- 73,421 users
- 100 jokes
- collected between April 1999 - May 2003
### Dataset 3
- 54,... |
C# | UTF-8 | 3,030 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Renci.SshNet;
namespace ReleaseFileBackupTool
{
class SftpFileBackup
{
public string RemoteHost { set; get; }
public int RemotePort { set; get; }
p... |
PHP | UTF-8 | 466 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Buildings extends Model
{
protected $table = 'buildings';
protected $fillable = [
'name',
'abbrev',
'description',
'conference_id'
];
public function rooms()
{
return $this->hasMany('App\Models\Roo... |
Go | UTF-8 | 1,207 | 2.953125 | 3 | [
"MIT"
] | permissive | package wamp
import (
"math/rand"
"sync"
"time"
)
const maxID int64 = 1 << 53
func init() {
rand.Seed(time.Now().UnixNano())
}
// NewID generates a random WAMP ID.
func GlobalID() ID {
return ID(rand.Int63n(maxID)) //nolint:gosec
}
// IDGen is generator for WAMP request IDs. Create with new(IDGen).
//
// WAM... |
JavaScript | UTF-8 | 747 | 2.78125 | 3 | [
"MIT"
] | permissive | window.global.active = 0;
window.global.blocks = 2;
var reRender = function(type) {
var reviews = $('#reviews > .content > .reviews').children();
if(type == 'left' && window.global.active > 0) {
window.global.active -= 1;
}
if(type == 'right' && window.global.active < reviews.length-1) {
window.globa... |
JavaScript | UTF-8 | 21,261 | 2.5625 | 3 | [] | no_license | let TAG_SPAN_CIRCLE_START = '<span class="ui red circular';
let TAG_SPAN_START = '<span';
let TAG_SPAN_CLOSE = '</span>';
let P_START = '<p>';
let P_END = '</p>';
count = (inputString, searachString) => {
inputString += '';
//searachString += '';
if (searachString.length <= 0) {
return 0;
}
... |
C | UTF-8 | 273 | 3.40625 | 3 | [] | no_license | #include "holberton.h"
#include <stdio.h>
/**
* main - print program name
* @argc: number of arguments
* @argv: arguments (string)
*
* Return: 0 on Success
*/
int main(int argc, char **argv)
{
if (argc)
{
argc--;
printf("%s\n", argv[argc]);
}
return (0);
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.