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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 5,728 | 2.984375 | 3 | [
"BSD-3-Clause"
] | permissive | """Multi-scale Attention Convolutional Neural Network (MACNN)."""
__author__ = ["jnrusson1"]
from sktime.networks.base import BaseDeepNetwork
from sktime.utils.validation._dependencies import _check_dl_dependencies
class MACNNNetwork(BaseDeepNetwork):
"""Base MACNN Network for MACNNClassifier and MACNN... |
Markdown | UTF-8 | 1,581 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | # TomatoTimer for Android
<a href='https://play.google.com/store/apps/details?id=artem122ya.tomatotimer'><img height="100" alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png'/></a>
TomatoTimer helps you increase productivity and fight procrastination wit... |
Markdown | UTF-8 | 2,032 | 2.5625 | 3 | [] | no_license | ---
layout: post
title: 'Bag snatchers'
author: 'Maggie Ad'
image: ''
categories: ['Living in ST', 'Shantouer', 'ๆชๅ็ฑป']
tags: []
---
Ahh... I'm a little bit depressed today coz my parents are here and I can't take them anywhere. Also my friend Jonny has just arrived for the travelling we'd planned before I broke my foo... |
Python | UTF-8 | 3,317 | 3.015625 | 3 | [] | no_license | import PIL
import matplotlib.pyplot as plt # single use of plt is commented out
import os.path
import PIL.ImageDraw
import random
def make_collage(original_image):
return original_image
def get_images(directory=None):
""" Returns PIL.Image objects for all the images in directory.
If dir... |
C++ | UTF-8 | 1,274 | 3.390625 | 3 | [
"MIT"
] | permissive | //////////////////////////////////////////////////////////////////////////
#include "Math/BitManipulation.hpp"
#include <gtest/gtest.h>
TEST(Math, Bits_SplitByOne_Limits)
{
using namespace CPF::Math;
uint32_t maxBit32 = uint32_t(1) << 15;
uint32_t maxBit64 = uint32_t(1) << 31;
// Zero
EXPECT_EQ(0, SplitByOne32(... |
C | UTF-8 | 302 | 2.515625 | 3 | [] | no_license | #ifndef HEADER
#define HEADER
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_NAME_LEN 20
#define MAX_PASS_LEN 20
//Structs
typedef struct user {
char name[MAX_NAME_LEN + 1];
char password[MAX_PASS_LEN + 1];
int num_articles_written;
struct user* next;
} User;
#endif
|
Python | UTF-8 | 232 | 2.65625 | 3 | [] | no_license | import random
class Person(object):
def __init__(self, is_vaccinated, is_dead, is_infected):
self._id = 0
self.is_vaccinated = is_vaccinated
self.is_dead = is_dead
self.is_infected = is_infected
|
SQL | UTF-8 | 141 | 2.921875 | 3 | [] | no_license | SELECT e1.first_name
FROM employees e1
WHERE
(
SELECT COUNT(*)
FROM employees e2
WHERE e2.first_name <= e1.first_name
)
% 2 = 1;
|
Java | UTF-8 | 2,461 | 3.671875 | 4 | [] | no_license | //*******************************************************************
//StoryNode.java @author Jane Abernathy
//CS230 Final Project Voyage Through Time
//
//Represents a node in the graph of the story. Stores the name of the
//node, descriptive text for the game user to read, point value to add
... |
C | UTF-8 | 1,044 | 3.1875 | 3 | [] | no_license | /* Cpt S 483, Introduction to Parallel Computing
* School of Electrical Engineering and Computer Science
*
* Example code
* Send receive test:
* implement the ring permutation (rank i sends to rank i-1 and receives from rank i+1)
* */
#include <stdio.h>
#include <mpi.h>
#include <assert.h>
int main(int argc... |
PHP | UTF-8 | 856 | 2.796875 | 3 | [] | no_license | <?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
class KeysMatchFields implements Rule
{
private $model;
/**
* Create a new rule instance.
*
* @return void
*/
public function __construct($model)
{
$this->model = $model;
}
/**
* Determine ... |
Java | UTF-8 | 2,427 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package com.didiglobal.turbo.engine.dao.mapper;
import com.didiglobal.turbo.engine.common.FlowDeploymentStatus;
import com.didiglobal.turbo.engine.entity.FlowDeploymentPO;
import com.didiglobal.turbo.engine.runner.BaseTest;
import com.didiglobal.turbo.engine.util.EntityBuilder;
import org.junit.Assert;
import org.juni... |
Python | UTF-8 | 16,036 | 2.65625 | 3 | [] | no_license | # supposed to handle passing "str | list" type-hinting to get_stat()
# but breaks print(f'string') because python 2.7? don't understand that
# from __future__ import annotations
import doctest
import logging
# https://inventwithpython.com/blog/2014/12/02/why-is-object-oriented-programming-useful-with-a-role-playing-... |
Markdown | UTF-8 | 13,301 | 3.09375 | 3 | [
"MIT"
] | permissive | # Hazy
> :partly_sunny: Lazy JSON fixtures in Node
-----
Hazy aims to ease the hassle of generating, maintaining and working with fixtures by making them DRY and more expressive.
Hazy lets developers describe and generate test data in a normailzed fasion and allows for fixtures to be processed further
at run-time f... |
Markdown | UTF-8 | 459 | 2.546875 | 3 | [] | no_license | # Predictive-Cricket
<ul>
<li>This is a console based project.</li>
<li>In this project your predicted number is matched with computer generated number,run depends upon how close your prediction was.</li>
<li>I have used only random module to generate random numbers</li>
<li>Not only this but It is having dunamic comme... |
Java | UTF-8 | 12,080 | 1.773438 | 2 | [] | no_license | package com.example.es_demo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.example.es_demo.model.MovieModel;
import org.apache.http.HttpEntity;
import org.apache.http.nio.entity.NStringEntity;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.actio... |
C | UTF-8 | 3,815 | 3.53125 | 4 | [
"MIT",
"BSD-4-Clause-UC",
"BSD-3-Clause"
] | permissive | #include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/* ls: List directory contents. Author: Warren Toomey */
/* External variables. */
extern int optind;
extern char *optarg;
int longoutput=0; // Do a long... |
Java | GB18030 | 6,169 | 2.46875 | 2 | [] | no_license | package com.zzy.threadpooldemo;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.FileNameMap;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
im... |
Java | UTF-8 | 3,239 | 2.765625 | 3 | [] | no_license |
package gestionecampionati.grafica.popMenu;
import gestionecampionati.Campionato;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import jav... |
Java | UTF-8 | 1,082 | 2.84375 | 3 | [] | no_license | package aodspace.ood.staff;
import java.time.LocalDate;
import aodspace.ood.staff.base.Member;
import aodspace.ood.staff.base.MemberType;
/**
* initialize percent of sales
*
* @author davit
*/
public class Sales extends Member {
private static final int SALES_SALARY_WITH_PERCENT = 1;
private static final int... |
Swift | UTF-8 | 4,395 | 2.59375 | 3 | [] | no_license | //
// ViewController.swift
// iphoneWatch
//
// Created by Mrudula on 1/14/18.
// Copyright ยฉ 2018 Mrudula. All rights reserved.
//
import UIKit
import Foundation
import WatchConnectivity
class ViewController: UIViewController,URLSessionDelegate,WCSessionDelegate {
@available(iOS 9.3, *)
public func sessi... |
C# | UTF-8 | 1,758 | 3.734375 | 4 | [] | no_license | ๏ปฟusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CoxAutoCode
{
public class PalindromeDetection
{
public static void checkPalindrone()
{
string[] array =
{
"civic",
... |
PHP | UTF-8 | 161 | 2.578125 | 3 | [] | no_license | <?php
namespace Gametrade;
abstract class BaseList
{
abstract public function fetch_all();
abstract public function fetch_by_filter($filter_array);
} |
C++ | UTF-8 | 5,171 | 2.578125 | 3 | [] | no_license | #include "process_scheduler.h"
#include "os_base.h"
bool g_bTerminate = FALSE;
CProcessScheduler::CProcessScheduler()
:m_processRunning(NULL),
m_nRunForApp(0),
m_nIdle(0)
{
};
CProcessScheduler::~CProcessScheduler()
{
};
void CProcessScheduler::HeartBeat()
{
if(g_bTerminate)
return;
// OutputStat... |
Java | UTF-8 | 1,202 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | package se.smokestack.bm;
import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import java.io.IOException;
import java.nio.file.Files;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import org.apache.deltaspike.core.util.ExceptionUtils;
import org.apache.logging.log4j.Log... |
Python | UTF-8 | 1,055 | 3.078125 | 3 | [] | no_license | import copy
from version_control.State import State
from version_control.Operation import Operation
class CSVFileOpInsertRow(Operation):
def __init__(self, file_name, index, value):
self.file_name = file_name
self.index = index
self.value = value
def apply_operation(self, state):
... |
Python | UTF-8 | 651 | 3.015625 | 3 | [
"MIT"
] | permissive | from sympy import ( symbols, solve, diff, integrate, exp, sqrt, lambdify, Integral, ln, pprint, oo )
# Researchers have shown that the number of successive dry days that occur after a rainstorm for a particular region is a random variable that is distributed exponentially with a mean of 9 days
mu = 9
t = symbols( 't' ... |
C# | UTF-8 | 1,166 | 2.890625 | 3 | [] | no_license | ๏ปฟusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Excel = Microsoft.Office.Interop.Excel;
namespace TablesTest
{
class Household
{
public int Number { set; get; }
public String Name { set; get; }
static ... |
Shell | UTF-8 | 11,598 | 3.3125 | 3 | [] | no_license | if [[ "$HOME" ]] && [[ -f ${MAS_ETC_BASH:=/etc/mastar/shell/bash}/.topparamfuncs ]] ; then
. ${MAS_ETC_BASH:=/etc/mastar/shell/bash}/.topparamfuncs
function mas_src_not_found ()
{
local errlineno=$1
shift
local errmpath=$1
shift
dbgmasp 3 "$LINENO:$FUNCNAME"
case $MAS_SCRIPTSN_ERRTYP... |
C++ | UTF-8 | 9,225 | 2.78125 | 3 | [] | no_license | #include "cuimage/cuda/conversion.h"
#include <gtest/gtest.h>
using namespace cuimage;
TEST(RgbaToGrayTest, works_float)
{
float4 c1 = make_float4(1.f, 1.f, 1.f, 1.f);
float4 c2 = make_float4(0.f, 0.f, 0.f, 0.f);
float4 c3 = make_float4(0.3f, 0.2f, 0.4f, 0.f);
float4 c4 = make_float4(0.3f, 0.2f, 0.4f... |
Python | UTF-8 | 6,188 | 2.671875 | 3 | [] | no_license | #!/usr/bin/env python
import time
import datetime
import re
import cloudscraper
import pandas as pd
from bs4 import BeautifulSoup
now = datetime.datetime.now()
# def convertPrice(price, area):
# '''Convert price format'''
# if price == "Giรก thแปa thuแบญn":
# return None
# elif price.split(" ")[1]=="... |
C++ | UTF-8 | 263 | 2.828125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int n;
string s;
cin >> n;
while(n--)
{ cin >> s;
if( s.size()<11)
{cout<< s<<endl;}
else
cout << s[0]<<s.size()-2<<s[s.size()-1]<<endl;
}
}
|
PHP | UTF-8 | 1,942 | 3.875 | 4 | [] | no_license | <?php
/*
*Classe TFilter
*provรช uma interface para definiรงรฃo de filtros de seleรงรฃo
*P. 174
*/
class TFilter extends TExpression
{
private $variable; //Variavel
private $operator; //Operador;
private $value; //Valor
/*
*metodo __construct()
*Instancia um novo filtro
*@param $variable = Variavel
*@param $oper... |
PHP | UTF-8 | 2,826 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
/*
* Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
* SPDX-License-Identifier: MIT
*/
declare(strict_types=1);
namespace Respect\Validation\Rules;
use finfo;
use Respect\Validation\Test\RuleTestCase;
use SplFileInfo;
use SplFileObject;
use function random_int;
use function tmpfile;
use const ... |
Java | UTF-8 | 547 | 3.09375 | 3 | [] | no_license | import java.util.Random;
public class Item {
private String symbol;
private int x;
private int y;
public Item (Map map) {
Random random = new Random();
do {
y = random.nextInt(map.GetSize());
x = random.nextInt(map.GetSize());
} while (!map.isEmptyCell(x, y));
}
public void SetSymbol(String symb... |
Java | UTF-8 | 82 | 1.757813 | 2 | [
"Apache-2.0"
] | permissive | package voss.nms.inventory.constants;
public enum PortMode {
IP,
VLAN,;
} |
Markdown | UTF-8 | 1,166 | 2.984375 | 3 | [] | no_license | ---
title: Connectivity check
table_of_contents: true
---
# Connectivity check
Connectivity checking is a NetworkManager functionality that allows
periodically testing whether the system can actually access the
internet or not. The network-manager snap allows configuring this
feature by using the following snap setti... |
Java | UTF-8 | 3,504 | 4.15625 | 4 | [] | no_license | package Exercises5;
// (a) Write a menu-driven program that provides three options:
// **The first option allows the user to enter a temperature
// in Celsius and displays the corresponding Fahrenheit temperature;
// **The second option allows the user to enter a temperature in
// Fahrenheit and displays the correspond... |
C++ | UTF-8 | 7,035 | 2.953125 | 3 | [] | no_license | int cardgame::ai_best_card_wins_strategy (const int ai_attack_point, const int player_attack_point) { // 0
print("best card ai");
if (ai_attack_point > player_attack_point) return 3;
if (ai_attack_point < player_attack_point) return -2;
return -1; //draw
}
int cardgame::ai_min_loss_strategy (const int ai_attac... |
Markdown | UTF-8 | 4,023 | 2.6875 | 3 | [
"MIT"
] | permissive | # 4ยช feira da 3ยช Semana do Advento
## 1ยช Leitura - Is 45,6b-8.18.21b-25
> Cรฉus, deixai cair orvalho das alturas.
**Leitura do Livro do Profeta Isaรญas 45,6b-8.18.21b-25**
6 Eu sou o Senhor, nรฃo hรก outro, 7 eu formei a luz e criei as trevas, crio o bem-estar e as condiรงรตes de mal-estar: sou o Senhor que fa... |
Java | UTF-8 | 502 | 3.203125 | 3 | [] | no_license | package ucankucuk.github.io.functionalInterface;
import java.util.function.Function;
public class FunctionalIntfExmpl {
public static void main(String[] args) {
Function<String, Integer> intFunc = x -> x.length();
System.out.println("Input length = " + intFunc.apply("ucankucuk"));
Functi... |
Python | UTF-8 | 2,733 | 2.65625 | 3 | [] | no_license | # coding=utf-8
import numpy as np
import cv2 as cv
import random
from matplotlib import pyplot as plt
__author__ = 'huangliang'
__version__ = 'v1.0'
def _nothing(x):
pass
def color_palette():
# ๅๅปบ็ฉบ็็ปๅธๅไธไธช็ชๅฃ
img = np.zeros((300,512,3), np.uint8)
cv.namedWindow('palette')
# ๅๅปบๆปๅจๆก... |
Java | UTF-8 | 230 | 2.265625 | 2 | [] | no_license | @Override
public CharBuffer slice() {
byteBuffer.limit(limit << 1);
byteBuffer.position(position << 1);
CharBuffer result = new CharToByteBufferAdapter(byteBuffer.slice());
byteBuffer.clear();
return result;
}
|
JavaScript | UTF-8 | 468 | 2.625 | 3 | [] | no_license | !function () {
var view = View('#Loading');
var controller = {
view: null,
init: function (view) {
this.view = view;
this.removeLoading();
},
removeLoading: function () {
//Loadingๅจ็ป็ปๆ
setTimeout(x => {
this.removeClassList(); //view.classList.remove('active')
}... |
Python | UTF-8 | 5,767 | 2.84375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | """
HappyBase utility module.
These functions are not part of the public API.
"""
import re
import asyncio
from functools import lru_cache
from typing import (
Dict,
List,
Tuple,
Any,
AnyStr,
Optional,
TypeVar,
Callable,
Iterable,
Iterator,
Union,
Coroutine,
)
from Hbas... |
TypeScript | UTF-8 | 1,368 | 2.78125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { Extension } from 'sourcegraph/module/client/extension'
import { ErrorLike, isErrorLike } from '../errors'
import { ExtensionManifest } from '../schema/extension.schema'
import * as GQL from '../schema/graphqlschema'
import { Settings } from '../settings'
/**
* Describes a configured extension.
*
* @templat... |
JavaScript | UTF-8 | 1,623 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
class SearchForm extends Component {
constructor(props) {
super(props);
this.state = {
city: '',
returnedData: ''
}
this.handleTextInput = this.handleTextInput.bind(this)
this.handleFormSubmit = this.handleFormSubmit.bin... |
C++ | UTF-8 | 1,977 | 2.75 | 3 | [] | no_license | #ifndef ONIONLETTER_H
#define ONIONLETTER_H
#include "OnionBase.h"
class OnionLetter
{
public:
static int numInstances;
OnionLetter();
~OnionLetter();
void addCurve(std::vector<glm::vec2>& curve, GLfloat resolution, GLfloat thickness, bool connected);
void addCurve(GLfloa... |
Python | UTF-8 | 607 | 3.40625 | 3 | [] | no_license | class Vehiculo():
def __init__(self,color, modelo, placa, nro_asientos):
self.color = color
self.modelo = modelo
self.placa = placa
self.nroasientos = nro_asientos
def desplazarse(self):
print("El vehiculo se esta desplazando")
def subirpersona(self):
print... |
JavaScript | UTF-8 | 3,852 | 3.828125 | 4 | [] | no_license | /**
้้กบๅบๆฐๆฎๆบๆ --- ๆ
ๆ ็ปๆๅ
ๅซไธ็ณปๅ็ถๅญๅ
ณ็ณป็่็น๏ผๆฏไธช่็น้ฝๆไธไธช็ถ่็น
ไปฅๅ0ไธชๆ่
ๅคไธชๅญ่็น
ๆ ้กถ้จ็่็นๅซๅๆ น่็น
่็นๅไธบๅ
้จ่็นๅๅค้จ่็น๏ผ่ณๅฐๆไธไธชๅญๅ
็ด ็่็น็งฐไธบๅ
้จ่็น๏ผๆฒกๆๅญๅ
็ด ็
่็น็งฐไธบๅค้จ่็นๆ่
ๅถ่็น๏ผ
ไธไธช่็นๅฏไปฅๆ็ฅๅ
ๅๅไปฃ๏ผ็ฅๅ
ๅ
ๆฌ็ถ่็นใ็ฅ็ถ่็นใๆพ็ฅ็ถ่็น
ๅญๆ ๆฏ็ฑ่็นๅๅฎ็ๅไปฃๆๆ๏ผ
่็น็ไธไธชๅฑๆงๆฏๆทฑๅบฆ๏ผ่็น็ๆทฑๅบฆๅๅณไบๅฎ็็ฅๅ
่็น็ๆฐ้๏ผ
ๆ ็้ซๅบฆๅๅณไบ่็นๆทฑๅบฆ็ๆๅคงๅผ๏ผๆ น่็นๅจ็ฌฌ0ๅฑ๏ผ
ไบๅๆ ็่็นๆๅคๅช่ฝๆไธคไธชๅญ่็น๏ผไธไธชๆฏๅทฆไพงๅญ่็น๏ผๅฆไธไธชๆฏๅณไพงๅญ่็น--ๆๅฉไบ
ๆไปฌๅๆๆด้ซๆ็ๅใไปๆ ไธญๆๅ
ฅใๆฅๆพๅๅ ้ค่็น็็ฎๆณ๏ผ
ไบๅๆ็ดขๆ bstๆฏไบๅๆ ็ไธ็ง... |
C++ | UTF-8 | 832 | 2.546875 | 3 | [] | no_license | #ifndef cpu_h
#define cpu_h
#include <ucontext.h>
#include <iostream>
#include "traits.h"
__BEGIN_API
class CPU
{
public:
class Context
{
private:
static const unsigned int STACK_SIZE = Traits<CPU>::STACK_SIZE;
public:
Context() { _stack = 0; } //Construto... |
C++ | UTF-8 | 9,509 | 2.5625 | 3 | [] | no_license | #include "SoyDecklink.h"
#include "SoyTypes.h" // Platform::IsOkay
#include "SoyCfString.h"
// include the API source
#include "DecklinkSdk/Mac/include/DeckLinkAPIDispatch.cpp"
/*
The DeckLink API can be accessed from a sandboxed applications if the following requirements are met:
Application is built against Mac ... |
C# | UTF-8 | 3,558 | 2.59375 | 3 | [] | no_license | ๏ปฟusing System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Web.Http;
using TwitterUtils;
namespace TwitterSentimentAnalysisApp.Controllers
{
[RoutePrefix("api/sentiment")]
pu... |
Java | UTF-8 | 6,680 | 2.015625 | 2 | [] | no_license | package com.example.nguyenhuutu.convenientmenu.manage_menu;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import androi... |
Java | UTF-8 | 511 | 3.125 | 3 | [] | no_license | package com.company;
import java.util.Scanner;
public class Test1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("ะะฒะตะดะธัะต ะบะพะปะธัะตััะฒะพ ัะธัะตะป ะฒ ะฟะพัะปะตะดะพะฒะฐัะตะปัะฝะพััะธ: ");
int count = sc.nextInt();
for( int i = 0; i < count; i++... |
TypeScript | UTF-8 | 3,288 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | export module GOOGLE_MAP_HELPER {
export let AUTO_COMPLETECOMPLETE_TYPE = {
ADDRESS: 'address',
ESTABLISHMENT: 'establishment',
GEOCODE: 'geocode'
};
export let PLACE_TYPE = {
STREET_NUMBER: 'street_number',
ROUTE: 'route',
SUBLOCALITY_LEVEL_1: 'sublocality_level_1',
ADMINISTRATIVE_AR... |
TypeScript | UTF-8 | 4,083 | 2.875 | 3 | [
"MIT"
] | permissive | import {ObservableValue} from "./observablevalue";
import {ComputedValue} from "../core/computedvalue";
import {ValueMode, AsStructure} from "./modifiers";
import {Lambda, invariant, assertPropertyConfigurable, isPlainObject} from "../utils/utils";
import {SimpleEventEmitter} from "../utils/simpleeventemitter";
import ... |
Python | UTF-8 | 526 | 4.65625 | 5 | [] | no_license | """
Bubble Sort
"""
def bubbleSort():
arr = [3, 1, 5, 8, 11, 10]
n = len(arr)
for i in range(n):
# Last i elements are already in place
for j in range(0, n-i-1):
if arr[j] > arr[j+1]:
arr[j], arr[j+1] = arr[j+1], arr[j]
print("Bubble Sort")
printArr... |
Java | UTF-8 | 781 | 2.171875 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package classes;
import interfaces.IDatabase;
import interfaces.IFileArchive;
import interfaces.IType;
/**
*
* @author... |
Python | UTF-8 | 1,076 | 3.140625 | 3 | [] | no_license | import boto3
def Stack_choice():
global Stack_choosen
while True:
print("\n1. Document Service - WS")
print("2. Document Service - Consumer")
Stack_choosen = input("Enter your Choice: ")
try:
int(Stack_choosen)
except ValueError:
print("This is not a number")
continue
if int(Stack_choosen) in ra... |
Java | UTF-8 | 1,922 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2010 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
C++ | UTF-8 | 3,945 | 2.640625 | 3 | [] | no_license | #include <AccelStepper.h>
#define HOME_BUTTON 8
#define FLIP_DIR_BUTTON 9
#define PAUSE_RUN_SWITCH 10
#define MAN_AUTO_SWITCH 11
#define VELOCITY_POT A0
#define DISTANCE_POT A1
#define MOTOR_DIR 2
#define MOTOR_STEP 3
#define MAX_DISTANCE 15325
#define MAX_DV 1
#define MAX_SPEED 500
#define MIN_SPEED 0.1
int ste... |
Python | UTF-8 | 209 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
class CharacterTokenizer(object):
'''
Character Tokenizer
'''
def __init__(self):
self.vocab = []
def encode(self, sentence):
return list(sentence)
|
C | UTF-8 | 519 | 3.421875 | 3 | [] | no_license | #include<stdio.h>
struct node{
int val;
struct node*next;
};
typedef struct node node;
print_recursive(node *head)
{
if(head==NULL)
return;
print_recursive(head->next);
printf("%d ",head->val);
}
node *addnode(int value)
{
node *xx;
xx=(node *)malloc(sizeof(node));
xx->val=value;
xx->next=NULL;
return xx;
}
int main()... |
Java | UTF-8 | 2,499 | 2.21875 | 2 | [] | no_license | package api.barrigarest;
import static io.restassured.RestAssured.given;
import java.util.HashMap;
import java.util.Map;
import org.hamcrest.Matchers;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import org.openqa.selenium.WebDriver;
i... |
JavaScript | UTF-8 | 1,299 | 2.71875 | 3 | [] | no_license | // Daniel Shiffman
// http://codingtra.in
// http://patreon.com/codingtrain
// Code for: https://youtu.be/VV1JmMYceJw
// instance mode by Naoto Hieda
var afinn;
var s = function (sketch) {
sketch.preload = function () {
afinn = sketch.loadJSON('afinn111.json');
}
sketch.setup = function () {
sketch... |
Python | UTF-8 | 277 | 3.625 | 4 | [] | no_license | # Greatest Magnitude Solution
#
# To find the greatest magnitude (the greatest distance from 0), I combine max() and abs()
# I call abs() on each num, and find the maximum resulting value using max()
def max_magnitude(nums):
return max(abs(num) for num in nums)
|
Rust | UTF-8 | 491 | 2.625 | 3 | [
"MIT"
] | permissive | use UCSChar;
pub trait CharExtend {
fn to_char_vec(&self) -> Vec<char>;
fn to_u16_vec(&self) -> Vec<u16>;
fn to_u32_vec(&self) -> Vec<u32>;
}
impl CharExtend for str {
fn to_char_vec(&self) -> Vec<char> {
self.chars().map(|c| c).collect()
}
fn to_u16_vec(&self) -> Vec<u16> {
s... |
Swift | UTF-8 | 3,439 | 2.75 | 3 | [
"MIT"
] | permissive | //
// SearchViewController.swift
// dumble-music
//
// Created by Olayemi Abimbola on 12/09/2021.
//
import UIKit
class SearchViewController: UIViewController{
let tableCellId = String(describing: SearchTableViewCell.self)
// let tableHeaderId =
let searchbar: UISearchBar = {
let searc... |
Java | UTF-8 | 802 | 1.921875 | 2 | [] | no_license | package pl.softwaremill.jozijug.joziawsdemo;
import pl.softwaremill.jozijug.joziawsdemo.impl.sdb.AwsAccessKeys;
import javax.inject.Inject;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
import java.util.concurrent.ScheduledThreadPoo... |
Java | UTF-8 | 675 | 2.796875 | 3 | [] | no_license | package com.design.factory.factory;
import com.design.factory.Vehicle;
import com.design.factory.VehicleFactory;
/**
* @author Zhang Yu
*/
public class CarFactory extends VehicleFactory {
@Override
protected Vehicle createVehicle(String item) {
switch (item) {
case "large":
... |
Swift | UTF-8 | 405 | 2.984375 | 3 | [
"MIT"
] | permissive | //
// ExpressionStatement.swift
// swiftparser
//
// Created by Nuno Silva on 22/06/2021.
//
import Foundation
extension Parser {
func expressionStatement() throws -> StatementProtocol {
let expression = try self.expression()
_ = try self.consume(tokenType: .semicolon, message: "Expected `;'... |
Java | UTF-8 | 1,145 | 2.125 | 2 | [] | no_license | package com.blog.entity;
import java.util.List;
/**
* @author lvconl
* ็ฑป่ฏดๆ๏ผ่ฏ่ฎบๅ้กต็ธๅ
ณๅฎไฝ็ฑป
* */
public class CommentPage {
private int currentPage;
private int pageSize;
private int totalCount;
private int totalPage;
private List<Comment> comments;
public int getCurrentPage() {
... |
Python | UTF-8 | 10,280 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # use json in Python 2.7, fallback to simplejson for Python 2.5
try:
import json
except ImportError:
import simplejson as json
import badges
import exercise_models
# All badges awarded for completing some subset of exercises inherit from
# ExerciseCompletionBadge
class ExerciseCompletionBadge(badges.Badge):
... |
PHP | UTF-8 | 1,871 | 3.328125 | 3 | [] | no_license | <?php
namespace App\Modules\Time;
class TimeConverter
{
public $days;
public $hours;
public $minutes;
public function getDays()
{
return $this->days;
}
public function getHours()
{
return $this->hours;
}
public function getMinutes()
{
return $this... |
Shell | UTF-8 | 497 | 3.265625 | 3 | [] | no_license | #!/bin/sh
set -e
log_dir=/var/log/redis-cluster
lock_file=/data/cluster.lock
mkdir -p $log_dir
# Initialize configs
for p in 6379
do
conf_path=/redis-$p.conf
data_dir=/data/redis-$p
mkdir -p $data_dir
cp /redis.conf $conf_path
echo "
port $p
dir $data_dir" >> $conf_path
echo "
[program:redis-$p]
comma... |
Shell | UTF-8 | 1,580 | 2.84375 | 3 | [] | no_license | #!/bin/bash
#
# Werite by: Jeon.sungwook
# Create Date : 2015-06-02
# Update Date : 2015-06-02
#
# OS : CentOS-7-x86_64 1503-01
# Node : controller
# Text : OPENSTACK INSTALLATION GUIDE FOR RED HAT ENTERPRISE LINUX 7, CENTOS 7, AND FEDORA 21 - KILO
#
# Perform script for for the chapter 2. Basic environment
#
# Thi... |
PHP | UTF-8 | 1,299 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php
namespace Lodge\Postcode;
class GoogleApi
{
/**
* Google API key.
*
* @var string
*/
protected $apiKey;
/**
* GoogleApi constructor.
* @param null $apiKey
*/
public function __construct($apiKey = null)
{
$this->apiKey = $apiKey;
}
/**
... |
Java | UTF-8 | 4,349 | 1.914063 | 2 | [] | no_license | package org.apache.camel.component.cxf;
import java.net.URI;
import java.net.URISyntaxException;
import javax.xml.namespace.QName;
import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.ExchangePattern;
import org.apache.camel.component.cxf.spri... |
Python | UTF-8 | 1,276 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | import sys, wx
sys.path.append('../../')
from skimage.draw import line
from sciwx.app.canvasapp import CanvasApp
from sciapp.action import Tool, ImageTool
class Pencil(ImageTool):
title = 'Pencil'
para = {'pc':(255,0,0)}
view = [('color', 'pc','pen', 'color')]
def __init__(self):
self.... |
JavaScript | UTF-8 | 3,770 | 2.734375 | 3 | [
"MIT"
] | permissive | $(() => {
const socket = io();
const audio = new Audio('bubble.mp3');
let focused = true;
let currentUser = null;
let unreadMessages = 0;
let connectedUsersCount = 0;
$('form').submit(() => {
const textbox = $('#text-box');
const msg = textbox.val();
if (msg) {
socket.emit('chat message', msg);
t... |
Markdown | UTF-8 | 858 | 3.171875 | 3 | [] | no_license | # Waline Example
This directory is a brief example of a [Waline](https://waline.js.org/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Waline project with Vercel.
[](https://vercel.com/import/project?template=https://g... |
Python | UTF-8 | 1,534 | 2.859375 | 3 | [] | no_license | #https://www.acmicpc.net/problem/9376
import sys
from collections import deque
t = int(sys.stdin.readline())
for _ in range(t):
n, m = map(int,sys.stdin.readline().split())
a = [['.'] + list(sys.stdin.readline().rstrip()) + ['.'] for _ in range(n)]
a.insert(0,['.']*(m+2))
a.append(['.']*(m+2))
d... |
Python | UTF-8 | 417 | 2.890625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
u_0 = [0.1,0.2,0.3,0.4,0.5]
tau = np.linspace(-1,1,100)
plt.figure(2)
for ind,i in enumerate(u_0):
u = np.array((tau**2+i**2)**0.5)
A = (u**2 + 2)/(u*(u**2 + 4)**0.5)
s = str(i)
plt.plot(tau,A,label='u_0='+s)
plt.legend()
plt.title('Family of single ... |
PHP | UTF-8 | 630 | 2.546875 | 3 | [] | no_license | <?php
/**
* User: sasik
* Date: 5/17/16
* Time: 11:11 AM
*/
namespace App\Builder;
use App\Storage\FileStorage;
use App\Storage\IStorage;
use App\Storage\RedisStorage;
class StorageBuilder
{
/**
* @param string $file
* @return FileStorage
*/
public static function buildFileStorage($file ... |
C++ | UTF-8 | 577 | 2.859375 | 3 | [] | no_license | #pragma once
#include "point3d.h"
class vector3d {
public:
vector3d();
vector3d(point3d desti);
vector3d(point3d origin, point3d tip);
vector3d(point3d vec, double length);
~vector3d();
point3d getTip() const;
void setLength(double l);
double getLength() const;
vector3d operator*(double d) const;
vector3d op... |
Java | UTF-8 | 124 | 1.601563 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | package org.beigesoft.uml.ui;
import java.io.File;
public interface IEditorDiagramUml {
void openDiagram(File file);
}
|
PHP | UTF-8 | 1,804 | 2.828125 | 3 | [] | no_license | <?php
// Require AWS
require 'vendor/autoload.php';
use Aws\S3\S3Client;
// Instantiate the S3 client using your credential profile
$clientParams = array();
$s3Client = S3Client::factory($clientParams);
// Verify bucket exists
function checkBucketExists($s3Client, $inputBucket)
{
$listBuckets = $s3Client->listB... |
Java | UTF-8 | 468 | 1.84375 | 2 | [] | no_license | package com.emily.framework.quartz.config;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
/**
* @program: spring-parent
* @description:
* @create: 2020/09/30
*/
@Configuration
@Conditional(EmilyCondition.class)
public class BeanB {
priva... |
Java | UTF-8 | 593 | 2.40625 | 2 | [] | no_license | package com.pokerface.pokerapi.util;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
import java.util.Arrays;
@ResponseStatus(HttpStatus.BAD_REQUEST)
public class InvalidSortMethod extends RuntimeException {
private String attempt;
private String[] m... |
PHP | UTF-8 | 221 | 2.84375 | 3 | [
"MIT"
] | permissive | <?php
namespace MVC\Router;
interface RouterInterface {
public function addRoute(RouteInterface $route);
public function removeRoute(String $name);
public function getMatch(String $name): RouteInterface;
}
|
Java | UTF-8 | 458 | 1.53125 | 2 | [] | no_license | package com.xiaobobo.crowdfunding.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiaobobo.crowdfunding.dao.MessageMapper;
import org.springframework.stereotype.Service;
import com.xiaobobo.crowdfunding.entity.Message;
import com.xiaobobo.crowdfunding.service.MessageService... |
Markdown | UTF-8 | 6,970 | 3.875 | 4 | [] | no_license | ## 2. ์๋ฐ ๋ฐ์ดํฐ ํ์
, ๋ณ์ ๊ทธ๋ฆฌ๊ณ ๋ฐฐ์ด
##### ๋ชฉํ : ์๋ฐ์ ํ๋ฆฌ๋ฏธํฐ๋ธ ํ์
, ๋ณ์ ๊ทธ๋ฆฌ๊ณ ๋ฐฐ์ด์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ์ตํ๋๋ค.
##### ํ์ตํ ๊ฒ
- ํ๋ฆฌ๋ฏธํฐ๋ธ ํ์
์ข
๋ฅ์ ๊ฐ์ ๋ฒ์ ๊ทธ๋ฆฌ๊ณ ๊ธฐ๋ณธ ๊ฐ
- ํ๋ฆฌ๋ฏธํฐ๋ธ ํ์
๊ณผ ๋ ํผ๋ฐ์ค ํ์
- ๋ฆฌํฐ๋ด
- ๋ณ์ ์ ์ธ ๋ฐ ์ด๊ธฐํํ๋ ๋ฐฉ๋ฒ
- ๋ณ์์ ์ค์ฝํ์ ๋ผ์ดํํ์
- ํ์
๋ณํ, ์บ์คํ
๊ทธ๋ฆฌ๊ณ ํ์
ํ๋ก๋ชจ์
- 1์ฐจ ๋ฐ 2์ฐจ ๋ฐฐ์ด ์ ์ธํ๊ธฐ
- ํ์
์ถ๋ก , var
---
</br>
#### 2-1. ํ๋ฆฌ๋ฏธํฐ๋ธ ํ์
์ข
๋ฅ์ ๊ฐ์ ๋ฒ์ ๊ทธ๋ฆฌ๊ณ ๊ธฐ๋ณธ ๊ฐ
---
> Primitive type of Ja... |
Markdown | UTF-8 | 711 | 3.296875 | 3 | [] | no_license | # Introduction ๅ่จ
This module is written for the learners with Mathematic background.
Before start to read the contents later, you need to understand all the concepts inside the basic part.
In the following tutorials, Iโm going to use some mathematical concepts as examples to continue explaining `gm`.
---
ๆฌๆจกๅๆฏไธไธบๆฐๅญฆ... |
JavaScript | UTF-8 | 3,339 | 3.03125 | 3 | [] | no_license | //= require snake
(function(root) {
var SnakeUI = root.SnakeUI = (root.SnakeUI || {});
var View = SnakeUI.View = function(htmlEl, max_x, max_y) {
this.$el = htmlEl;
this.length = max_x;
this.width = max_y;
};
var handleKeyEvent = function(event) {
switch(event.keyCode) {
case 37... |
Shell | UTF-8 | 282 | 2.53125 | 3 | [] | no_license | #!/bin/sh
set -e -x
COMMIT=`git rev-parse HEAD`
COMMIT_ABBREV=`git rev-parse --short HEAD`
COMMIT_TIME=`git log -1 --format=%cd`
CI=true \
REACT_APP_GIT_SHA=${COMMIT} \
REACT_APP_GIT_SHA_ABBREV=${COMMIT_ABBREV} \
REACT_APP_COMMIT_TIME=${COMMIT_TIME} \
npm run build
|
JavaScript | UTF-8 | 573 | 3.84375 | 4 | [] | no_license | // 2.) getItemsByBrand(array, brand)
// Create a function called getItemsByBrand that
// takes an item array returns a new array of all items
// of a specified brand.
// Test this function by searching for Sony, Cannon, Nikon and Panasonic.
var data = require("./products.json")
var getItemsByBrand = function (ar... |
Java | UTF-8 | 3,126 | 3.765625 | 4 | [] | no_license | /**
* A fully static class offering some simple utility
* random functions. It allows the generating of random
* values between a minimum and maximum value.
*
* This is meant as a small utility class for times when you
* need a one off random number between a given range.
* It is designed to save the time and t... |
Java | UTF-8 | 866 | 2.25 | 2 | [] | no_license | package com.algaworks.algafood.api.assembler;
import java.util.List;
import java.util.stream.Collectors;
import org.modelmapper.ModelMapper;
import org.springframework.stereotype.Component;
import com.algaworks.algafood.api.dto.FormasPagamentoDTO;
import com.algaworks.algafood.domain.model.FormasPagamento;
@Compone... |
Python | UTF-8 | 801 | 3.484375 | 3 | [] | no_license | # A starter program for Python with Tkinter
from tkinter import * # import Tkinter library
from tkinter.ttk import *
from ttkthemes import ThemedTk
window = ThemedTk(theme = "arc") # Create the application window
window.title("Hello")
window.geometry('500x500')
combo = Combobox(window)
combo['values']= (1, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.