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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 434 | 2.546875 | 3 | [] | no_license | export default class Figure extends Object {
constructor({ parent, scale, context, dx, dy, ...rest }) {
super(rest);
this.parent = parent;
this.scale = scale;
this.context = context;
this.x = dx;
this.y = dy;
}
updateXY(x, y) {
this.ready = false;
this.x = x;
this.y = y;
}
... |
JavaScript | UTF-8 | 1,015 | 4.1875 | 4 | [] | no_license | // Trouvez tous les nombres de Armstrong de moins de 1000.
// Nombre de Armstrong: nombre naturel égal à la somme des cubes des chiffres qui le composent.
var nombre = 1;
var nombreArmstrong = "";
while(nombre < 1000) {
var nombreEnMorceaux = nombre.toString().split("");
var positionDansArray = 0;
var som... |
Java | UTF-8 | 3,896 | 2.421875 | 2 | [] | no_license | package api_automation.stepDefinition;
import cucumber.api.Scenario;
import cucumber.api.java.Before;
import cucumber.api.java.en.*;
import io.restassured.RestAssured;
import io.restassured.response.Response;
import static io.restassured.RestAssured.given;
import static org.junit.Assert.assertEquals;
import static or... |
C | UTF-8 | 3,886 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "tm4c123gh6pm.h"
unsigned char UART_InChar(void);
void UART_OutChar(unsigned char data);
unsigned char UART_InChar(void);
void UART_Init(void);
void printString (char * string);
uint32_t PortF_Input(void);
void printMessage(uint32_t data);
uint32_t messa... |
PHP | UTF-8 | 2,776 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
include_once ($_SERVER["DOCUMENT_ROOT"] . '/shopguns/tp7/model/categoria.php');
class CategoriaDao {
public static function ObtenerPorID($id)
{
$cat = new Categoria();
$params = array
(
":id" => $id
);
$DBH = new PDO("mysql:host=127.0.0.1;dbname=siste... |
Java | UTF-8 | 1,274 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | package me.snowdrop.istio.client;
import io.fabric8.kubernetes.api.model.KubernetesResourceList;
import io.fabric8.kubernetes.api.model.apiextensions.CustomResourceDefinition;
import io.fabric8.kubernetes.client.KubernetesClient;
import me.snowdrop.istio.api.model.DoneableIstioResource;
import me.snowdrop.istio.api.mo... |
Rust | UTF-8 | 13,086 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | use crate::*;
use indoc::indoc;
use migration_engine_tests::{test_each_connector, TestResult};
#[test_each_connector]
async fn basic_create_migration_works(api: &TestApi) -> TestResult {
let dm = r#"
model Cat {
id Int @id
name String
}
"#;
let dir = api.cre... |
JavaScript | UTF-8 | 787 | 3.0625 | 3 | [] | no_license | const BST = require('./2-BinarySearchTree');
checkHeight = (tree) => {
let lHeight = 0;
let rHeight = 0;
this.check = (tree) => {
if(!tree || tree.value){
return;
} else {
// check left
if(tree.left && tree.left.key > tree.key){
console.... |
Markdown | UTF-8 | 846 | 2.875 | 3 | [] | no_license | # Retrofit
> https://github.com/square/retrofit
这是Retrofit在github上的代码,在idea里面通过maven的方法创建工程,然后将github上的代码复制进入。
可以通过各个模块的test代码,学习Retrofit的各种用法。
## AtomicReference
AtomicReference 用于存放一个可以原子更新的对象引用。
该类包含 get() , set() , compareAndSet() , getAndSet() 等原子方法来获取和更新其代表的对象引用。
## CountDownLatch
CountDownLatch的作用:
等待其他的线... |
PHP | UTF-8 | 3,402 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types = 1);
namespace PhpCsFixerCustomFixers\Fixer;
use PhpCsFixer\FixerDefinition\CodeSample;
use PhpCsFixer\FixerDefinition\FixerDefinition;
use PhpCsFixer\Preg;
use PhpCsFixer\Tokenizer\Token;
use PhpCsFixer\Tokenizer\Tokens;
final class SingleLineThrowFixer extends AbstractFixer implements ... |
Markdown | UTF-8 | 13,343 | 2.78125 | 3 | [
"MIT"
] | permissive | ---
title: "Customer Identity And Access Management Using Azure AD B2C - Custom Attributes"
excerpt: "In this post we are going to talk about how to use custom attributes in Azure AD B2C..."
header:
overlay_image: /images/code.jpeg
date: 2022-05-15
tags: [Azure B2C, Azure, Identity, CIAM]
---
In the [previous post](... |
Markdown | UTF-8 | 1,389 | 3.890625 | 4 | [] | no_license | # Binary Search
## Classic Application of Binary Search
Binary Search finds the position of a target value in a sorted array. The complexity for this algorithm is
<pre>
- Worst-case performance O(log n)
- Best-case performance O(1)
- Average performance O(log n)
- Worst-case space complexity... |
Python | UTF-8 | 3,124 | 2.59375 | 3 | [] | no_license | import os
import numpy as np
import gym
import pybullet_envs
from storage import ReplayBuffer
from ddpg.ddpg import DDPG
class Base:
def __init__(self, env, device, model_dir, args):
self.env = env
self.env_name = args.env_name
self.seed = args.seed
self.state_dim = self.env.obser... |
PHP | UTF-8 | 618 | 2.53125 | 3 | [] | no_license | --TEST--
Create an new paradox database
--SKIPIF--
<?php if (!extension_loaded("paradox")) print "skip"; ?>
--POST--
--GET--
--INI--
--FILE--
<?php
$dirname = dirname($_SERVER["SCRIPT_FILENAME"]);
$fp = fopen($dirname."/px013.db", "w+");
$pxdoc = new paradox_db();
$fields = array(array("col1", "S"), array("col2", "I")... |
Java | UTF-8 | 2,198 | 3.6875 | 4 | [
"MIT"
] | permissive | package edu.sda.parser;
import edu.sda.data.Task;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;
/**
* Parser reads user input and interprets it as a
* command and transfers it to objects. Every time it is called, it reads a line from the termin... |
Java | UTF-8 | 609 | 2.28125 | 2 | [
"Unlicense"
] | permissive | /* FantastleReboot: An RPG
Copyright (C) 2011-2012 Eric Ahnell
Any questions should be directed to the author via email at: products@puttysoftware.com
*/
package com.puttysoftware.fantastlereboot.battle.map;
import com.puttysoftware.fantastlereboot.gui.Prefs;
public class MapBattleArrowSpeedConstants {
// Cons... |
Python | UTF-8 | 491 | 3.734375 | 4 | [] | no_license | # セクション4: データ構造
# 20.リストの使い所
# タクシーの乗車ゲーム
seat = []
min = 0
max = 5
print(min <= len(seat) < max)
seat.append('p')
print(min <= len(seat) < max)
print(len(seat))
seat.append('p')
print(min <= len(seat) < max)
print(len(seat))
seat.append('p')
print(min <= len(seat) < max)
print(len(seat))
seat.append('p')
seat.append(... |
C++ | UTF-8 | 2,869 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "com_wn518_printer_core_PrinterLib.h"
#include <memory.h>
#ifdef __cplusplus
extern "C" {
#endif
void intcolor2bitcolorline(int * intcolor,int w,signed char * bitcolor,signed char * header,int headerSize);
JNIEXPORT jbyteArray JNICALL Java_com_wn518_printer_core_PrinterLib_getBitmapData(JNIEnv *env, jobject ... |
Java | GB18030 | 1,107 | 3.78125 | 4 | [] | no_license | package edu.whut.enumeration;
import org.junit.Test;
/**
*
* @Description:öٳ÷
*
* name(): ȡöֵ
* ordinal():ȡöֵλ
* valueOf():ַתö
* values():öֵ
*/
public class EnumTest3 {
@Test
public void test(){
System.out.println(stu.A.name());
System.out.println(stu.A.ordinal());
System.out.println("------------... |
C# | UTF-8 | 721 | 3.25 | 3 | [
"MIT",
"CC-BY-4.0"
] | permissive | // <Snippet15>
using System;
using System.Globalization;
public class Example
{
public static void Main()
{
CompareInfo ci = CultureInfo.CurrentCulture.CompareInfo;
string searchString = "\u00ADm";
string s1 = "ani\u00ADmal" ;
string s2 = "animal";
Console.WriteLine(ci.IndexOf(s1... |
C++ | UTF-8 | 1,583 | 2.9375 | 3 | [
"MIT"
] | permissive |
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
A... |
C# | UTF-8 | 4,013 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Api.Provagas.Domains;
using Api.Provagas.Interfaces;
using Api.Provagas.Repositories;
namespace ProVagas.Controllers
{
[Produces("application/json... |
PHP | UTF-8 | 1,149 | 3.609375 | 4 | [] | no_license | <?php
class XMLAttribute
{
private $type; // Typ attributu
private $argument_order; // Poradi attributu
private $value; // Hodnota attributu
/**
* XMLAttribute constructor.
* @param $argument_order Poradi argumentu
*/
function __construct($argument_order)
{
$this->argum... |
C++ | UTF-8 | 2,188 | 2.890625 | 3 | [] | no_license | #pragma once
#include <stdexcept>
#include "rect.h"
#include "icommon.h"
#include <list>
#include <imath.h>
#include <boost/shared_ptr.hpp>
class EdgesContainer;
/**
Oriented edge structure
**
/|^\ next
/ || \
... |
PHP | UTF-8 | 1,072 | 2.90625 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use DB;
use Illuminate\Support\Collection;
class Book extends Model
{
/**
* Получает все книги у которых N и более авторов
*
* @param int $count
* @return string
*/
public function getBookWithNAuthors(int $count) : string
... |
C++ | UTF-8 | 6,968 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <unordered_map>
#include <boost/algorithm/string/find.hpp>
#include <cmath>
#include <boost/range/algorithm/count.hpp>
class Tile
{
public:
Tile() = default;
Tile(int _id) : id(_id) {}
... |
JavaScript | UTF-8 | 2,830 | 2.8125 | 3 | [
"MIT"
] | permissive | function plot_time_series(name, id, refresh_interval) {
var options = {
lines: { show: true },
points: { show: true },
xaxis: { mode: "time" },
series: { shadowSize: 0 } // Drawing is faster without shadows
};
// Initiate a recurring data update
function start_updatin... |
Shell | UTF-8 | 438 | 3.15625 | 3 | [
"OFL-1.1",
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #!/bin/bash
colors="red:#cc0000 green:#00cc00 orange:#ddaa00 grey:#cccccc"
for res in 16 32 64; do
for color in ${colors}; do
colname=${color%:*}
colspec=${color#*:}
convert -background none cf.svg \
+level-colors "${colspec}," \
-colorspace RGB \
... |
Python | UTF-8 | 350 | 2.796875 | 3 | [] | no_license | import mysql.connector as mysql
mydb = mysql.connect(
host="localhost",
user="root",
passwd="",
database="test"
)
mycursor = mydb.cursor()
sql = "insert into new (sku) values(%s)"
val = [("new1001"),("new234234243"),("new12312")]
print(sql, val)
mycursor.executemany(sql,val)
mydb.commit()
print(mycurs... |
Java | UTF-8 | 2,146 | 2.359375 | 2 | [] | no_license | package nyc.c4q.contactsapp;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.makeramen.roundedimage... |
Python | UTF-8 | 5,216 | 2.796875 | 3 | [] | no_license | import numpy as np
import os
import logging
logger = logging.getLogger(__name__)
intX = 'int32'
floatX = 'float32'
class POMDPEnv(object):
def __init__(self, confusion_dim, num_actual_states, num_actions, good_terminal_states=9, bad_terminal_states=8,
max_steps=1000):
self.model = MDPUse... |
Java | UTF-8 | 934 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package es.tid.pce.computingEngine.algorithms;
import java.util.concurrent.Callable;
import es.tid.pce.computingEngine.ComputingResponse;
import es.tid.pce.parentPCE.ChildPCERequestManager;
import es.tid.pce.pcep.messages.PCEPRequest;
import es.tid.pce.pcep.messages.PCEPResponse;
public class ChildPCERequest impleme... |
C++ | UTF-8 | 1,043 | 2.953125 | 3 | [] | no_license | //
// pathfinding library
// Created by yash on 8/6/19.
//
#pragma once
#include <cstddef>
namespace pl::graph
{
/// pfl_graph will be the standard graph used in this library.
/// @tparam Graph
template<typename ContainerType, typename DataType>
class graph
{
public:
using graph_type = ContainerType;
usin... |
Markdown | UTF-8 | 13,512 | 3.140625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 《有效训练你的研究能力》笔记
subtitle: 研究和学习的根本区别在于,学习最核心的部分是重复练习,而研究不是练习,更没有重复,只有不断得获取新东西。所以研究是具有艺术性的。
date: 2018-08-28
author: coding-zen
header-img: img/home.jpg
catalog: true
tags:
- 读书笔记
---
acitively making meaning, rather than just absorbing information
1.在学习的时候为了学得更好而更主动进入的对你... |
JavaScript | UTF-8 | 1,383 | 2.71875 | 3 | [] | no_license | function signUp() {
var formData = new FormData();
formData.append("userPhoto", document.getElementById("userPhoto").files[0]);
$.ajax({
url : '/support/profilePhoto/',
data : formData,
processData : false,
contentType : false,
type : 'POST',
success : function(photo) {
var employee = {};
employee.... |
Java | UTF-8 | 472 | 2.390625 | 2 | [] | no_license | package com.vti.entity;
public class ExperienceCandidate extends Candidate{
private int expInYear;
private ProSkill proSkill;
public enum ProSkill{
DEV,TEST,JAVA,SQL
}
public ExperienceCandidate(String firstName, String lastName, String phone, String email, String passWord,
Category category, int expInYear... |
C# | UTF-8 | 599 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using RESTfulWebInterface.Models;
namespace RESTfulWebInterface.Tests
{
public static class ColorHelper
{
public static string ToDisplayString(this Color color)
... |
Python | UTF-8 | 870 | 3.671875 | 4 | [] | no_license | #!/usr/bin/env python3
def part1(input_list):
expenses = sorted(input_list)
a = 0
b = len(expenses) - 1
while a < b:
val1 = expenses[a]
val2 = expenses[b]
sum = val1 + val2
if sum == 2020:
print("input = {}, val1 = {}, val2 = {}, product = {}".format(input_... |
Python | UTF-8 | 10,149 | 3.28125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat May 30 23:00:22 2020
@author: ISIL
"""
from preprocess import read_data, create_samples, split_data, read_vectors, read_vocab
import numpy as np
import datetime
import random
from scipy.special import expit
#OVERWIEV
"""
hidden_layer_size/2 ≈ input_layer_size + output_layer... |
C++ | UTF-8 | 8,208 | 2.671875 | 3 | [] | no_license |
#include "PVPathTransform.hh"
#include <sstream>
#include <exception>
#include <stdexcept>
#include <algorithm>
#include <iterator>
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4PhysicalVolumeStore.hh"
#include "globals.hh"
#include "G4TransportationManager.hh"
#include "G4Navigator.hh"
... |
Go | UTF-8 | 839 | 3.09375 | 3 | [] | no_license | package main
import (
"fmt"
"html/template"
"log"
"net/http"
)
func index(w http.ResponseWriter, r *http.Request) {
t, _ := template.ParseFiles("index.html")
t.Execute(w, nil)
}
func login(w http.ResponseWriter, r *http.Request) {
fmt.Println("method:", r.Method) //get request method
... |
Python | UTF-8 | 5,966 | 2.84375 | 3 | [] | no_license | from typing import List, Dict
import numpy
from overrides import overrides
from spacy.tokens import Doc
from allennlp.common.util import JsonDict, sanitize, group_by_count
from allennlp.predictors.predictor import Predictor
from allennlp.data import DatasetReader, Instance
from allennlp.models import Model
from allen... |
Markdown | UTF-8 | 2,494 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
author: "Simon Dellicour"
date: 2023-01-23T12:00:00+02:00
title: "Our new study about the atypically pathogenic H3N1 avian influenza epidemic that occurred in 2019 in Belgium"
---
The high economic impact and zoonotic potential of avian influenza call for detailed investigations of dispersal dynamics of epidemics. ... |
Java | UTF-8 | 1,457 | 3.265625 | 3 | [] | no_license | package us.costan.watchy.flashcards.dummy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Helper class for providing sample prompt for user interfaces created by
* Android template wizards.
* <p/>
* TODO: Replace all uses of this class before publishing yo... |
Markdown | UTF-8 | 1,548 | 2.515625 | 3 | [] | no_license | # Getting the message across {#getting-the-message-across}
_Date posted: 9 June 2010_
Until fairly recently, organisations have relied on a hierarchical approach to communication. The message cascades down through the layers until it hits the bottom. We know that this message usually gets diluted, so we come up with ... |
C# | UTF-8 | 2,883 | 2.59375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WordMemory.DAL;
using WordMemory.DTO;
using WordMemory.Model;
namespace WordMemory.BLL
{
public class PracticeDetailController
{
PracticeDetailManagement _practiceDetailManagement;... |
JavaScript | UTF-8 | 7,086 | 2.875 | 3 | [] | no_license | let addBtn = document.querySelector(".add-btn");
let removeBtn = document.querySelector(".remove-btn");
let modalCont = document.querySelector(".modal-cont");
let mainCont = document.querySelector(".main-cont");
let textArea = document.querySelector(".textarea-cont");
let allPriorityColors = document.querySelectorAll("... |
C++ | UTF-8 | 749 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | #include "SkTypes.h"
#include <stdio.h>
#include <stdlib.h>
void sk_throw() {
SkASSERT(!"sk_throw");
abort();
}
void sk_out_of_memory(void) {
SkASSERT(!"sk_out_of_memory");
abort();
}
void* sk_malloc_throw(size_t size) {
return sk_malloc_flags(size, SK_MALLOC_THROW);
}
void* sk_realloc_throw(voi... |
Shell | UTF-8 | 941 | 3 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# source: https://medium.com/@trstringer/create-kubernetes-controllers-for-core-and-custom-resources-62fc35ad64a3
set -e
# ROOT_PACKAGE :: the package (relative to $GOPATH/src) that is the target for code generation
ROOT_PACKAGE="github.com/dgkanatsios/azuregameserversscalingkubernetes"
# CUSTOM_RESOURCE_N... |
C# | UTF-8 | 4,288 | 2.578125 | 3 | [
"MIT"
] | permissive | #if NETCOREAPP3_0_OR_GREATER
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using X10D.CompilerServices;
namespace X10D.Text;
/// <summary>
/// Text-related extension methods... |
PHP | UTF-8 | 582 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Controller\PrivateRest;
use Cake\Http\Exception\UnauthorizedException;
class UsersController extends PrivateRestController
{
public function view($login)
{
$loggedUser = $this->Authentication->getIdentity();
if ($loggedUser->username !== $login) {
throw new Un... |
JavaScript | UTF-8 | 2,184 | 2.5625 | 3 | [
"MIT"
] | permissive | import { isObject } from './helpers';
import React from 'react';
export function prepareTag(tag) {
prepareStyle(tag);
prepareClass(tag);
return tag;
}
function prepareStyle(tag){
var position = getPosition(tag.row, tag.column);
if(!position.top){
position.top = 0;
}
... |
C++ | UTF-8 | 728 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
typedef long long ll;
int t, n;
priority_queue<ll> pq;
ll MOD = 1000000007;
ll mul(ll a, ll b)
{
return ((a % MOD) * (b % MOD)) % MOD;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
for(cin >> t; t > 0; t--)
{
ll ans = 1;
if(!pq.empty(... |
JavaScript | UTF-8 | 11,759 | 3.359375 | 3 | [] | no_license | var TEST_ENV = false;
var inputValue = "";
var searched = false;
var savedCount = 0;
var hasFav = false;
var valueArr = [null];
var savedItemIdArr = [null];
var favoritesList;
var track;
// Initialize Favorites section depending on saved data in browser
showFavorites();
displayResults();
// if there are no saved item... |
Java | UTF-8 | 178 | 2.609375 | 3 | [] | no_license | package com.abc33;
public class CheckStrings {
public boolean stringFound(String s1, String s2) {
if (s1.contains(s2)) {
return true;
}
return false;
}
} |
Python | UTF-8 | 1,190 | 3.578125 | 4 | [] | no_license | import requests
from bs4 import BeautifulSoup
# URL to be scraped
url = 'https://www.worldometers.info/coronavirus/countries-where-coronavirus-has-spread/'
# Get URL HTML
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
data = []
data_iterator = iter(soup.find_all('td'))
while True:
try:... |
C# | UTF-8 | 3,156 | 2.828125 | 3 | [] | no_license | using System;
namespace KProcess.Presentation.Windows.Controls
{
/// <summary>
/// Defines a model containing informations on a media
/// </summary>
public class MediaInfo
{
/// <summary>
/// Gets or sets if the media has video.
/// </summary>
public bool HasVideo {... |
Python | UTF-8 | 734 | 3.53125 | 4 | [] | no_license | class empleados:
def __init__(self,nombre,cargo,salario):
self.nombre=nombre
self.cargo=cargo
self.salario=salario
def __str__(self):
return "{} que trabaja como {} tiene un salario de {} $".format(self.nombre, self.cargo, self.salario)
listaEmpleados=[
empleados("juan","dire... |
Java | UTF-8 | 354 | 2.59375 | 3 | [] | no_license | /*
* classe che descrive delle coordinate
* */
package autoMag.space;
import java.io.Serializable;
public class Coord implements Serializable {
private String sector;
public Coord(String newSector) {
sector = newSector;
}
public String getSector() {
return sector;
}
public String toString() {
... |
Java | UTF-8 | 1,150 | 2.53125 | 3 | [] | no_license | package org.innopolis.javaEE.stat.model.dao;
import org.innopolis.javaEE.stat.model.pojo.Top;
import org.innopolis.javaEE.utils.DataSourceFactory;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
public ... |
Ruby | UTF-8 | 926 | 2.59375 | 3 | [] | no_license | # frozen_string_literal: true
require 'transaction'
describe Transaction do
describe '#initialize' do
it 'initializes a new transaction' do
transaction = Transaction.new
expect(transaction).to be_an_instance_of(Transaction)
end
end
describe '#deposit_transaction' do
it 'creates a log fo... |
Python | UTF-8 | 145 | 3.359375 | 3 | [] | no_license | import re
text = "In this text-oriented string how can you remove non-hyphen words?"
pattern = r'[\w]+-[\w]+'
print(re.findall(pattern,text))
|
Python | UTF-8 | 656 | 3.34375 | 3 | [] | no_license | from turtle import Turtle
class Scoreboard(Turtle):
def __init__(self):
super().__init__()
self.score_l = 0
self.score_r = 0
self.write_scores()
def write_scores(self):
self.clear()
self.color("white")
self.hideturtle()
self.penup()
self... |
Markdown | UTF-8 | 918 | 2.609375 | 3 | [] | no_license | # Article R714-3
Dans les établissements où le travail est organisé de façon continue pendant tout ou partie de l'année parce que sont mises
en oeuvre des matières susceptibles d'altération très rapide ou parce que toute interruption de travail entraînerait la perte
ou la dépréciation du produit en cours de fabricatio... |
JavaScript | UTF-8 | 813 | 2.546875 | 3 | [] | no_license | /* eslint-disable default-case */
import React from 'react';
const input = (props) => {
let inputEl = null;
switch(props.elementType) {
case ('input'):
inputEl = <input {...props.elementConfig}
value={props.value}
onChange={props.changed}
... |
C# | UTF-8 | 628 | 3.0625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace MasterMind.Utils
{
public class ClosedInterval
{
private int min;
private int max;
public ClosedInterval(int min, int max)
{
Debug.Assert(min <= max);
... |
Java | UTF-8 | 1,154 | 1.859375 | 2 | [] | no_license | package esiapp.esi.model.retroModel;
import java.io.Serializable;
/**
* Created by Randhir Kumar on 2/17/2017.
*/
public class IpNumberEligibilityCheckResp implements Serializable {
private String IPnumber;
private String IsIPEligible;
private String ResponseCode;
// private String OtpCode;
... |
C++ | UTF-8 | 459 | 2.6875 | 3 | [] | no_license |
#include"ArrayBST.h"
int main()
{
ArrayBST A;
cout<<A.isEmpty()<<endl;
A.addBST(30);
A.addBST(20);
A.addBST(40);
A.addBST(15);
A.addBST(25);
A.addBST(35);
A.addBST(14);
A.addBST(17);
A.addBST(23);
A.addBST(27);
A.addBST(32);
A.addBST(37);
A.trasverse()... |
Swift | UTF-8 | 1,757 | 2.84375 | 3 | [
"MIT"
] | permissive | import RxSwift
import RxCocoa
import Action
import Presentations
protocol FoodInfoPresentingViewModel: AnyObject, PresentingViewModel {
var foodInfoPresenter: FoodInfoPresenter? { get set }
var presentFoodInfo: Action<Bool, FoodInfoViewModel> { get }
}
extension FoodInfoPresentingViewModel {
/// Makes an... |
Java | UTF-8 | 1,635 | 3.703125 | 4 | [] | no_license | package theb.r.i.a.n.system;
import java.util.ArrayList;
import java.util.List;
// Create a class to represent the set data structure. Has the appropriate get
// and set methods
class Set{
Team homeTeam;
Team awayTeam;
List<Game> games = new ArrayList<>();
Team winner;
public Team getHomeTeam(){... |
Python | UTF-8 | 3,896 | 2.84375 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import matplotlib.cm as cm
import matplotlib.font_manager
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
plt.rcParams['font.family'] = 'Serif'
# Then, just call
plt.figure(figsize=(... |
SQL | UTF-8 | 12,604 | 3.25 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : 本机
Source Server Version : 50520
Source Host : localhost:3306
Source Database : center
Target Server Type : MYSQL
Target Server Version : 50520
File Encoding : 65001
Date: 2017-04-05 15:50:45
*/
SET FOREIGN_KEY_CHECKS=0;
-- --------... |
Python | UTF-8 | 1,393 | 3.328125 | 3 | [] | no_license | class Node:
def __init__(self,val):
self.data = val
self.next = None
def construct(L):
root = Node(L[0])
curr = root
for i in range(1,len(L)):
curr.next = Node(L[i])
curr = curr.next
return root
def merge(root1,root2):
res = None
if not root1:
return... |
Java | UTF-8 | 2,461 | 2.015625 | 2 | [] | no_license | package com.zcbspay.platform.cnaps.beps.message.bean;
import java.io.Serializable;
/**
* 代收付合同协议bean
*
* @author guojia
* @version
* @date 2017年2月23日 下午4:00:22
* @since
*/
public class ContractBean implements Serializable{
/**
* serialVersionUID
*/
private static final long serialVersio... |
Java | UTF-8 | 15,173 | 2.15625 | 2 | [] | no_license | package App.HKM;
import java.awt.EventQueue;
import javax.swing.JFrame;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
im... |
C++ | UTF-8 | 407 | 3.0625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int a, b, i, j, counter=0;
cin >> a >> b;
for(i=a;i <= b;i++){
string current = to_string(i);
for(j=0;j < current.length() / 2 ;j++){
if(current[j] != current[current.length() - j - 1]) break;
}
if(j != 0 && j ... |
Python | UTF-8 | 157 | 3.375 | 3 | [] | no_license | import classcars
car = classcars.Cars('red', 'big')
print('your car\'s color is:{},shape is:{},now you can drive it。'.format(car.color, car.shape)) |
C++ | UTF-8 | 1,318 | 2.703125 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<map>
#include<set>
#include<vector>
#include<utility>
#include<math.h>
#define sd(x) scanf("%d",&x);
#define sd2(x,y) scanf("%d %d",&x,&y);
#define sd3(x,y,z) scanf("%d %d %d",&x,&y,&z);
#define sull(x) scanf("%ull",&x)... |
Java | UTF-8 | 748 | 3.203125 | 3 | [] | no_license |
// @Title: 最长和谐子序列 (Longest Harmonious Subsequence)
// @Author: 15218859676
// @Date: 2020-11-29 22:55:32
// @Runtime: 15 ms
// @Memory: 38.7 MB
class Solution {
public int findLHS(int[] nums) {
//返回最长和谐子序列的长度
//和谐子序列:数组中元素最大和最小值差是1
int len = nums.length;
if(len < 2){
... |
Shell | UTF-8 | 788 | 2.78125 | 3 | [] | no_license |
cd /home/project/core
./build.sh
echo " ====> 更新module-manage项目开始 ..."
path="/home/project/module/manage"
cd $path
back=$path"/backup/`date +%G_%m_%d_%H_%M_%S`"
echo " ====> 项目更新中 ..."
svn co --username xxx --password xxx https://192.168.1.254/svn/developer/trunk/module-parent/module-manage module-manage
cd module-... |
PHP | UTF-8 | 1,509 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AddToCardController extends Controller
{
public function addToCart($id)
{
$cart = session()->get('cart');
if (!$cart){
$cart = [$id => $this->sessionData($this->getSeat($id), $id)];
return $this... |
C | UTF-8 | 25,767 | 2.515625 | 3 | [] | no_license | // CDCL.c
// Joshua Blinkhorn 29.04.2019
// This file is part of CDCL
#include "CDCL.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <limits.h>
#include <time.h>
#include "getRSS.c"
#ifdef DEBUG
#define DEBUG_MSG(x) (x)
#else
#define DEBUG_MSG(x)
#endif
// MACROS
// results
#define UNSAT 0
#de... |
Java | UTF-8 | 234 | 2.9375 | 3 | [
"MIT"
] | permissive | class Solution {
public int titleToNumber(String s) {
int result = 0;
for(int i=s.length()-1;i>=0;i--){
result+=(s.charAt(i)-'A'+1)*Math.pow(26,s.length()-1-i);
}
return result;
}
}
|
Markdown | UTF-8 | 8,268 | 3.359375 | 3 | [] | no_license | Реализовать алгоритмы матричных операций:
Замечание: можно реализовать алгоритмы самостоятельно или воспользоваться готовыми библиотеками.
Для большинства операций используется библиотека Apache Commons Math
Создание матрицы происходит следующим образом:
```java
// Импортируем используемые библиотеки
import org.apa... |
C# | UTF-8 | 444 | 2.640625 | 3 | [] | no_license | using UnityEngine;
public class PlayerData
{
private Vector3 _position;
private Quaternion _rotation;
// コンストラクタ
public PlayerData(){}
// デストラクタ
~PlayerData(){}
public Vector3 Position
{
get { return _position; }
set { _position = value; }
}
public Quatern... |
Java | UTF-8 | 17,160 | 2.125 | 2 | [] | no_license | package kasirapp;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class mainForm extends javax.swing.JFrame {
JFrame jf = new JFrame();
public mainForm() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code... |
Java | UTF-8 | 1,091 | 2.03125 | 2 | [] | no_license | package com.dsa.subscription.converter;
import com.dsa.subscription.entity.Subscription;
import com.dsa.subscription.stream.dto.SubscriptionDTO;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mock... |
C++ | UTF-8 | 978 | 2.78125 | 3 | [] | no_license | #ifndef __MORSUTIL_H
#define __MORSUTIL_H
typedef void (*MorseON)(int freq,char ditdah);
typedef void (*MorseOFF)(void);
class Morse {
private:
int ditlen;
int dahlen;
int ditdahdel;
int letterdel;
int delscale;
int freq;
MorseON morseon;
MorseOFF morseoff;
public... |
SQL | UTF-8 | 504 | 2.75 | 3 | [
"MIT"
] | permissive | create table if not exists `x_xadmin`(
`id` int auto_increment,
`username` varchar(20) not null,
`password` varchar(32) not null,
`aid` smallint unsigned not null default 0 comment '权限id',
`addtime` int unsigned not null,
`status` tinyint unsigned not null default 1 comment '状态',
`login_error_times` tinyint uns... |
Markdown | UTF-8 | 1,259 | 3.28125 | 3 | [] | no_license | #Author:
========
* Delacroix Louis
#Explication:
=============
* Ce projet s'inscrit dans le cadre de mes études. Il a pour but de nous faire découvrir la programmation en assembleur sur Intel 64.
* La calculatrice est suffixée donc l'opérateur est à la fin de l'opération. Et elle ne fait que des calculs sur des ... |
Shell | UTF-8 | 785 | 3.84375 | 4 | [] | no_license | #!/bin/bash
function usage {
echo "description"
}
if [ "$1" == "-h" ] || [ "$1" == "-help" ]; then
usage #write usage function#
fi
#OPERATORS=()
if [ "$1" == "arith" ]; then
#SELECTEDOPERATOR=${OPERATORS[$RANDOM % ${#operators[@]} ]}
if [[ "$2" =~ [0-9] ]] && [[ "$3" =~ [0-9] ]]; then
FIRSTNUMBER=$(... |
Rust | UTF-8 | 529 | 2.671875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | use edgedb_derive::Queryable;
use edgedb_protocol::queryable::{Queryable, Decoder};
#[derive(Queryable, Debug, PartialEq)]
enum Status {
Open,
Closed,
Invalid,
}
#[test]
fn enumeration() {
let dec = Decoder::default();
assert_eq!(Status::decode(&dec, &b"Open"[..]).unwrap(), Status::Open);
asse... |
JavaScript | UTF-8 | 1,153 | 3.21875 | 3 | [] | no_license | export function getRandomWages() {
let wages = [];
for (let i = 0; i <= 2500; i++) {
wages[i] = (2 * Math.random()) - 1;
}
return wages;
}
export function generateGrid(rows, cols) {
const containter = document.getElementById('container');
const resultGrid = document.getElementById('resu... |
C# | UTF-8 | 8,841 | 2.6875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace MT4OrderAnalyze
{
public static class StringUtil
{
public static MatchResult MatchRuleResult(MatchRule rule, string source, int startIndex... |
C++ | UTF-8 | 10,684 | 3.140625 | 3 | [] | no_license |
#include "Classes.h"
using namespace std;
Card::Card() {
_suit = "Hearts";
_rank = "Queen";
_value = 12;
}
Card::Card(string suit, string rank, int value) {
_suit = suit;
_rank = rank;
_value = value;
}
void Card::ConvertValuetoRank() {
if (_value == 1) {
SetRank(... |
Java | UTF-8 | 2,478 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2018 Johannes Donath <johannesd@torchmind.com>
* and other copyright owners as documented in the project's IP log.
*
* 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
*
* ... |
Java | UTF-8 | 7,076 | 2.03125 | 2 | [
"MIT"
] | permissive | package com.simperium.client;
import com.simperium.util.JSONDiff;
import com.simperium.util.Logger;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
import java.util.TimerTask;
import static com.simperium.util.Uuid.uuid;
public class Change {
public st... |
Markdown | UTF-8 | 6,856 | 3.359375 | 3 | [] | no_license | CMSC 508 Database Problem Proposal
## Problem Statement:
This database will be used to determine which tech websites are offering the best deals for
tech and tech peripherals. When considering what components a user is going to build their
computer with or what phone is wo... |
Rust | UTF-8 | 8,264 | 3.453125 | 3 | [
"MIT"
] | permissive | //! An MPSC channel whose receiving end is an event source
//!
//! Create a channel using `Channel::<T>::new()`, which returns a
//! `Sender<T>` that can be cloned and sent accross threads if `T: Send`,
//! and a `Channel<T>` that can be inserted into an `EventLoop`. It will generate
//! one event per message.
use std... |
Python | UTF-8 | 18,217 | 2.703125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""all procedures for recipes"""
import pandas as pd
import numpy as np
from . ingredient import Ingredient
from .. import config
from .. import transformer
import time
from typing import List, Union, Dict, Optional
import re
import logging
logger = logging.getLogger(__name__)
def translat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.