language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 625 | 3.671875 | 4 | [] | no_license | # This is a comment
# this is some high level code
2 + 2 == 4
4 - 1 == 3
print("quick maths")
def func1():
""" docstring and some code later """
print("Hello, World!")
def func2():
" docstring and some code later "
print("Hello, World!2")
def func3(k):
" docstring and some code later "
prin... |
Java | UTF-8 | 8,038 | 1.820313 | 2 | [] | no_license | package com.appvirality.appviralityui.custom;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.GradientDrawable;
import android.text.Html;
import android.text.TextUtils;
import android.... |
Java | UTF-8 | 551 | 1.976563 | 2 | [] | no_license | package com.kgignatyev.workflow.fileprocessing;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.TestWatcher;
import static com.kgignatyev.workflow.fileprocessing.WFContext.testEnv;
public class WFTestWatcher implements TestWatcher {
public void testFailed(Extensio... |
Python | UTF-8 | 3,159 | 2.640625 | 3 | [] | no_license | import numpy as np
import pandas as pd
from keras.layers import Embedding, Dropout, Dense, Input, Flatten, Concatenate, Dot, Add
from keras.models import load_model, Model
from keras.optimizers import Adam, Adamax
from keras.callbacks import Callback, EarlyStopping, ModelCheckpoint
from keras.preprocessing.sequen... |
Ruby | UTF-8 | 649 | 2.578125 | 3 | [] | no_license | class ApiKey < ActiveRecord::Base
attr_accessible :key, :user_id, :active, :application_url
belongs_to :user
before_create :generate_api_key
before_save :prevent_reactivating
validates_presence_of :application_url
def prevent_reactivating
return false if (self.active_was == false && self.active == tr... |
SQL | UTF-8 | 1,394 | 3.640625 | 4 | [
"BSD-3-Clause"
] | permissive | -- we don't know how to generate schema sandbox (class Schema) :(
create table mail_types
(
id int auto_increment
primary key,
name varchar(32) not null,
code varchar(128) not null,
sender json not null,
subject varchar(64) null,
attachments json null,
bcc_recipients json null,
charset varchar(16) d... |
C++ | UTF-8 | 1,189 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;
#define max_n 10000
#define max_m 100
struct Tuple {
int p, a;
} arr[max_n + 5][4]
int prime[max_m + 5] = {0};
void get_num(int a, int b, Tuple *temp) {
int len = 0;
while (a != 1) {
... |
Markdown | UTF-8 | 1,113 | 2.765625 | 3 | [
"MIT"
] | permissive | # pythonStudy
Code studying python<br>
help(*\<function/class\>*) # to list doc_here<br>
dir(*\<function/class\>*) # to list members/attributes<br>
<br>
\>\>\> import this<br>
The Zen of Python, by Tim Peters<br>
<br>
Beautiful is better than ugly.<br>
Explicit is better than implicit.<br>
Simple is better than complex... |
JavaScript | UTF-8 | 2,350 | 2.53125 | 3 | [] | no_license | import React, {Component} from 'react';
import { getLongLat, reverseGeocoding, switcher} from '../actions';
import { connect } from 'react-redux'
import AutoComplete from './googleMapWrapper/autoComplete'
class Header extends(Component){
constructor(props){
super();
this.switchToAutofill=this.swit... |
C# | UTF-8 | 398 | 2.59375 | 3 | [] | no_license | using factory.PizzaStaff;
namespace factory.PizzaStoreStaff
{
public abstract class PizzaStore
{
public Pizza OrderPizza(string order)
{
var pizza = CreatePizza(order);
pizza.Bake();
pizza.Cut();
pizza.Box();
return pizza;... |
Java | UTF-8 | 329 | 2.078125 | 2 | [
"MIT"
] | permissive | package net.serenitybdd.screenplay.jenkins.targets;
import net.serenitybdd.screenplay.targets.Target;
public class Label {
public static Target called(String text) {
return Target.the(String.format("the '%s' label", text))
.locatedBy("//label[contains(.,'{0}')]")
.of(text);... |
Rust | UTF-8 | 34,572 | 2.921875 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"bzip2-1.0.6",
"LicenseRef-scancode-other-permissive",
"NCSA",
"MIT",
"ISC",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"Unlicense"
] | permissive | use chalk_integration::query::LoweringDatabase;
#[test]
fn well_formed_trait_decl() {
lowering_success! {
program {
trait Clone { }
trait Copy where Self: Clone { }
struct Foo { }
impl Clone for Foo { }
impl Copy for Foo { }
}
}
}
#... |
TypeScript | UTF-8 | 7,782 | 2.984375 | 3 | [] | no_license | import { Coords, PolarCoordinate } from '@/Types/types';
export class Mouse {
private canvas : HTMLCanvasElement;
private offsetX = 0;
private offsetY = 0;
private mouseX = 0;
private mouseY = 0;
constructor(e: MouseEvent, canvas: HTMLCanvasElement) {
this.canvas = canvas;
c... |
Java | UTF-8 | 1,367 | 2.109375 | 2 | [] | no_license | package com.accp.service;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.accp.domain.Shop;
import com.... |
Python | UTF-8 | 223 | 3 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 29 11:03:09 2020
@author: Ayush
"""
def printDict():
x=int(input())
d={}
for i in range (1,x+1):
d[i]=i**2
print(d,end="")
printDict()
printDict() |
Java | UTF-8 | 4,770 | 2.78125 | 3 | [] | no_license | package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
import model.User;
public... |
Java | UTF-8 | 1,940 | 2.34375 | 2 | [] | no_license | package com.devfest.musicstore.activity;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.devfest.musicstore.R;
import com.devfest.musicstore.adapter... |
Java | UTF-8 | 285 | 2.671875 | 3 | [] | no_license | package org.westos.设计模式;
//懒汉式的更加实现
public class Singleton4 {
private Singleton4() {
}
private static class Holder{
static Singleton4 ME=new Singleton4();
}
public static Singleton4 getInstance(){
return Holder.ME;
}
}
|
Python | UTF-8 | 717 | 3.421875 | 3 | [] | no_license | def count_n_dig(num):
# "12345678"
s_num = str(num)
dig_num = len(s_num)
bottom_half = int(s_num[dig_num/2:])
top_half = int(s_num[:dig_num/2][::-1])
if top_half == 1:
return bottom_half
return top_half + bottom_half
def count(num):
if num < 10:
return num
if num % 10 == 0:
return count(nu... |
Python | UTF-8 | 8,690 | 2.625 | 3 | [] | no_license |
import numpy as np
import matplotlib.pylab as plt
from scipy.interpolate import griddata
import time
import pickle
from functools import reduce
from matplotlib import animation
def PointFocalLaw(f,F,p,N,x,y,c):
xn = np.linspace(-0.5*(N-1)*p,0.5*p*(N-1),N)
Fn = [F*np.exp(-2j*f*np.pi*np.sqrt((x-xn[n])**2 + y... |
Java | ISO-8859-1 | 1,454 | 2.734375 | 3 | [] | no_license | package com.Aluguel.repositorios;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import com.Aluguel.Basicas.Aluguel;
public class RepositorioAluguel {
private static RepositorioAluguel instanciaAluguel;
public static RepositorioAluguel getInstan... |
Python | UTF-8 | 1,406 | 3.78125 | 4 | [] | no_license | #A media access control address (MAC address) is a unique identifier assigned to network interfaces for communications on the physical network segment.
#The standard (IEEE 802) format for printing MAC-48 addresses in human-friendly form is six groups of two hexadecimal digits (0 to 9 or A to F), separated by hyphens (... |
Rust | UTF-8 | 32,586 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | // Copyright 2017 Daniel P. Clark & other digits Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distrib... |
JavaScript | UTF-8 | 653 | 2.734375 | 3 | [] | no_license | const theme = (() => {
const init = () => {
let hour = new Date().getHours();
const body = document.getElementsByTagName("body")[0];
if (hour >= 18 || hour < 6) {
body.setAttribute("class", "theme--dark");
} else {
body.setAttribute("class", "theme--default");
}
};
const handleThem... |
Python | UTF-8 | 5,351 | 2.890625 | 3 | [] | no_license | import torch
from torch import nn
import numpy as np
import math
import torch.nn.functional as F
from Resnet_demo import ResNet18
class SincConv_fast(nn.Module):
"""Sinc-based convolution
Parameters
----------
in_channels : `int`
Number of input channels. Must be 1.
out_channels : `int`
... |
Java | UTF-8 | 10,535 | 1.617188 | 2 | [
"BSD-3-Clause",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown"
] | 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 not ... |
Java | UTF-8 | 148 | 2.078125 | 2 | [] | no_license | package a3adept;
public class Rice extends IngredientImpl {
public Rice(double amount) {
super(amount, 0.25, "rice", true, false, true);
}
}
|
Markdown | UTF-8 | 3,035 | 2.65625 | 3 | [] | no_license | # Growth Hackers Test Frontend
## Table of contents
- [General info](#general-info)
- [Technologies](#technologies)
- [Quality assurance](#quality-assurance)
- [Setup](#setup)
## General info
The project is a mercado livre clone, that has just some features related with
the e-commerce:
- It list products of difere... |
C | UTF-8 | 978 | 3.15625 | 3 | [] | no_license | #include <assert.h>
#include <string.h>
#include "brainfuck.c"
void test_gen_bracket_table(){
assert(gen_bracket_table("[]", 3)[0] == 1);
assert(gen_bracket_table("[[]]", 5)[0] == 3);
assert(gen_bracket_table("[[]]", 5)[1] == 2);
assert(gen_bracket_table("[[[]]][]", 9)[0] == 5);
assert(gen_bracket_... |
Python | UTF-8 | 1,211 | 2.515625 | 3 | [] | no_license | '''Classes for standard handler responses.'''
"""This file is part of PyF.
PyF is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PyF is dist... |
TypeScript | UTF-8 | 968 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | import { readFileSync } from 'fs';
type Input = number[][];
type Output = number;
function main() {
const input = readInput();
const output = solve(input);
writeOutput(output);
}
function readInput(): Input {
const raw = readFileSync(0).toString();
const ans: number[][] = [];
let current: num... |
Markdown | UTF-8 | 8,998 | 2.9375 | 3 | [] | no_license | ---
title: Compile SASS with npm
metaDescription: Use npm package.json scripts, node-sass npm package cli and clean-css npm package cli to compile SCSS and minify the css output with Node.js
guid: 99bf307e-00e5-4226-b919-a8a08f8301b6
author: James Edwards
tags:
- Node.js
- SASS
image: npm-compile-sass.png
imageAlt:... |
JavaScript | UTF-8 | 2,804 | 2.65625 | 3 | [] | no_license | function Particle (particleTemplate, paramPosition, paramMoveDirection, paramVelocity) {
this.id = particleIdCounter++;
this.type = "particle";
this.template = ParticlesTemplateRooster.getTemplate(particleTemplate);
this.curAnimStep = 0;
this.position = paramPosition;
this.moveDirection = param... |
JavaScript | UTF-8 | 1,061 | 2.53125 | 3 | [] | no_license | import {ADD_ORDER, DELETE_ORDER} from '../constants'
export default ( tableForCheck = setDefaultTableForCheck(), action ) => {
console.log(action);
const { type, payload } = action;
switch (type) {
case ADD_ORDER:
let {order} = payload;
if (order.bill_id) {
table... |
JavaScript | UTF-8 | 451 | 2.59375 | 3 | [] | no_license | import R from 'ramda'
export default function changeAt(key, val, obj) {
if (R.isNil(val)) {
// Remove
return R.ifElse(
Array.isArray,
R.remove(key, 1),
R.assoc(key, val)
)(obj)
}
else {
// Replace
return R.ifElse(
Array.isArray,
R.ifElse(
R.propEq('length', key),
R.append(val), // A... |
C# | UTF-8 | 461 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP_InitClasses
{
class Hummer
{
public string firm = null;
public string Material { get; set; }
public int Weight { get; set; }
public int price;
... |
Python | UTF-8 | 3,708 | 3.140625 | 3 | [] | no_license | # This file will serve to create a CSV that contains all lotto results since Draw #1.
import requests
from bs4 import BeautifulSoup
from datetime import date, datetime
import csv
import os
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 ... |
Markdown | UTF-8 | 4,465 | 3.078125 | 3 | [] | no_license | 三五
这并不是他们窝囊,而是九玄洞的攻击力量,远远超乎他们意料之外。
因为这里并非只有九玄洞的人,还有丐帮、长鲸帮、华山派和天台派的高手,也汇合在一起。
这些武林人物,本各处于天南地北,不知如何,此刻竟然齐聚此地,而且还表现得相当团结。
团结,永远是一种最强大的力量。
倘若只有九玄洞的人,说不定早已溃不成军。
这九十六个青衣大汉,确是一支精锐雄师。
但除了九玄洞之外,再加上这数大门派帮会的力量,情况就绝不相同。
激战之下,神血盟伤亡惨重。
只有极少数人冲开二条血路,得以幸免。
铁凤师的伤势其实只是痊愈的八成左右。
但在这一役,他的表现却... |
PHP | UTF-8 | 956 | 3.234375 | 3 | [] | no_license | <?php
namespace Botchka\Command;
use \Botchka\Command;
/**
* Class Who
* @author Joost Mul <joost@jmul.net>
*
* Returns a list of users who match <name>.[54] If the flag "o" is given, the server will only return information about IRC Operators.
*
* Defined in RFC 1459
*/
final class Who extends Command
{
/... |
TypeScript | UTF-8 | 328 | 2.84375 | 3 | [] | no_license | (() => {
enum Sizes {
Small = 'small',
Medium = 'medium',
Large = 'large'
}
enum Sizes {
ExtraLarge = 'xtraLarge'
}
let selectedSize: Sizes = Sizes.Small;
function updateSizes(size: Sizes): void {
selectedSize = size;
}
updateSizes(Sizes.ExtraLarge);
console.log(selectedSize... |
Java | UTF-8 | 797 | 2.8125 | 3 | [] | no_license | package com.mycompany.commands;
import com.codename1.ui.Command;
import com.codename1.ui.Dialog;
import com.codename1.ui.events.ActionEvent;
import com.mycompany.a3.GameWorld;
public class AboutCmd extends Command {
/**
* Constructor for the Command object.
* @param gw = GameWorld from which the comma... |
Markdown | UTF-8 | 1,607 | 2.8125 | 3 | [] | no_license | 学习笔记
# HTML
* symbol
* ` `: 空格
* no-break space
* 会破坏语义,不建议使用
* `"`: `"`
* `&`: `&`
* `<`: `<`
* `>`: `>`
* 语义化
* 定义
* 语义指的是一段代码的含义
* 例如: 这个 HTML 的元素有什么作用,扮演了什么样的角色
* 在恰当的需求下使用恰当的 HTML 元素
* 好处
* `<h1>`它的语义会被在很多地方以不同的方式被使用到, 例如搜索引擎会把它包含的内容作为一个重要的关键词,从而影响这个页面在搜索... |
Rust | UTF-8 | 9,110 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | use std::collections::HashMap;
use std::sync::Arc;
use grpcio::{Channel, ChannelBuilder, ChannelCredentialsBuilder, Environment};
#[cfg(feature = "serialize")]
use serde::{Deserialize, Serialize};
use crate::exporter::Compression;
use crate::ExportConfig;
use super::default_headers;
#[cfg(feature = "logs")]
mod log... |
C# | UTF-8 | 761 | 2.578125 | 3 | [] | no_license | using UnityEngine;
using UnityEngine.UI;
public class HPSlider : MonoBehaviour
{
public Slider HPslider;
public Text HPText;
private float HP;
public float HP1 { get => HP; set => HP = value; }
void Start()
{
HPslider.minValue = 0;
HPslider.maxValue = 100;
HP1 = HPslid... |
Java | UTF-8 | 3,690 | 2.546875 | 3 | [] | no_license | package com.sfmap.api.maps.offlinemap;
import android.os.Parcel;
import android.os.Parcelable;
/**
* 下载城市属性的相关类。
*/
public class OfflineMapCity
extends City
{
/**
* 下载城市的数据地址。
*/
private String url = "";
/**
* 返回下载城市数据的大小,单位字节。
*/
private long size = 0L;
/**
* 城市下载状态。
... |
JavaScript | UTF-8 | 1,271 | 2.546875 | 3 | [] | no_license | import {
ADD_TODO,
CLEAR_COMPLETED_TASKS,
UPDATE_TASK_DESCRIPTION,
TOGGLE_COMPLETE
} from '../data/constants';
import moment from 'moment';
import uuid from 'uuid';
export default function reducer(state, action) {
switch (action.type) {
case UPDATE_TASK_DESCRIPTION:
return {
... |
Java | UTF-8 | 752 | 3.78125 | 4 | [] | no_license | package sort;
/**
* 冒泡算法
* 实现思路:数向上慢慢爬
* @author xuguowei
*
*/
public class BubbleSort {
/**
* 时间复杂度:o(n2)
* @param sortArray
* @return
*/
public int[] BubbleSort_1(int[] sortArray){
for(int i = 0;i<sortArray.length;i++){
for(int j=sortArray.length-1;j>i;j--){
if(sortArray[j-1]>=sortArray[j]){... |
Python | UTF-8 | 9,710 | 3 | 3 | [] | no_license | import argparse
import nd2reader
import os
import numpy as np
from os import listdir
import shutil
from skimage.feature import register_translation
from scipy.ndimage import fourier_shift
from skimage import exposure
def read_data(reader, data_path):
"""
Reads data from .nd2 files.
:param reader: nd2 rea... |
JavaScript | UTF-8 | 2,436 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /*jslint sloppy:true*/
/*globals console,freedom*/
function FileServer(inSocial) {
this.social = inSocial;
this.files = {};
}
FileServer.prototype.serve = function (myClientState, key, value, name) {
console.log('serve-data: now serving ' + key);
this.files[key] = {
data: value,
stats: {}
};
if (my... |
Python | UTF-8 | 202 | 2.6875 | 3 | [] | no_license | import math
#=input()
#=int(input())
a,b,c=map(int,input().split())
#=map(str,input().split())
#=list(map(int,input().split()))
if 4*a*b < (-a-b+c)**2 and a+b<=c:
print("Yes")
else:
print("No") |
C++ | UTF-8 | 1,818 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
#define SIZE 10
struct Choice{
int order[SIZE];
Choice *next;
};
class CombanitonAndArrangement{
private:
int *ChosenNumberInit(int how_many_need){
int *chosen_number_group = new int[how_many_need +1];
chosen_number_group[0] = -1;
return(chosen_... |
Java | UTF-8 | 388 | 2 | 2 | [] | no_license | package codingcareers.webapp.client.PageComponents;
import codingcareers.webapp.client.Constants;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.RootPanel;
public abstract class PageFooter extends HorizontalPanel implements PageComponent {
// TODO PageFooter load()
public... |
JavaScript | UTF-8 | 942 | 2.625 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
var paper;
var ground;
var dustbin1,dustbin2,dustbin3;
function preload()
{
}
function setup() {
createCanvas(1350, 700);
engine = Engine.create();
world = engine.world;
//Create the Bodies Her... |
Markdown | UTF-8 | 1,654 | 3.859375 | 4 | [
"MIT"
] | permissive | ### [Possible Bipartition](https://leetcode.com/problems/possible-bipartition)
<p>We want to split a group of <code>n</code> people (labeled from <code>1</code> to <code>n</code>) into two groups of <strong>any size</strong>. Each person may dislike some other people, and they should not go into the same group.</p>
<... |
C# | UTF-8 | 485 | 2.59375 | 3 | [
"MIT"
] | permissive | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class fasttest : MonoBehaviour {
// Use this for initialization
int tr;
int fal;
void Start () {
tr = 0;
fal = 0;
}
// Update is called once per frame
void Update () {
int temp = Random.Ra... |
Shell | UTF-8 | 2,146 | 4.09375 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env bash
# -----------------------------------------------------------------------------
# bat-extras | Copyright (C) 2019 eth-p | MIT License
#
# Repository: https://github.com/eth-p/bat-extras
# Issues: https://github.com/eth-p/bat-extras/issues
# -------------------------------------------------------... |
Java | UTF-8 | 1,442 | 1.890625 | 2 | [] | no_license | package com.pfa.AppRecrutement;
import com.pfa.AppRecrutement.dao.UserRepository;
import com.pfa.AppRecrutement.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boo... |
Shell | UTF-8 | 362 | 3.203125 | 3 | [] | no_license | #!/bin/bash -eu
. `dirname $0`/../library/script
initd_path=/etc/init.d/virtualbox-guest-utils
# install VirtualBox guest packages
install virtualbox-guest-{dkms,utils,x11}
# disable warnings for VirtualBox Guest init.d script
name=log_warning_msg
sudo perl -pe "s/(\s*)($name .+)/\1# \2/" -i $initd_path
[[ `pcregrep... |
PHP | UTF-8 | 530 | 3.234375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: shiwenyuan
* Date: 2019/12/31 13341007105@163.com
* Time: 15:37
*/
/*
* Class Solution
*/
class Solution
{
/**
* @param String[] $s
* @return NULL
*/
function reverseString(&$s)
{
// krsort($s);
$len = count($s);
for ($i=... |
Java | UTF-8 | 1,595 | 2.5 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package InventApp;
import java.util.*;
/**
*
* @author master
*/
public class Sesion {
private Date fechaInicializacion;
p... |
SQL | UTF-8 | 22,927 | 3.234375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : Dim 05 mai 2019 à 20:44
-- Version du serveur : 8.0.13-4
-- Version de PHP : 7.2.17-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
Markdown | UTF-8 | 2,171 | 2.78125 | 3 | [] | no_license | # Article 1
Les appellations autorisées pour les établissements de soins vétérinaires sont le « cabinet vétérinaire », la « clinique vétérinaire », le « centre hospitalier vétérinaire » et le « centre de vétérinaires spécialistes ».
Pour se prévaloir d'une de ces appellations, l'établissement de soins doit répondre a... |
Markdown | UTF-8 | 1,203 | 2.53125 | 3 | [] | no_license | ## Bookmarks tagged [[runtime]](https://www.bookmarks.dev/search?q=[runtime])
_<sup><sup>[www.bookmarks.dev/tagged/runtime](https://www.bookmarks.dev/tagged/runtime)</sup></sup>_
---
#### [Byte Buddy - runtime code generation for the Java virtual machine](https://bytebuddy.net/#/)
_<sup>https://bytebuddy.net/#/</sup>_... |
Python | UTF-8 | 1,738 | 4.15625 | 4 | [] | no_license | #Ref:
#https://github.com/williamfiset/Algorithms/blob/master/src/main/java/com/williamfiset/algorithms/search/InterpolationSearch.java
#https://www.geeksforgeeks.org/interpolation-search/
#For uniform distrubtion list.
#Worst Case O(n)
#Avearge Case O(log(log(n)))
#When element to be search si closer to data[hi]
# ... |
C# | UTF-8 | 504 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Project_Euler___C_Sharp {
static class RandomSequence {
public static int[] RandomList(int length) {
List<int> numbers = new List<int>(length);
Random rand ... |
C++ | UTF-8 | 2,980 | 2.75 | 3 | [
"MIT"
] | permissive | #pragma once
#include <SFML/Graphics.hpp>
#include "engine/physics/physics.hpp"
#include "engine/common/utils.hpp"
struct Renderer
{
const CIVector<PhysicObject>& objects;
sf::RenderTarget& target;
sf::VertexArray objects_va;
sf::Texture circle_texture;
sf::RenderSta... |
Python | UTF-8 | 1,782 | 3.578125 | 4 | [] | no_license | class Ingredient:
"""A liquid ingredient of a mixed drink"""
def __init__(self, name, flavs = {}):
"""Returns a new Ingredient instance.
Keyword arguments:
flavs -- dictionary of string keys, the flavors, and number values:
name -- string, name of ingredient
... |
TypeScript | UTF-8 | 261 | 2.875 | 3 | [] | no_license | export class CourseService{
static courses: string[]= ["C1", "C2", "C3"];
getCourses():string[]{
return CourseService.courses;
}
static setCourse(course:string){
CourseService.courses[CourseService.courses.length]=course;
}
} |
Markdown | UTF-8 | 3,889 | 2.609375 | 3 | [] | no_license | ---
layout: post
author: Hiroto Kaneko
title: Tello EDU 4台を使ったドローン編隊飛行に挑戦(第1回:ざっくり全体像)
tags:
---
今回から Tello EDU 4台を使ってドローン編隊飛行に挑戦していきます!
Tello EDU([Tello EDU 公式サイト](https://www.ryzerobotics.com/jp/tello-edu))は、香港のとなりのIT産業の盛んな町、深圳のベンチャー企業 Ryze Technology 社から発売されている小さなちいさなドローンです。同じ会社から発売されている無印の Tello との最大の違いは、なんと複数台で編隊... |
Markdown | UTF-8 | 3,286 | 3.234375 | 3 | [
"MIT"
] | permissive | # Matchers and Conditions (Draft)
Here we will learn how to execute Matchers depending on some given Conditions.
In complex forms use-cases, some controls directly depend on the value or status of some other form control. Then we implement custom behaviors, like `hiding` a field when another control has some value, o... |
JavaScript | UTF-8 | 988 | 2.734375 | 3 | [] | no_license | "use strict";
export default function songChooser(settings) {
function randomItem(items) {
return items[Math.floor(Math.random() * items.length)];
}
const SPARTAK = [300, 200, 300, 200, 150, 100, 150, 100, 150, 300, 100, 100, 100, 100, 150, 100, 200, 300, 120, 130, 120, 300];
const MORTA... |
Ruby | UTF-8 | 595 | 3.78125 | 4 | [] | no_license | # write a ruby script to accept a filename from the user print the extension of that
#file = "H:/3-2 subjects/SL Lab/program3.rb" #here we are explicitly taking the file name
#Reading filename
puts "Enter the file name: "
file = gets.chomp
#filename
fname = File.basename file
puts "File name: " + fname
#basenam... |
Java | UTF-8 | 991 | 2.640625 | 3 | [
"MIT"
] | permissive | public class w
{
public char n;
public int w;
}
package <missing>;
public class GlobalMembers
{
public static w[] a = tangible.Arrays.initializeWithDefaultwInstances(4);
public static void Main()
{
int z;
int q;
int s;
int l;
int i;
int j;
int t;
char x;
for (z = 1;z < 60;z++)
{
for (q = 1;... |
Markdown | UTF-8 | 933 | 3.1875 | 3 | [] | no_license | # Game.TicTacToe
TicTacToe game problem
Tic-Tac-Toe
Tic tac toe console game in C#
What?
Tic-tac-toe (also known as noughts and crosses or Xs and Os) is a game for two players, X and O,
who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical ... |
JavaScript | UTF-8 | 2,162 | 4 | 4 | [] | no_license | // Assignment Code
var generateBtn = document.querySelector("#generate");
// Write password to the #password input
function writePassword() {
var password = generatePassword();
var passwordText = document.querySelector("#password");
passwordText.value = password;
}
// Add event listener to generate button
gen... |
Java | UTF-8 | 1,749 | 2.078125 | 2 | [
"Apache-2.0"
] | permissive | package it.cnr.isti.labsedc.bpmls;
import org.springframework.web.bind.annotation.RequestBody;
public interface LearningProcessEngineController {
public String registerNewUser(@RequestBody String responseJSON);
public String authenticateUser(@RequestBody String responseJSON);
/**
* {status:error,errortype:... |
Python | UTF-8 | 1,727 | 2.671875 | 3 | [] | no_license | from sqlparser.parser.parser import parser
from sqlparser.parser.lex import lexer
from sqlparser.output.csv_output import CsvOutput
from sqlparser.parser.boxes import QueryBox
from sqlparser.tables.abstract import AbstractTable
from sys import stdout
from typing import Dict, Type
class TableManager(object):
def... |
JavaScript | UTF-8 | 5,657 | 2.578125 | 3 | [] | no_license | // Generated by CoffeeScript 1.9.1
(function() {
var board, dirs, draw, fs, gameOver, hasToPass, http, idCounter, invertibles, io, player, port, put, reset, sendMessage, server, size, socketio, switchTurn, turn;
http = require("http");
fs = require("fs");
socketio = require("socket.io");
port = process.en... |
C++ | UTF-8 | 830 | 2.515625 | 3 | [] | no_license | #include "roomdto.h"
QString RoomDto::getName() const
{
return name;
}
void RoomDto::setName(const QString &value)
{
name = value;
}
int RoomDto::getRoomTypeId() const
{
return roomTypeId;
}
void RoomDto::setRoomTypeId(int value)
{
roomTypeId = value;
}
bool RoomDto::getNeedClean() const
{
retu... |
PHP | UTF-8 | 4,486 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Generated by Protobuf protoc plugin.
*
* File descriptor : Documents/Document.proto
*/
namespace AgentSIB\Diadoc\Api\Proto\Documents;
/**
* Protobuf enum : AgentSIB.Diadoc.Api.Proto.Documents.RevocationStatus
*/
class RevocationStatus extends \Protobuf\Enum
{
/**
* UnknownRevocationStatus... |
Swift | UTF-8 | 467 | 2.640625 | 3 | [] | no_license | //
// DisplayableDetailContainer.swift
// AlienGo
//
// Created by Richmond Watkins on 10/5/16.
// Copyright © 2016 Nashville Native. All rights reserved.
//
import UIKit
struct DetailTextContainer: DetailTextItem {
var title: String
var content: String
init?(title: String?, content: String?) {
... |
Markdown | UTF-8 | 410 | 3.296875 | 3 | [
"MIT"
] | permissive | ### 566. 重塑矩阵
### 代码
```
func matrixReshape(nums [][]int, r int, c int) [][]int {
l1:=len(nums)
l2:=len(nums[0])
res:=make([][]int, r)
for i, _:=range res{
res[i]=make([]int, c)
}
if r*c!=l1*l2{
return nums
}
for i:=0;i<r;i++{
for j:=0;j<c;j++{
k:=i*c... |
Python | UTF-8 | 3,935 | 3.078125 | 3 | [] | no_license | # exercise 11.4.1
import numpy as np
from matplotlib.pyplot import (figure, imshow, bar, title, xticks, yticks, cm,
subplot, show)
from scipy.io import loadmat
from toolbox_02450 import gausKernelDensity
from sklearn.neighbors import NearestNeighbors
def Outlier(input_data, index_to_che... |
Python | UTF-8 | 3,506 | 2.65625 | 3 | [] | no_license | class User:
def __init__(self, name, pasw):
self.name = name
self.pasw = pasw
USERS.append(self)
def newContent(self):
mes = list(filter(lambda m: m.userNoticed == self and not m.revised, MESSAGES))
pub = list(filter(lambda p: p.userNoticed == self and not p.revised, PUB... |
Markdown | UTF-8 | 1,183 | 2.59375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
uid: Microsoft.Quantum.Math.ArcTan
title: ArcTan 関数
ms.date: 1/23/2021 12:00:00 AM
ms.topic: article
qsharp.kind: function
qsharp.namespace: Microsoft.Quantum.Math
qsharp.name: ArcTan
qsharp.summary: Returns the angle whose tangent is the specified number.
ms.openlocfilehash: 6c7b22ce1278c2cb45f16330b0c2276ac15296c... |
PHP | UTF-8 | 8,381 | 2.765625 | 3 | [] | no_license | <?php
require_once(__DIR__ . "/../businessobjects/AbstractBaseDataClass.php");
require_once(__DIR__ . "/../businessobjects/PageClass.php");
/**
* @table "pagenavigation"
*/
class PageNavigationClass extends AbstractBaseDataClass {
const PAGENAVIGATIONTYPE_MOBILE = "X";
const PAGENAVIGATIONTYPE_PAGE = "P";... |
Swift | UTF-8 | 1,719 | 3.328125 | 3 | [] | no_license | //
// Date+Ext.swift
// ShortsReportBeta
//
// Created by Aidan Pendlebury on 24/06/2020.
//
import Foundation
extension Date {
func minutesBetweenDates() -> Double {
//get both times sinces refrenced date and divide by 60 to get minutes
let newDateMinutes = Date().timeIntervalSinceRe... |
Java | UTF-8 | 1,538 | 2.09375 | 2 | [] | no_license |
package com.cw.stu.internet.tech.stu.audit.webservice.test.client;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java ... |
PHP | UTF-8 | 7,771 | 2.625 | 3 | [] | no_license | <?php
class Functions
{
public function logoHeader() {
$result = mysql_query("SELECT * FROM settings");
$row = mysql_fetch_object($result);
if ($row->logoexist === 'true') {
echo '<img id="logoimg" src="' . $row->logo . '" alt="' . $row->servername . ' - ' . $row->slogan . '">';
echo '<hr class="noscreen"... |
Java | UTF-8 | 527 | 2.0625 | 2 | [] | no_license | package com.example.tung.gituser.ui.main;
import com.example.tung.gituser.BasePresenter;
import com.example.tung.gituser.BaseView;
import com.example.tung.gituser.data.model.User;
import java.util.List;
public interface MainContract {
interface Presenter extends BasePresenter {
void getUsers();
... |
Markdown | UTF-8 | 9,430 | 2.78125 | 3 | [] | no_license | # Projeto XY
Projeto sobre novo sistema em nuvem para a XY Brasil
## Objetivo
O Objetivo deste documento é facilitar a tomada de decisão sobre a implantação de um sistema em núvem para o novo sistema de gestão integrada para a empresa XY Brasil.
## On-Premisses VS SaaS
O uso de sistemas on-premisses é a forma mais tr... |
PHP | UTF-8 | 350 | 2.59375 | 3 | [
"MIT"
] | permissive | <?php namespace Quince\Pelastic\Contracts\Config;
interface PelasticConfigInterface {
/**
* Bootstrap from array
*
* @param array $params
* @return $this
*/
public function setClientConfig(array $params);
/**
* Get client config
*
* @return array
*/
public... |
Ruby | UTF-8 | 1,001 | 3.921875 | 4 | [] | no_license | class Product
attr_reader :red
def initialize(name,blue,red,green)
@name = name #ocup variables de instancia para que sean en sadas en otro momento.
@blue = blue.to_i
@red = red.to_i
@green = green.to_i
end
def total
@blue+@red+@green
end
end
products = []... |
Python | UTF-8 | 1,261 | 3.65625 | 4 | [] | no_license | from linked_list import _Node, LinkedList
from typing import List, Any, Optional
class Queue:
"""
This is a queue implemented using linked list
"""
def __init__(self):
self.item = LinkedList([])
def is_empty(self) -> bool:
"""
Return whether this queue contains no items
... |
Python | UTF-8 | 1,308 | 2.671875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 13 10:46:03 2018
@author: Manjit
This function contains the density calibration shots for each day
"""
def calshot(day):
if day == '101718':
return '101718r2'
if day =='101618':
return '101618r3'
if day == '100218':
return '100218r5'
... |
Java | UTF-8 | 307 | 1.851563 | 2 | [] | no_license | package springMongo.MovieStore.service;
import java.util.List;
import springMongo.MovieStore.bean.Result;
import springMongo.MovieStore.bean.Users;
public interface UserService {
public Users save(Users users);
public Users getUser(String name);
public List<Result> getAvgrating(Integer id);
}
|
Swift | UTF-8 | 1,103 | 3.265625 | 3 | [] | no_license | import Foundation
func solution(_ expression:String) -> Int64 {
let priors: [[Character]] = [["+", "-", "*"], ["+", "*", "-"],
["-", "+", "*"], ["-", "*", "+"],
["*", "-", "+"], ["*", "+", "-"]]
let operands = expression.components(sep... |
C++ | UTF-8 | 908 | 3.9375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
/*
Write a program that prompts the user to enter the number of students, the students’ names,
and their scores, and prints student names in decreasing order of their scores.
*/
struct Student {
string name;
int scor... |
Markdown | UTF-8 | 10,040 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | # :blush:JPTabBar:blush:
[](https://bintray.com/peng83508440/maven/JPTabBar)
<br>[](http://android-arsenal.com/details/1/4685)
###
# 效果图
![](https://... |
Markdown | UTF-8 | 6,315 | 3.53125 | 4 | [
"MIT"
] | permissive | ---
title: Segunda clase
date: '2019-03-25'
description: 'Introducción a Funcional. Composición, Precedencia de Operadores, primera parte de Tipado.'
tags: [funcional, composicion, tipado, precedencia-de-operadores, inmutabilidad]
---
## Tarea para la clase que viene
- **Hacer parejas para los trabajos practicos que ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.