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 |
|---|---|---|---|---|---|---|---|
Go | UTF-8 | 391 | 3.34375 | 3 | [
"MIT"
] | permissive | package mathutil
import "sort"
// Copy copies an array of float64s.
func Copy(input []float64) []float64 {
output := make([]float64, len(input))
copy(output, input)
return output
}
// SortCopy copies and sorts an array of floats.
func SortCopy(input []float64) []float64 {
inputCopy := make([]float64, len(input))... |
Java | UTF-8 | 3,761 | 1.773438 | 2 | [
"Apache-2.0",
"GPL-1.0-or-later",
"CDDL-1.0",
"MIT",
"LGPL-2.1-or-later"
] | permissive | /*
* Copyright (c) 2014 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
C# | UTF-8 | 5,017 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Xml;
using Newtonsoft.Json.Linq;
namespace WindowsFormsCalculation
{
class FtpManager
{
int count = 1;
public FtpWebResponse connectServer(string ip, string id, string pw, string... |
Python | UTF-8 | 3,009 | 3.0625 | 3 | [
"MIT",
"NCSA",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | """!
@brief Pytorch abstract dataset class for inheritance.
@author Efthymios Tzinis {etzinis2@illinois.edu}
@copyright University of illinois at Urbana Champaign
"""
from abc import abstractmethod
import inspect
class Dataset:
@abstractmethod
def get_arg_and_check_validness(self,
... |
TypeScript | UTF-8 | 1,524 | 2.5625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HeroModel } from '../models/hero.model';
import { map } from 'rxjs/operators';
@Injectable({
providedIn: 'root'
})
export class HeroesService {
private mainURL = 'https://roco-8b1a4.firebaseio.com';
construct... |
C# | UTF-8 | 847 | 3.265625 | 3 | [] | no_license | using System;
namespace TrialConsoleAppWithGit
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hi My Name is Shanice");
Console.WriteLine("I am here to help");
Console.WriteLine("What is your name?");
var usersName = Consol... |
Java | UTF-8 | 1,618 | 1.921875 | 2 | [
"MIT"
] | permissive | package net.minecraft.util.datafix.fixes;
import com.mojang.datafixers.DSL;
import com.mojang.datafixers.DataFix;
import com.mojang.datafixers.TypeRewriteRule;
import com.mojang.datafixers.schemas.Schema;
import com.mojang.datafixers.util.Pair;
import java.util.stream.Collectors;
import net.minecraft.util.datafix.Type... |
Java | UTF-8 | 360 | 2.140625 | 2 | [] | no_license | package schmoller.unifier.mods.mekanism;
import mekanism.common.RecipeHandler.Recipe;
import schmoller.unifier.Mappings;
public class CombinerProcessor extends MekanismBaseProcessor
{
@Override
public String getName()
{
return "Combiner";
}
@Override
public int applyMappings( Mappings mappings )
{
return ... |
SQL | UTF-8 | 1,500 | 2.921875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 17, 2019 at 08:18 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
Markdown | UTF-8 | 908 | 2.5625 | 3 | [
"MIT"
] | permissive | ## Example Application ##
This is a simple example application demonstration how ASP.NET Core, Angular 2, TypeScript and WebPack (to name just these four) work together.
### Before the first launch ###
Before launching the application for the first time after cloning the repository make sure to rebuild the vendor scri... |
Markdown | UTF-8 | 3,072 | 2.765625 | 3 | [
"MIT"
] | permissive | # Convergence Input Element Bindings
[](https://github.com/convergencelabs/input-element-bindings/actions/workflows/build.yml)
This module provides a set of utilities to bind plain HTML Input / Form Elements to a ... |
Java | UTF-8 | 10,344 | 1.976563 | 2 | [] | no_license | package com.bw.movie.model;
import com.bawei.mymovie.R;
import com.bw.movie.api.DetailsApiServise;
import com.bw.movie.api.MyApiServise;
import com.bw.movie.contract.MyContract;
import com.bw.movie.model.entity.UserFollowCinemaEntity;
import com.bw.movie.model.entity.UserFollowMovieEntity;
import com.bw.movie.model.en... |
C | GB18030 | 1,678 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
int main (int argc , char **argv)
{
xmlDocPtr pdoc = NULL;
xmlNodePtr proot = NULL, pcur = NULL;
/*****************xmlĵ********************/
xmlKeepBlanksDefault(0);//ϣֹԪǰĿհıŵһnode
pdoc = xmlReadFile ("test.xml", ... |
C++ | UHC | 676 | 3.109375 | 3 | [] | no_license | /*
2016.8.22
BaekJoon Online Judge
Problem Solving
Seong Joon Seo (ID: jjunCoder)
Problem
#1065
Ѽ
( X ڸ ̷ٸ Ѽ Ѵ.)
*/
#include <iostream>
using namespace std;
bool isHanSu(int n) {
if (n < 100)
return true;
if (n == 1000)
return false;
int n1, n2, n3;
n1 = n % 10;
n /= 10;
n2 = n % 10;
n /= 10;
n... |
Java | UTF-8 | 1,619 | 2.65625 | 3 | [] | no_license | package bombercraft.game.entity.wall;
import java.awt.Graphics2D;
import bombercraft.game.GameAble;
import bombercraft.game.entity.Entity;
import bombercraft.game.level.Block;
import utils.math.GVector2f;
public abstract class Wall extends Entity{
public Wall(GVector2f position, GameAble parent) {
super(position... |
Python | UTF-8 | 765 | 2.703125 | 3 | [] | no_license | import PySimpleGUI as sg
from PIL import Image, ImageTk, ImageSequence
from PySimpleGUI.PySimpleGUI import TITLEBAR_MINIMIZE_KEY, Titlebar, popup_animated
sg.theme('DarkAmber')
gif_filename = r'shapeB.gif'
layout = [[
[sg.Image(filename=gif_filename,
enable_events=True,
key="-IMAGE-"... |
Markdown | UTF-8 | 1,540 | 3.21875 | 3 | [] | no_license | # How to start a process from a JavaScript action
var processInstanceId = **startActivitiProcess** (processId, obj);
* processId: process id
This value can be retrieved from the list of the processes or from the Web Modeler. Example: in the "Execution process list" you can see all the processes. To be more precise, ... |
Java | UTF-8 | 1,917 | 4.0625 | 4 | [] | no_license | package leetcode;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
/**
* 给定一个字符串,找到最长不含有重复字符的子字符串
*/
class LongestSubstring {
public static void main(String[] args) {
// String str = "abc";
// String str = "abcabcbb";
// String str = "cdd";
String str = "abba";
System.out.printl... |
PHP | UTF-8 | 831 | 2.796875 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Trevor
* Date: 2019/5/30
* Time: 19:13
*/
namespace lib;
/**
* Class App
* @package lib
*/
class App
{
/**
* 应用运行入口
*/
static public function run()
{
$version='v1';
$action='Index';
if (isset($_SERVER['REQUEST_URI'])){
... |
Swift | UTF-8 | 3,897 | 2.640625 | 3 | [] | no_license | //
// APIYahoo.swift
// hiragana
//
// Created by Pongrapee Attasaranya on 2020/02/11.
// Copyright © 2020 Majorl3oat. All rights reserved.
//
import Foundation
class APIYahoo: NSObject, XMLParserDelegate {
// MARK: - Declaration
struct API {
private init() {}
static let... |
Markdown | UTF-8 | 1,500 | 2.8125 | 3 | [] | no_license | 3613点威力尽显
====
**今天的走势极端技术化,前面已经明确说了,只要站不住3613点,就要再次探底。今天低开后,在60分钟刚好跌破顶分型的下边,早上那标准的回抽,极端显然地上不了3613点,因此确认这对顶分型下边的跌破是有效的,因此后面的下跌就顺理成章了,为什么?因为向下要形成笔。**
** **
**现在的走势很显然了,向上的笔后形成向下笔的调整,也就力度最大那种调整,因此,后面在向下笔结束前,都不适宜再度介入。但一旦向下笔结束,就又有一次美妙的短差机会。**
** **
**各位,看到没有,就用一个简单的60分钟分型结构是否延伸为笔,我们就能完全把握这样的走势与相应的退出,现在,我们只需要等待新的买... |
Java | UTF-8 | 4,835 | 2.15625 | 2 | [
"Apache-2.0"
] | permissive | package github.hemandroid.checkifscreenlocked;
import android.app.KeyguardManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.Ringtone;
import android.net.Uri;
import android.os.Bundle;
import androi... |
JavaScript | UTF-8 | 1,434 | 2.59375 | 3 | [] | no_license | const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
window = dom.window;
document = window.document;
XMLHttpRequest = window.XMLHttpRequest;
var _0x5490 = ["length", " ", "offsecphun1.gif", "offsecphun2.png", "getSeconds", "floor", "<img src=\'", "\'>",... |
C++ | UTF-8 | 3,044 | 3.296875 | 3 | [] | no_license | //
// main.cpp
// rank_simple
//
// Created by Sean Yang on 2019/2/27.
// Copyright © 2019 Sean Yang. All rights reserved.
//
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
#define LENGTH 20
int *getMergeArray(int arr1[],int arr2[],int max_length_array_a,int max_length_array_b);
i... |
Java | UTF-8 | 2,280 | 2.34375 | 2 | [] | no_license | package routes;
import core.IO.Reader;
import core.PlagiarismDetection.Assignment;
import core.PlagiarismDetection.Submission;
import core.PlagiarizerFactory.Factory;
import com.fasterxml.jackson.databind.ObjectMapper;
import core.configuration.ApplicationConfig;
import org.springframework.http.ResponseEntity;
import ... |
Python | UTF-8 | 1,274 | 3.1875 | 3 | [] | no_license | #!/usr/bin/python
# https://wiki.wxpython.org/AnotherTutorial
import wx
class MyMenu(wx.Frame):
def __init__(self, parent, id, title):
wx.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(200, 100))
# menubar
menubar = wx.MenuBar()
# menus
file = wx.Menu(... |
C++ | UTF-8 | 438 | 2.875 | 3 | [] | no_license | #include <stdint.h>
#include<stdio.h>
#include<stdlib.h> //strlen
int main(int argc, char** argv) {
if (argc != 3) {
printf("Wrong number of argumens, expected 2 arguments.");
return -1;
}
uint8_t x1 = (uint8_t) atoi(argv[1]);
uint8_t x2 = (uint8_t) atoi(argv[2]);
... |
Go | UTF-8 | 226 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | package singleton
import (
"log"
"sync"
)
var a *Alone
var once sync.Once
func GetInstance() *Alone {
once.Do(func() {
a = &Alone{}
})
return a
}
type Alone struct{}
func (a Alone) Alone() {
log.Println("a...")
}
|
C | UTF-8 | 909 | 3.75 | 4 | [] | no_license | #include <stdio.h>
#include <math.h>
float a, b, c,delta, x1, x2;
int main()
{
/* printf("Entrez la valeur de a : ");
scanf("%f\n",&a);
printf("Entrez la valeur de a : %f\n", a);
printf("Entrez la valeur de a : %f\n", c);
*/
a=0;
b=0;
c=0;
x1=0;
x2=0;
printf("\n*** Programme Po... |
Java | UTF-8 | 499 | 1.976563 | 2 | [] | no_license | package com.event_manager.eventservice.repositories;
import com.event_manager.eventservice.models.Goody;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.List;
public interface ... |
C++ | UTF-8 | 1,067 | 3.390625 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
#define read() freopen("input.txt", "r", stdin)
#define write() freopen("output.txt", "w", stdout)
using namespace std;
bool balance(string s);
bool check(char a, char b);
int main(void)
{
int T;
cin >> T;
cin.ignore();
for(int i = 1; i <= T; i++){
string s;
g... |
C# | UTF-8 | 343 | 2.75 | 3 | [] | no_license | void Main()
{
var dt = new MyData();
FillTracking(dt);
}
public void FillTracking(TrackableObject obj)
{
obj.LastUpate = DateTime.Now;
}
public class TrackableObject
{
public DateTime LastUpate { get; set; }
}
public class MyData : TrackableO... |
Python | UTF-8 | 5,629 | 3.375 | 3 | [] | no_license | #! /usr/bin/env python
#
def cpv ( f, a, b, n ):
#*****************************************************************************80
#
## CPV estimates the Cauchy Principal Value of an integral.
#
# Location:
#
# http://people.sc.fsu.edu/~jburkardt/f_src/cauchy_principal_value/cpv.f90
#
# Discussion:
#
# This fun... |
C++ | UTF-8 | 137 | 2.5625 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
int main(){
int null=0, *p=&null;
double * p2=NULL;
std::cout << *p << std::endl;
return 0;
}
|
Markdown | UTF-8 | 8,533 | 3.390625 | 3 | [] | no_license | # JVM相关
## 目录
1. 介绍一下Class文件
2. Java虚拟机运行时的数据区
3. 双亲委派模型
4. 判断Java中对象存活的算法
5. JVM垃圾回收算法
* 介绍一下Class文件
Java诞生之初,Java的规范就拆分为Java语言规范和Java虚拟机规范,为了实现Java语言的平台无关性,各种不同平台的虚拟机都统一使用的程序存储格式,也就是字节码。使用Java编译器可以把Java代码编译成为存储字节码的Class文件。Class文件是一组以8个字节为基础单位的二进制流,每一个Class文件都对应着唯一一个类或接口的定义信息。
* Java虚拟机运行时的数据区
分为 **程序计数器**,**Jav... |
Java | UTF-8 | 234 | 2.40625 | 2 | [] | no_license | package com.codingame.game.exception;
@SuppressWarnings("serial")
public class CellNotValidException extends GameException {
public CellNotValidException(int id) {
super("You can't plant a seed on cell " + id);
}
}
|
TypeScript | UTF-8 | 1,308 | 2.84375 | 3 | [] | no_license | import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import { Product } from "../Products/products.slice";
import { RootState } from "../store";
// interface CartProduct extends Product {
// amount: number
// }
type CartProduct = Product & {
amount: number
}
const CartSlice = createSlice({
name: 'Car... |
Python | UTF-8 | 946 | 4.0625 | 4 | [] | no_license | '''
Created on 24-May-2020
@author: sasidharl
Tuple - examples
'''
if __name__ == '__main__':
pass
# declare tuple
a = ("apple", "banana", "watermelon")
#
print("a length : ",len(a))
# print all values from tuple
print(a)
# print value by index
print(a[1])
#print value by negative index
# -1 refers the last... |
Markdown | UTF-8 | 1,809 | 3.265625 | 3 | [] | no_license | ## Data Structure and Algorithms in Python
1. Stack
- Determine if brackets are balanced
- Reverse string
- Convert decimal integer to binary
2. Singly Linked Lists
- Insertion
- Deletion by value
- Deletion by position
- Length
- Node swap
- Reverse
- Merge two sorted linked ... |
Markdown | UTF-8 | 1,900 | 2.71875 | 3 | [] | no_license | 仿MIUI计算器
===========
基本功能:
1,完成了基本的加减乘除运算。
2,表达式出错(例如除以0)会返回错误。
3,点击等号后会有运算小动画(视图动画)。
4,点击等号运算结束后,再点击运算符和数字会有不同的效果,即点击运算符会把上一次的结果当做第一个数参与运算,而点击数字会清空重新输入。
5,完成科学计算界面
6,完成简易计算器与科学计算器之间的动画变换。
7,待完善科学计算的计算程序........囧,还没写完
重点:
* 键盘界面仿的小米计算器,使用TableLayout,由于TableLayout不支持合并行,因而采用了嵌套的方式来显示跨行的等号。
* 最上面的表达式和结果显... |
Java | UTF-8 | 6,234 | 1.984375 | 2 | [] | no_license | /**
* Copyright 2010-present Facebook.
*
* 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 agre... |
Markdown | UTF-8 | 5,537 | 2.59375 | 3 | [] | no_license | Local reply modification {#config_http_conn_man_local_reply}
========================
The
`HTTP connection manager <arch_overview_http_conn_man>`{.interpreted-text
role="ref"} supports modification of local reply which is response
returned by Envoy itself.
Features:
- `Local reply content modification<config_http_... |
Java | UTF-8 | 1,000 | 2.609375 | 3 | [] | no_license | import java.util.*;
import java.sql.*;
import java.sql.Date;
import java.io.*;
import java.math.*;
public class Fines {
private int Loan_id;
private Double Fine_amt = 0.00;
private boolean Paid = false;
public Fines(int Loan_id) {
super();
this.Loan_id= Loan_id;
}
public Fin... |
Java | UTF-8 | 642 | 3.09375 | 3 | [] | no_license | package hongbao67;
import java.util.ArrayList;
import java.util.Random;
public class Memeber extends User {
public Memeber(String name, int money) {
super(name, money);
}
public void receive(ArrayList<Integer> list ){ //创建receive方法 接收空集合
Random random=new Random(); //生... |
Markdown | UTF-8 | 5,775 | 2.828125 | 3 | [] | no_license | ---
nid: '1961'
title: 'The Knights of Free Software'
authors: 'Matt Barton'
published: '2006-12-20 21:52:23'
tags: 'ethics,philosophy,religion'
license: verbatim_only
section: opinions
listed: 'true'
---
Lately, I've been thinking about what the free software movement is really about. Is it really just a bunch of guy... |
Python | UTF-8 | 472 | 3.703125 | 4 | [] | no_license | def binary_search(number_list, number):
first = 0
last = len(number_list) - 1
number_found = False
while first <= last and not number_found:
middle = (first + last) / 2
if number_list[middle] == number:
number_found = True
else:
if number < number_list[mid... |
Go | UTF-8 | 1,248 | 2.8125 | 3 | [] | no_license | package cache
import (
"gopkg.in/redis.v4"
"testing"
)
const (
largeSize = 4234987444
)
func TestSet(t *testing.T) {
redisClient := redis.NewClient(&redis.Options{Addr: "localhost:6379", Password: "", DB: 13})
subject := RedisMetadataStore{redisClient}
if err := subject.Set("key", &Metadata{"text/html", largeS... |
Python | UTF-8 | 7,569 | 3.546875 | 4 | [] | no_license | from classes.Piece import Piece
from classes.Queen import Queen
class Pawn(Piece):
def create(self, id, color, position):
self.id = id
self.type = "Pawn"
self.color = color
self.position = position
self.isCaptured = False
#print("Creating " + self.color + " " + self... |
C++ | UTF-8 | 7,845 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "GameEngineMain.h"
#include <assert.h>
#include <thread>
#include <chrono>
#include <iostream>
#include <SFML/Graphics.hpp>
#include "Util/TextureManager.h"
#include "Util/AnimationManager.h"
#include "Util/ButtonManager.h"
#include "Util/CameraManager.h"
using namespace GameEngine;
float GameEngineMain::WI... |
Python | UTF-8 | 1,309 | 2.53125 | 3 | [
"MIT"
] | permissive | import matplotlib
matplotlib.use('TKAgg')
import matplotlib.pyplot as plt
import sys
sys.path.append('..')
import eccentricPre as SN
import pandas as pd
import numpy as np
import astropy.units as units
inputs = 50
Mcomp = 20 #np.random.choice(a=range(3,21), size=50, replace=false)
Mhe = 5 #np.random.choice(a=range(3,... |
Python | UTF-8 | 236 | 2.78125 | 3 | [] | no_license | from AOC import read_input
from string import ascii_letters
inp = read_input()
c = 0
for i in inp.strip().split('\n'):
l = len(i)
c1, c2 = set(i[:l//2]), set(i[l//2:])
c += ascii_letters.index(list(c1 & c2)[0])+1
print(c) |
Python | UTF-8 | 388 | 3.578125 | 4 | [] | no_license | #import a memory_profiler module
from memory_profiler import profile
#Using a for loop
@profile
def my_func():
a = range(1000)
b = []
for i in a:
b.append(i * 2)
return b
#using list to illustrate the memory usage
@profile
def my_second():
a = range(1000)
b = [i * 2 for i in a]
... |
Markdown | UTF-8 | 1,734 | 2.578125 | 3 | [] | no_license | # Course project
Neobis course project was created as part of our study plan, using django and django rest framework.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the proje... |
JavaScript | UTF-8 | 4,681 | 3 | 3 | [] | no_license | //
// BOTER, KAAS EN EIEREN RULESET
//
exports.gameMove = function(globalGameState, room, move) {
var player = globalGameState[room]["init"][globalGameState[room]["users"][globalGameState[room]["active"]]];
var gamestate = JSON.parse(globalGameState[room]["gamestate"]);
if (ruleSet(move, gamestate)) {
... |
Ruby | UTF-8 | 1,465 | 3.265625 | 3 | [
"Ruby"
] | permissive | # Author:: Michael J. Bruderer
# Copyright:: March 2009
# License:: Ruby License
# Email: ojos@gmx.ch
begin
require 'rubygems'
require 'chronic'
require 'date'
$CHRONIC_INSTALLED=true
rescue LoadError
$CHRONIC_INSTALLED=false
end
class Newtodos
@todo_string = ''
def initialize s=''
$stderr.print... |
Python | UTF-8 | 938 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | class Solution:
# @param A: An integers list.
# @return: return any of peek positions.
def findPeak(self, A):
if not A:
return -1
l, r = 0, len(A) - 1
while l + 1 < r:
# 取中点位置
mid = l + int((r - l) / 2)
# 判断中点位置左右情况
# 左>中,峰... |
Java | UTF-8 | 3,679 | 3.203125 | 3 | [] | no_license | /*
Provides an abstracted version of a client. This class handles anything related
*/
package client;
//Socket Class
import java.net.Socket;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.... |
JavaScript | UTF-8 | 2,992 | 3.5 | 4 | [] | no_license | class TypeWriter {
constructor(txtElement, words, wait = 3000) {
this.txtElement = txtElement;
this.words = words;
this.txt = "";
this.wordIndex = 0;
this.wait = parseInt(wait, 10);
this.type();
this.isDeleting = false;
}
type() {
// Current i... |
Java | UTF-8 | 3,691 | 2.078125 | 2 | [
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* IzPack - Copyright 2001-2020 The IzPack project team.
* All Rights Reserved.
*
* http://izpack.org/
*
* 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.o... |
C# | UTF-8 | 854 | 2.609375 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
using System;
[Serializable]
public class Stat
{
[SerializeField]
private Bar bar;
[SerializeField]
private int maxVal;
[SerializeField]
private int currentVal;
public void LinkBarToObject(GameObject card)
{
bar = card.GetComponent<... |
Python | UTF-8 | 1,458 | 3.65625 | 4 | [] | no_license | # 18.03.2019
# br = value/weight
# Bir hirsizin cantasinin kapasitesi 40 br
class item(object):
def __init__(self, n, v, w):
self.name = n
self.value = v
self.weight = w
item_1 = item('computer', 200, 20)
item_2 = item('clock', 175, 10)
item_3 = item('painting', 90, 9)
item_4 = item('ra... |
Shell | UTF-8 | 4,298 | 3.75 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env bash
set -e
INTERACTIVE=${INTERACTIVE:-"yes"}
BUILD_IMAGE=${BUILD_IMAGE:-"no"}
COM=$@
PORTS=${PORTS:-"8002-8010"}
export PORTS=${PORTS:-"8002-8010"}
CONTAINER_PORTS=${PORTS}
export CONTAINER_PORTS=${PORTS}
FOLDER_NAME=${PWD##*/}
PROJECT_NAME=${FOLDER_NAME}
export FOLDER_NAME=${PWD##*/}
if [ "${INTERACT... |
C++ | UTF-8 | 4,488 | 3.046875 | 3 | [] | no_license | #include "LineSeries.hpp"
#include <fstream>
#include <random>
#include <tuple>
#undef min
LineSeries::LineSeries(const std::vector<vec2>& line_points, vec4 color) :
mLinePoints(line_points), mColor(color) {
}
void LineSeries::push(const vec2& point) {
mLinePoints.push_back(point);
}
void LineSeries::pop() {
a... |
Python | UTF-8 | 133 | 4 | 4 | [] | no_license | c = input('Enter any alphabet:')
vowel = 'aeiouAEIOU'
if c in vowel:
print(f'{c} is vowel')
else:
print(f'{c} is consonant') |
JavaScript | UTF-8 | 935 | 3 | 3 | [] | no_license | function is_object(mixedVar)
{
return mixedVar instanceof Object;
}
function isset(obj)
{
if((typeof obj == 'undefined') || (obj === null) || (obj === ""))
{
return false;
}
else
{
return true;
}
}
var apiJs = {
typeRequest: '',
urlRequest: '',
typeResponse: '',
stringParam: '',
}
apiJs... |
SQL | UTF-8 | 3,040 | 4.3125 | 4 | [] | no_license | -- # 12-1 객체를 생성, 변경, 삭제하는 데이터 정의어
/*
데이터 정의어(DDL : Data Definition Language)는 데이터베이스 데이터를 보관하고 관리하기
위해 제공되는 여러 객체의 생성, 변경, 삭제 관련 기능을 수행하는 언어이다.
주의사항
사용자 정의어 실행은 COMMIT 효과를 낸다
*/
-- # 12-2 테이블을 생성하는 CREATE
-- 모든 열의 각 자료형을 정의해서 테이블 생성하기
CREATE TABLE EMP_DDL(
EMPNO NUMBER(4),
ENAME VARCHAR2(10),
JOB VARCHAR2(9)... |
Java | UTF-8 | 805 | 2.09375 | 2 | [] | no_license | package blog.vo;
public class Likey {
private int lokeyNo;
private int postNo;
private String memberId;
private int likeyCk;
private String likeyDate;
public int getLokeyNo() {
return lokeyNo;
}
public void setLokeyNo(int lokeyNo) {
this.lokeyNo = lokeyNo;
}
public int getPostNo() {
r... |
C# | UTF-8 | 44,628 | 3 | 3 | [
"Apache-2.0"
] | permissive | // Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may no... |
Markdown | UTF-8 | 2,551 | 2.796875 | 3 | [] | no_license | Being a blogger myself, I realise how much
quality content is written on the internet every day;
content that gets lost in an endless stream of online information.
I know how much you want to be able to share your content with an audience,
but it's so difficult to do.
Twitter is very momentarily; Reddit suffers fro... |
JavaScript | UTF-8 | 846 | 3.203125 | 3 | [] | no_license | function splitText(parent_div_class, wrapper_class_name, class_name) {
let parent_array = document.getElementsByClassName(parent_div_class);
for(var j=0; j<parent_array.length; j++) {
let text = parent_array[j].innerText;
parent_array[j].innerText = "";
let word = text.split(" ");
for(var i=0; i<word.length... |
Java | UTF-8 | 1,273 | 4.09375 | 4 | [] | no_license | package jb02.part02;
/*
1. while (조건)
2. do.. while (조건)
활용 및 차이점을 확인.
*/
public class WhileTest
{
public static void main(String[] args)
{
//while 문
int i = 0; // #1. 순환문의 조건을 주기위한 int i 초기화
while (i < 10) // #2. 조건 ( boolean data type )
// while ( 0 ) { // ==> compile error (error를 확인하면... )
{
... |
Markdown | UTF-8 | 1,155 | 2.546875 | 3 | [] | no_license | # Article 2
Le ministre chargé de l'éducation attribue chaque année aux recteurs d'académie une dotation d'indemnités de sujétions spéciales pour chaque degré d'enseignement.
Pour le second degré, les recteurs répartissent la dotation correspondante entre les collèges et les lycées de l'académie et établissent annuel... |
Java | UTF-8 | 3,044 | 2.234375 | 2 | [] | no_license | package org.stepdefinition;
import java.util.List;
import java.util.Map;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.When;
public class AddingTarifff {
static WebDriver driver;
@... |
Python | UTF-8 | 780 | 3.5625 | 4 | [] | no_license | def get_data():
f = open("inputs/input2.txt", "r")
lines = f.read().splitlines()
f.close()
return lines
def day2(items):
x = 0
y = 0
for i in items:
first = int(i.split("-")[0])
second = int(i.split("-")[1].split(" ")[0])
character = i.split(" ")[1].split(":")[0]
... |
Java | UTF-8 | 357 | 3.015625 | 3 | [] | no_license | class Lab298{
public static void main(String[] arg)
{
Hello h=new Hello();
String a= h.add(10,"jlc");
System.out.println(a);
String b= h.add("jlc",30);
System.out.println(b);
}
}
class Hello{
String add(int a,String b){
System.out.println("add(int,string)");
return a+b;
}
String add(String a,int b){
System.out.println... |
C++ | UTF-8 | 1,339 | 3.109375 | 3 | [] | no_license |
class Solution {
public:
//the role of multi
void helper(string num, int pos, int target, long curr, long multi, string path, vector<string> & res) {
if (pos == num.length()) {
if (curr == (long)target) {
cout << curr << " " << target << endl;
res.push_back(p... |
C | UTF-8 | 1,887 | 2.8125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* get_color.c :+: :+: :+: ... |
PHP | UTF-8 | 4,638 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use App\DiscountType;
use App\Bookingfact;
use DateTime;
use Validator;
use App\Lib\Calculator;
class Reservation extends Model
{
private $field;
private $price;
private $errorsMessages;
public function bookingfacts()
{
return $this->b... |
Java | UTF-8 | 3,073 | 3 | 3 | [] | no_license | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException{
//BufferedReader f = new BufferedReader(new FileReader("uva.in"));
BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
//PrintWriter out = new PrintWrite... |
Markdown | UTF-8 | 2,256 | 3.296875 | 3 | [] | no_license | # MacOS-like diacritical mark input for Windows
This is an AutoHotKey script that emulates the MacOS diacritical mark input mechanism under Windows.
As a developer, I find the US keyboard layout superior for coding. As a spanish speaker, I need to be able to easily add diacritical marks to characters when typing, but ... |
Ruby | UTF-8 | 338 | 2.75 | 3 | [
"MIT"
] | permissive | module Mlc
module Abstract
class Block
def initialize
@children = []
end
def <<(child)
@children << child
end
def to_lua(indent, options, state)
i = ' ' * indent
i + @children.map {|el| el.to_lua(indent + 1, options, state)}.join("\n#{i}")
end... |
Python | UTF-8 | 1,506 | 3.03125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
import requests
import json
from urllib.parse import urlencode
from haversine import haversine
import sys
from tabulate import tabulate
API_URL = "https://maps.googleapis.com/maps/api/geocode/json"
API_VELOV_URL = "https://download.data.grandlyon.com/ws/rdata/jcd_jcdecaux.jcdve... |
C | UTF-8 | 13,846 | 3.96875 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <time.h>
/* CURRENT IDEA:
numbers are stored using a singly linked list where the orders of magnitude are backwards
ex. 1024 would be stored as [ 4, 2, 0, 1 ]
it should be stored backwards because in order fo... |
C++ | UTF-8 | 556 | 2.578125 | 3 | [] | no_license | #ifndef INFORMATIONOBJECT_H
#define INFORMATIONOBJECT_H
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
class InformationObject
{
public:
InformationObject();
void setContours(vector<vector<Point>>);
void setCenter(Point2f)... |
Java | UTF-8 | 867 | 3.46875 | 3 | [] | no_license | import java.util.Scanner;
public class PopularVotes {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int T = Integer.parseInt(sc.nextLine());
for (int i = 0; i < T; i++) {
int N = Integer.parseInt(sc.nextLine());
int total = 0;
int highest = -1;
int winner = -1... |
Python | UTF-8 | 6,967 | 3.296875 | 3 | [] | no_license | """
coordinates -- Manipulate and convert coordinates of different types
Notes:
- Currently, UTM calculations do not handle nonstandard zones.
Sources:
- http://www.uwgb.edu/dutchs/usefuldata/utmformulas.htm
- https://en.wikipedia.org/wiki/
Universal_Transverse_Mercator_coordinate_system
- https://en.... |
JavaScript | UTF-8 | 616 | 2.8125 | 3 | [] | no_license | const Discord = require('discord.js')
module.exports = {
name: 'embed',
description: 'send embed message',
execute(msg, args){
if (!msg.member.hasPermission("MANAGE_MESSAGES"))
return msg.channel.send("You lack the permissions to run this command");
let message1 = args.join(" ");
msg.delete... |
JavaScript | UTF-8 | 1,931 | 3.71875 | 4 | [] | no_license | // 210. Course Schedule II
// There are a total of n courses you have to take labelled from 0 to n - 1.
// Some courses may have prerequisites, for example, if prerequisites[i] = [ai, bi] this means you must take the course bi before the course ai.
// Given the total number of courses numCourses and a list of the prere... |
TypeScript | UTF-8 | 930 | 2.796875 | 3 | [] | no_license | import jwtHelper from "../helper/JwtHelper";
const debug = console.log.bind(console);
/**
* Middleware: Authorization user by Token
* @param {*} req
* @param {*} res
* @param {*} next
*/
const isAuth = async (req, res, next): Promise<void> => {
const tokenFromClient = req?.header("Authorization")?.replace("Bea... |
Python | UTF-8 | 978 | 3.765625 | 4 | [] | no_license | import numpy as np
# matrix with data type
npa = np.array(([1,2,3],[4,5,6]), dtype=int)
npb = np.array(([1,3,3],[4,7,6]), dtype=float)
print(npa)
print(npb)
#matrix with fromfunction
def kuadrat(baris,kolom):
return kolom**2
def jumlah(baris,kolom):
return baris+kolom
hasil = np.fromfunction(kuadrat, (1,8),... |
Java | UTF-8 | 1,689 | 2.765625 | 3 | [] | no_license | package com.android.curso.simplelist2;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.Li... |
SQL | UTF-8 | 2,374 | 3.15625 | 3 | [] | no_license | --mysql -u root -p
-- create datase oauth_admin;
-- use oauth_admin;
drop table if exists oauth_client_details;
create table oauth_client_details (
client_id VARCHAR(255) PRIMARY KEY,
resource_ids VARCHAR(255),
client_secret VARCHAR(255),
scope VARCHAR(255),
authorized_grant_types VARCHAR(255),
web_server_... |
PHP | UTF-8 | 2,452 | 2.65625 | 3 | [] | no_license | <?php
namespace Application\Service;
//use Zend\ServiceManager\ServiceManager;
//use Zend\ServiceManager\ServiceManagerAwareInterface;
//use Application\Entity\Admin;
//use Zend\Filter\StaticFilter;
use User\Entity\User;
use Application\Entity\Setting;
use Zend\Crypt\Password\Bcrypt;
/**
* The AdminManager service ... |
TypeScript | UTF-8 | 86 | 2.796875 | 3 | [] | no_license | export const compose = <A, B, C>(f: (b: B) => C, g: (a: A) => B) => (a: A) => f(g(a))
|
Shell | UTF-8 | 143 | 3.53125 | 4 | [] | no_license | #set -x
set -e
data_root=$1
if [[ ! -d ${data_root} ]]; then
echo "error: first arg (${data_root}) needs to be an existing directory."
fi
|
Java | UTF-8 | 180 | 1.539063 | 2 | [] | no_license | package com.cooksys.conversion_tracking.tx;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper=false)
public class TXShort {
Integer num;
}
|
Python | UTF-8 | 771 | 3.875 | 4 | [] | no_license | def convert_time(string):
print('converting %s...' % string)
if 'AM' in string:
print('the time is in the AM.')
if string[:2] == '12':
print('it starts with 12, so change it to 00 instead.')
string = '00%s' % string[2:]
return string[:len(string) - 2]
elif 'PM' in string:
print('the time is in the PM.'... |
Java | UTF-8 | 1,101 | 2.828125 | 3 | [
"MIT"
] | permissive | package com.socrata.datasync.deltaimporter2;
import java.io.IOException;
import java.io.InputStream;
public abstract class ProgressingInputStream extends InputStream {
private final InputStream underlying;
private long count = 0L;
private long lastSentAt = 0L;
public ProgressingInputStream(InputStrea... |
Java | UTF-8 | 458 | 2.453125 | 2 | [
"MIT"
] | permissive | package gameView.observers;
import entity.restricted.IRestrictedEntity;
import java.util.Observable;
import java.util.Observer;
public class EntityObserver implements Observer {
private ObserverManager myObserverManager;
public EntityObserver(ObserverManager images) {
myObserverManager = images;
}
@Override... |
Java | UTF-8 | 7,199 | 1.679688 | 2 | [
"Apache-2.0"
] | permissive | /*
* Licensed to David Pilato (the "Author") under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Author licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.