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 | 1,133 | 3 | 3 | [
"Zlib"
] | permissive | package com.robototes.abomasnow;
import edu.wpi.first.wpilibj.DigitalInput;
/**
*
* @author sam
*/
public class LineSensorGroup {
DigitalInput left;
DigitalInput middle;
DigitalInput right;
LineSensorGroup(int l, int m, int r) {
left = new DigitalInput(l);
middle = new DigitalInput... |
JavaScript | UTF-8 | 412 | 2.640625 | 3 | [] | no_license | const index = require('./index');
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const command = () => {
rl.question("Enter command: ", function(values) {
if (values === 'Q') {
rl.close();
} else {
... |
Go | UTF-8 | 1,961 | 4.0625 | 4 | [
"MIT"
] | permissive | /*
Vlad enjoys listening to music. He lives in Sam's Town. A few days ago he had a birthday, so his parents gave him a gift: MP3-player! Vlad was the happiest man in the world! Now he can listen his favorite songs whenever he wants!
Vlad built up his own playlist. The playlist consists of N songs, each has a unique p... |
Java | UTF-8 | 622 | 1.796875 | 2 | [] | no_license | package nudt.web.repository;
import nudt.web.entity.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
public interface PermissionRepository extends JpaRepo... |
Java | UTF-8 | 3,690 | 2.140625 | 2 | [] | no_license | package dispositivos.moviles.karla.cuatro;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import com.squareup.picasso.Picasso;
import dispositivos.moviles.karla.cuatro... |
Python | UTF-8 | 642 | 3.203125 | 3 | [] | no_license | import unittest
import time
"""
1.执行顺序是start-执行测试用例test01-end;test02也是如此
2.执行顺序是先执行setUp,然执行test*开头的用例,最后是后置tearDown
3.addtest没执行,说明只执行test开头的用例
"""
class Test(unittest.TestCase):
def setUp(self):
print("start")
def tearDown(self):
time.sleep(1)
print('end')
def test02(self):
... |
Markdown | UTF-8 | 2,831 | 2.609375 | 3 | [
"MIT"
] | permissive | ---
layout: page
label: portfolio
title: "SKULLY Helmet AR-1"
date: 2015-06-01
tags:
- Industrial_Design
- Mechanical_Eng
- Creative_Direction
- Player_Coach
description: The flagship SKULLY AR-1 Helmet.
image: /assets/img/skully_ar1_bg.jpg
---
### The SKULLY AR-1 helmet was the world's first augmented reality... |
Markdown | UTF-8 | 970 | 2.546875 | 3 | [] | no_license | # Учебный курс React JS. Полный Курс 2020
[React documentation](https://reactjs.org/).
[React Hooks documentation](https://react-redux.js.org/api/hooks).
На основании этого видео
[](http://www.youtube.com/watch?v=9KJxaFHotqI "Основное видео")
## Основ... |
Markdown | UTF-8 | 9,488 | 2.96875 | 3 | [] | no_license | ## Writeup Template
### You can use this file as a template for your writeup if you want to submit it as a markdown file, but feel free to use some other method and submit a pdf if you prefer.
---
**Advanced Lane Finding Project**
The goals / steps of this project are the following:
* Compute the camera calibratio... |
Java | UTF-8 | 7,064 | 2.671875 | 3 | [] | no_license | import java.awt.Color;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package javaapplication1;
/**
*
* @author User
*/
public class CustomGameFrame extends javax.swing.JFrame {
/**
* Creates new form CustomGameFrame
*/
public CustomGameFra... |
C# | UTF-8 | 1,345 | 2.734375 | 3 | [] | no_license | using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using SchoolApi.Interfaces;
using SchoolApi.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
namespace SchoolApi.Controllers
{
[ApiController]
[Route("api/[con... |
C# | UTF-8 | 2,256 | 2.75 | 3 | [] | no_license | using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScoreController : MonoBehaviour
{
[Header("Score Attributes")]
public List<ScoreInfo> highScores;
[Space(10)]
public float currentScore = 0f;
public void ManageScore(fl... |
Java | UTF-8 | 1,745 | 2.296875 | 2 | [] | no_license | package com.neusoft.book.entity;
import java.util.Date;
public class LenBook {
// String sql="insert into lenbook(bid,mid,credate,retday,retstatus,creditno) values(?,?,?,?,?,?)";
private Integer leid;
private Books books;//图书
private Member member;//用户
private Date credate;//借书起始时间
private Date retdate... |
Java | UTF-8 | 591 | 2.171875 | 2 | [] | no_license | package com.AssiaTanji;
public class Livre {
String titre,auteur,categorie;
int idLivre;
public String getTitre() {
return titre;
}
public void setTitre(String titre) {
this.titre = titre;
}
public String getAuteur() {
return auteur;
}
public void setAuteur(String auteur) {
this.auteur = a... |
Java | UTF-8 | 492 | 1.96875 | 2 | [] | no_license | package br.com.loja.util;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.inject.Named;
import br.com.loja.controller.LoginController;
import br.com.loja.entity.Cliente;
@Named(value = "verificaLogado")
@RequestScoped
public class VerificaLogado {
@Inject
private LoginCont... |
Markdown | UTF-8 | 10,268 | 2.90625 | 3 | [] | no_license | ruby on rails 6.0 默认使用 Webpacker。
作为js打包的工具,webpack已经成为了现代js应用打包的事实标准。
Webpacker makes it easy to use the JavaScript pre-processor and bundler webpack 4.x.x+ to manage application-like
JavaScript in Rails. It coexists with the asset pipeline, as the primary purpose for webpack is app-like JavaScript,
not imag... |
Python | UTF-8 | 934 | 3.140625 | 3 | [] | no_license | import re
import os
import fnmatch
def gen_file_list(base_path):
for base, unused, filelist in os.walk(base_path):
for name in filelist:
yield os.path.join(base, name)
def files_matching_regex(base_path, regex, ignore_case=False):
try:
if ignore_case:
pat = re.compile(regex, re.IGNORECASE)
else:
pat ... |
Markdown | UTF-8 | 1,891 | 2.5625 | 3 | [] | no_license | # BA Node.js
[](http://meetupjs.herokuapp.com)
## Qué es y por qué
BA Node.js intenta impulsar la comunidad Node.js en Buenos Aires. La idea nació en charlas entre miembros de la comunidad y por la necesidad de un enfoque descentralizado, dónde todos pueden par... |
Markdown | UTF-8 | 2,925 | 2.984375 | 3 | [
"BSD-2-Clause"
] | permissive | # browse.php Payload
*[browse.php - Remote payload](https://github.com/bytecode-77/browse.php-payload), single file directory browser & downloader <https://bytecode77.com/hacking/payloads/browse>*
**browse.php** is a PHP single-file script providing an HTML based directory
browser. Once arbitrary write access is... |
Python | UTF-8 | 1,626 | 4.21875 | 4 | [] | no_license | """
Classe Retangulo: Crie uma classe que modele um retangulo:
Atributos: LadoA, LadoB (ou Comprimento e Largura, ou Base e Altura, a escolher)
Métodos: Mudar valor dos lados, Retornar valor dos lados, calcular Área e calcular Perímetro;
Crie um programa que utilize esta classe. Ele deve pedir ao usuário que informe a... |
Python | UTF-8 | 260 | 4 | 4 | [] | no_license | a = int(input("Enter the first number: "))
b = int(input("Enter the second number: "))
d = input("Enter an action: + , - , * , / ")
if d == "+":
print(a + b)
elif d == "-":
print(a - b)
elif d == "*":
print(a * b)
elif d == "/":
print(a / b) |
C | UTF-8 | 1,191 | 3.53125 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
typedef int datatype;
void Swap(datatype array[],int x,int y){
int t=array[x];
array[x]=array[y];
array[y]=t;
}
int Partition_3(datatype array[],int left,int right){// xiabiao
int d=left;
for(int i=left;i<right;++i){
if(array[i]<=array[right]){
Swap(array,i,d);
d++;
}
... |
PHP | UTF-8 | 637 | 2.65625 | 3 | [] | no_license | <?php
if (isset($_POST["name"]) && isset($_POST["description"]) && isset($_POST["price"])) {
echo $_POST["name"].$_POST["description"].$_POST["price"];
}
require_once "inc/dbconn.inc.php";
$sql = "INSERT INTO Product(name, description, price) VALUES(?, ?, ?);";
$statement = mysqli_stmt_init($conn);
mysqli_... |
C++ | GB18030 | 2,535 | 2.859375 | 3 | [] | no_license | // ʹgrabCutкĤָ
// ܽлָЧһ㣬ߡëδȥԲıԵ⻬
// ֶλ
#include <iostream>
#include <opencv2\core.hpp>
#include <opencv2\imgproc.hpp>
#include <opencv2\highgui.hpp>
using namespace std;
int main()
{
cv::Mat image = cv::imread("S6000S00.jpg");
if (!image.data)return 0;
cv::namedWindow("Original Image");
cv::imshow("Original Im... |
Python | UTF-8 | 1,643 | 3.65625 | 4 | [] | no_license | treeDraw = """
1
/ \\
2 3
/ \\ / \\
4 56 7
/ \\
8 9
"""
print(treeDraw)
tree = [
(1, None),
(2, 1),
(3, 1),
(4, 2),
(5, 2),
(6, 3),
(7, 3),
(8, 4),
(9, 4),
]
# de cualquier nodo a cualquier nodo mostrando el camino.
def treestep... |
Markdown | UTF-8 | 2,369 | 2.5625 | 3 | [
"MIT"
] | permissive | # Desenvolvimento local
## Configuração inicial
Tentamos facilitar o desenvolvimento de novas funcionalidades por membros da comunidade, e todas as contribuições são bem-vindas. Para começar, é necessário um ambiente de desenvolvimento Java atualizado, com:
* [git][GIT]
* [git-crypt][GITCRYPT]
* [GPG][GPG]
* [JDK 8]... |
C++ | UTF-8 | 550 | 2.65625 | 3 | [] | no_license |
#ifndef DUALQUATERNION_H
#define DUALQUATERNION_H
#include "glm::quaternion.h"
class Dualglm::quat
{
Dualglm::quat(glm::quat q, glm::vec3 v)
{
ord = q;
glm::vec3 quatvect = q.getVector();
dual.setA(quatvect.scaleProduct(v)*-0.5f);
glm::vec3 dualvector = glm::vec3(0.5f * (v.x * q.getA() + v.y * quatvect.z ... |
JavaScript | UTF-8 | 528 | 4.125 | 4 | [] | no_license | "use strict"
/*
Utilizando un bucle, mostrar la suma y la media de los números ingresados
hasta introducir un número negativo y ahí mostrar el resultado
*/
var suma = 0;
var contador = 0;
do{
var numero = parseInt(prompt("Introduce algún número", 0));
if(isNaN(numero)){
numero = 0;
}
else... |
Python | UTF-8 | 120 | 3.046875 | 3 | [] | no_license | from collections import Counter as co
arr = [2, 2, 1]
arr = co(arr)
for i in arr:
if arr[i] == 1:
print(i) |
Go | UTF-8 | 975 | 2.703125 | 3 | [] | no_license | package cmd
import (
"github.com/spf13/cobra"
)
var rootCmd = &cobra.Command{
Use: "blackjack",
Short: "Blackjack Game",
Long: "Starts a Blackjack Game",
}
func init() {
startGameCmd.Flags().IntP("decks", "d", 1, "Number of decks to initialize with")
startGameCmd.Flags().IntP("jokers", "j", 0, "Number of Jo... |
C# | UTF-8 | 324 | 3.21875 | 3 | [] | no_license | public void Draw(RenderWindow window)
{
var index = Math.Max(0, points.Count - 8);
var offset = Math.Min(points.Count, 8);
points.RemoveRange(index, offset);
foreach (Point point in points)
{
point.Draw(window);
}
... |
Java | UTF-8 | 466 | 2.234375 | 2 | [] | no_license | package com.pwc.us.common.exception;
/**
* This exception is thrown when a user who is already registered in Guidewire
* attempts to register again.
* @author Roger Turnau - <roger.turnau@us.pwc.com>
*/
public class GwUserAlreadyRegisteredException extends Exception {
public GwUserAlreadyRegisteredException(St... |
Markdown | UTF-8 | 1,352 | 2.578125 | 3 | [
"MIT"
] | permissive | # InvoiceMe
Simple invoice program
## Stage 1
### UI design
- Login form (Done)
- MainMenu from (Done)
- Contact form (Done)
- Invoice form (Done)
- Overview form (Done)
- Print form (Done)
### Scripting
- Loging form functions with DB (Done)
- Contact form to add contacts to DB (Done)
- Contacts form ... |
C# | UTF-8 | 3,208 | 2.84375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using ProductCatalog.Models;
using ProductCatalog.Repositories;
namespace ProductCatalog.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class ... |
C++ | UTF-8 | 2,408 | 3.140625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <utility>
using namespace std;
class Solution{
private:
string roll(vector<vector<int>> &maze, int ballRow, int ballCol, const vector<int> & hole, int dr, int dc, int dist, const string&path, pair<string, int>&res){
if (dist < res.second){
if (dr != 0... |
Java | UTF-8 | 1,296 | 2.53125 | 3 | [] | no_license | package com.example.locuslabs.recommendedimplementation;
/**
* This class is for testing Proguard rules, it has no functional use. It should get obfuscated by Proguard, as described in the case below.
*
* Scenario: Proguard rules should not prevent obfuscation of customer's code
* Given the RecommendedImplementat... |
JavaScript | UTF-8 | 3,346 | 2.984375 | 3 | [] | no_license |
window.AudioContext = window.AudioContext || window.webkitAudioContext;
const audioContext = new AudioContext();
const drawAudio = url => {
fetch(url)
.then(response => response.arrayBuffer())
.then(arrayBuffer => audioContext.decodeAudioData(arrayBuffer))
.then(audioBuffer => draw(normalizeData(filter... |
Python | UTF-8 | 619 | 2.546875 | 3 | [] | no_license | __author__ = 'xwffirilat'
import MainRegistry
from command.registry import CommandRegistry
from internal.exception import CommandException
class Interpreter:
def __init__(self, GUI):
MainRegistry.setInterpreter(self)
self.GUI = GUI
def interpret(self, string: str):
command, *args = s... |
C++ | UTF-8 | 1,997 | 3.59375 | 4 | [] | no_license | //
// Non-overlappingIntervals.cpp
// LeetCode-main
//
// Created by jackma on 2022/3/9.
// Copyright © 2022 JackMa. All rights reserved.
//
#include "Non-overlappingIntervals.hpp"
/**
Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to re... |
C++ | UTF-8 | 1,086 | 2.75 | 3 | [
"MIT"
] | permissive | /**
* @file DescriptorsRecognizer.cpp
* @author Люнгрин Андрей aka prostoichelovek <iam.prostoi.chelovek@gmail.ru>
* @date 01 Aug 2020
* @copyright MIT License
*/
#include "DescriptorsRecognizer.h"
namespace faces {
bool DescriptorsRecognizer::save(std::string const &dst) {
return classifier->save(d... |
PHP | UTF-8 | 3,393 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
namespace SGT\HTTP\Navigation;
use SGT\Traits\Config;
class ButtonDropdown
{
use Config;
use AddItem;
public $type = 'button_dropdown';
protected $alignment = 'right';
protected $color = null; // Can be left or right
protected $items = [];
protected $size ... |
Java | UTF-8 | 1,654 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | package com.robbendev.common.base;
/**
* <p>
* 通用响应结果
* </p>
*
* @param <T>
*/
public class BaseResult<T> {
// 返回信息-失败
public static final String APP_DEFINE_ERR = "参数错误或者操作未成功";
// 返回信息-成功
public static final String APP_DEFINE_SUC = "操作成功";
public static final String CODE_SUCCESS = "0";
public static fi... |
C | UTF-8 | 343 | 4.1875 | 4 | [] | no_license | #include <stdio.h>
int isPrime(int);
int main() {
int number;
printf("Enter a number: ");
scanf("%d", &number);
if (isPrime(number))
printf("\nEntered number is prime!");
else
printf("\nEntered number is not prime!");
}
int isPrime(int x) {
for (int i = 2; i < x; i++)
if (x % i == 0)
... |
C++ | UTF-8 | 1,819 | 2.8125 | 3 | [] | no_license | #ifndef _cAStar_HG_
#define _cAStar_HG_
#include <Scene\sPathNode.h>
#include <OpenGL\OpenGLHeaders.h>
#include <vector>
#include <deque>
#include <list>
class cAStar
{
public:
cAStar();
~cAStar();
// Set start and goal nodes of the path
void SetStartNode(sPathNode* node);
void SetStartNode(const glm::vec3& po... |
TypeScript | UTF-8 | 815 | 2.734375 | 3 | [
"MIT"
] | permissive | export default FunctionWordsInKeyphraseAssessment;
/**
* Assessment to check whether the keyphrase only contains function words.
*/
declare class FunctionWordsInKeyphraseAssessment extends Assessment {
/**
* Sets the identifier and the config.
*
* @param {Object} [config] The configuration to use.
... |
Java | UTF-8 | 3,961 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2009-2011 Mathias Doenitz
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
JavaScript | UTF-8 | 5,922 | 3.1875 | 3 | [] | no_license | var schedule = {}
$(document).ready(function() {
// listen for save button clicks
schedule = JSON.parse(localStorage.getItem("schedule")) || {};
function setSchedule(schedule) {
for (var time in schedule){
var hour = time.split("-")[1];
var textAreaClass = `.textarea${hour}`;
var entry = ... |
Markdown | UTF-8 | 6,626 | 2.5625 | 3 | [] | no_license | 三四〇
一八一四年秋天,尼古拉和玛丽亚公爵小姐结了婚,尼古拉带着妻子、母亲和索尼娅迁到童山居住。
三年内,他没有变卖妻子的田产就还清了其余的债务。一个表姐去世后,他继承了一笔不大的遗产,把欠皮埃尔的债也还清了。
又过了三年,到一八二〇年,尼古拉已把他的财务整顿得有条不紊,更进一步在童山附近买了一处不大的庄园;此时他还在谈判买回父亲在奥特拉德诺耶的住宅——这可是他梦寐以求的一桩大事啊!
起初,他管理家业是出于需要,但不久就对经营庄园入了迷,几乎成为他独一无二的爱好了。尼古拉是个普通地主,不喜欢新办法,特别不喜欢当时流行的那套英国办法,他嘲笑经济理论著作,不喜欢办工厂,不喜欢价格高昂的产品,... |
JavaScript | UTF-8 | 1,180 | 2.765625 | 3 | [] | no_license | function timer()
{
var timer = {
running: false,
iv: 5000,
timeout: false,
cb : function(){},
start : function(cb,iv,sd){
var elm = this;
clearInterval(this.timeout);
this.running = true;
if(cb) this.cb = cb;
if(iv) this.iv = iv;
if(sd) elm... |
TypeScript | UTF-8 | 293 | 3.46875 | 3 | [] | no_license | // interface Person {
// name:string;
// age:number;
// }
type Person = {
name:string;
age:number;
}
var a:Person = {
name: 'ss',
age: 27
}
type s = string;
var str:s = 'hhh';
type Todo = {id:string; title:string; done:boolean};
function getTodo(todo: Todo){
} |
Python | UTF-8 | 2,892 | 3.3125 | 3 | [] | no_license | '''
start.py
This is the file in which I began testing and development
with the python requests library and API key
author: awenstrup
'''
#----------------Import statements---------------------
import requests
from user import User
#----------------Global Variable Definitions-----------
#API Key Path
api_key_file_p... |
Java | UTF-8 | 873 | 2.03125 | 2 | [] | no_license | package top.parak.config;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import javax.websocket.server.ServerEndpointConfig;
/**
* @aut... |
PHP | UTF-8 | 1,048 | 2.640625 | 3 | [] | no_license | <?php
include_once('../config/security.php');
function get_token($context,$data)
{
global $ALLOWED_TOKEN_CONTEXTS;
if(in_array($context,$ALLOWED_TOKEN_CONTEXTS))
{
//check for duplicate token
$query = "SELECT code FROM tokens WHERE context='$context' AND data='$data'";
$ret = mysql_query($query);
... |
Shell | UTF-8 | 1,238 | 4 | 4 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env bash
cd "$(dirname "$0")"
CONFIG="configs.js"
if [[ "$1" != "" ]]; then
CONFIG="$1"
fi
if ! [[ -f "$CONFIG" ]]; then
echo "File \"$CONFIG\" not found" 1>&2
exit 1;
fi
# The prefix for temporary files
tmp_prefix=`./get_conf_field.js misc.tmp_prefix $CONFIG`
next_prefix=`./get_conf_field.... |
C++ | UTF-8 | 1,055 | 3.6875 | 4 | [] | no_license | /** \file
* Contains declaration of Point class and PolarPoint structure
*/
#ifndef POINT_H_INCLUDED
#define POINT_H_INCLUDED
#include<iostream>
namespace cg{
/**
A point representing a location in (x,y) coordinate space, specified in
double precision. It can be used to store a set of <x,y> points, create a new po... |
Python | UTF-8 | 2,154 | 2.796875 | 3 | [
"MIT"
] | permissive | #
# Copyright 2014-2018 Neueda Ltd.
#
from heliumdb import Heliumdb, HE_O_CREATE, HE_O_VOLUME_CREATE
import unittest
import os
class TestInt(unittest.TestCase):
def setUp(self):
os.system('truncate -s 2g /tmp/test-int')
flags = HE_O_CREATE | HE_O_VOLUME_CREATE
self.hdb = Heliumdb(url="he:/... |
Java | UTF-8 | 6,045 | 2.34375 | 2 | [] | no_license | /*
* Created on 27/02/2002
* Donated from Lindsay's private source library
*
* @author Lindsay Bradford
*
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
... |
Java | UTF-8 | 7,491 | 2.609375 | 3 | [] | no_license | package com.flatrocktechnology.android.famousquotequiz.fragments;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widg... |
Python | UTF-8 | 781 | 3.59375 | 4 | [] | no_license | def non_repeat(line):
temp_longest, current_longest = '', ''
for char in line:
if char in temp_longest:
current_longest = max(current_longest, temp_longest, key=lambda x: len(x))
index_of_repeating_symbol = temp_longest.index(char) + 1
temp_longest = temp_longest[inde... |
JavaScript | UTF-8 | 1,045 | 2.765625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
class Addtodo extends React.Component{
state = {
value:''
}
textChange = (e) => this.setState({[e.target.name]:e.target.value})
onSubmit = (e) => {
e.preventDefault()//The preventDefault() method cancels the event if it is ca... |
Markdown | UTF-8 | 3,886 | 3.421875 | 3 | [] | no_license | # Problem 126: Word Ladder II
> https://leetcode.com/problems/word-ladder-ii/\#/description
------
## 思路
> https://discuss.leetcode.com/topic/27504/my-concise-java-solution-based-on-bfs-and-dfs
这个讲解不错!
* 这道题是上一题的延伸,要寻找所有的最短梯子的解,而上一题只要得出最短的 length 长度就可以了。
* 可以用 bfs + dfs 的方式来得出所有的解。这里用 distance 记录所有的元素从 beginWord ... |
Python | UTF-8 | 659 | 3.171875 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# @File Name: 003.py
# @Author: Joshua Liu
# @Email: liuchaozhenyu@gmail.com
# @Create Date: 2017-03-24 14:03:22
# @Last Modified: 2017-03-24 14:03:59
# @Description:
import unittest
def lengthOfLongestSubstring(s):
res = 0
left = 0
d = {}
for i, ch in enumerate(... |
PHP | UTF-8 | 23,491 | 2.828125 | 3 | [] | no_license | <?php
/**
* Holder for items in the shopping cart and interacting with them, as
* well as rendering these items into an interface that allows editing
* of items,
*
* @author morven
* @package commerce
*/
class ShoppingCart extends Commerce_Controller {
/**
* URL Used to access this controller
*
... |
C++ | UTF-8 | 753 | 2.8125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<map>
using namespace std;
map<char,char>mark;
string line;
int main()
{
mark['e']='q';
mark['r']='w';
mark['t']='e';
mark['y']='r';
mark['u']='t';
mark['i']='y';
mark['o']='u';
mark['p']='i';
mark['[']='o';
mark[']']='p';
mark['d... |
JavaScript | UTF-8 | 1,179 | 2.890625 | 3 | [] | no_license | const {qCard, getDescription, getBasicEndPoint } = require('./Logic')
// Sample Data
var qCardSample = {"id":44,"name":"Relaxing","description":"restful, calming, peaceful"}
test('Should hit endpoint without the database', () => {
return getBasicEndPoint().then(res => {
var data = res.data
expect(... |
JavaScript | UTF-8 | 2,400 | 3.0625 | 3 | [] | no_license | // authored by kyle simmons. this is the data provider for the news section
import {getFriendArrayByUser} from '../friends/FriendProvider.js'
let news = []
// gets the news from the api
export const getNews= () =>{
return fetch("http://localhost:8088/articles?_expand=user")
.then(response => response.json())
... |
Java | UTF-8 | 7,344 | 2.25 | 2 | [
"MIT"
] | permissive | /*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... |
Markdown | UTF-8 | 3,699 | 2.96875 | 3 | [] | no_license | # TwitterClone
<p align="center">
<img src="Documentation/twitterclone-portfolio-mockup.png" width="650" title="Twittermenti App">
</p>
## Author
Taylor Patterson
## Description
What better way to test out your skills as a developer than to try and tackle one of the most iconic social media apps. As the app name ... |
Shell | UTF-8 | 1,093 | 4.03125 | 4 | [
"MIT"
] | permissive | #!/bin/sh
# Checks requirements
depends_on() {
for i in $@; do
hash $i >/dev/null 2>&1 || {
echo >&2 "$i not installed. Aborting."; exit 1; }
done
}
# Clones GitHub repo
github_clone() { git clone https://github.com/$1.git $2 || exit 1; }
# Clones configs
clone_config() {
# Checks whether ~/.vim exis... |
Java | UTF-8 | 4,688 | 2.703125 | 3 | [] | no_license | package com.example.LBGManager.Model;
import com.example.LBGManager.Channel;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class LBG {
private static List<Event> events = new ArrayList<>();
private static List<Member> members = new ArrayList<>();
private static List<T... |
Markdown | UTF-8 | 2,733 | 2.703125 | 3 | [] | no_license | # Wordpress and Magento 2 Docker setup for Google Cloud.
This set of bash scripts creates the Dorel IO infrastructure which includes but is not limited to:
- Docker
- SQL
- Storage buckets
- Compute machines
- Let's Encrypt
- Wordpress
- Magento
Learn more about Google's infra: https://peering.google.com/#/infrastruc... |
Python | UTF-8 | 3,046 | 3.296875 | 3 | [] | no_license | import pandas
import numpy as np
'''def compute_error(thetaone, thetazero, points):
error = 0
n = range(len(points))
thetaone = float(thetaone)
thetazero = float(thetazero)
for i in (0 ,n ):
point = points[i]
error += (point[1] - (thetaone * point[0] + thetazero)) ** 2
retu... |
Shell | UTF-8 | 242 | 2.65625 | 3 | [] | no_license | #!/bin/bash
# First setup
if [[ ! -e /data/db ]]; then
mkdir -p /data/db
fi
if [[ ! -e /data/.alreadyrun ]]; then
touch /data/.alreadyrun
/scripts/firstRun.sh
else # start by marathon after shutdown
/scripts/runAsSlave.sh
fi
|
Java | UTF-8 | 2,056 | 2.53125 | 3 | [] | no_license | /*
* Created on 22-mrt-2005
*
*/
package nl.fountain.xelem.ztest;
import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;
import nl.fountain.xelem.Area;
import nl.fountain.xelem.excel.Row;
import nl.fountain.xelem.excel.Worksheet;
import nl.fountain.xelem.lex.DefaultExcelReaderListener;... |
PHP | UTF-8 | 1,365 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace Acme\LoginBundle\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
class Person {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
*
* @var integer $id
*/
private $id;
/**
... |
Markdown | UTF-8 | 2,294 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | # CHANEGLOG
## v1.4.0
Some of the major upgrades/changes:
* Update to React 16.3 and use of `Fragment` component for menu items.
* Upgraded testing framework `enzyme` and fixed failing `Nav` tests.
* Polished and reformatted code.
The rest of changes can be found [here](https://github.com/DalerAsrorov/componofy/pro... |
Python | UTF-8 | 739 | 2.734375 | 3 | [] | no_license | import csv
import json
import pandas as pd
# conteudo[i].municipio.id
# features.properties.codearea
malha = open('malha-dos-municipios-pi.json')
municipios = open('id-municipios-pi.json')
vacinados = open('vacinados.csv', 'rb')
# 1 - Cria o arquivo
f = open('p_vacinados.csv', 'w', newline='', encoding='utf-8')
# 2. ... |
PHP | UTF-8 | 11,612 | 2.546875 | 3 | [] | no_license | <?php
include 'connection.php';
# Checks if a value exists in a column
function thereExists($to_be_checked,$table,$col){
$query = "SELECT ".$col." FROM ".$table."";
$run = mysqli_query($GLOBALS['link'],$query);
for($i = 0 ; $row = mysqli_fetch_assoc($run) ; $i++){
... |
Java | UTF-8 | 5,068 | 2.140625 | 2 | [] | no_license | package com.calculator.controller;
import com.calculator.domain.PriceComponent;
import com.calculator.domain.PurchaseOrder;
import com.calculator.service.PriceEngineService;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.BeforeEach;... |
Java | UTF-8 | 3,289 | 2.265625 | 2 | [
"MIT",
"Apache-2.0"
] | permissive | /*-
* #%L
* anchor-plugin-image
* %%
* Copyright (C) 2010 - 2020 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche
* %%
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software ... |
Swift | UTF-8 | 562 | 2.671875 | 3 | [] | no_license | //
// URLSchemas.swift
// Base-Project
//
// Created by Mojtaba Al Mousawi on 9/19/18.
// Copyright © 2018 Tedmob. All rights reserved.
//
import Foundation
struct URLSchemas{
enum Browsers : String{
case securedChrome = "googlechromes://"
case notSecuredChrome = "googlechrome://"
... |
Java | UTF-8 | 131 | 2.265625 | 2 | [] | no_license | package com.book.JPRGerbertShildt.example.patterns.structural.composite.composite3;
public interface Shape {
void draw();
}
|
Python | UTF-8 | 1,264 | 2.765625 | 3 | [
"Beerware"
] | permissive | import datetime
import json
import os
class Recorder:
def __init__(self, folder, name):
self.folder = folder
self.name = name
self.paused = False
self.f = None
self.write_number = 0
self.new()
def close_file(self):
if self.f:
self.f.seek... |
TypeScript | UTF-8 | 533 | 2.78125 | 3 | [] | no_license | import {AbstractPackager} from "../AbstractPackager";
import {StringPackage} from "../package/StringPackage";
import {Packager} from "../context/annotations/Packager";
@Packager
export class StringPackager extends AbstractPackager<string, StringPackage> {
public unpack(pkg: StringPackage): string {
return pkg.v;
}... |
Java | UTF-8 | 1,528 | 2.234375 | 2 | [] | no_license | package controle;
import java.io.Serializable;
import java.util.List;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import model.Cargo;
import repository.Cargos;
import util.jsf.FacesUtil;
import filter.CargoFilter;
@Named
@ViewScoped
public class PesquisaCargoBean impl... |
Java | WINDOWS-1255 | 2,201 | 2.890625 | 3 | [] | no_license | package geometries;
import static primitives.Util.*;
import primitives.*;
import java.util.List;
public class Plane extends Geometry {
private Point3D p;
private Vector vNormal;
// ***************** Constructors ********************** //
public Plane(Point3D p, Vector v)
{
this.p =new Point3D(p);
this.vNorm... |
PHP | UTF-8 | 8,230 | 2.515625 | 3 | [] | no_license | <?php
require_once "db/db_handle.php";
require_once "includes/layout2.php";
$location= urlencode($_SERVER['REQUEST_URI']);
if (isset($_SESSION['id']) == false){
header ("Location: login.php?location=$location");
}
?>
<title>My favourite</title>
<?php
if (isset($_GET["page"])) { $page = $_GET["page"]; } e... |
Markdown | UTF-8 | 2,260 | 2.96875 | 3 | [] | no_license | ## The Naming Algorithm
1. Is the function a test? -> `test_<entity>_<behavior>`.
1. Does the function has a @property decorator? -> don’t use a verb in the function name.
1. Does the function use a disk or a network:
1. to store data? -> `save_to`, `send`, `write_to`
1. to receive data? -> fetch, load, read
1... |
JavaScript | UTF-8 | 2,985 | 2.625 | 3 | [
"MIT"
] | permissive | var sys = require("sys"),
http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
events = require("events");
function load_static(uri, response) {
var filename = path.join(process.cwd(), uri);
fs.exists(filename, function(exists) {
... |
Java | UTF-8 | 1,099 | 1.578125 | 2 | [] | no_license | package com.grubhub.AppBaseLibrary.android.account;
import android.support.v4.app.q;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.ViewSwitcher;
class GHSAddr... |
Java | UTF-8 | 2,741 | 1.929688 | 2 | [] | no_license | package com.saint.aoyangbuulid.mine.code;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.widget.ImageView;
import android.widget.T... |
Python | UTF-8 | 681 | 2.5625 | 3 | [] | no_license | import os
from watson_developer_cloud import DocumentConversionV1, WatsonException
def get_doc_coversion(fp):
document_conversion = DocumentConversionV1(
username=os.environ['watson_dc_username'],
password=os.environ['watson_dc_password'],
version='2017-03-23')
result = ''
try:
... |
C# | UTF-8 | 1,361 | 2.578125 | 3 | [] | no_license | using UnityEngine;
using UnityEngine.UI;
using Ai.Goap;
namespace TeamZapocalypse {
public class Shelter : MonoBehaviour, IStateful {
public float shieldEnergy = 60f;
public Text shieldEnergyText;
public GameObject shield;
private readonly State state = new State();
private const float energyDe... |
Java | UTF-8 | 4,989 | 1.953125 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2005, 2007 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, ... |
Java | UTF-8 | 1,376 | 2.234375 | 2 | [] | no_license | package com.fullgc.jbehave.steps;
/**
* Created by dani on 24/09/18.
*/
import com.fullgc.dispatcher.RequestDispatcher;
import com.fullgc.jbehave.cache.CacheBean;
import net.thucydides.junit.spring.SpringIntegration;
import org.jbehave.core.annotations.Given;
import org.jbehave.core.annotations.Named;
import org.ju... |
TypeScript | UTF-8 | 2,253 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... |
Markdown | UTF-8 | 863 | 2.8125 | 3 | [] | no_license | #### A set of python projects dealing with exceptions
**0-safe_print_list.py:** print x number of elements in a list inside try/except
**1-safe_print_integer.py:** print an integer inside of try/except
**2-safe_print_list_integers.py:** print a list of integers as integers, handle except
**3-safe_print_division.p... |
Markdown | UTF-8 | 917 | 2.96875 | 3 | [] | no_license | ---
id: act1
title: Activity
sidebar_label: Activity
---
import useBaseUrl from '@docusaurus/useBaseUrl';
## Dashboard Activity
You can hover your mouse over the pie chart to view the number of tasks Overdue, In Progress and Completed. Click on the pie chart to bring you into the underlying detail.
<img alt="Pie C... |
Python | UTF-8 | 1,094 | 3.828125 | 4 | [] | no_license | from typing import List
class Node:
def __init__(self, val=None, children=None):
self.val = val
self.children = children
def preorder_recursive(root: Node) -> List[int]:
res = []
def dfs(node: 'Node'):
if node is None:
return
res.append(node.val)
for ... |
Java | UTF-8 | 5,081 | 2.109375 | 2 | [
"MIT"
] | permissive | package de.timherbst.wau.domain;
import java.io.Serializable;
import java.util.Date;
import java.util.Vector;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import de.timherbst.wau.domain.riege.EinzelRiege;
import de.timherbst.wau.domain.riege.MannschaftsRiege;
import de.timherbst.wau.domain.rie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.