language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 778 | 2.375 | 2 | [] | no_license | package com.ssrn.test.support.ssrn.website.pagemodel;
import com.ssrn.test.support.browser.Browser;
public class CssSelectorLocatedPopupHyperlink<TVisit> extends UrlChangingHyperlink<TVisit>{
private final String cssSelector;
private final WebPageBase<TVisit> webPage;
private int visitTimeoutSeconds;
... |
Java | WINDOWS-1252 | 629 | 2.1875 | 2 | [] | no_license | package com;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
/**
* Created with IntelliJ IDEA.
* User: ye
* Date: 13-3-17
* Time: 2:38
* To change this template use File | Settings | File Templates.
*/
public class TestClass {
static private final ... |
Java | UTF-8 | 1,524 | 4.1875 | 4 | [] | no_license | package day38Review;
import java.util.ArrayList;
import java.util.Collections;
public class ArrayListCollections {
public static void main(String[] args) {
// TODO Auto-generated method stub
// Arrays class is a class that have a lot of
// static methods to perform common array operation
// Arra... |
TypeScript | UTF-8 | 975 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | import { BaseModel } from './base.model';
/*export const enum ResourceType {
Instance, // Number of instances a user can create
IP, // Number of public IP addresses an account can own
Volume, // Number of disk volumes an account can own
Snapshot, // Number of snapshots an account can own
Template, // Number ... |
PHP | UTF-8 | 2,218 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\DB;
class syncMarsWeatherData extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command... |
Java | UTF-8 | 278 | 2.5625 | 3 | [] | no_license | package day0901;
public abstract class Shape {
volatile int age6;
public abstract void draw();
public void clear(){
System.out.println("/n/n/n/n/nnnnnn");
System.out.println("图形被擦除");
System.out.println("...............");
}
}
|
Java | UTF-8 | 2,050 | 2.1875 | 2 | [] | no_license | package com.smartflow.ievent.dao;
import com.smartflow.ievent.dto.FaultDistributionConditionInputDTO;
import com.smartflow.ievent.dto.PageConditionInputDTO;
import com.smartflow.ievent.model.EventSymptom;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
public interface EventSymptomDao {... |
Java | UTF-8 | 785 | 3.734375 | 4 | [] | no_license | package Day_13;
import java.util.Scanner;
public class Bin2Dec11 {
public static void main(String[] args) {
start();
}
public static boolean checkBinStr(String str) {
return str.matches("[0-1]+");
}
public static int bin2Dec(String str) {
return Integer.parseInt(str,2);
... |
Java | UTF-8 | 403 | 1.984375 | 2 | [] | no_license | package suit;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;
/**
* @Author yuzhenni
* @Date 2020/9/5
*/
public class suitConfig {
@BeforeSuite
public void bs(){
System.out.println("suit运行了");
}
@AfterSuite
... |
JavaScript | UTF-8 | 427 | 3.390625 | 3 | [] | no_license | setTimeout(function(hello) {
console.log('1000ms');
}, 1000, 'hello');
setTimeout(function() {
console.log('500ms');
}, 500);
setTimeout(function() {
setTimeout(function() {
}, 2000);
}, 2000);
Array.prototype.forEachAsync = function(cb) {
for (var i=0; i<this.length; i++) {
setTimeout(cb, 10 * i, thi... |
Markdown | UTF-8 | 205 | 2.765625 | 3 | [] | no_license | # Write a Python program to remove newline characters from a file.
Define a function that takes a string that contains a filepath. The function should remove all the newline characters('\n') in the file.
|
C++ | UTF-8 | 736 | 3.015625 | 3 | [] | no_license | //
// main.cpp
//
// Created by Auon Muhammad Akhtar on 2017-01-01.
// Copyright © 2017 Auon Muhammad Akhtar. All rights reserved.
//
#include "Python.h"
#include <iostream>
#include "Dijkstra.h"
int main(int argc, const char * argv[])
{
//Dijkstra myGR(int sg, float md), where sg = size_graph, md = maximum_di... |
Shell | UTF-8 | 532 | 3.859375 | 4 | [] | no_license | #!/bin/bash
if [ $# -eq 0 ]; then
recursive_clean.sh `pwd`
else
if [ ! -d $1 ]; then
echo "$1 is not a directory. Exiting."
exit 1
fi
file="$1/.AppleDouble"
if [ -d $file ]; then
echo "Found $file. Removing:"; rm -frv $file
fi
for file in `find $1 -type d -maxdepth 1 -mindepth 1 -no... |
Java | UTF-8 | 548 | 3.125 | 3 | [] | no_license | package model;
import java.awt.Color;
import java.awt.Graphics2D;
/**
*
* @author tiwi
*/
public abstract class Shape {
protected final int x;
protected final int y;
protected final int breedte;
protected final int hoogte;
protected final Color kleur;
public Shape(Color kleur, int x, int ... |
PHP | UTF-8 | 1,598 | 2.625 | 3 | [] | no_license | <?php
require '../database/connect.php';
require '../session.php';
include '../function/formatTime.php';
if(isset($_POST['content']) && isset($_POST['id'])){
$content = $_POST['content'];
$id = $_POST['id'];
if(strlen(trim($content)) > 0){
$sql = "I... |
PHP | UTF-8 | 36,015 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
class InmateModel extends CI_Model
{
/**
* Model function to handle the inmate login
* @param array $credentials
* @return mixed[]
**/
public function getMedicineScheduleSearch($credentials)
{
$this->db->sel... |
C# | UTF-8 | 496 | 2.75 | 3 | [] | no_license | using UnityEngine;
public class RandomHelper
{
public static int Range(int x, int y, int key, int range)
{
uint hash = (uint)key;
hash ^= (uint)x;
hash *= 0x51d7348d;
hash ^= 0x85dbdda2;
hash = (hash << 16) ^ (hash >> 16);
hash *= 0x7588f287;
hash ^= (uin... |
C# | UTF-8 | 8,656 | 2.53125 | 3 | [] | no_license | namespace Repository
{
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using IRepository;
using POCO;
public class DegreeAuditRepository : BaseRepository, IDegreeAuditRepository
{
// const string
private const string Add... |
C++ | UTF-8 | 814 | 3.046875 | 3 | [] | no_license | #include "Action.hh"
#include "Board.hh"
using namespace std;
Action::Action (istream& is) {
ordres1.clear();
ordres2.clear();
ordres3.clear();
int id;
while (is >> id and id != -1) {
int x, y;
is >> x >> y;
ordres1[id] = Posicio(x, y);
}
while (is >> id and id != -1) {
int d;
is... |
PHP | UTF-8 | 1,434 | 2.609375 | 3 | [] | no_license | <?php ob_start();
require_once('header.php');
if (isset($_GET['id'])) {
$id = $_GET['id'];
try {
require_once('db.php');
$sql = "SELECT * FROM markers WHERE id = :id";
$cmd = $conn->prepare($sql);
$cmd->bindParam(':id', $id, PDO::PARAM_INT);
$cmd->execute();
$result = $cm... |
Go | UTF-8 | 2,052 | 2.671875 | 3 | [
"MIT",
"BSD-3-Clause",
"MPL-2.0",
"ISC",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | package dnsproxy
import (
"context"
"net"
"reflect"
"runtime"
"testing"
"time"
"github.com/miekg/dns"
"github.com/stretchr/testify/require"
"github.com/datawire/dlib/dlog"
"github.com/telepresenceio/telepresence/v2/pkg/iputil"
)
func TestLookup(t *testing.T) {
type tType struct {
qType uint16
qName s... |
JavaScript | UTF-8 | 387 | 2.65625 | 3 | [] | no_license | /*module.exports = function(req, res, next){
console.log("Hello from the testmodule.js");
res.status(200).send("Hello from the testmodule.js");
next();
}*/
module.exports.testFunction = function(){
console.log("Hello from module.exports.testFunction ");
return "return from module.exports.testFunction!";
//... |
Java | UTF-8 | 551 | 1.8125 | 2 | [] | no_license | package com.ywcjxf.mall.serviceinterface.feign.fallback;
import com.ywcjxf.mall.pojo.IndexAd;
import com.ywcjxf.mall.serviceinterface.feign.IndexAdServiceFeign;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public class IndexAdServiceFeignFallback implements IndexAdServiceFeign {... |
JavaScript | UTF-8 | 723 | 2.671875 | 3 | [] | no_license | // 导入 http 模块
const http = require('http');
const fs = require('fs');
const qs = require('querystring');
const urlM = require('url');
// 创建服务器
var server = http.createServer(function(req, res){
if (req.url == '/favicon.ico') {
return;
}
// 获取 POST 数据
// data 有一段数据到达(很多次)
var str = '';
var n = 1;
r... |
PHP | UTF-8 | 207 | 2.9375 | 3 | [] | no_license | <?php
declare(strict_types = 1);
namespace App\Comparable;
interface IntegerInterface
{
public function getIntegerValue(): int;
public function isMultipleOf(self $toCompare): bool;
}
|
Python | UTF-8 | 364 | 3.171875 | 3 | [] | no_license | import pickle
# my_tuple = (('hello stranger', 'naked cartoon character'), 'penguin meme', 'yo! mama meme')
# with open("my_pickle", 'wb') as my_pickle:
# pickle.dump(my_tuple, my_pickle)
with open("my_pickle", 'rb') as my_pickle:
tp = pickle.load(my_pickle)
print(tp)
first, second, third = tp
for i in fir... |
C | UTF-8 | 5,611 | 2.5625 | 3 | [
"MIT"
] | permissive |
#include "../../include/header.h"
#include "../../include/monitor_queries.h"
#include "../../include/dir_queries.h"
#include "../../include/VaccinMonitor_Utilities.h"
extern struct monitor_info m_structs;
/* ========================================================================= */
bool Compare_vaccinationdates(cha... |
Java | UTF-8 | 278 | 1.617188 | 2 | [] | no_license | package com.jumbo.wms.model.mongodb;
@SuppressWarnings("serial")
public class StaCartonLineCommand extends StaCartonLine {
private Long qty2;
public Long getQty2() {
return qty2;
}
public void setQty2(Long qty2) {
this.qty2 = qty2;
}
}
|
Java | UTF-8 | 1,506 | 2.1875 | 2 | [] | no_license | package kr.or.pets.notice.vo;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.sql.Date;
import org.springframework.stereotype.Component;
/*
noticeImageNo number(10) PRIMARY KEY
, noticeImageFileName varchar2(50)
, regDate DATE DEFAULT sysdate
, noNumber number(10)
, CONSTRAINT FK... |
Java | UTF-8 | 617 | 2.828125 | 3 | [] | no_license | /**
* @author Nastya
*
* This is a simple Microservice Application
* App uses Third Party API of Ice and Fire to find fellows of entered
* characters of the same house who are not dead.Yet.
*
* How to get specified data:
*
* GET + /characters - returns all data stored in database(paginated)
*
* GET + /chara... |
Java | UTF-8 | 177 | 1.585938 | 2 | [
"Apache-2.0"
] | permissive | package com.yundroid.kokpit.commands;
public enum FlyingMode {
FLYING_MODE_FREE_FLIGHT,
FLYING_MODE_HOVER_ON_TOP_OF_ROUNDEL,
FLYING_MODE_HOVER_ON_TOP_OF_ORIENTED_ROUNDEL;
}
|
Python | UTF-8 | 3,290 | 3.3125 | 3 | [
"MIT"
] | permissive | """
dictgen.py
The WPA2 password hint is as follows:
1) It contains two words/acronyms, one with 3 letters and the other with 4
letters. Each letter can be upper or lower case. The two words are separated.
2) It contains 4 consecutive digits.
3) It contains two special characters, the ones above the numbers on the
... |
JavaScript | UTF-8 | 2,018 | 4.03125 | 4 | [] | no_license |
// Array of objects holding the 7 questions and answers
quizArray = [
{
question: "Which programming language is the basic backbone of all websites we browse online today?",
answer: "html"
},
{
question: "Which programming language is currently the most commonly used for front-end development?",
answer: "ja... |
Java | UTF-8 | 13,411 | 3.984375 | 4 | [] | no_license | package calculator;
import java.util.ArrayList;
import java.util.Stack;
import java.util.Scanner;
import java.io.FileNotFoundException;
import java.io.FileReader;
/**
* The Calculator class. Takes from a .txt file a mathematical expression consisting of the operators "+", "-", "*", "%", or "/", the unary
* ... |
Java | UTF-8 | 704 | 3.046875 | 3 | [] | no_license | public class Main {
public static void main(String[] args) {
//220 284
int sayi1 = 220;
int sayi2 = 284;
int toplam1 = 0;
int toplam2 = 0;
for (int i = 1; i < sayi1; i++) {
if (sayi1 % i == 0) {
toplam1 += i;
}
... |
Python | UTF-8 | 2,127 | 3 | 3 | [] | no_license | import unittest
from src.data_preprocessing.steps.row_bc_col import RemoveRowBcColStep
import pandas as pd
class RRCBRStepTests(unittest.TestCase):
def test__no_col__throws_error(self):
self.assertRaises(Exception, RemoveRowBcColStep(column_name=None, bad_values="some bad values"))
def test__no_... |
JavaScript | UTF-8 | 3,413 | 2.75 | 3 | [
"MIT"
] | permissive | import { html, render } from "https://unpkg.com/lit-html?module";
/*global flyd, P, S, PS*/
var conditions = {
initialState: {
conditions: {
precipitations: false,
sky: "Sunny"
}
},
actions: function(update) {
return {
togglePrecipitations: function(value) {
update({ conditi... |
Java | UTF-8 | 1,621 | 2.59375 | 3 | [] | no_license | package com.jiuge;
import com.jiuge.storage.Storage;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.Arrays;
/**
* @program:Server
* @author:Nine_odes
* @description:
* @create:2020-10-15 17:04
**/
public class UDPServer {
private static Thread w... |
Python | UTF-8 | 1,228 | 3.0625 | 3 | [
"MIT"
] | permissive | import pytest
from inference_logic.data_structures import (
PrologList,
PrologListNull,
UnificationError,
construct,
)
def test__repr__():
assert repr(construct([1, [2, 3], 4])) == "[1, [2, 3], 4]"
def test__eq__fail():
with pytest.raises(UnificationError) as error:
PrologListNull(... |
C# | UTF-8 | 6,180 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using MISA.Core.Entities;
using MISA.Core.Interfaces;
using MISA.Core.Interfaces.Services;
namespace MISA.EMIS.API.Controllers
{
[ApiController]
[Route("api/v1/Employees")]
publ... |
Java | UTF-8 | 1,927 | 2.03125 | 2 | [] | no_license | package testCases;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;
import wdMethods.ProjectMethods;
public class DeleteLeads extends ProjectMethods{
//@Test(dependsOnMethods="testCases.CreateLeadsOOPS.createLead")
//@Test(groups = "regression",dependsOnGroups="sanity")
@Test(d... |
Java | UTF-8 | 803 | 3.65625 | 4 | [] | no_license | package com.radostin.intro.hangman;
import java.util.Random;
/**
* Class which generates random word for hangman game. It contains array with
* words.
*
* @author Radostin Ivanov
*
*/
public class RandomWord {
private static String[] words = { "eggs", "apple", "banana", "cheese", "meat", "cereals"... |
Ruby | UTF-8 | 334 | 2.890625 | 3 | [] | no_license | lines = ARGF.read.split("\n")
num = lines[0].to_i
pyramid = []
def build_first_line(number)
str = []
number.times do |i|
str.push("#{i+1}")
end
return str.join + str.slice(0,str.length-1).reverse.join
end
num.times do |i|
pyramid.push(build_first_line(i+1))
end
puts pyramid + pyramid.slice(0,pyramid.len... |
Python | UTF-8 | 18,827 | 2.578125 | 3 | [] | no_license | import re
from stdlib import *
def lex(fc):
lexlists = []
fc = fc.split("\n")
for fcl in fc:
lexlist = []
tok = ""
state = "undefined"
cache = ""
fcl = list(fcl)
fcl.append("<EOL>")
i = -1
while i < len(fcl) - 1:
i+=1
... |
Markdown | UTF-8 | 585 | 3.125 | 3 | [] | no_license | # speech_say
## comment
Causes text to be spoken using a given voice.
Both the text parameter and the voice parameter are required.
Usually, the voice is obtained using "speechGetVoicesByLanguage", like this:
```kalzit
$voice = first: speechGetVoicesByLanguage: "en".
"This will be said" speechSay voice.
```
If you ... |
Swift | UTF-8 | 2,595 | 3.25 | 3 | [] | no_license |
//
// APIManager.swift
// AssignmentPeople
//
// Created by Palak jain on 18/05/20.
// Copyright © 2020 Palak jain. All rights reserved.
//
import Foundation
import UIKit
class APIManager {
static let instance = APIManager()
enum RequestMethod {
case get
}
//MARK: API calling
func makeGetCal... |
SQL | UTF-8 | 238 | 2.6875 | 3 | [] | no_license | use Pecuniaus;
drop procedure if exists avz_gen_spRetrieveUserTypes;
delimiter $$
Create procedure avz_gen_spRetrieveUserTypes()
begin
select usr.ID as keyId, usr.UserName as description
from tb_users usr Order By usr.UserName asc;
end;
|
C | UTF-8 | 3,751 | 2.53125 | 3 | [] | no_license | #include "csp_gpio.h"
#include "csp_tm4c.h"
#include "tm4c123gh6pm.h"
//initlize each pin
static uint8_t Csp_Gpio_Port(csp_gpio_pinout_t);
static uint8_t Csp_Gpio_Port_Pin(csp_gpio_pinout_t);
void Csp_Gpio_Init(csp_gpio_dev_instance_t* gpio_inst, csp_gpio_dev_config_t gpio_config)
{
uint8_t port;
uint8_t p... |
Java | UTF-8 | 1,013 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | package com.lepeng.fastjson.serializer;
import java.lang.reflect.Type;
import java.math.BigDecimal;
public class BigDecimalSerializer
implements ObjectSerializer
{
public static final BigDecimalSerializer instance = new BigDecimalSerializer();
public BigDecimalSerializer() {}
public void write(JSONSeria... |
Java | UTF-8 | 104 | 1.570313 | 2 | [] | no_license | package com.iscob.iscob.entities.enums;
public enum NewMemberType {
NUEVO_CONVERSO, MENOS_ACTIVO
}
|
C# | UTF-8 | 2,617 | 3.40625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace Pictionary.Model
{
public class Comando : ICommand
{
private readonly Action execute;
private readonly Func<bool> canExecute... |
Java | UTF-8 | 1,134 | 2.390625 | 2 | [] | no_license | package pageObjects;
import common.SysUtil;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class LoginPage {
WebDriver driver;
By btnLogin = By.xpath("//button[@type='submit']");
By txtUser = By.xpath("//*[@placeholder='Email']");
By txtPass = By.xpath("//*[@placeholder=... |
TypeScript | UTF-8 | 1,245 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | import {Injectable} from '@angular/core';
import {LogMessage, Type} from '../../utils/logMessage';
import { DatePipe } from '@angular/common';
import { LogUtils } from 'src/app/utils/LogUtils';
export interface LogMessageListener{
messageAdded(logMessage:LogMessage):void;
}
@Injectable({
providedIn: 'root'
})
ex... |
Markdown | UTF-8 | 3,088 | 3.25 | 3 | [] | no_license | ---
title: "[Daily Coding Problem] #12"
slug: daily-code-12
date: 2020-04-08
categories:
- Daily Code Problems
- Java
tags:
- daily code
- interview
- algorithms
- java
keywords:
- daily
- coding
- java
- problems
- algorithms
- tutorial
- intelij
autoThumbnailImage: true
thumbnailImagePosition: "l... |
C | UTF-8 | 6,277 | 3.09375 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include "thread.h"
#include "function.h"
#include "context.h"
#include "struct.h"
/*
** Function call information.
** Basically just acts as a stack frame.
** Stored in a linked list so they can be reused, avoiding dynamic allocations.
*/
struct Call {
Call* next;
Call*... |
Python | UTF-8 | 6,700 | 2.59375 | 3 | [] | no_license | from .basic import _Basic_class
from .utils import mapping, is_installed
from .music import Music
from distutils.spawn import find_executable
class TTS(_Basic_class):
_class_name = 'TTS'
SUPPORTED_LANGUAUE = [
'zh-CN', # 普通话(中国)
'en-US', # 英语(美国)English-United States
'en-GB', # 英语(英国)En... |
C++ | UTF-8 | 1,061 | 3.625 | 4 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
struct Rect{
double x,y,w,h;
};
double overlap(Rect *r1,Rect *r2){
double area;
if((r1->x + r1->w<=r2->x and r1->y + r1->h>=r2->h) or (r2->x + r2->w <= r1->x and r2->y + r2->h >= r1->y)){
return 0;
}
else if(((r1->x +r1->w <= r2->x +r2->w)and r2->x<r1... |
Swift | UTF-8 | 1,328 | 2.640625 | 3 | [] | no_license | //
// TitleTableViewCell.swift
// FinPlus
//
// Created by nghiendv on 20/06/2018.
// Copyright © 2018 Cao Van Hai. All rights reserved.
//
import UIKit
enum TextCellType {
case TitleType
case DesType
}
class TitleTableViewCell: UITableViewCell {
@IBOutlet weak var leftConstraint: NSLayoutConstraint... |
Python | UTF-8 | 3,665 | 2.8125 | 3 | [] | no_license | import boto3
import os
import logging
from dotenv import load_dotenv
from code.boto_factory import BotoFactory
load_dotenv()
logging.basicConfig(level=logging.WARNING)
class DDBToHTML():
def __init__(self, session):
self.ddb = BotoFactory().get_capability(
boto3.client, session, 'dynamodb'
... |
Shell | UTF-8 | 315 | 3.71875 | 4 | [] | no_license | # this script is for checking disk usage
#For testing
#!/bin/bash
MAX=25
EMAIL=server@127.0.0.1
PART=xvda
USE=$(df -h | grep $PART | awk '{ print $5 }' | cut -d'%' -f1)
if [ $USE -gt $MAX ]; then
echo "Percent used: $USE" | mail -s "Running out of disk space" $EMAIL
else
echo "Disk usage is normal"
fi
|
Java | UTF-8 | 4,515 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | package com.dmelnyk.workinukraine.ui.vacancy_list.core;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.util.Log;
import android.view.ViewGroup;
import com.dmelnyk.workinukraine.ui.vacancy_list.business.IVac... |
JavaScript | UTF-8 | 304 | 3.046875 | 3 | [] | no_license | var newColor = document.getElementsByClassName("invoer");
var kleuren = ["red", "blue", "yellow"]
function colorChange(){
newColor[0].style.backgroundColor = kleuren[Math.floor(Math.random()*kleuren.length)];
newColor[1].style.backgroundColor = kleuren[Math.floor(Math.random()*kleuren.length)];
}
|
C# | UTF-8 | 3,567 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
namespace MASClassLibrary
{
[Serializable]
// public, because it can't be catched in the ActionInterpeter, if its private.
public class WrongTeamException : System.Exception
... |
JavaScript | UTF-8 | 387 | 2.734375 | 3 | [] | no_license | // 2-global.js
// 내장된 전역변수에 대한 이해
// GLOBALS - NO WINDOW !!!
// __dirname - 최근 디렉토리 경로
// __filename - 파일 이름
// require - 모듈을 사용하기 위한 함수
// module - 최근 모듈의 정보
// process - 실행중인 프로그램의 환경 정보
console.log(__dirname)
setInterval(() => {
console.log("hello World!");
},1000);
|
JavaScript | UTF-8 | 4,220 | 2.75 | 3 | [] | no_license | // requiring packages needed for liri.js
var keys = require("./keys.js");
var request = require("request");
require("dotenv").config();
var fs = require("file-system");
var Twitter = require("twitter");
var Spotify = require("node-spotify-api");
var instruction = process.argv[3];
//log the liriCommand and userEntry h... |
Java | UTF-8 | 327 | 2.078125 | 2 | [
"MIT"
] | permissive | package com.groupname.game.controllers;
import org.junit.Test;
import static org.junit.Assert.*;
public class TitleControllerTests {
@Test(expected = NullPointerException.class)
public void gameCannotBeNull() {
TitleController controller = new TitleController();
controller.init(null, null);
... |
Java | UTF-8 | 6,013 | 2.375 | 2 | [] | no_license | package com.currency.exchange.rest;
import com.currency.exchange.advice.CurrencyExchangeErrorResponse;
import com.currency.exchange.exception.CurrencyNotFoundException;
import com.currency.exchange.exception.InvalidCurrencyException;
import com.currency.exchange.service.CurrencyExchangeService;
import com.currency.exc... |
C# | UTF-8 | 7,526 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Entidades;
using CapaAccesoDatos;
using System.Data;
namespace CapaNegocio
{
public class negMesa
{
#region singleton
private static readonly negMesa _instancia = new negMesa();
public static ne... |
Python | UTF-8 | 917 | 4.34375 | 4 | [] | no_license | def bubbleSort(arr):
n = len(arr)
# Traverse through all array elements
for i in range(n):
# Last i elements are already in place
for j in range(0, n - 1): #if I have an array with 6 elements, why do I only need to make 5 iterations? https://stackoverflow.com/questi... |
Python | UTF-8 | 423 | 3.625 | 4 | [] | no_license | #获取对象信息
class MyObject(object):
ca = 8888
def __init__(self):
self.x = 9
def power(self):
return self.x * self.x
obj = MyObject()
print(hasattr(obj,'x'))
print(hasattr(obj,'y'))
setattr(obj,'y',19)
print(getattr(obj,'y'))
fn = getattr(obj,'power')
print(fn())
# obj.ca = 999
MyObject.ca = ... |
Markdown | UTF-8 | 8,824 | 2.875 | 3 | [
"Unlicense"
] | permissive |
# Is the global quest to end plastic waste a circular firing squad?
Published at: **2019-11-04T02:11:00+00:00**
Author: **Joel Makower**
Original: [GreenBiz](https://www.greenbiz.com/article/global-quest-end-plastic-waste-circular-firing-squad)
It’s been roughly three years since the world’s attention turned to th... |
JavaScript | UTF-8 | 4,267 | 3.734375 | 4 | [] | no_license |
// //Home page
var weightButton = document.getElementById("weight-button");
var tempButton = document.getElementById("temp-button");
var homeButton = document.getElementById("home");
// //Hide the categories and back button by default
document.getElementById("weight-converter").style.display = "none";
document.getE... |
Java | UTF-8 | 6,268 | 3.203125 | 3 | [] | no_license | import obj_lib.AquaProcess;
import obj_lib.Aquarium;
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
AquaProcess process;
// имя для файла с игровым полем
String filename = "aquarium.txt";
File file = new File(filename);
... |
C# | UTF-8 | 341 | 3.375 | 3 | [] | no_license | using System;
class MainClass
{
static void Main()
{
Console.Write("Skriv ett tal mellan 0 och 100: ");
int i = int.Parse(Console.ReadLine());
for (int e = i; e < 101; e++) //Får inte använda samma varaible som redan är tilldelad
{
Console.WriteLine(e);
... |
Java | UTF-8 | 403 | 1.828125 | 2 | [] | no_license | package com.hs.reptilian.model;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Data
@Entity
@Table(name = "fx_system_config")
public class SystemConfig {
@Id
@GeneratedValue
private Integer id;
... |
SQL | UTF-8 | 3,951 | 3.125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 1234
Source Server Version : 50633
Source Host : localhost:3306
Source Database : zf_foodie
Target Server Type : MYSQL
Target Server Version : 50633
File Encoding : 65001
Date: 2016-10-13 10:16:03
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
Java | UTF-8 | 1,596 | 2.390625 | 2 | [] | no_license | package com.example.bluecloudmedicalclinic.db;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
/**
* Created by HP on 12/24/2019.
*/
public class SQLitePrescriptionHelper extends SQLiteOpenHelper{
private static fin... |
C++ | UTF-8 | 2,388 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct elem
{
int dane;
elem * nast;
};
void add(elem* &pocz_kolejki, elem* &kon_kolejki, int x)
{
if(!pocz_kolejki)
{
pocz_kolejki = new elem;
pocz_kolejki->dane = x;
kon_kolejki = pocz_kolejki;
}
else
{
kon_kolejki... |
Python | UTF-8 | 966 | 3.75 | 4 | [] | no_license | class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def count_paths(t, target):
if t is None:
return 0
count = dfs(t, target, 0)
if t.left is not None:
count += count_paths(t.left, target)
if t.right is not None:
count += count_paths(t.right, target)
return count... |
Java | UTF-8 | 1,903 | 1.867188 | 2 | [] | no_license | package com.yipeng.bill.bms.dao;
import com.yipeng.bill.bms.domain.User;
import java.util.List;
import java.util.Map;
public interface UserMapper {
int deleteByPrimaryKey(Long id);
int insert(User record);
int insertSelective(User record);
User selectByPrimaryKey(Long id);
User selectByPrimar... |
Go | UTF-8 | 1,035 | 3.484375 | 3 | [] | no_license | import "math"
func nievePrimeSlice(n int) []int {
knownPrimes := []int{}
number := 2
var aux func(n int)
aux = func(n int) {
if n != 0 {
primeFound := true
for _, prime := range knownPrimes {
if float64(prime) > math.Sqrt(float64(number)) {
break
}
if number % prime == 0 {
primeFound ... |
Java | UTF-8 | 928 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package org.ihiw.management.service.mapper;
import org.ihiw.management.domain.IhiwLab;
import org.ihiw.management.domain.User;
import org.ihiw.management.service.dto.LabDTO;
import org.ihiw.management.service.dto.UserDTO;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
... |
C# | UTF-8 | 1,303 | 3.65625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace p0053MaximumSubarray.cs
{
public class Solution
{
public int MaxSubArray(int[] nums)
{
if (nums.All(num => num >= 0))
return nums.Sum();
else if (nums.All(num => num < 0))
... |
PHP | UTF-8 | 4,158 | 2.5625 | 3 | [] | no_license | <?php
namespace App\Actions;
use App\Calculator\CollectibleFoundCalculator;
use App\Calculator\WorkBuildingCalculator;
use App\Exceptions\GameException;
use App\Models\Character;
use App\Models\CharacterBuilding;
use App\Models\Item;
use Illuminate\Support\Facades\DB;
class WorkBuildingAction
{
use BuildingGuard... |
Swift | UTF-8 | 260 | 3.46875 | 3 | [] | no_license | import UIKit
// 赋值运算符
let b = 10
var a = 5
a = b
// a 现在等于 10
let (x, y) = (1, 2)
// 现在 x 等于 1, y 等于 2
// 此句错误, 因为 x = y 并不返回任何值
//if x = y {
//
//}
// 复合赋值
var m = 1
m += 2 // m 现在是 3
|
Java | UTF-8 | 4,066 | 2.703125 | 3 | [] | no_license | package edudcball.wpi.users.enotesandroid.AsyncTasks;
import android.os.AsyncTask;
import android.text.TextUtils;
import android.util.Log;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.HttpCookie;
import java.net.HttpURLCo... |
C# | UTF-8 | 3,393 | 2.53125 | 3 | [] | no_license | using DesktopApp.Reports;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DesktopApp
{
public partial class MainForm : Form
{
... |
C# | UTF-8 | 2,164 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace MadeInHouse.Dictionary
{
class ExcelUtiles
{
private static string Path;
private stati... |
JavaScript | UTF-8 | 858 | 3.1875 | 3 | [] | no_license | function solution(msg) {
let answer = [];
const dict = {};
let cnt = 26;
// 사전에 A ~ Z 등록
for(let i = 65; i <= 90; i++) {
dict[String.fromCharCode(i)] = i - 64;
}
const msgLen = msg.length;
for(let i = 0; i < msgLen;){ // msg의 첫번째 idx부터 끝까지
for(let j = msgLen; j >= i; ... |
Java | UTF-8 | 1,641 | 2.890625 | 3 | [] | no_license | package Entities;
import Game.InputHandler;
import Game.Level;
import Game.Debugger;
import Graphics.Screen;
import Graphics.Colors;
import Graphics.Font;
import java.net.InetAddress;
import java.awt.Graphics;
/**
* Write a description of class PlayerMP here.
*
* @author (your name)
* @versio... |
Python | UTF-8 | 1,061 | 3.203125 | 3 | [] | no_license | import random
import datetime
import time
def source(second=1):
while True:
yield {
'datetime': datetime.datetime.now(datetime.timezone(datetime.timedelta(hours=8))),
'value': random.randint(1,100)
}
time.sleep(second)
def window(iterator, handler, width:int, interv... |
Markdown | UTF-8 | 1,674 | 2.625 | 3 | [] | no_license |
This is another of my big projects called Mini-Campaign. It showcases my ability to work more with redux-forms, and adds in elements that were not seen in previous projects.
In this coding masterpiece I work with Google OAuth, Stripe payments, and the Send Grid API. Basically, it allows you to send large survey ema... |
C++ | UTF-8 | 666 | 2.953125 | 3 | [] | no_license | /***************************************************************
dfs序
其实就是从根节点进行搜索,
然后向下dfs遍历树,依次进行编号,
同时能保证子树的编号一定大于父节点的编号,
同时借用两个数组,L[_],R[_]
分别表示这个节点u的子树的节点编号在(L[u],R[u]),开区间内。
这样在进行对子树进行的操作的时候可以借助数据结构对区间进行查找,
***************************************************************/
vector<int >G[N];
int cnt = 0;
void ... |
C | UTF-8 | 2,484 | 2.578125 | 3 | [] | no_license | #include <stddef.h>
#include <stdint.h>
#include <stdio.h>
/* int t[] = { */
/* #define B1(x) x, !x, !x, x */
/* #define B2(x) B1(x), B1(!x), B1(!x), B1(x) */
/* #define B3(x) B2(x), B2(!x), B2(!x), B2(x) */
/* #define B4(x) B3(x), B3(!x), B3(!x), B3(x) */
/* B4(0) */
/* } */
/* */
/* */
/* int t[] = { */
/* #defi... |
Java | UTF-8 | 417 | 2.5625 | 3 | [] | no_license | package net.game.playstaff;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
/**
* @author Olga_Zlobina
*/
public class PlayerATest{
private static final int rounds = 100;
@Test
public void playTest() {
Player playerA = new PlayerA();
for (int i=0;i<... |
Ruby | UTF-8 | 928 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | module Moonshot
module Plugins
class DynamicTemplate
def initialize(source:, parameters:, destination:)
@dynamic_template = ::Moonshot::DynamicTemplate.new(
source: source,
parameters: parameters,
destination: destination
)
end
def run_hook
... |
Python | UTF-8 | 1,288 | 3.125 | 3 | [] | no_license | from matplotlib import pyplot
import numpy as np
# x = (c-b*y)/a
def f(x, c1, c2, b):
return (b - c1*x)/c2
def graficar(k, solucion):
n = 2
fig, (ax, tabax) = pyplot.subplots(nrows=2)
# Definiciones para la gráfica
x = np.arange(0.0, 2.0, 0.01)
... |
C# | UTF-8 | 989 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleTaskManagerWpf.Models
{
public class TaskManagerProcess
{
public string TMProcessId { get; set; }
public string TMProcessName { get; set; }
public string ... |
Java | UTF-8 | 780 | 1.945313 | 2 | [] | no_license | package com.katkada.Activity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.katkada.GetDataUsage.Fragment.ProcessListFragment;
import com.katkada.R;
public class MyDataUsage extends... |
Java | UTF-8 | 1,904 | 2.359375 | 2 | [] | no_license | package com.cabbage.sdpjournal.Model;
import java.util.Random;
/**
* Created by Junwen on 30/8/17.
*/
public class Constants {
//Database
public final static String Users_End_Point = "users";
public final static String Entries_End_Point = "entries";
public final static String Journals_End_Point =... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.