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 | 5,764 | 3.390625 | 3 | [
"MIT"
] | permissive | import { QueryValueError } from './error';
import { isPlainObject, isShallowEqual, isString, isNumber } from '../util/is';
import { clone } from '../util/clone';
/**
* Manage filters applied to a query.
* @public
*/
export class QueryFilter {
private _filters: Map<string, unknown> = new Map();
/**
* Retriev... |
PHP | UTF-8 | 833 | 2.578125 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateSkill extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('skill', function (Blue... |
Python | UTF-8 | 1,256 | 3.78125 | 4 | [] | no_license | """
0.就是调用这个又调用那个
1.横向关系用组合,纵向关系用继承
2.类对象在定义类后即产生了
3.方法会被属性替换掉
4.num count 是类属性,x,y是实例属性
5.方法是要绑定实例对象的,printBB 没有绑定
"""
class Cntnum():
num = 0
def __init__(self):
Cntnum.num += 1
def __del__(self):
Cntnum.num -= 1
def getNum(self):
return Cntnum.num
# a = Cntnum()
# b = Cn... |
Java | UTF-8 | 2,578 | 2.96875 | 3 | [] | no_license | package com.example.justingil1748.mobivity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import java.util.Stack;
/**
* Created by justingil1748 on 4/23/17.
*/
public class Game2 extends AppCo... |
C | UTF-8 | 1,584 | 3.546875 | 4 | [] | no_license | #include <stdio.h>
#define STACK_SIZE 1000
#define MAX_ROW 5
#define MAX_COL 5
struct path
{
int x;
int y;
};
struct path stack[STACK_SIZE];
typedef struct path item_t;
int esp = -1;
int maze[MAX_ROW][MAX_COL] = {
0, 1, 0, 0, 0,
0, 1, 0, 1, 0,
0, 0, 0, 0, 0,
0, 1, 1, 1, 0,
0, 0, 0, 1, 0,
};
void push(item_... |
JavaScript | UTF-8 | 633 | 2.53125 | 3 | [
"LicenseRef-scancode-public-domain",
"CC0-1.0"
] | permissive | import { state } from 'cerebral';
/**
* sets the state.showModal to whatever is pass in the factory function
*
* @param {string } showModal the value to set the modal to
* @returns {Function} the primed action
*/
export const setShowModalFactoryAction = showModal => {
/**
* sets the state.showModal to whatev... |
Java | UTF-8 | 484 | 2.515625 | 3 | [] | no_license | package fr.umontpellier.iut.dominion.cards.common;
import fr.umontpellier.iut.dominion.CardType;
import fr.umontpellier.iut.dominion.cards.Card;
import java.util.List;
public abstract class Victory extends Card {
public Victory(String name, int cost){
super(name,cost);
}
@Override
public Li... |
Java | UTF-8 | 5,705 | 2.25 | 2 | [] | no_license | package ekosh;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.PrivateKey;
i... |
Java | UTF-8 | 8,945 | 3.109375 | 3 | [] | no_license | package study_DateAndTime;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
import basic.Basic;
public class SimpleDateFormatTest extends Basic{
public static void main(String[] args){
try{
// test01();
// test011();
/... |
Java | UTF-8 | 967 | 3.953125 | 4 | [
"MIT"
] | permissive | package OOP_Part_1.Class;
//CLASS
public class ClassCar {
private int wheels;
private String color;
private String model;
private int doors;
//Setter methods
public void setColor(String color) {
this.color = color;
}
public void setModel(String model){
String modelChec... |
Java | UTF-8 | 1,761 | 2.34375 | 2 | [] | no_license | package stepDefinitions;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
import cucumber.api.java.en.Then;
import cucumber.api.junit.Cucumber;
import helper.DriverInitiation;
import cucumber.api.java.*;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import pageObjects.Cre... |
PHP | UTF-8 | 500 | 3 | 3 | [] | no_license | <?php
$values = [
"message" => "Hello world!",
"count" => 150,
"pi" => 3.14,
"status" => false,
"result" => null
];
$count = 3;
$price = 9.99;
$data = [$count, $price];
$articles = [
["title" => "First post", "content" => "This is the first post"],
["title" => "Another post"... |
C# | UTF-8 | 4,603 | 2.890625 | 3 | [] | no_license | using System;
using System.ComponentModel;
using System.Linq;
using System.Windows.Forms;
namespace Impresso_Expresso
{
/// <summary>
/// <author>Stefan Tropčić</author>
/// </summary>
public partial class FrmSkladiste : Form
{
private enum opcijeSort { ID, AZ, ZA, Najskuplji, Najjeftiniji... |
Python | UTF-8 | 2,029 | 4.25 | 4 | [] | no_license | # __call__ dunder method............................................
class Printing:
def __init__(self,name):
self.name = name
def __call__(self):
print("enter user name is : ", self.name)
p = Printing("Rakib")
p()
# simple decorator......................................................
... |
Java | UTF-8 | 1,928 | 2.3125 | 2 | [] | no_license | package az.course.web;
import az.course.dao.UserDao;
import az.course.dao.UserDaoImpl;
import az.course.model.Student;
import az.course.service.UserService;
import az.course.service.UserServiceImpl;
import az.course.util.Security;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException... |
Python | UTF-8 | 4,178 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | #! /usr/bin/env python
import logging
import collections
from typing import Dict, List
class TrieNode:
def __init__(self):
self.children: Dict[str, TrieNode] = {}
self.is_word: bool = False
class Trie:
def __init__(self, is_case_sensitive=False):
self.root: TrieNode = TrieNode()
... |
Python | UTF-8 | 1,341 | 2.875 | 3 | [] | no_license | import sys,os
class PollObject:
def __init__(self, abbr, points):
self.points = points
self.abbr = abbr
# UD = 0, Trump = 1, Biden = 2
self.cand = 0
self.obj = {}
states = {}
def getAllStates():
all_states = open('states.csv', 'r').readlines()
for state in all_stat... |
Python | UTF-8 | 213 | 4.09375 | 4 | [] | no_license | s = input("Enter any string: ")
#take input from user
x = s.split()
#use split method to split at whitespaces
x.reverse()
#reverse all the elements of the string
print(' '.join(x))
#concatenate them into a string |
Markdown | UTF-8 | 910 | 3.046875 | 3 | [] | no_license | ---
id: editable-text
title: 文本制作规则
---
---
### 文本相关的制作规则:
#### 1. 不可编辑文本建议转换为形状图层做(右键从文字创建形状); 如果使用了非指定的特殊字体,想要保留字体效果也需要转换成形状图层。 <br/>
#### 2. 可编辑文本(即文本内容有被替换的需求)用文本图层制作。 <br/>
#### 3. 关于换行和缩小————用户输入文本较多时: <br/>
- 如果不需要自动换行和缩小,则用点文本制作(并设置想要的对齐方式)。 <br/>
- 如果需要自动换行和缩小字号,则用框文本制作,pag会在框内自动换行和缩小字号。 <br/>
- 如果只需要... |
C++ | UTF-8 | 1,079 | 3.59375 | 4 | [] | no_license | #include <iostream>
using namespace std;
int lectura (int n){
if (n==0 or n==1 or n==2 or n==3 or n==4 or n==5 or n==6 or n==7 or n==8 or n==9){
if (n==0)
cout << "El numero es : " << "cero" ;
if (n==1)
cout << "El numero es : " << "uno" ;
if (n==2)
... |
Markdown | UTF-8 | 4,379 | 2.953125 | 3 | [] | no_license | ---
description: "Simple Way to Make Perfect Banana ice cream with frozen raspberries"
title: "Simple Way to Make Perfect Banana ice cream with frozen raspberries"
slug: 137-simple-way-to-make-perfect-banana-ice-cream-with-frozen-raspberries
date: 2020-04-15T17:53:01.385Z
image: https://img-global.cpcdn.com/recipes/534... |
Java | UTF-8 | 977 | 2.6875 | 3 | [] | no_license | package test.optimizingfetching;
import java.util.List;
import model.Users;
import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.criterion.Order;
import dao.UsersDAO;
public class PagingResult {
public static void main(String[] args) {
Us... |
Shell | UTF-8 | 497 | 3.484375 | 3 | [] | no_license | #!bin/bash
#usage : sh makeBigBeds.sh <directory name>
#converts all bed files in directory $1 to bigBeds
for filename in $1/*.bed; do
echo "processing $filename..."
awk -F, '{$1="chr"$1;print $0}' OFS=, $filename | sed 's/chrdmel_mitochondrion_genome/chrM/g' | sort -k1,1 -k2,2n > $filename.chr.bed
bedToB... |
Python | UTF-8 | 497 | 3.4375 | 3 | [] | no_license | import os
print("When you input path please write it with in forward slash in place of blackslash, Thank you.")
path = input("Give your path: ")
name = input("new file name: ")
type = input("the file's type")
def main():
i = 0
dest = path
for filename in os.listdir(dest):
my_dest = name... |
Ruby | UTF-8 | 96 | 2.9375 | 3 | [] | no_license | class NumberGames
def self.next_odd_number (number)
return number + number%2 + 1
end
end |
Java | UTF-8 | 7,487 | 1.703125 | 2 | [] | no_license | package com.tappx.a;
import android.content.Context;
import android.os.Build;
import android.util.DisplayMetrics;
import android.view.WindowManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import java.lang.reflect.Constructor;
import java.util.Locale;
import java.util.concurrent.CountDownLatc... |
Markdown | UTF-8 | 871 | 2.78125 | 3 | [
"MIT"
] | permissive |
# Precision Sawmill
Addition
------
```java
mods.mekanism.sawmill.addRecipe(IItemStack inputStack, IItemStack outputStack, @Optional IItemStack bonusOutput, @Optional double bonusChance)
mods.mekanism.sawmill.addRecipe(<minecraft:bow>, <minecraft:stick> * 3, <minecraft:string> * 3, 0.5);
mods.mekanism.sawmill.addReci... |
C | UTF-8 | 769 | 2.59375 | 3 | [] | no_license | /* emulator.h
* Jason Iskenderian and Alexa Bosworth
* 11/16/17
* Provides definitions and headers for the Emulator Module
*/
#ifndef EMULATOR_INCLUDED
#define EMULATOR_INCLUDED
#define T Emulator_T
typedef struct T *T;
#include <stdio.h>
/* run
* Purpose: Runs the um on the provided file
* Arguments: Emulato... |
Ruby | UTF-8 | 269 | 3.328125 | 3 | [] | no_license | require 'pry'
def solution(number)
arry = []
counter = 0
number = number - 1
number.times do
counter += 1
if counter % 3 == 0 || counter % 5 == 0
arry << counter
end
end
arry.sum
end
p solution(10)
p solution(20)
p solution(200)
|
Python | UTF-8 | 543 | 2.96875 | 3 | [] | no_license | import matplotlib.pyplot as plt
from skimage import measure,data,color
#生成二值测试图像
img=color.rgb2gray(data.horse())
#检测所有图形的轮廓
contours = measure.find_contours(img, 0.5)
#绘制轮廓
fig, axes = plt.subplots(1,2,figsize=(8,8))
ax0, ax1= axes.ravel()
ax0.imshow(img,plt.cm.gray)
ax0.set_title('original image')
rows,cols=img.s... |
JavaScript | UTF-8 | 1,947 | 2.5625 | 3 | [] | no_license | (function(){
$.fn.cProgress = function(){
var $ct2 = $('.ct2'),
$art = $ct2.find('article'),
/*$ct3 = $('.ct3'),
$art2 = $ct3.find('article'),*/
num = 0,
per = 0,
leftDeg = 180,
rightDeg = 0,
nowDeg = 0;
//선택된 요소의 갯수에 따라 각각 적용될 함수를 실행
$art.each(function(i){
num = $('#p... |
Java | UTF-8 | 18,074 | 2.84375 | 3 | [] | no_license | /**
* Created on 09.11.2002
*
* To change this generated comment edit the template variable "filecomment":
* Window>Preferences>Java>Templates. To enable and disable the creation of file
* comments go to Window>Preferences>Java>Code Generation.
*/
package ru.myx.ae3.help;
import java.math.RoundingMode;
import j... |
Markdown | UTF-8 | 2,386 | 2.953125 | 3 | [] | no_license | # PHP Telegram Bot
A simple code to create a bot to telegram application
This bot was created with colaboration of [LeonelF](https:/LeonelF)
**The host must support HTTPS in order for this to work.**
### Create Telegram Bot
Start a conversation with the *BotFather*:
```
GLOBAL SEARCH -> BotFather
```
> **BotFath... |
Markdown | UTF-8 | 1,095 | 2.609375 | 3 | [] | no_license | **Description**
Please include a summary of the change and which issue is fixed (Add to Resolves list). Be sure to elaborate on any current functionality this may affect.
**Resolves These Issues**
Resolves #(replace parentheses and the stuff here with the issue number, if there isn't one, create one.)
**Type of chan... |
Java | UTF-8 | 550 | 3.421875 | 3 | [] | no_license | package com.tiarebalbi.section_one;
public interface Stack<T> {
/**
* Insert a new item onto stack
*
* @param item item to be inserted
*/
void push(T item);
/**
* Remove and return the item most recently added
*
* @return most recently item added
*/
T pop();
/**
* Check if stack... |
Ruby | UTF-8 | 745 | 3.21875 | 3 | [] | no_license | require "yaml"
CHANNEL_MANAGER_FILE = "data/channel_manager.yaml"
class ChannelManager
attr_accessor :channels
def initialize()
@channels = Array.new()
end
def add_channel_to_manager(channel)
if does_not_contain_channel(channel)
@channels << channel
end
end
def does_not_contain_channe... |
TypeScript | UTF-8 | 4,584 | 2.59375 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { SearchResults } from '../models/SearchResults.model';
import { MovieInformation } from '../models/MovieInformation.model';
import { BannerState } from '../models/BannerState.model';
import { BannerContext } from... |
Java | UTF-8 | 996 | 2.25 | 2 | [] | no_license | package com.lvsint.abp.server.feeds.enetpulse.creators;
public class ImporterResultInfo {
private String gameId;
private int scoreHome;
private int scoreAway;
private boolean abandoned;
private final long countryId;
public ImporterResultInfo(String gameId, long countryId, boolean abandoned) {... |
Shell | UTF-8 | 4,178 | 2.875 | 3 | [] | no_license | #!/bin/bash
#simple script to determine what graphics package to use
set -x
#revision 2 20101201 (complete rewrite)
#revision 3 20110523 for spup
#revision 4 20110927 nouveau rant
#revision 5 20120129 new kernels
#revision 6 20120225 more new kernels -unionfs
#revision 7 20121317 back to aufs
rm -f /tmp/luci_recomend... |
Python | UTF-8 | 1,933 | 3.046875 | 3 | [] | no_license | import requests
import json
import sys
from bs4 import BeautifulSoup
def parseUrl(url):
r = requests.get(url)
titles_list = []
text_list = []
soup = BeautifulSoup(r.text, 'html.parser')
main_title = soup.h1.text
main_title = list(main_title)
for i in main_title:
if i == '\xa0' or i ... |
Java | UTF-8 | 8,113 | 2.265625 | 2 | [] | no_license | package gui;
import code.Main;
import code.ManagerBill;
import code.ManagerCostumer;
import code.ManagerGeneralValidations;
import code.ManagerProduct;
import java.awt.event.ItemEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
public class InformationOptions extends javax.s... |
Markdown | UTF-8 | 972 | 2.96875 | 3 | [] | no_license | ## greeting-web-app
*Small server app, created for educational purposes.
Build with spring boot, maven, docker*
```shell
$ mvn spring-boot:run
$ docker build -t greeting-app .
$ docker run -p 5000:5000 greeting-app
```
# Specification:
1. Given the following input values
account=personal and id=... |
TypeScript | UTF-8 | 658 | 2.78125 | 3 | [
"MIT"
] | permissive | import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';
import * as bcrypt from 'bcrypt';
export type UserDocument = User & Document;
@Schema({ timestamps: true })
export class User {
@Prop({ trim: true, required: true, lowercase: true, unique: true })
email: string;
... |
Ruby | UTF-8 | 450 | 4.125 | 4 | [] | no_license | # [1,2,3]
# init like
arr = []
# new new new
arr1 = Array.new(5)
arr2 = Array.new(2, true)
arr3 = Array.new(2, "abc")
arr3.first.upcase!
puts arr3
arr4 = Array.new(25) {"abc"}
pos = arr4.length-6
arr4[pos].upcase!
puts arr4
puts arr4.length
# array of symbols instantiated with %i
arr_sym = %i(w a s d)
puts arr_s... |
C++ | UTF-8 | 1,862 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include "Bohr.hpp"
int main() {
using MyBohr = Bohr<uint32_t>;
using symbol_t = MyBohr::symbol_t;
using pattern_t = MyBohr::pattern_t;
MyBohr b;
std::vector<pattern_t> patterns{{1,2,3,0}, {1,2,0}, {2,0}, {3,1}... |
JavaScript | UTF-8 | 1,565 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | const http = require('http');
const {Readability} = require('@mozilla/readability');
const JSDOM = require('jsdom').JSDOM;
const portsParam = process.env.PORT; // get the port from the env variable
let port = 8080; // default port
if (portsParam) {
ports = portsParam
} else {
console.error('Can not read port p... |
TypeScript | UTF-8 | 254 | 2.5625 | 3 | [
"MIT"
] | permissive | import { Exception } from './exception';
export class CapacityFullException extends Exception {
constructor(message: string) {
super(message);
}
public toString() {
return `CapacityFullException${super.toString()}`;
}
} |
Shell | UTF-8 | 1,783 | 3.21875 | 3 | [
"MIT"
] | permissive | #!/bin/bash
################################
# Author: Rum Coke
# Data : 2015/05/06
# Ver : 1.4.0
################################
# for EL-USB-RT
# path of tempsensor binary
BIN_PATH="/usr/local/bin"
# Setting threshold value for warn and critical.
WARN_TEMP='30'
CRITICAL_TEMP='35'
WARN_HYD='40:'
CRITICAL_HYD='3... |
Java | UTF-8 | 1,042 | 2.5625 | 3 | [] | no_license | package org.geektimes.projects.user.web.listener;
import org.apache.activemq.command.ActiveMQTextMessage;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import javax.jms.MessageProducer;
import javax.jms.Topic;
public class TestingComponent {
@Resource(name = "jms/activemq-topic")
p... |
JavaScript | UTF-8 | 4,530 | 2.734375 | 3 | [] | no_license | import $ from 'jQuery';
class Base{
//中间列表HTML
getContentListHTML(data=[]){
let self = this, html = ``;
this.dataList = new Set(data);
let list = this.changeDataToMap(data);
for( let [y,year] of list.entries()){
html += `<div class="content_year tips" id="content_year_${y}">${y}</div>`;
for( let ... |
C++ | UTF-8 | 4,608 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "latool.h"
#include "memory.h"
namespace ODER{
Mat4::Mat4(float mat[4][4]){
memcpy(m, mat, 16 * sizeof(float));
}
Mat4::Mat4(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31,... |
Java | UTF-8 | 312 | 2.953125 | 3 | [] | no_license | package stringPrograms;
import java.util.ArrayList;
import java.util.List;
public class StringContains {
public static void main(String[] args) {
List<String> cityName = new ArrayList<>();
cityName.add("Chennai Egmore");
for(String city: cityName) {
System.out.println(city.contains("Egmore"));
}
}
}
|
Python | UTF-8 | 1,284 | 2.6875 | 3 | [] | no_license | #Logfile Parser
from string import split
from operator import itemgetter
def parseline(line):
try:
arr=split(line, "z_*")
print(arr)
time=arr[0]
module=arr[1]
urgency=arr[2]
message=arr[3]
parsedtime=split(time, "|")
return(parsedtime[0], parsedtime[1], parsedtime[2], module, urgency, message)
exc... |
Java | UTF-8 | 1,113 | 2.203125 | 2 | [] | no_license | package com.travel.buddy.coreproject.utils;
import com.travel.buddy.coreproject.model.Interest;
import com.travel.buddy.coreproject.model.UserProfile;
import com.travel.buddy.coreproject.repository.InterestRepository;
import com.travel.buddy.coreproject.utils.SlopeOne.SlopeOne;
import org.springframework.beans.factory... |
Python | UTF-8 | 357 | 2.9375 | 3 | [
"MIT"
] | permissive | import jieba
def get_seg_features(text):
word_sentence = []
seg_sentence = []
for word in jieba.cut(text):
word = word.lower()
for ch in word:
word_sentence.append(ch)
seg_sentence.append(word)
return word_sentence, seg_sentence
def joint_output_str(sentence,... |
PHP | UTF-8 | 389 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
/**
*
* @author developer
*
*/
class UserRepository extends BaseRepository{
private $_updateKeys = ['true_name', 'accounts', 'phone', 'e_mail'];
public function save($id, $save_data)
{
$user = User::find($id);
foreach ($save_data as $key => $value) {
if (in_array($key, $this->_updateKeys... |
SQL | UTF-8 | 475 | 3.09375 | 3 | [] | no_license | create table hospital(
reference_id number ,
name varchar(30) not null,
age number not null,
gender varchar(10) check ((gender='male' or gender='female')) not null ,
marital_status varchar(10) not null,
phone_number number check ((phone_number>7000000000)or(phone_number<100000000000)) not null,
disease_type var... |
TypeScript | UTF-8 | 1,529 | 2.703125 | 3 | [] | no_license | /// <reference types="node" />
import { StateKey, State, Fn, ReactEventHandlerKey, ReactEventHandlers, InternalConfig, InternalHandlers } from './types';
declare type GestureTimeouts = Partial<{
[stateKey in StateKey]: NodeJS.Timeout;
}>;
/**
* The controller will keep track of the state for all gestures and also ... |
Java | UTF-8 | 660 | 1.820313 | 2 | [] | no_license | package com.honeywen.credit.modules.sys.web;
import com.honeywen.credit.modules.sys.entity.SysUser;
import com.honeywen.credit.modules.sys.service.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind... |
Python | UTF-8 | 34 | 2.640625 | 3 | [] | no_license | a = float(input()) * 2.54
print(a) |
C++ | UTF-8 | 1,044 | 2.53125 | 3 | [] | no_license | #ifndef __I_FACADE__
#define __I_FACADE__
#include "gameStd.h"
class IMediator;
class Notification;
class ICommand;
class IProxy;
class IFacade
{
public:
virtual void notifyMediator(Notification& noti)=0;
virtual void notifyCommand(Notification& noti)=0;
virtual void registerCommand(const string& notification... |
Python | UTF-8 | 3,138 | 3.140625 | 3 | [] | no_license | import Queue
import abc
import threading
import Manager
import time
import binascii
class CommunicationManager(Manager.Manager):
def __init__(self):
self.thread = threading.Thread(target=self.read)
self.connected = False
# queue holding the data
self._incoming_messages = Queue.Qu... |
Java | UTF-8 | 719 | 2.734375 | 3 | [] | no_license | package com.company.arrays;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class FindLuckyIntegerInArrayTest {
@Test
void findLuckyWithAnswer3() {
FindLuckyIntegerInArray luck = new FindLuckyIntegerInArray();
assertEquals(3, luck.findLucky(new int[]{1,2,... |
Java | UTF-8 | 4,426 | 1.898438 | 2 | [] | no_license | package com.constants;
import java.io.File;
import android.os.Environment;
public class AppConstant {
public static final String UPLOAD_MESSAGE_ACTION = "com.upload.uploadprogressbar";
public static final String UPLOAD_SUCCESS_MESSAGE = "com.upload.success";
public static final String UPLOAD_ERROR_MESSAG... |
TypeScript | UTF-8 | 13,747 | 2.71875 | 3 | [
"MIT"
] | permissive | /* The following applies to the code modifications
The MIT License (MIT)
Copyright (c) 2021 Florian Stamer
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 l... |
Java | ISO-8859-1 | 1,719 | 3.25 | 3 | [] | no_license |
package de.stegemann.examples;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import java.util.HashSet;
import java.util.Set;
import org.junit.Test;
public class PersonenEqualsTest {... |
Python | UTF-8 | 2,352 | 2.71875 | 3 | [] | no_license |
import math
import re
from pytv import Shows, Show as TvShow
from pytv.tvmaze import ApiError, get_updates
from .models import Show
# keys that match the pattern are added by the library pytv excluding them
# allows **dict dump into Show model
default_pattern = r"_url|_list|id|type|next|_links"
def dict_data(show,... |
Markdown | UTF-8 | 1,070 | 2.765625 | 3 | [
"MIT"
] | permissive | <h1 dir="rtl">ضم الملك عبدالعزيز الأحساء .</h1>
<h5 dir="rtl">العام الهجري: 1331
الشهر القمري: جمادى الأولى
العام الميلادي: 1913</h5>
<p dir="rtl">بدأ الملك عبدالعزيز بالاستعداد في القيام بدخول الأحساء فاتفق مع بعض كبار رجالات أسر الأحساء في تنفيذ عملية الفتح.
غادر الملك عبدالعزيز الرياض بقواته إلى الأحساء ووصل ... |
C# | UTF-8 | 3,483 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ConsoleApp5
{
class GameLogic
{
const int MOVE_SIZE = 5;
Timer t = new Timer();
public List<Coordinate> Snake = new List<Coordinate>... |
Go | UTF-8 | 114 | 2.546875 | 3 | [] | no_license | package utils
import "strconv"
// ToInt ...
func ToInt(str string) int {
i, _ := strconv.Atoi(str)
return i
}
|
C# | UTF-8 | 1,990 | 2.578125 | 3 | [] | no_license | using UnityEngine;
using UnityEngine.Events;
using System.Collections;
using System.Collections.Generic;
[System.Serializable]
public class SourceEvent : UnityEvent<GameObject>
{
}
public class EventManager : MonoBehaviour {
private Dictionary <string, SourceEvent> eventDictionary;
private static EventManager e... |
Python | UTF-8 | 1,222 | 2.734375 | 3 | [] | no_license | import time
import giphy_client
from giphy_client.rest import ApiException
from pprint import pprint
import webbrowser
def gifGenerator(txt, results):
# create an instance of the API class
api_instance = giphy_client.DefaultApi()
api_key = 'dc6zaTOxFJmzC' # str | Giphy API Key.
q = txt # str | Search ... |
C | UTF-8 | 1,083 | 3.75 | 4 | [] | no_license | //***Here c is a constant
for (int i = 1; i <= c; i++)
{
a += 5;
}
//***incremented / decremented by a constant amount
for (int i = 1; i <= n; i += c)
{
}
for (int i = n; i > 0; i -= c)
{
}
//***divided / multiplied by a constant amount
for (int i = 1; i <=n; i += c)
{
for (int j = 1; j <=n; j += c)
{
//... |
Java | UTF-8 | 1,775 | 2.3125 | 2 | [] | no_license | package com.month.controller;
import com.month.domain.member.Member;
import com.month.domain.member.MemberCreator;
import com.month.domain.member.MemberRepository;
import com.month.exception.ConflictException;
import com.month.type.session.MemberSession;
import lombok.RequiredArgsConstructor;
import org.springframewor... |
C++ | UTF-8 | 2,917 | 3.625 | 4 | [] | no_license | #include "Collision.h"
#include <cmath>
/**
* Simple collision detection.
*/
/**
* @return Whether two SDL_Rects collided.
* @param a_ , b_ : The rectangles to check.
*/
bool Collision::rectsCollided(const SDL_Rect& firstRectangle, const SDL_Rect& secondRectangle){
// Calculate the sides of rect A.
const int ... |
PHP | UTF-8 | 1,779 | 2.609375 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
namespace app\models;
use Yii;
/**
* This is the model class for table "fault_rate_forecast_data".
*
* @property integer $fault_rate_forecast_data_id
* @property integer $fault_rate_forecast_id
* @property string $date
* @property string $sales_date
* @property integer $sales_count
* @property string $... |
Markdown | UTF-8 | 7,177 | 2.984375 | 3 | [] | permissive | ## 术语
- Advertiser:广告主,花钱做广告的人
- Publisher:发布者
- Creative:一般指实际被展示出去的图/视频
- Impression:Creative一次就是一个Impression
- Click:点击
- Conversion / Action:转化,点击户的后续行为
- CTR: 点击率, click / impression
- IR / CR:转化率 action / click
- DAU:日活
- MAU:月活
- ARPU:平均用户收入
- PV:日阅览量或者点击量
- UV:独立访客数
### 售卖术语
- CPM:按展示付费
- CPC:按点击付费
- CPA:按行为付... |
JavaScript | UTF-8 | 939 | 3.59375 | 4 | [] | no_license | const daysE1 = document.getElementById('days');
const hoursE1 = document.getElementById('hours');
const minsE1 = document.getElementById('mins');
const secondsE1 = document.getElementById('seconds');
const newYears = "1 jan 2022";
function countdown() {
const newYearsDate=new Date(newYears);
const ... |
Shell | UTF-8 | 162 | 2.90625 | 3 | [] | no_license | #!/bin/sh
for pair in $(printenv)
do
var=$(echo "$pair" | cut -d= -f1)
value=$(echo "$pair" | cut -d= -f2)
sed -i "s|{{ $var }}|$value|g" "$1"
done
|
C# | UTF-8 | 1,478 | 2.53125 | 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;
using Seven.BLL;
namespace Seven.UI
{
public partial class CreateCategory : Form
{
publi... |
Shell | UTF-8 | 587 | 3.015625 | 3 | [] | no_license | #!/bin/bash -e
# usage: init.sh 1.2.3.4
# more info: https://github.com/kylemanna/docker-openvpn/blob/master/docs/docker-compose.md
HOST=${1:-$(echo $DOCKER_HOST | awk -F'[/:]' '{print $4}')} # first arg or docker host from env var
echo "Initializing config for host '$HOST'"
docker-compose run --rm openvpn ovpn_genconf... |
Java | UTF-8 | 11,621 | 3.453125 | 3 | [] | no_license | //*******1*********2*********3*********4*********5*********6*********7*********8
package ics240.assignment4;
/******************************************************************************
* This class is a homework assignment; A DoubleLinkedSeq</CODE> is a collection
* of double</CODE> numbers. The sequence can hav... |
Java | UTF-8 | 1,804 | 1.773438 | 2 | [] | no_license | package com.google.android.gms.location.internal;
import android.app.PendingIntent;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.common.api.PendingResult;
import com.google.android.gms.common.api.Status;
import com.google.android.gms.location.ActivityRecognitionApi;
public c... |
C# | UTF-8 | 1,811 | 3.3125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
class Program02
{
static void Main()
{
string[] input = Console.ReadLine().Split(new char[] { ' ', '.' }, StringSplitOptions.RemoveEmptyEntries);
ulong bitrhDayMulty = 1L;
int birthMonth = int.Parse(input[1]... |
Rust | UTF-8 | 2,556 | 2.609375 | 3 | [] | no_license | use gfx::*;
use ggez::*;
use ggez::graphics::{Color, Drawable, DrawParam, Image};
use image::RgbaImage;
use crate::ggez_utils::Point2;
use crate::transitions::transition::Transition;
// Define the input struct for our shader.
gfx_defines! {
constant Dim {
rate: f32 = "u_Rate",
center_x: f32 = "cen... |
PHP | UTF-8 | 452 | 2.78125 | 3 | [] | no_license | <?php
include __DIR__ . '/src/GenerateImage.php';
if ((empty($_GET['userName'])) && (empty($_GET['userSurname'])))
{
header($_SERVER['SERVER_PROTOCOL'] . '404 Not Found ');
exit();
}
else
{
$name = $_GET['userName'];
$surname = $_GET['userSurname'];
$userName = $name . ' ' . $surname;
$mark = ... |
C++ | UTF-8 | 526 | 3.15625 | 3 | [] | no_license | #ifndef queue_h
#define queue_h
#include "node.h"
template <class T>
class Queue
{
private:
Node<T> *head;
Node<T> *bottom;
public:
Queue()
{
head = 0;
bottom = 0;
};
void queue(T Value)
{
Node<T> *n = new Node<T>;
n->data = Value;
n->next = 0;
if(head == 0)
head = bottom = n;
else
{
bo... |
Java | UTF-8 | 1,103 | 2.265625 | 2 | [
"Apache-2.0"
] | permissive | package com.newolf.refreshlayout.adapter;
import android.util.Log;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.newolf.library.adapt.base.BaseQuickAdapter;
import com.newolf.library.adapt.base.viewholder.BaseViewHolder;
import com.newolf.refreshlayout.R;
import java.util.List;
... |
Python | UTF-8 | 241 | 3.484375 | 3 | [] | no_license | import random
num = random.randint(1,100)
i = int(input("input a number: " ))
while i != num:
if i > num:
i = int(input("input smaller:"))
elif i < num:
i = int(input("input bigger:"))
print("congratulation!")
|
Java | UTF-8 | 1,228 | 2.046875 | 2 | [] | no_license | package com.scholarship.demo.service;
import com.scholarship.demo.api.*;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service
public interface StudentService {
/**
* 当前流程查询接口
* @param
* @return
*/
CurrentProcessRep currentPorcess(String ac... |
C# | UTF-8 | 1,936 | 2.546875 | 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;
using System.Data.SqlClient;
namespace OnlineJobPortal
{
public partial class Login : Form
{
... |
Python | UTF-8 | 5,069 | 2.671875 | 3 | [] | no_license | #!/usr/bin/env python
#
# Generate a key, self-signed certificate, and certificate request.
# Usage: csrgen <fqdn>
#
# When more than one hostname is provided, a SAN (Subject Alternate Name)
# certificate and request are generated. This can be acheived by adding -s.
# Usage: csrgen <hostname> -s <san0> <san1>
#
# Auth... |
Java | UTF-8 | 5,031 | 1.96875 | 2 | [] | no_license | package cn.honry.oa.allWorks.vo;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
/**
* @Description:流转中和已办毕vo
* @Author: zhangkui
* @CreateDate: 2018/2/5 20:08
* @Modifier: zhangkui
* @version: V1.0
*/
public class ProcessVo implements Serializable {
private static f... |
Java | UTF-8 | 375 | 1.757813 | 2 | [
"MIT"
] | permissive | package com.example.agendapublica.Repository;
import com.example.agendapublica.Config.EntityMapper;
import com.example.agendapublica.DTO.TelephoneNumberDTO;
import com.example.agendapublica.Entities.TelephoneNumber;
import org.mapstruct.Mapper;
@Mapper(componentModel = "spring")
public interface NumberMapping extends... |
C++ | UTF-8 | 1,315 | 2.953125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: ExpBuilder.h
* Author: Admin
*
* Created on March 21, 2019, 3:10 PM
*/
#ifndef EXPBUILDER_H
#define EXPBUILDER_H
#... |
SQL | UTF-8 | 1,257 | 3.828125 | 4 | [] | no_license | create schema project;
create table student(
StudentID varchar(100) not null primary key,
Lastname varchar(100) default null,
OtherNames varchar(100) default null,
DOB date default null,
GroupLeader varchar(100) null);
select * from student;
create table Description(
ProjectID varchar(100) not null primary key,
Projec... |
JavaScript | UTF-8 | 1,120 | 3.421875 | 3 | [
"MIT"
] | permissive | var BowlingGame = function() {
this.rolls = [];
this.currentRoll = 0;
this.roll = function(pins) {
this.rolls[this.currentRoll++] = pins;
console.log("rolls : " + this.rolls);
console.log("longueur : " + this.rolls.length);
console.log("currentRoll : " + this.currentRoll);
};
this.s... |
Java | UTF-8 | 3,078 | 2.703125 | 3 | [] | no_license | package bundle;
import exception.QuickException;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
import java.io.File;
import java.io.FilenameFilter;
import play.Logger;
import play.Play;
/**
* Load classes and script in the bundle context
*
* @author Paolo Di Tommaso
*
*/
public class ... |
C | UTF-8 | 322 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int code1,unite1,code2,unite2;
double price1,price2,cost1,cost2,cost;
scanf("%d %d %lf\n%d %d %lf",&code1,&unite1,&price1,&code2,&unite2,&price2);
cost1=unite1*price1;
cost2=unite2*price2;
cost=cost1+cost2;
printf("VALOR A PAGAR: R$ %.2lf",cost);
return 0;
... |
Shell | UTF-8 | 342 | 3.53125 | 4 | [] | no_license | #! /usr/bin/env bash
# File: print_num_args.sh
# Write a Bash program that prints the number of arguments provided to that program multiplied by the first argument provided to the program.
echo "Number of args: $#"
echo "Number of args times first arg:" # HOW SUPPRESS NEWLINE SO NUMBER APPEARS ON THIS LINE???
ex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.