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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 1,264 | 2.515625 | 3 | [] | no_license | import 'winston-daily-rotate-file';
import * as fs from 'fs';
import * as path from 'path';
import * as winston from 'winston';
// make a logs directory if it does not exists
const logsDir = path.resolve('.', 'logs');
if (!fs.existsSync(logsDir)) fs.mkdirSync(logsDir);
// set max log level
const level = process.env.... |
PHP | UTF-8 | 694 | 2.796875 | 3 | [] | no_license | <?php
/**
* Account.php
* Date: 13.01.2017
* Time: 10:14
* Author: Maksim Klimenko
* Email: mavsan@gmail.com
*/
namespace AmoCRM;
class Account
{
protected static $_accountInfo;
/**
* Получение информации о учетной записи в AmoCRM
*
* @param \AmoCRM\Handler $handler инициализированн... |
C++ | UTF-8 | 812 | 2.703125 | 3 | [] | no_license | #ifndef TREEITEM_H
#define TREEITEM_H
#include <QList>
#include <QVariant>
#include <QStringList>
#include <QModelIndex>
class TreeItem
{
public:
explicit TreeItem(TreeItem *parent = nullptr);
TreeItem(const QVariantList& data,TreeItem *parent = nullptr);
~TreeItem();
void appendChild(TreeItem *chil... |
C++ | UTF-8 | 207 | 2.578125 | 3 | [] | no_license | #include <cstdio>
#include <cassert>
#include <cstdlib>
int main (int argc, char **argv) {
assert (argc == 2);
int n = atoll (argv[1]);
printf ("square of %d is %d\n", n, n * n);
return 0;
} |
Shell | UTF-8 | 1,979 | 2.921875 | 3 | [
"BSD-3-Clause",
"GPL-2.0-or-later"
] | permissive | #!/bin/bash
export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
export CFLAGS="-w $CFLAGS"
export CXXFLAGS="-w $CXXFLAGS"
export CPPFLAGS="$CPPFLAGS -I$PREFIX/include"
#export SAGE_FAT_BINARY=yes
export SAGE_LOCAL="$PREFIX"
export SAGE_PKGS=`pwd`/build/pkgs
export SAGE_CYTHONIZED=`pwd`/build/cythonized
export SAGE... |
Java | UTF-8 | 1,099 | 1.953125 | 2 | [] | no_license | package me.znzn.tools.module.blog.service;
import me.znzn.tools.module.blog.entity.form.SubscribeManageForm;
import me.znzn.tools.module.blog.entity.po.Eid;
import me.znzn.tools.module.blog.entity.po.Subscribe;
import java.util.List;
/**
* @author zhuzening
* @version 1.0
* @since 2021/8/5
*/
public interface Su... |
C | UTF-8 | 2,567 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#define LEN 64
void sendMessageSocket(char* hostname, char* str, int port)
{
struct hostent *hp;
int s, rc, len;
struct sockaddr_in sin;
... |
Java | UTF-8 | 1,943 | 2.71875 | 3 | [] | no_license | package com.ogresolutions.kaogire.smarthouse.objects;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by Njuguna on 4/26/2016.
*/
public class Notice {
int id;
String houseNo;
String title;
String body;
Date timeUp;
boolean seen;
// ... |
C++ | UTF-8 | 577 | 3.25 | 3 | [
"MIT"
] | permissive | #include "header.hpp"
class Solution
{
public:
vector<int> sortedSquares(vector<int> &A)
{
int l = 0;
int r = A.size() - 1;
vector<int> res(r + 1);
int i = r;
while (l <= r)
{
int l_square = A[l] * A[l];
int r_square = A[r] * A[r];
... |
C# | UTF-8 | 3,850 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
namespace NotificationLam... |
C++ | UTF-8 | 1,795 | 3.53125 | 4 | [] | no_license | //2020.09.20_#0_官方解法
//注意后期学会unordered_map的旧C遍历法
class Solution {
private:
string returnHash(string str) {
int counter[26] = {0};
string hashString;
for (int i = 0; i < str.size(); i++) {
counter[str[i] - 'a']++;
}
for (int i = 0; i < 26; i++) {
has... |
Java | UTF-8 | 726 | 2.671875 | 3 | [] | no_license | package valiant.aop.springaspect;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import valiant.aop.Apology;
public class Test {
public static void main(String[] args) {
ApplicationContext applicationContext =
new ClassPath... |
JavaScript | UTF-8 | 10,492 | 2.890625 | 3 | [
"MIT"
] | permissive | /* MEDIA LIBRARY MODAL */
function MediaLibrary (getter, setter, token)
{
// Set up vars
this.filesToUpload = [];
// The URLs we need to get the media from and upload
this.getterURL = getter;
this.setterURL = setter;
// Laravel CSRF-token
this.token = token;
// Will be overwritte... |
Python | UTF-8 | 2,028 | 4.0625 | 4 | [] | no_license | toDoList = []
# store dictionaries in a list
# make dictionary(ies) +
# delete something on a list
# add something to a list +
# view everything on the list
# have a way to quit
# can't stop won't stop until Q :check
# MAKE THEM IN FUNCTIONS check in progress
def introduction():
displayMessage = """\n
Welcom... |
Swift | UTF-8 | 1,097 | 2.921875 | 3 | [] | no_license | //
// PokemonAbility.swift
// PokeApi
//
// Created by Felipe Ramos on 13/03/21.
//
import Foundation
import Unrealm
struct PokemonAbility: Decodable, Realmable {
//Whether or not this is a hidden ability
var is_hidden: Bool = false
//The slot this ability occupies in this Pokémon species
var slot:... |
PHP | UTF-8 | 975 | 3.125 | 3 | [] | no_license | <?php
class Region
{
public $id = null;
public $name = null;
public $slug = null;
public function __construct($name, $slug)
{
$this->name = $name;
$this->slug = $slug;
}
// Setters
public function setName($param)
{
$this->name = $param;
}
pu... |
Python | UTF-8 | 1,038 | 2.859375 | 3 | [] | no_license | import urllib2
import json
import time
def get_minute_avg_query(uuid, starttime, endtime, width=1):
# def dont call this (or any of these functions) with more than a
# couple hour difference between start time and end time. Smap will
# only look at about 10,000 samples.
return get_smap_query(uuid, "minute", star... |
Java | UTF-8 | 989 | 2.265625 | 2 | [] | no_license | package poc.rabbitmq.service;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import poc.rabbitmq.model.Payment;
import static java.util.Objects.*;
@Service
public class PaymentPublisherService {
... |
Java | UTF-8 | 151 | 2.140625 | 2 | [] | no_license | package abstractFactory;
public class City extends Auto {
public City (AutoParts autoParts) {
this.autoParts = autoParts;
}
}
|
C | UTF-8 | 609 | 2.5625 | 3 | [] | no_license | // SAMIP JASANI 2015A7PS0127P
#ifndef TREE_H
#define TREE_H
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
typedef struct node node;
extern const char keys1[][30];
extern const char keys2[][15];
typedef node *Node;
struct node
{
bool isterminal;
void *data;
Node child;
Node parent;
Nod... |
PHP | UTF-8 | 1,026 | 2.765625 | 3 | [] | no_license | <?php
$hostname = "localhost";
$username = "root";
$password = "0000";
$dbname = "margo";
$output;
$error;
$conn = mysqli_connect($hostname, $username, $password, $dbname);
$username = $_POST['username'];
$event_action = $_POST['event_action'];
$statement = "practice001.exe " . $username . " "... |
Java | UTF-8 | 1,553 | 2.9375 | 3 | [] | no_license | package utilities;
import java.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ValidatorOfData {
private static final int PASSWORD_MIN_LENGTH = 6;
public static Boolean validateData(String data){
//TODO
return true;
}
publi... |
Java | UTF-8 | 396 | 1.929688 | 2 | [] | no_license | package com.PJ.Shipping.Repository;
import com.PJ.Shipping.Entity.Operation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@RepositoryRestResource
public
interface OperationRepository extends JpaRepository<Operation, Long... |
Java | UTF-8 | 7,550 | 1.945313 | 2 | [] | no_license | package org.fxp.android.market.worker.frame.master;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security... |
Shell | UTF-8 | 987 | 3.953125 | 4 | [] | no_license | #!/bin/bash
USAGE() {
echo USAGE:
echo "$0"
exit 1
}
if [ $# -lt 0 ];then
USAGE
fi
cd $(dirname $0)
number_of_tries=0
done=0
if ! sudo xm list > node_list; then
exit 1
fi
for (( i=0; i<100; i++ )); do
if [ "`grep -w "node-${i}" node_list`" == "" ]; then
echo node-$i is not running.
nodeno=$... |
JavaScript | UTF-8 | 1,984 | 2.796875 | 3 | [] | no_license |
// bookmark values
var chr = "chrome";
var dwy = "dewey";
// bookmark URLs
var chromeBM = "chrome://bookmarks";
var deweyBM = "chrome-extension://aahpfefkmihhdabllidnlipghcjgpkdm/app.html#/main";
// URL to use
var bmURL = " ";
// callback function
var setBM = function(bm) {
// set bookmarks URL to chrome or chos... |
JavaScript | UTF-8 | 2,985 | 3.78125 | 4 | [] | no_license |
// if ( condition ) {
// }
// var age = prompt("What is your age?");
// var cash = prompt("How much money do you have?");
// var drinks = prompt("How many drinks have you had already?");
// if (age >= 18) {
// if (drinks >= 5) {
// if (cash > 7) {
// console.log("You can drink!");
// }
// else if (cash >... |
Python | UTF-8 | 334 | 3.28125 | 3 | [] | no_license | import Stack
def convert2binary(num):
rem = Stack.Stack()
result = ''
while num > 0:
remainer = num % 2
num = num // 2
rem.push(remainer)
while rem.is_empty() != 1:
result += str(rem.peek())
rem.pop()
return result
print conve... |
JavaScript | UTF-8 | 645 | 4.09375 | 4 | [] | no_license | const palindrome = (str) => {
let loweredWord = str.toLowerCase();
let originalWord = loweredWord.replace(/[^0-9a-z]/gi, '')
console.log(originalWord)
let splitWord = originalWord.split("")
let reversedArr = splitWord.reverse()
let reversedWord = reversedArr.join("")
console.log(reversedWord)
... |
C++ | UTF-8 | 925 | 2.75 | 3 | [] | no_license | /**
@author Nathan
*/
#ifndef RENDERER_H
#define RENDERER_H
#include <vector>
#include "RenderLayer.h"
#include "TextureList.h"
#include "ModelRemovalToken.h"
class Renderer
{
private:
bool m_bIsRendering;
TextureList* m_textureList;
ModelList* m_modelList;
std::vector<RenderLayer> m_renderLayers;
protec... |
C++ | UTF-8 | 998 | 2.875 | 3 | [] | no_license | // https://leetcode.com/problems/baseball-game/
// Easy
class Solution {
public:
stack<int>st;
int popData() {
int temp = 0;
if(!st.empty()) { temp = st.top(); st.pop(); }
return temp;
}
int calPoints(vector<string>& ops) {
int... |
Python | UTF-8 | 406 | 3.484375 | 3 | [] | no_license | prime = [True] * 10000001 # 소수이면 True
def sieve():
prime[1] = False
for n in range(2, 10000001):
if prime[n]: # n 가 소수인경우
for m in range(n + n, 10000001, n):
prime[m] = False
sieve()
N = int(input())
for i in range(2, N+1):
if(N == 1):
break
if prime[i]:... |
Java | UTF-8 | 2,386 | 3.03125 | 3 | [] | no_license | import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Choice;
import java.awt.Frame;
import java.awt.Label;
import java.awt.Panel;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class Notes extends... |
Python | UTF-8 | 4,482 | 2.75 | 3 | [
"MIT"
] | permissive | # modificare.py
from pip._vendor.distlib.compat import raw_input
import dbConnection
def MeniuModificaCarte():
print("===============================")
print("Modificare inregistrare in baza de date:")
print("===============================")
titluCarte = raw_input("\n Introduceti titlul cartii pe c... |
C++ | UTF-8 | 400 | 2.734375 | 3 | [] | no_license | #include "Arduino.h"
#include "Raindrop.h"
#define NUM_LEDS 150
#define LOWER_HUE 140
#define UPPER_HUE 210
Raindrop::Raindrop() {
pos = random(0, NUM_LEDS - 1);
hue = random(LOWER_HUE, UPPER_HUE);
}
int Raindrop::updatePos() {
pos--;
if (pos < 0) {
pos = random(NUM_LEDS,NUM_LEDS*2);
hue = random(LOWE... |
C# | UTF-8 | 3,938 | 3 | 3 | [] | no_license | using System;
using System.Linq;
namespace MvcJqGrid.Example.Models
{
public class Repository
{
private readonly AdventureWorksDataContext _dataContext = new AdventureWorksDataContext();
public int CountCustomers(GridSettings gridSettings)
{
var customers = _dataContext.Cu... |
Python | UTF-8 | 685 | 2.703125 | 3 | [] | no_license | from kivy.lang import Builder
from kivy.app import App
from kivy.clock import Clock
from plyer import camera
class MyApp(App):
count = 0
def build(self):
import pygame
print 'pygame version:', pygame.ver
print 'SDL version:', pygame.get_sdl_version()
def on_pause(self):
pr... |
Swift | UTF-8 | 2,023 | 2.984375 | 3 | [] | no_license | //
// PostViewModel.swift
// Parrot
//
// Created by administrador on 26/07/19.
// Copyright © 2019 Treinamento. All rights reserved.
//
import Foundation
import RealmSwift
struct PostView {
var id = 0
var likes = 0
var user = User()
var message = ""
}
class PostViewModel {
static func save(p... |
Markdown | UTF-8 | 9,874 | 2.953125 | 3 | [
"Beerware"
] | permissive | # Créer un formulaire de demande de devis avec l'API de son site Kiubi
## Introduction
Ce dépôt est un tutoriel qui explique comment utiliser l'API de son site [Kiubi](http://www.kiubi.com) pour créer un formulaire de demande de devis.
L'objectif étant d'intégrer de façon automatique le contenu du panier de l'inter... |
PHP | UTF-8 | 329 | 2.78125 | 3 | [] | no_license | <?php
namespace sat8bit\RoombaSim\Roomba;
interface RoombaAIInterface
{
/**
* when hit.
*
* @param int $distance
* @return Motion
*/
public function hit($distance);
/**
* when ran.
*
* @param int $distance
* @return Motion
*/
public function ran($dist... |
C++ | UTF-8 | 2,890 | 3.15625 | 3 | [] | no_license | // BEGIN CUT HERE
/*
SRM 653 Div2 Medium (500)
問題
-N回じゃんけんする
-勝つと1ポイントもらえる
-ちょうどscoreポイント稼ぐ場合の数を求める
*/
// END CUT HERE
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstring>
using namespace std;
typedef long long LL;
#define COMBSZ 2048
#define MOD 100000... |
Java | UTF-8 | 270 | 1.742188 | 2 | [
"MIT"
] | permissive | package pl.tycm.fes.controller.service;
import pl.tycm.fes.model.ManualFileExchange;
public interface ManualFileExchangeService {
public void startManualFileExchange(ManualFileExchange manualFileExchange);
public void stopManualFileExchange(Long id);
}
|
PHP | UTF-8 | 2,384 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\JsonResponse;
use Illuminate\Validation\ValidationException;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;
class StoreBookValidation extends FormRequest
{
/**... |
Python | UTF-8 | 8,153 | 3.796875 | 4 | [] | no_license | # search.py
# ---------
# Licensing Information: Please do not distribute or publish solutions to this
# project. You are free to use and extend these projects for educational
# purposes. The Pacman AI projects were developed at UC Berkeley, primarily by
# John DeNero (denero@cs.berkeley.edu) and Dan Klein (klein@cs.be... |
Python | UTF-8 | 1,590 | 3.28125 | 3 | [] | no_license | import face_recognition
import os
pictures = [f for f in os.listdir() if f.endswith('jpg')]
# Load all the images of those people who are known to us and calculate their face encodings
image_known_1 = face_recognition.load_image_file('person_1.jpg')
image_known_2 =face_recognition.load_image_file('person_2.jpg')... |
Java | UTF-8 | 1,922 | 2.265625 | 2 | [] | no_license | package com.example.paytusker.Adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import com.example.paytusker.R;
publ... |
Python | UTF-8 | 616 | 4.0625 | 4 | [] | no_license | #递归式生成器:解决多层嵌套列表
"""
在生成器开头进行检查。要检查对象是否类似于字符串,简单、 快捷的方式是,尝
试将对象与一个字符串拼接起来,并检查这是否会引发TypeError异常
"""
def flatten(nested):
try:
# 不迭代类似于字符串的对象:
try: nested + ''
except TypeError: pass
else: raise TypeError
for sublist in nested:
for element in flatten(sublist):
... |
Markdown | UTF-8 | 2,039 | 3.28125 | 3 | [
"MIT"
] | permissive | ---
title: Logic Blocks
---
# Logic Blocks
MPF config files include the concept of "logic blocks" which let you
perform logic when certain events occur. Logic blocks can be thought of
as the "glue" that ties together all the different shows, shots,
achievements, and other parts of your game logic.
There are four ty... |
SQL | UTF-8 | 1,842 | 3.53125 | 4 | [] | no_license | CREATE TABLE hd_attr (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
name char(10) NOT NULL DEFAULT '',
color char(10) NOT NULL DEFAULT '',
PRIMARY KEY (id)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
CREATE TABLE hd_blog (
id int(10) unsigned NOT NULL AUTO_INCREMENT,
title varchar(30) NOT NULL DE... |
Java | UTF-8 | 3,927 | 2.40625 | 2 | [
"MIT"
] | permissive | /*
* This file is part of jHDF. A pure Java library for accessing HDF5 files.
*
* http://jhdf.io
*
* Copyright (c) 2023 James Mudd
*
* MIT License see 'LICENSE' file
*/
package io.jhdf;
import io.jhdf.api.Group;
import io.jhdf.api.Node;
import io.jhdf.api.NodeType;
import io.jhdf.exceptions.HdfInvalidPathExcep... |
Shell | UTF-8 | 582 | 3.234375 | 3 | [
"MIT"
] | permissive | # vim: ft=sh
dot_edit() {
# init
if [ ! -e "${dotlink}" ]; then
echo "$(prmpt 1 empty)$(bd_ ${dotlink})"
if __confirm y "make dotlink file ? " ; then
echo "cp ${DOT_SCRIPT_ROOTDIR}/examples/dotlink ${dotlink}"
cp "${DOT_SCRIPT_ROOTDIR}/examples/dotlink" "${dotlink}"
else
echo "Aborted.... |
Java | UTF-8 | 695 | 2.453125 | 2 | [
"MIT"
] | permissive | package org.sparky.model.builders;
import org.sparky.model.Filter;
import org.sparky.model.Rule;
import java.util.HashMap;
import java.util.Map;
/**
* Created by lloyd on 19/10/2015.
*/
public class FilterBuilder {
private VariableBuilder left;
private VariableBuilder right;
public FilterBuilder with... |
Java | UTF-8 | 761 | 2.28125 | 2 | [
"MIT"
] | permissive | package com.automation.pages;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import com.automation.core.SeleniumPageBase;
import com.automation.elements.PageElement;
public class LoginPage extends PageElement{
public static PageElement UsernameTextField... |
Java | UTF-8 | 12,833 | 2.125 | 2 | [] | no_license | /*
2019-2학기 전자상거래 최종 프로젝트
@12163786 장현수
@12161652 정명현
@12162892 김지은
*/
/*
MainActivity -> 일반 소비자 계정으로 접속하였을 때 만나게 되는 페이지.
소비자는 사이트 별로 주문을 넣거나, 현재 우리 대학 사람들이 특정 사이트에 얼마 만큼의 주문을 넣었는지를 확인 할 수 있다.
또한 주문이 들어간 물품에 대해서는 결제를 진행할 수 있다.
*/
package com.example.ecommerce;
import android.content.Context;
import android.content.I... |
C | UTF-8 | 1,837 | 3.953125 | 4 | [] | no_license | #include <stdio.h>
#include <math.h>
int bestPrize(int N) {
int i;
int bp = 0;
for (i=0; i<N; i++) {
bp += pow(2, i);
}
return bp;
}
void binary(int N, char* bString) {
int i=0;
// Fill bString with a backward binary representation
while (N) {
if (N & 1) { // as long as the bitwise AND does not give '00... |
Markdown | UTF-8 | 357 | 2.6875 | 3 | [] | no_license | # ivanchiou.github.io
## This is my first personal website.
### The website structure:
- Home
- Team Members
- Projects
- More items
<p align="center">
<img src="images/website_preview.png" alt="website-preview">
</p>
### Git commands I used:
```
git clone https://github.com/username/repository-name
git add .
git ... |
C++ | UTF-8 | 5,431 | 2.84375 | 3 | [] | no_license | #pragma once
#include "graph.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <optional>
#include <unordered_map>
#include <utility>
#include <vector>
namespace Graph
{
template< typename Weight >
class Router
{
private:
using Graph = DirectedWeight... |
Java | UTF-8 | 10,867 | 1.78125 | 2 | [] | no_license | package com.example.veradebora.dds.ui;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.... |
Python | UTF-8 | 314 | 2.609375 | 3 | [] | no_license | import requests
def main():
params = {
'q':'python',
}
url = 'https://qiita.com/search/'
r = requests.get(url,params=params)
event_info = r.json()
for event in event_info['events']:
print(event['title'])
# print (event_info)
if __name__ == '__main__':
main()
|
Markdown | UTF-8 | 944 | 2.765625 | 3 | [] | no_license | # Classes in C++
This project creates and tests shape classes in C++.
### Description
C++ header and source files that define and implement several shape classes. The code is tested by running the test.cpp source file.
### Required Libraries and Dependencies
No required Libraries or external dependencies to run this ... |
C# | UTF-8 | 1,111 | 3.328125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using StoreLibrary;
namespace Example01
{
internal class Program
{
private static void Main(string[] args)
{
Product product = new Product();
Console.Writ... |
SQL | UTF-8 | 1,912 | 3.171875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 01, 2018 at 07:15 PM
-- Server version: 5.7.19
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
TypeScript | UTF-8 | 465 | 2.546875 | 3 | [] | no_license | export interface Article {
key?: string;
title: string;
category: string;
topic: string;
date: number;
lastModifiedDate: number;
hebrewDate: string;
sections: ArticleSection[];
isActive: boolean;
}
export interface ArticleSection {
header?: string;
content: string;
sourc... |
Java | UTF-8 | 6,991 | 1.875 | 2 | [
"MIT"
] | permissive | /*
* The MIT License (MIT)
*
* Copyright (c) 2015 NBCO Yandex.Money LLC
*
* 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 rights
... |
C++ | UTF-8 | 1,132 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
//字面值常量类
/*
1. 数据成员都是字面之类型的聚合类,是字面值常量类
2. 数据成员都是字面值类型;至少含有一个constexpr构造函数;
如果数据成员含有类内初始值,则初始值是常量表达式;
如果成员属于某种类类型,则初始值必须使用成员自己的constexpr构造函数;
类必须使用析构函数的默认定义;
3. constexpr构造函数体一般是空的;
*/
class Debug {
public:
//constexpr构造函数必须初始化所有成员
constexpr Debug(bool b = true): hw(b)... |
Python | UTF-8 | 424 | 2.953125 | 3 | [] | no_license | # PIL(Python Image Library) 객체 활용
from io import BytesIO
from picamera import PiCamera
from PIL import Image
stream = BytesIO()
camera = PiCamera()
print(camera.resolution) # 기본 해상도 확인
camera.rotation = 180 # 180도 회전
camera.capture(stream, format='jpeg')
stream.seek(0) # rewind
image = Image.o... |
Java | UTF-8 | 1,995 | 2.609375 | 3 | [] | no_license | package com.household.pojo;
public class OperationRecords {
private Integer operationId;
private String operationObject;
private String operationBehavior;
private String dataLast;
private String dataNow;
public Integer getOperationId() {
return operationId;
}
... |
PHP | UTF-8 | 7,143 | 2.796875 | 3 | [] | no_license | <?php
class SessionControl {
public static function start_session($user_id, $user_firstname, $user_secondname, $user_lastname, $user_email, $user_password, $user_phone, $user_gender, $user_is_active, $user_kind, $user_creation_date, $user_image) {
// Verificamos que no esté iniciada otra sesi... |
Java | UTF-8 | 1,347 | 2.546875 | 3 | [] | no_license | package com.zadi.zadi.utils;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import com.zadi.zadi.R;
public class DialogUtils {
public static AlertDialog showAlertDialog(Context context, String message,
... |
Markdown | UTF-8 | 2,072 | 2.578125 | 3 | [] | no_license | ### Instalar OpenSSH:
* Ejecutar Powersherll con permisos de administrador
* Verificar si OpenSSH server y client están instalados
~~~
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
~~~
> Nota: si dice ***NotPresent*** significa que no está instalado
* Instalar OpenSSH client si no se ha instalad... |
C# | UTF-8 | 3,704 | 2.796875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using SirLibCore.Data;
using SirLibCore.Utilities;
namespace Solum
{
public class Qds_Setting_Sp
{
#region Fields
protected string connectionStringName;
#endregion
#region Constructors
public Qds_Setting_Sp... |
C++ | UTF-8 | 2,362 | 3.21875 | 3 | [
"MIT"
] | permissive | #if !defined (CLUSTER_H)
#define CLUSTER_H
//------------------------------------
// (c) Reliable Software 1997
//------------------------------------
// A cluster of lines that were moved together
class Cluster
{
public:
Cluster (): _len (0) {}
Cluster (int oldLineNo, int newLineNo, int len = 1)
: _oldLineNo (ol... |
TypeScript | UTF-8 | 1,782 | 3.15625 | 3 | [
"MIT"
] | permissive | export type Plat = {
exit: (code: number) => never
stdout: {
write: (out: string) => void
}
args: string[]
}
const PLAT = {} as Plat
const print = (output: string): void => {
PLAT.stdout.write(output)
}
const println = (output: string): void => {
print(output + '\n')
}
const exit = (... |
Java | UTF-8 | 464 | 1.65625 | 2 | [] | no_license | package modelo;
public interface InterrogaModelo {
public String[][] getClientes();
public String[][] getLlamadas(String text);
public String[][] getFacturas(String text);
public String[][] getClientesEntreFechas(String inicio, String fin);
public String[][] getLlamadasEntreFechas(String NIF, String inicio,... |
Java | UTF-8 | 4,876 | 1.601563 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; y... |
Java | UTF-8 | 833 | 2.171875 | 2 | [] | no_license | package br.com.tavares.clockinout.clockinout.v1.facade;
import br.com.tavares.clockinout.clockinout.facade.TimeFacade;
import br.com.tavares.clockinout.clockinout.v1.model.TimeRequest;
import br.com.tavares.clockinout.clockinout.v1.model.TimeResponse;
import org.springframework.stereotype.Component;
import static br.... |
Java | UTF-8 | 8,029 | 1.945313 | 2 | [] | no_license | package org.webdsl.serg.beans;
import java.util.*;
import java.io.Serializable;
import static javax.persistence.PersistenceContextType.EXTENDED;
import javax.persistence.PersistenceContext;
import javax.persistence.EntityManager;
import javax.faces.event.ValueChangeEvent;
import javax.ejb.Stateless;
import javax.ejb.S... |
PHP | UTF-8 | 3,570 | 2.96875 | 3 | [] | no_license | <?php
// Definition einer Klasse //
class BrowserDetective {
public $userAgent;
public $platform;
public $browserName;
public function __construct() {
$this->set_user_agent();
$this->reset();
}
public function set_user_agent() {
if (isset($_SERVER['HTTP_USER_AGENT'])... |
Python | UTF-8 | 839 | 3.21875 | 3 | [] | no_license | import pickle
def save_pickle(list_students):
file = open("Students.txt", 'wb')
pickle.Pickler(file).dump(list_students)
file.close()
def load_pickle():
file = open("Students.txt", 'rb')
list_students = pickle.Unpickler(file)
list_s = list_students.load()
file.close()
return list_s
... |
PHP | UTF-8 | 3,009 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | <?php
// Copyright 2012-present Nearsoft, Inc
// 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 ... |
Swift | UTF-8 | 399 | 3.140625 | 3 | [] | no_license | //: Playground - noun: a place where people can play
import UIKit
class DatabaseConnection {
init() {
print("New Database is up and running!")
}
func execute(statement: String) {
print("EXECUTE: \(statement)")
}
}
class DataStore {
lazy var connection = DatabaseConnection()
}... |
PHP | UTF-8 | 9,260 | 2.515625 | 3 | [] | no_license | <?php
session_start();
$_SESSION['page']='Add_Contest';
date_default_timezone_set('Asia/Kolkata');
$currentdatetime=date_create(date('Y-m-d'));
$result = $currentdatetime->format('Y-m-d h:i');
// Check if image file is a actual image or fake image
if(isset($_POST["submit"])) {
$t... |
TypeScript | UTF-8 | 1,828 | 3.71875 | 4 | [
"MIT"
] | permissive | import { OptSpace } from "./stringAliases";
export type integer = number;
export type int32 = number;
export type int64 = number;
export type float = number;
export type NumericCharacter = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
export type Hexadecimal = NumericCharacter | "A" | "B" | "C" | "D" | "... |
C++ | UTF-8 | 11,783 | 2.6875 | 3 | [
"BSD-3-Clause"
] | permissive | /*=========================================================================
Module: VerdictVector.hpp
Copyright 2003,2006,2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
Under the terms of Contract DE-NA0003525 with NTESS,
the U.S. Government retains certain rights in this software... |
Python | UTF-8 | 1,968 | 3.046875 | 3 | [] | no_license |
from __future__ import print_function, division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import MultinomialNB
from sklearn.svm import... |
C++ | UTF-8 | 1,900 | 2.734375 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <queue>
#include <cstring>
#include <utility>
using namespace std;
const int MAXN = 128;
const int INF = 0x3f3f3f3f;
typedef pair<int,int> pii;
bool operator < (const pii &a, const pii &b){
return (a.first > b.first) || (a.first == b.first && a.second > b.second);
}... |
SQL | UTF-8 | 459 | 2.984375 | 3 | [] | no_license | drop table if exists 'user';
create table 'user' (
'id' integer primary key autoincrement,
'name' text not null,
'username' text not null,
'password' text not null,
'c_password' text not null,
'email' text not null
);
drop table if exists 'fi';
create table 'fi' (
'id' integer primary key au... |
C++ | UTF-8 | 1,838 | 3.484375 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
#include <iostream>
#include <cstdio>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), n... |
Java | UTF-8 | 1,674 | 2.875 | 3 | [] | no_license | package interview_google.round08;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
public class Problem02 {
public boolean canFinish(int n, int[][] prerequisites) {
ArrayList<Integer>[] adj = new ArrayList[n];
for (int i = 0; i < n; i++) {
adj[i] = new A... |
C++ | UTF-8 | 6,055 | 3.03125 | 3 | [] | no_license | /*************************************************
Copyright (C), 2017.10.10-2017.10.13, Trunk Tech.
File name: pathFinder.h
Author: 薛崇 Version: 1.0 Date:2017.10.11
Description: path finder with A* algorithm
leader function is aStar()
check input using judge
... |
C++ | UTF-8 | 7,015 | 3.296875 | 3 | [] | no_license | /* Trigonometry_routine.cc */
struct Point {
double x,y,z;
};
void write_Point(Point P){
cout << P.x << " " << P.y << " " << P.z << "\n";
};
Point midpoint(Point P, Point Q){
Point R;
R.x=(P.x+Q.x)/2.0;
R.y=(P.y+Q.y)/2.0;
R.z=(P.z+Q.z)/2.0;
return(R);
};
double norm(Point P){
return(sqrt(P.x*P.x+P.y*P.y+P... |
PHP | UTF-8 | 3,806 | 2.65625 | 3 | [] | no_license | <?php
// index.php
//
// This is the server-side entry point to a Fusion application
//
// Having the entry point server-side instead of a client-side HTML page gives us the following
// benefits:
//
// 1. We save future requests to CreateSession.php and requesting the Application Definition resource as we can do tha... |
SQL | UTF-8 | 2,457 | 4 | 4 | [] | no_license | show processlist;
show databases;
use mysql;
show tables;
desc user;
## 使用create user创建新用户
create user 'jason'@'localhost' identified by '123456'; -- 若主机名为‘%’则表示对所有主机开放权限
select * from user where User='jason2';
## 避免使用明文指定用户密码
select password('123456');
create user 'jason1'@'localhost' identified by password '*6BB... |
Markdown | UTF-8 | 5,105 | 2.84375 | 3 | [
"MIT"
] | permissive | # Практическая работа №2 "Связные списки"
Реализуйте простой плейер с графическим интерфейсом. Предусмотрите
следующий функционал:
1) создание плейлиста;
2) удаление плейлиста;
3) добавление музыкальной композиции в плейлист;
4) удаление музыкальной композиции из плейлиста;
5) перемещение музыкальной композиции на дру... |
Markdown | UTF-8 | 1,546 | 3.15625 | 3 | [
"MIT"
] | permissive | # How To Stake Tokens
### Goal
Stake tokens for your account.
### Before you begin
* Install the currently supported version of `cleos`.
* Ensure the reference system contracts from `cyberway.contracts` repository is deployed and used to manage system resources.
* Understand the following:
* What is an [acc... |
Python | UTF-8 | 296 | 2.796875 | 3 | [] | no_license | def main():
n = int(input())
a = list(map(int,input().split()))
b = [0 for i in range(n + 1)]
a.sort()
ans = n
for i in range(n):
b[i + 1] = b[i] + a[i]
for i in range(1,n):
if b[i + 1] - b[i] > 2 * b[i]:
ans = n - i
print(ans)
main() |
C | UTF-8 | 4,677 | 2.515625 | 3 | [
"MIT"
] | permissive | #include <types.h>
#include <err.h>
#include <sys.h>
#include <c.h>
#include <mesg.h>
#include <proc0.h>
#include <stdarg.h>
#include <string.h>
#include <log.h>
#include <eth.h>
#include <ip.h>
#include <net_dev.h>
#include <net.h>
#include "net.h"
bool
arp_match_ip(struct net_dev *net,
uint8_t *ip_src,
uint8_t... |
Markdown | UTF-8 | 2,943 | 3.703125 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: "648. Replace Words"
date: 2019-03-07 17:24
author: Botao Xiao
categories: Leetcode
description:
---
## 648. Replace Words
### Question
In English, we have a concept called root, which can be followed by some other words to form another longer word - let's call this word successor. For examp... |
TypeScript | UTF-8 | 1,027 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | import {Message} from 'discord.js';
import {AkairoArgumentType, DiceCommand, DiceCommandCategories} from '../../structures/DiceCommand';
import {sum} from '../../util/reducers';
export default class AverageCommand extends DiceCommand {
constructor() {
super('average', {
aliases: ['average-numbers', 'avg-numbers'... |
JavaScript | UTF-8 | 1,619 | 3.359375 | 3 | [
"Apache-2.0"
] | permissive | //CORE JS FUNCTIONALITY
//Contains only the most essential functions for the theme. No jQuery.
// Get the header
const header = document.getElementById('header')
// Get the offset position of the navbar
const sticky = header.offsetTop
/* ======================================================================... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.