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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 717 | 3.40625 | 3 | [] | no_license | ## Machine Learning Lesson
This is an exercise that corresponds to a lesson on using Jupyter notebooks.
This notebook demonstrates how to to use scikit-learn for performing both a linear-regression and random-forest model for prediction.
In the linear regression model, we use sample data of weight and heights of 10... |
Python | UTF-8 | 3,451 | 4.03125 | 4 | [] | no_license | #! /usr/bin/python3
import itertools
import random
import copy
# NUM_INPUTS | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
# NUM_COMPARATORS | 0 | 1 | 3 | 5 | 9 | 12 | 16 | 19 |
NUM_INPUTS = 4
NUM_COMPARATORS = 5
def is_sorted(array):
"""
Returns True if array is sorted, otherwise False
"""
f... |
PHP | UTF-8 | 375 | 2.953125 | 3 | [] | no_license | <?php
namespace Nitrogen\Hydrator;
interface HydratorInterface
{
/**
* Hydrate $object with the give $data
*
* @param array $data
* @param object $obj
*/
public function hydrate(array $data, $obj);
/**
* Extract data from an object
*
* @param object $obj
* @ret... |
Python | UTF-8 | 3,520 | 2.8125 | 3 | [
"BSD-2-Clause"
] | permissive | from dns import rdatatype, rdataclass, flags, rcode
def parse_query(query, nameserver, duration):
""" Parse a dns response into a dict based on record type.
Should adhere to propsed rfc format:
http://tools.ietf.org/html/draft-bortzmeyer-dns-json-00
"""
flag_list = flags.to_text(query.response.fla... |
Java | UTF-8 | 2,720 | 2.03125 | 2 | [] | no_license | package com.alibaba.nb.android.trade.web.interception.base.handler;
import java.util.LinkedHashMap;
import java.util.Map;
public class AliTradeHandlerInfoBuilder
{
private AliTradeHandlerInfo handlerInfo = new AliTradeHandlerInfo();
public static AliTradeHandlerInfoBuilder newHandlerInfo(String paramString)
... |
Python | UTF-8 | 1,554 | 4 | 4 | [] | no_license | # 1. Get (a, b) counts
# 2. Make generator that finds solution
# 3. Iterate over generator
# 4. From pattern, string, and a, b lengths
def get_counts(pattern):
a_count, b_count = 0, 0
for c in pattern:
if c=='a':
a_count += 1
else:
b_count += 1
return (a_count, b_count)
def solve_equation(a... |
Python | UTF-8 | 6,183 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | """class to manage jsonschema type schema."""
import copy
import pkgutil
import json
from jsonschema import Draft7Validator, draft7_format_checker # pylint: disable=import-self
from schema_enforcer.schemas.validator import BaseValidation
from schema_enforcer.validation import ValidationResult, RESULT_FAIL, RESULT_PAS... |
Markdown | UTF-8 | 962 | 2.640625 | 3 | [
"MIT"
] | permissive | # Azure CLI 2.0 Samples
This is a repo of scripts for illustrating usage of Azure CLI 2.0 and more generally, Azure in Linux.
The intent is to provide real world scripts and scenarios to help folks be successful working with
Azure infrastructure.
If you have an suggestions for scripts or would like to see an example ... |
Markdown | UTF-8 | 17,307 | 2.875 | 3 | [] | no_license | # 686 Usability Research: P2 (Roger O)
### Warm up
- *Tell me a little about yourself*
- 61, live in CT
- Served in the Navy initially as a corpsman, became a flight nurse in the AF reserve at ~26-27 years of service
- Started having issues years ago, went to Vet Center and been going there for 3+ years now
-... |
Markdown | UTF-8 | 776 | 2.734375 | 3 | [
"MIT"
] | permissive | # React
## Learning patterns etc.
### 1. controlled vs uncontrolled
- 1 How to make simple components
### 2. state management (mobx)
- 1 Make the same components, but usng store state
- 2 When components need to communicate
### 3. hooks
Full components vs presenational
### 4. state management vs hooks
When to ... |
Java | UTF-8 | 342 | 2.859375 | 3 | [] | no_license | package edu.sbcc.cs105;
public class Program {
public static void main(String[] args) {
StudentRepository repo = new StudentRepositoryMock();
Student s = new Student("Joe", "A", "Gaucho", 1);
repo.saveStudent(s);
Student s1 = repo.getStudent(1);
System.out.printf("%s %s", s1.getFirstName(), s1.g... |
C++ | UTF-8 | 3,213 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <time.h>
#include "String.hpp"
#include "List.hpp"
using namespace std;
inline char toLower(char ch){return 'A'<=ch&&ch<='Z'?(ch-'A'+'a'):ch;}
void findAllKMP(String const& str, List<String>& patList, int times){
static int init=0;
static List<int*> prefixList;
... |
Java | UTF-8 | 2,637 | 2.453125 | 2 | [] | no_license | package com.gome.ecmall.util;
import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.ht... |
Python | UTF-8 | 599 | 2.5625 | 3 | [] | no_license | """
Shuffles the positions for barcodes -> used to compare null model assumptions
"""
import pandas as pd
positions_in = snakemake.input['positions']
positions_out = snakemake.output['positions']
xmin = snakemake.params['xmin']
xmax = snakemake.params['xmax']
ymin = snakemake.params['ymin']
ymax = snakemake.params['y... |
Markdown | UTF-8 | 541 | 3.171875 | 3 | [] | no_license | # workTimer
A simple timer application made with HTML, CSS and Javascript, to remind the user when to take a short break during work. The user can input the amount of time they wish to have working and, how long they wish to take a break in between. The application alerts the user when the timer is up, either to take ... |
Markdown | UTF-8 | 9,577 | 4.03125 | 4 | [
"MIT"
] | permissive | # Coursework Two - Full-time
Java provides several types of numbers, but it does not provide fractions. Your task is to implement a
`Fraction` API (**A**pplication **P**rogrammer's **I**nterface) and write a small program that uses it.
## Purpose of this assignment
* To give you practice with creating classes.
* T... |
Markdown | UTF-8 | 3,527 | 2.90625 | 3 | [] | no_license | # 示例篇
## 前言
上一篇[移动应用遗留系统重构(2)-架构篇](https://juejin.cn/post/6945313969556946980)我们介绍了业内的优秀架构实践以及CloudDisk团队根据业务情况设计的分层架构。
这一篇我们将介绍一个浓缩版的示例,示例中我们设计了一些常见的异常依赖,后续的重构篇我们也将基于这个示例进行操作演示。为了简化代码及对业务上下文的理解,示例中的部分实现都是空实现,重点体现异常的耦合依赖。
仓库地址:[CloudDisk](https://github.com/junbin1011/CloudDisk)
## CloudDisk示例
### 项目概述
CloudDisk... |
Markdown | UTF-8 | 9,337 | 3.5 | 4 | [] | no_license | # token bot
`token` is a chat bot for acknowledging and thanking peers. It can be used to award prizes to people who have helped others. It was built on the [Hubot][hubot] framework.
## Summary
The bot keeps track of acknowledgment given from one user to another. Each unit of acknowledgment is called a **token**. Ev... |
Python | UTF-8 | 527 | 3.234375 | 3 | [] | no_license | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
def main():
infile = open('berlin.jpg', 'rb') # Would get error if try 'rt' as this is binary and not text file
outfile = open('berlin-copy.jpg', 'wb')
while True:
buf = infile.read(10240) # reading in 10k byte chunks; not wise to read... |
Markdown | UTF-8 | 1,374 | 2.59375 | 3 | [] | no_license | # Using The Products Package
The package is used to instanciate products object necessary to store in the database.
### Creating a Desktop Object
**Add the class** Desktop using
`var Desktop = require('./Products/Desktop.js')`
**Instanciate** a Desktop with arguments using
`var myDesktop = new ... |
Markdown | UTF-8 | 6,276 | 2.859375 | 3 | [] | no_license | ---
layout: post
title: 读文笔记Fast R-CNN
category: blog
description: 阅读Fast R-CNN笔记
---
声明:本博客欢迎转发,但请保留原作者信息!
作者:高伟毅
博客:[https://gwyve.github.io/](https://gwyve.github.io/)
微博:[http://weibo.com/u/3225437531/](http://weibo.com/u/3225437531/)
## 引言
这篇文章属于R-CNN之后的一篇,基本是在R-CNN<sup>1</sup>和SPPnet<s... |
PHP | UTF-8 | 9,447 | 2.96875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* @copyright Copyright 2017, CitrusFramework. All Rights Reserved.
* @author take64 <take64@citrus.tk>
* @license http://www.citrus.tk/
*/
namespace Citrus;
use Citrus\Configure\Configurable;
use Citrus\Message\Item;
use Citrus\Variable\Singleton;
use Citrus\Variabl... |
PHP | UTF-8 | 1,860 | 2.65625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories\UserProgress;
use App\Models\Setting;
use App\Models\User;
use App\Models\UserProgress;
use App\Repositories\BaseRepository;
/**
* Class ProgressRepository.
*/
class UserProgressRepository extends BaseRepository
{
/**
* related model of this repository.
*
* @var object
*/
publi... |
JavaScript | UTF-8 | 1,222 | 3.265625 | 3 | [] | no_license | const observer = {
next: x => console.log(x),
error: e => console.error(e),
complete: () => console.log('done')
};
function map(transformFn) {
const inputObservable = this;
return createObservable(outputObserver => {
inputObservable.subscribe({
next: x => outputObserver.next(tra... |
C++ | UTF-8 | 2,164 | 2.8125 | 3 | [] | no_license |
#include <iostream>
#include <fstream>
#include <boost/program_options.hpp>
using namespace std;
namespace po = boost::program_options;
template<class T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
return os;
}
int main(int argc, char** argv)
{
... |
Java | UTF-8 | 7,694 | 3.28125 | 3 | [] | no_license | import java.util.Scanner;
import java.lang.Math;
public class Orbits {
static Scanner scan = new Scanner(System.in);
static Satellite[] satArray = new Satellite[5];
public static int mainMenu() {
System.out.println("\n––––––––––––––––––––––––––––––––––––––––––––");
System.out.printl... |
SQL | UTF-8 | 626 | 2.53125 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : Locahost
Source Server Version : 50710
Source Host : localhost:3306
Source Database : kahina
Target Server Type : MYSQL
Target Server Version : 50710
File Encoding : 65001
Date: 2016-02-16 17:57:50
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... |
Java | UTF-8 | 509 | 2.953125 | 3 | [] | no_license | import java.util.Scanner;
/**
* Created by Lawrence on 2017/8/4.
*/
public class SimpleChat {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("请输入IP地址和端口号,格式如下:IP地址,端口号");
String[] ask = in.nextLine().split(",");
String ip = ask[0]... |
Go | UTF-8 | 1,367 | 3.6875 | 4 | [
"MIT"
] | permissive | /*
Question:
Fuel required to launch a given module is based on its mass. Specifically, to find the fuel required for a module, take its mass, divide by three, round down, and subtract 2.
For example:
For a mass of 12, divide by 3 and round down to get 4, then subtract 2 to get 2.
For a mass of 14, dividing ... |
Markdown | UTF-8 | 1,135 | 2.984375 | 3 | [
"MIT"
] | permissive | # 快速缓存
::: tip
- MadFastBuffer.h
- MadFastBuffer.c
:::
## madFBufferCreate
```c
MadFBuffer_t* madFBufferCreate(MadSize_t n, MadSize_t size)
```
新建快速缓存。
| 参数名 | 方向 | 说明 |
| :-| :-:| :-|
| n | in | 指定快速缓存的分块数 |
| size | in | 指定快速缓存的分块尺寸 |
| 返回值 | 说明 |
| :-:| :-|
| 0 | 失败 |
| NZ | 成功(指向快速缓存的指针) |
## madFBufferGet
`... |
Java | UTF-8 | 855 | 1.828125 | 2 | [] | no_license | package com.ubtechinc.alpha.mini.repository.datasource;
import com.ubtechinc.alpha.mini.entity.AlbumItem;
import com.ubtrobot.lib.sync.engine.ResultPacket;
import com.ubtrobot.param.sync.Params;
import java.util.List;
/**
* @作者:liudongyang
* @日期: 18/3/22 14:23
* @描述:
*/
public interface IAlbumsDataSource {
... |
Python | UTF-8 | 1,640 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | import lettria
import json
api_key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhbmFseXRpY0lkIjoiNWRlOGRiMzBlYzY4YjA1MWNmZmZiZGRjIiwicHJvamVjdElkIjoiNWRlOGRiMzBlYzY4YjA1MWNmZmZiZGRkIiwic3Vic2NyaXB0aW9uSWQiOiI1ZDZkMjExNjExZGM5MDMxMGQ4ZWJhMzIiLCJpYXQiOjE2MTgzMjAyOTAsImV4cCI6MTY2NjcwNDI5MH0.emln3t9ACFTFQH3uChi-fOAvJgBDHEqe... |
Java | UTF-8 | 4,333 | 1.914063 | 2 | [] | no_license | package com.canzhang.sample;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.Recycler... |
Java | UTF-8 | 3,055 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | package io.rosensteel.cochrane.crawler;
import io.rosensteel.http.WebReader;
import io.rosensteel.http.WebResult;
import java.io.IOException;
import java.util.HashMap;
import java.util.Set;
public class CochraneTopics {
private WebReader webReader;
private CochraneTopicLinks topicLinks;
private HashMap<S... |
TypeScript | UTF-8 | 1,782 | 2.515625 | 3 | [
"MIT"
] | permissive | import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { error } from 'console';
import { UpdateMerchantDTO } from '../DTO/updateMerchantDTO';
import { Merchant } from '../model/merchant.model';
@Injectable()
export class MerchantService {
constructor(
@InjectModel(M... |
C++ | UTF-8 | 24,705 | 2.515625 | 3 | [] | no_license | /*
The purpose of this code is to enable the use of the MicroView Arduino to be used as a replacement board for the
2011 Dye Proto Matrix Rail (PMR). The current board is out of production and many of the predetermined settings
are outdated. This code can also be applied in the future to other models of paintball mark... |
Java | UTF-8 | 1,480 | 2.078125 | 2 | [] | no_license | package com.yj.domain.user.service;
import com.yj.domain.user.model.RolePermission;
import com.yj.domain.user.model.RolePermissionDto;
import com.yj.domain.user.model.UserDetail;
import com.yj.domain.user.repository.RolePermissionRepository;
import com.yj.pojo.ReSult;
import org.springframework.beans.factory.annotatio... |
SQL | UTF-8 | 1,448 | 4.28125 | 4 | [
"Apache-2.0"
] | permissive | #standardSQL
CREATE TEMPORARY FUNCTION getImportantProperties(css STRING)
RETURNS ARRAY<STRUCT<property STRING, freq INT64>>
LANGUAGE js
OPTIONS (library = "gs://httparchive/lib/css-utils.js")
AS '''
try {
var ast = JSON.parse(css);
let ret = {
total: 0,
important: 0,
properties: {}
};
walkDeclarat... |
Ruby | UTF-8 | 1,591 | 2.875 | 3 | [] | no_license | class Gear < ActiveRecord::Base
has_many :gearactivities
has_many :activities, through: :gearactivities
def self.essentials
essentials = self.select do |gear|
gear.essential == true
end
essentials.pluck(:name).map do |name|
puts name
end
end
... |
Java | UTF-8 | 546 | 3.546875 | 4 | [] | no_license | package com.arun.java8.module1;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
public class StrategyInjectionFour {
public static int totalValues(List<Integer> values, Predicate<Integer> strategy)
{
return values.stream()
.filter(strategy)
.reduce(0, Math::addExact);
}... |
Markdown | UTF-8 | 1,071 | 2.5625 | 3 | [] | no_license | ---
author:
name: RachelR
body: "Hi all\r\n\r\nQuick question - Are there any problems associated with using
underscores in the name of font families? Are there any charcaters that shouldn't
be used in the name of fonts?\r\n\r\nEg.\r\n\r\nMy_Font "
comments:
- author:
name: Ramiro Espinoza
picture: 110426... |
C++ | GB18030 | 1,669 | 3.875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
//ҵķʱռڴѾѣDz
bool isPalindrome(string s)
{
int lenStr = s.size();
if (lenStr == 0)
return true;
char tmp;
int j = lenStr - 1;
for (int i = 0; i < lenStr;++i)
{
if (isalpha(s[i]) || isdigit(s[i]))
{
tmp = s[i];... |
Markdown | UTF-8 | 2,584 | 3 | 3 | [] | no_license | # Google-Calendar-Tool
Lo scopo di questo di tool è quello di permette ad un utente di visualizzare, con la possibilità di stampare in formato pdf, l'elenco dei propri calendari presenti sulla piattaforma Google Calendar e del monte ore degli stessi.
Il tool è stato realizzato utilizzando le API di Google Calendar, re... |
C++ | UTF-8 | 2,043 | 2.671875 | 3 | [
"MIT"
] | permissive | //----------------------------------*-C++-*-----------------------------------//
/**
* @file PPMPlotter.cc
* @brief PPMPlotter member definitions
* @note Copyright (C) Jeremy Roberts 2013
*/
//----------------------------------------------------------------------------//
#include "ioutils/PPMPlotter.hh"
#incl... |
Python | UTF-8 | 9,453 | 2.53125 | 3 | [] | no_license | import os
import cv2 as cv
import cv2
import numpy as np
import logging
import csv
import operator
import parameter
def get_images(path):
""" Returns a list of filenames for
all images in a directory. """
image_filenames = []
for f in os.listdir(path):
if f.endswith('bmp') or f.endswith('jpg') ... |
Markdown | UTF-8 | 3,580 | 2.71875 | 3 | [] | no_license | # Evoq Modules - Liquid Content Job List
This is a sample DNN module to access Liquid Content using Angular JS v1.6. A bearer token with read permission for Liquid Content is generated on the server side and passed to the front-end.

## View.ascx
Add a div with Angular co... |
JavaScript | UTF-8 | 1,289 | 2.796875 | 3 | [] | no_license |
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
//io.on('connection', function(socket){
// socket.on('chat message', function(msg){
// console.log('message: ... |
Markdown | UTF-8 | 2,252 | 2.78125 | 3 | [] | no_license | # [RetinaFace: Single-stage Dense Face Localisation in the Wild](https://arxiv.org/abs/1905.00641)
_September 2019_
tl;dr: Single stage face detection with landmark regression and dense face regression. Landmark regression helps object detection.
#### Overall impression
The paper is from the same authors of [ArcFace... |
Java | UTF-8 | 2,199 | 2.25 | 2 | [] | no_license | package rcp.manticora.acciones;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewActionDelegate;
import org.eclips... |
C++ | UTF-8 | 589 | 2.71875 | 3 | [] | no_license | #pragma once
#include <string>
#include "Statistics.h";
using namespace std;
class Player
{
private:
string name;
char playing_mark;
Statistics stats;
public:
Player();
Player(string player_name, char mark_used);
int get_score();
string getPlayerName();
void setPlayerName(string playerName);
char getPlayingMa... |
JavaScript | UTF-8 | 1,345 | 2.59375 | 3 | [] | no_license | var
express = require("express"),
fs = require("fs"),
bodyParser = require("body-parser"),
cors = require("cors"),
config = {
name_str: "price",
port_int: 3000,
host_str: "0.0.0.0"
},
app = express();
app.use(bodyParser.json());
app.use(cors());
app.get("/", (req, res) => {
res.status(200).send(... |
Markdown | UTF-8 | 891 | 2.75 | 3 | [
"MIT"
] | permissive | # JCL IT
**Created At:** 5/28/2018 11:12:03 AM
**Updated At:** 6/11/2018 4:15:27 AM
**Original Doc:** [318726-jcl-it](https://docs.jbase.com/45792-jcl/318726-jcl-it)
**Original ID:** 318726
**Internal:** No
## Description
The command reads a tape record into the primary input buffer. It takes the general... |
Python | UTF-8 | 2,383 | 2.890625 | 3 | [] | no_license | import os, sqlite3, hashlib, atexit
_DATABASE=sqlite3.connect('data.sqlite')
def hashfile(filecontents):
"""Save a string to a file and return the hash for lookup.
The string can then be retrieved by gethash().
TODO unit tests
"""
filehash=hashlib.sha256(filecontents).hexdigest() # pylint: disable-msg=E1101
# s... |
JavaScript | UTF-8 | 1,025 | 2.953125 | 3 | [] | no_license | let $button, $img, imageCapture;
document.addEventListener('DOMContentLoaded', init, false);
function init() {
$button = document.querySelector('#takePictureButton');
$img = document.querySelector('#testImage');
navigator.mediaDevices.getUserMedia({video: true})
.then(setup)
.catch(error => console.error('getUs... |
C++ | UTF-8 | 1,029 | 3.703125 | 4 | [] | no_license | /*
Palindrome.cpp
*/
#include <string>
#include <iostream>
#define STACKSIZE 80
#define TRUE 1
#define FALSE 0
using namespace std;
class Stack {
public:
void StackInit();
int IsStackEmpty();
int IsStackFull();
int StackPush(char c);
char StackPop();
char ViewStackTop();
private:
char myStack[80];
int top;... |
Java | UTF-8 | 1,009 | 3.625 | 4 | [] | no_license | package interfacePractice_ComparatorGeometry;
import java.util.Arrays;
public class GeometryComparatorTest {
public static void main(String[] args) {
Circle[] circles = new Circle[2];
circles[0] = new Circle(20, "black", false);
circles[1] = new Circle(18, "black", false);
Rectang... |
Markdown | UTF-8 | 4,213 | 3.015625 | 3 | [
"BSD-3-Clause"
] | permissive | # Table of contents
- [What is gitlab-tester-tools](#what-is-gitlab-tester-tools)
- [Gitlab setup](#gitlab-setup)
- [Create tester user](#create-tester-user)
- [Add tester user to your project](#add-tester-user-to-your-project)
- [Setup testing secret token](#setup-testing-secret-token)
- [Setting up th... |
C++ | UTF-8 | 1,309 | 2.640625 | 3 | [] | no_license | #ifndef TEST_RGBLEDJSONSERVICE_H
#define TEST_RGBLEDJSONSERVICE_H
#include <Arduino.h>
#include <ArduinoJson.h>
#include <domain/valoplus/rgbLed.h>
class RgbLedJsonService {
private:
public:
char* toJson(RgbLed obj) {
StaticJsonBuffer<200> jsonBuffer;
JsonObject& root = jsonBuffer.createObject();
root(... |
Markdown | UTF-8 | 2,261 | 2.84375 | 3 | [
"MIT"
] | permissive | # Vendor Dependencies
When we use hardware from a third-party source, we need to place what are called "vendor dependency" files into our robot program.
A prime example of such hardware would be a motor controller (see [Motors](https://frc1257.github.io/robotics-training/#/frc/1-Basics/2-Motors) for more detail).... |
Java | UTF-8 | 335 | 1.632813 | 2 | [] | no_license | package com.brtbeacon.map3d.demo.dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
public interface DialogFragmentListener {
void onDialogCancel(DialogFragment fragment);
void onDialogDismiss(DialogFragment fragment);
void onDialogResult(DialogFragment fragment, Bundl... |
Java | UTF-8 | 19,641 | 1.664063 | 2 | [] | no_license | package com.bestweby.enewz.activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.... |
Markdown | UTF-8 | 914 | 2.8125 | 3 | [] | no_license | # DHI-clone
DHI was an app which my college used in my first year engineering . I was always curious to make like that of my own . Now I was studying Django, I thought of giving a shot.
In this application, people can normally signup and by default they will be logged in as student , if one needs to upgrade status to t... |
C# | UTF-8 | 1,139 | 2.78125 | 3 | [
"MIT"
] | permissive | using Domain.Entitties.Library;
using Domain.Interfaces;
using MediatR;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace Application.Services.LibraryService.EditionFeatures.Commands
{
public class CreateEdition
{
public record Command(Edition Edition) : IRequest... |
C | UTF-8 | 487 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <door.h>
int
main(int argc, const char *argv)
{
int fd;
door_arg_t door_arg = {0};
fd = open(DOOR_FILE, O_RDONLY);
if (fd == -1) {
perror("open");
return EXIT_FAILURE;
}
if (door_call(fd, &door_arg) == -1) {
perror("door_call");
close(f... |
Python | UTF-8 | 540 | 3.453125 | 3 | [] | no_license | """
This file just shows if we have to compare 2 objects based on their field values
how we could override the equals method for the Object within the class of the object.
here the method to override would be :
1) __eq__ for the equals method (==)
2) __ne__ for not equals (!=)
3) __lt__ for less than (<)
4) __gt__ fo... |
JavaScript | UTF-8 | 554 | 2.9375 | 3 | [] | no_license |
/**
* Represents a user role
*/
class UserRole {
/**
* Creates a new instance of UserRole
* @param {number} id role identifier
* @param {string} label role label used for display
*/
constructor(id, label) {
this.id = id;
this.label = label;
}
}
/**
*
* Registers ev... |
Java | UTF-8 | 2,514 | 3.90625 | 4 | [] | no_license | package facebookCoding;
/**
* Write a function to tell if two line segments intersect or not
* @author shirleyyoung
*http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/
*http://shirleyisnotageek.blogspot.com/2015/02/determine-if-two-line-segments-intersect.html
*/
public class IntersectionOfTw... |
Markdown | UTF-8 | 5,381 | 2.78125 | 3 | [] | no_license | iRobot Interview Project
========================
A command-line application that leverages the [Food2Fork API](https://www.food2fork.com/about/api) in order to find the most popular recipe based on ingredients the user specifies.
See the [Take Home Assignment](./docs/take-home-assignment.md) doc for the original ass... |
Python | UTF-8 | 1,012 | 3.796875 | 4 | [] | no_license | #!/usr/bin/env python
# encoding: utf-8
"""
用list模拟堆栈
"""
from stack_interface import BaseStack
class Stack(BaseStack) :
def __init__(self) :
"""
init a stack with []
"""
self.stack = []
def push(self,item) :
"""
push an item into stack.
"""
se... |
C# | UTF-8 | 8,408 | 2.765625 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace TcBlackCLI
{
/// <summary>
/// Builds a TwinCAT project using the devenv.
/// </summary>
public class TcProjectBuilder
... |
Java | UTF-8 | 2,832 | 1.8125 | 2 | [] | no_license | /**
* <copyright>
* </copyright>
*
* $Id$
*/
package IFC2X3.impl;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import IFC2X3.IFC2X3Package;
import IFC2X3.IfcObjectTypeEnum;
import IFC2X3.IfcProxy;
import org.eclipse.emf.common.notify.Notification;
... |
Java | UTF-8 | 3,502 | 2.1875 | 2 | [
"MIT"
] | permissive | package me.calebjones.spacelaunchnow.astronauts.list;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
import java.uti... |
Java | UTF-8 | 1,344 | 4.34375 | 4 | [] | no_license | package com.company;
/*
CountDownLatch is described in section 5.5.1. The constructor initializes a counter to the
provided value. The countdown() method decrements the counter (by 1); the await()
method returns when the counter is no longer positive
*/
public class CountDownLatch {
//simple counting variable
... |
JavaScript | UTF-8 | 406 | 3.546875 | 4 | [] | no_license | const binarySearch = (Arr, target) => {
const len = Arr.length;
let lo = 0;
let hi = len - 1;
while ( lo <= hi ) {
let mid = Math.floor((lo + hi) / 2);
if ( Arr[mid] === target ) {
return mid;
}
if ( target < Arr[mid] ) {
hi = mid - 1;
}
if ( target > Arr[mid] ) {
lo = ... |
Java | UTF-8 | 1,820 | 3.484375 | 3 | [] | no_license | import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class FizzBuzzGameTest {
@Test
@DisplayName("Converter should return the same number when the number is not divisible by 5 or 10 or 15")
void test1(){
//given
Fiz... |
C# | UTF-8 | 927 | 2.515625 | 3 | [
"BSD-2-Clause"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
using System.Xml.Serialization;
namespace ThoughtWorks.CruiseControl.Remote.Messages
{
/// <summary>
/// A message for passing a message to the server.
/// </summary>
[XmlRoot("messageMessage")]
[Serializable]
public class Mess... |
Java | UTF-8 | 3,814 | 2.15625 | 2 | [
"MIT"
] | permissive | /**
* Copyright 2017, 2018, 2019, 2020 Stephen Powis https://github.com/Crim/pardot-java-client
*
* 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 without restriction, including without limi... |
Java | UTF-8 | 1,962 | 2.4375 | 2 | [] | no_license | package cn.example.wang.slideslipedemo;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import java.util.ArrayList;
import java... |
C++ | UTF-8 | 641 | 3.828125 | 4 | [] | no_license | #include <iostream>
using namespace std;
string &appendToString(string &OrigString, string PreString, string PostString)
{
/*
this doesn't work:
OrigString.insert(OrigString.begin(), PreString);
*/
/*
this works:
OrigString.insert(OrigString.begin(), PreString.begin(), PreString.end());
... |
Java | UTF-8 | 358 | 2.296875 | 2 | [] | no_license | public class Dummy {
void sendRequest(Connection conn) throws SQLException {
String sql = "Select T.tripId,T.customerId,T.driverId,P.totalFare From tripHistory T join payment P ON T.tripId>P.tripId where P.totalFare>="+Fare+" AND (T.date<="+CurrentDate") order by P.totalFare DESC";
Statement stmt = conn.createState... |
Java | UTF-8 | 344 | 1.875 | 2 | [] | no_license | package com.example.turistickaagencija.repository;
import com.example.turistickaagencija.model.Destinacija;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
public interface DestinacijaRepository extends JpaRepository<Destinacija,Long> {
List<Destinacija> findAllByDrzhavaCont... |
Markdown | UTF-8 | 4,093 | 3.859375 | 4 | [
"MIT"
] | permissive | # 哈希表
面试中能用 hashMap 解答的题目往往会有更优的解法,但是 hashMap 是一种最容易想到也最容易实现的解法。
## [每日温度](https://leetcode-cn.com/problems/daily-temperatures/)
> 请根据每日 **气温** 列表,重新生成一个列表。对应位置的输出为:要想观测到更高的气温,至少需要等待的天数。如果气温在这之后都不会升高,请在该位置用 0 来代替。
>
> 例如,给定一个列表 temperatures = [73, 74, 75, 71, 69, 72, 76, 73],你的输出应该是 [1, 1, 4, 2, 1, 1, 0, 0]。
>
>... |
C# | UTF-8 | 943 | 3.140625 | 3 | [] | no_license | using System;
using App.Extensions;
using App.LSP.Good.Models;
namespace App.LSP.Good
{
public static class LspGoodExample
{
private static readonly Type BaseType = typeof(Fruit);
// We can replace Fruit BaseType with any SubType Apple or
// Orange without altering the correctness of ... |
Markdown | UTF-8 | 37,957 | 2.78125 | 3 | [] | no_license | # Interfaz Gráfica en Java
Curso propuesto por el grupo de trabajo Semana de Ingenio y Diseño (**SID**) de la Universidad Distrital Francisco Jose de Caldas.
## Monitor
**Cristian Felipe Patiño Cáceres** - Estudiante de Ingeniería de Sistemás de la Universidad Distrital Francisco Jose de Caldas
# Clase 7
## Objeti... |
SQL | UTF-8 | 2,266 | 4.5 | 4 | [] | no_license | -- List for each employee: employee number, last name, first name, gender, salary
SELECT e.emp_no, e.last_name, e.first_name, e.sex, s.salary
FROM employees as e
JOIN salaries as s ON e.emp_no = s.emp_no
ORDER BY e.emp_no;
-- List first name, last name, and hire date for employees who were hired in 1986
SELECT e.fi... |
Python | UTF-8 | 206 | 2.640625 | 3 | [] | no_license | # Link: https://edabit.com/challenge/YN9mNNc4mMPDxyhFf
def name_string(name):
return name+'Edabit'
print(name_string('Mubashir'))
print(name_string('Matt'))
print(name_string('python'))
|
JavaScript | UTF-8 | 874 | 2.90625 | 3 | [] | no_license | /**
* Advent of code solution
* @Andrew_Haine
*/
import fs from 'fs';
import chunk from 'chunk';
import { showAns, dump } from "../../utils/index.js";
const input = fs.readFileSync(new URL('input.txt', import.meta.url), "utf8");
const rucksacks = input.split("\n");
const groups = chunk(rucksacks, 3);
const lette... |
PHP | UTF-8 | 1,018 | 2.96875 | 3 | [] | no_license | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This class define the main class for all db exceptions, support to put some data
* on the exception , for example a current value of a record.
* Esa clase define la excepcion base para errores en base de datos.
*
* @author Carlos Ara... |
Java | UTF-8 | 2,723 | 2.3125 | 2 | [] | no_license | package com.sublimeprev.api.service;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sublimeprev.api.config.i18n.Messages;
import com.sublime... |
C | UTF-8 | 1,945 | 2.640625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_b.c :+: :+: :+: ... |
Markdown | UTF-8 | 13,075 | 2.796875 | 3 | [
"MIT"
] | permissive | ---
title: "Enterprise Browser - Using the Android Headset as a Barcode Trigger"
summary: "What if... you want to use a Zebra's Android device mounted on an arm-wrist and you want to control the barcode scanner with a wired button? WT6000 is the obvious answer! But if your customer has already chosen the TC51 for other... |
Java | UTF-8 | 120 | 1.734375 | 2 | [] | no_license | package online.fireflower.easy_enchants.enchant_types;
public enum EnchantType {
ARMOR_ENCHANT,
ITEM_ENCHANT
}
|
SQL | UTF-8 | 245 | 3.75 | 4 | [] | no_license | SELECT e.FirstName + ' ' + e.LastName AS [Full Name], d.Name, e.HireDate
FROM Employees AS e
JOIN Departments AS d
ON e.DepartmentID = d.DepartmentID
WHERE d.Name IN ('Sales', 'Finance')
AND e.HireDate >= '1995/1/1' AND e.HireDate <= '2005/1/1'
|
TypeScript | UTF-8 | 1,726 | 2.8125 | 3 | [
"MIT"
] | permissive | import { range } from '../range';
export function getPagersNumbers(
currentIndex: number,
lastIndex: number,
currentPageNeighboursCount: number,
ellipsisPrev: number,
ellipsisNext: number
): number[] {
// @see https://www.figma.com/file/SBNBQInDC8Ms3GyiqtEzm3/%F0%9F%95%B9-Vienna-RDS-Components?... |
C | UTF-8 | 742 | 2.984375 | 3 | [] | no_license | #include "lorem.h"
int pushInList(t_data **pointer, char *word) {
t_data *elem;
if ((elem = malloc(sizeof(t_data))) == NULL)
return (-1);
elem->word = word;
elem->prec = *pointer;
*pointer = elem;
return (0);
}
char *popInList(t_data **pointer) {
char *word;
t_data *tmp;
if (!*pointer)
return (N... |
Java | UTF-8 | 1,430 | 2.09375 | 2 | [] | no_license | package com.geovanni.studioghibli.views.views.base;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.geovanni.studioghibl... |
Go | UTF-8 | 797 | 2.65625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | package shared
import "flag"
type Version int
type Server struct {
Address string
Https bool
Tls struct {
Address string
Domain string
HttpsKey string
HttpsCert string
}
}
type Recording struct {
Enabled bool
CompressLevel int
Name string
Folder string
Zip ... |
Java | UTF-8 | 16,035 | 1.773438 | 2 | [] | no_license | package br.ufjf.pgcc.eseco.app.controller;
import br.ufjf.pgcc.eseco.app.service.MendeleyService;
import br.ufjf.pgcc.eseco.app.validator.ResearcherFormValidator;
import br.ufjf.pgcc.eseco.domain.model.core.*;
import br.ufjf.pgcc.eseco.domain.service.core.*;
import br.ufjf.pgcc.eseco.common.controller.CommonCont... |
Java | UTF-8 | 6,470 | 2.28125 | 2 | [] | no_license | package cn.notemi.controller;
import cn.notemi.po.User;
import cn.notemi.po.UserCustom;
import cn.notemi.po.UserQueryVo;
import cn.notemi.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.spr... |
PHP | UTF-8 | 3,522 | 3.078125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* PHP Version: 7.4
*
* @category
* @author Oleh Boiko <developer@mackais.com>
* @copyright 2018-2020 @MackRais
* @link <https://mackrais.com>
* @date 2020-02-17
*/
declare(strict_types=1);
namespace TicTacToe\Board;
use TicTacToe\Exception\InvalidBoardUser;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.