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 | 3,198 | 3.15625 | 3 | [] | no_license | import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
public class Game extends BasicGame {
... |
PHP | UTF-8 | 5,978 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\Http\Controllers\NavioController;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use App\Models\Jogo;
use App\Models\Tabuleiro;
use App\Http\Controllers\CasaController;
use phpDocumentor\Reflection\Types\True_;
class TabuleiroController extends Cont... |
Markdown | UTF-8 | 1,008 | 3.21875 | 3 | [] | no_license | # Adam
The *Adam* (short for *adaptive moment estimation*) optimization algorithm is a combination of [[gradient descent with momentum]] and [[RMSProp]]. [[@kingmaAdamMethodStochastic2017]]
Thus, after initializing $v_{\nabla J} = s_{\nabla J} = 0$, on each iteration $t$ the following steps are
(where the squaring a... |
Java | UTF-8 | 2,125 | 2.65625 | 3 | [] | no_license | /*
* Copyright (c) 2018 SSI Schaefer Noell GmbH
*
* $Header: $
*/
package com.ssn.ssijs.hibernate;
import java.util.Date;
import java.util.List;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.MetadataSources;
import org.hibernate.boot.registry.StandardS... |
PHP | UTF-8 | 801 | 2.515625 | 3 | [] | no_license | <?php
include_once('../config/Connexion.php');
$tab[0] = 0;
if( (isset($_POST['produit'])) && (!empty($_POST['produit'])) ){
$produit = strtoupper($_POST['produit']);
$query = $bdd -> prepare("SELECT COUNT(ID_PROD) AS NB FROM produit WHERE LIBELLE=:prod");
$query -> bindParam(':prod', $produit, PDO::... |
C | UTF-8 | 2,210 | 2.953125 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* formats_parameter_bis.c :+: :+: :+: ... |
Markdown | UTF-8 | 2,014 | 2.625 | 3 | [] | no_license | 
# Cotizador de Seguros para el Automóvil
Aplicación web te permite calcular el seguro de tu coche en función de la marca, año del vehículo y plan que quieras contratar. [Co... |
C# | UTF-8 | 2,114 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace DBapplication
{
public partial class UserSignUp : Form
{
Controller controllerObj;
public UserSignUp... |
Java | UTF-8 | 1,686 | 3.84375 | 4 | [] | no_license |
/**
* Represents a text-based board for holding painted-squares tiles.
*
* @author Terry Sergeant
* @version Spring 2016
*
*/
import java.util.Scanner;
import java.io.File;
public class Board
{
/** The tiles available for placement. */
protected Tile [] tiles;
/** The number of rows on the board. */
prot... |
C | UTF-8 | 151 | 2.96875 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#define CUADRADO(numero) (numero*numero)
int main ()
{
printf("cuadrado es: %d \n",CUADRADO(5));
return 0;
} |
JavaScript | UTF-8 | 2,763 | 2.671875 | 3 | [] | no_license | import { useEffect, useState } from 'react'
import { useHistory } from 'react-router-dom'
import { getAllArtists, getAllGenres } from '../../lib/api'
import DisplayCard from './DisplayCard'
import { FilterSelect } from '../common/FilterSelects'
export default function ArtistIndex() {
const [artists, setArtists] = us... |
Java | UTF-8 | 1,050 | 3.40625 | 3 | [] | no_license | package com.corejava;
import java.io.File;
public class CountsOfFiles {
static void RecursivePrint(File[] arr, int index, int level) {
if (index == arr.length)
return;
for (int i = 0; i < level; i++)
System.out.print("\t");
if (arr[index].isFile())
System.out.println(arr[index].getName());
else i... |
Markdown | UTF-8 | 1,423 | 3.140625 | 3 | [] | no_license | 这是参加的第3场在线笔试,感觉自己好菜,但要越挫越勇,不断进步吧
招银网络是30道选择题,和3道前端方向的题,选择题所有开发岗位都是一样的题,包括数据结构、计算机网络、C++、Java等方面的内容
选择题(大概只记得这些了)
---
* 排序
* 二叉树
* 子网掩码
* 共享栈
* 哈夫曼编码
* 单精度浮点数
* 推理题,判断哪个为真哪个为假
* 磁盘调度算法CSCAN
前端开发题(具体数字不记得了,大致是以下的题目)
* 下面这一段代码并不能输出1,2,3,4,5,解释下原因,并且修正下函数,使之输出正确的结果
```
for (var i=1;i<=5;i++) {
setTimeout(function... |
PHP | UTF-8 | 4,757 | 3.15625 | 3 | [
"MIT"
] | permissive | <?php
namespace nadir2\core;
/**
* The class provides the centralized access to the parameters of input request.
* @author Leonid Selikhov
*/
class Request
{
/** @var array It contains the raw request body. */
private $rawBody = null;
/**
* The constructor inits the private properties of the obje... |
C | UTF-8 | 2,200 | 2.921875 | 3 | [
"MIT"
] | permissive | #ifndef __BUTTERWORTH_H__
#define __BUTTERWORTH_H__
/* ---------------------------------------------------------------------------
* Simple Butterworth filter library
*
* @author Anderson Felippe <adfelippe@gmail.com>
*
* @brief This library provides two simple functions to filter an analog
* signa... |
Java | UTF-8 | 66,171 | 2.078125 | 2 | [] | no_license | package com.scttsc.business.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class CellManualExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database t... |
Python | UTF-8 | 498 | 3.4375 | 3 | [] | no_license | @author: dinaaouani
a = int(raw_input('Enter value for a:\n'))
b = int(raw_input('Enter value for b:\n'))
c = int(raw_input('Enter value for c:\n'))
n = int(raw_input('Enter value for n:\n'))
def check_fermat(a, b, c, n):
if n>2:
if a**n + b**n == c**n:
print('Holy Smokes, Fermat was Wrong!\n')... |
C++ | UTF-8 | 1,006 | 3.03125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class PublicTransit {
public:
int f(int x1, int y1, int x2, int y2) {
return abs(x1 - x2) + abs(y1 - y2);
}
int minimumLongestDistance(int R, int C) {
int result = numeric_limits<int>::max();
for (int a = 0; a < R; ++a) {
for (int b = 0; b < C; ++b... |
C# | UTF-8 | 2,573 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | using System.Linq;
using FubuMVC.RavenDb.InMemory;
using NUnit.Framework;
using Shouldly;
namespace FubuMVC.RavenDb.Tests.InMemory
{
[TestFixture]
public class InMemoryPersistorTester
{
[Test]
public void load_all()
{
var persistor = new InMemoryPersistor();
... |
Java | UTF-8 | 1,223 | 1.914063 | 2 | [] | no_license | package com.mao.demo.common.config;
import com.mao.demo.dao.PictureCopyright;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.web3j.crypto.Credentials... |
Java | UTF-8 | 1,235 | 3.671875 | 4 | [] | no_license | package ds_bitree;
import java.util.HashMap;
import java.util.Map;
//给定后序和中序,还原二叉树
public class BuildTree1 {
int[] inorder;
int[] postorder;
int rootIndex;
Map<Integer, Integer> inorderMap = new HashMap<Integer, Integer>();
public TreeNode buildTree(int[] inorder, int[] postorder) {
this.... |
Ruby | UTF-8 | 20,303 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | # frozen_string_literal: true
RSpec::Matchers.define_negated_matcher :not_include, :include
RSpec.describe 'Macros' do
let(:leader) { '1234567890' }
describe '#extract_link_data' do
context 'A record where indicator 2 is 0 and magic word is not in one of the label subfields' do
let(:url_856_1) do
... |
Java | UTF-8 | 3,617 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package toolbox_msgs.msg.dds;
import us.ihmc.communication.packets.Packet;
import us.ihmc.euclid.interfaces.Settable;
import us.ihmc.euclid.interfaces.EpsilonComparable;
import java.util.function.Supplier;
import us.ihmc.pubsub.TopicDataType;
/**
* This message is part of the IHMC footstep planning module.
... |
Java | UTF-8 | 1,745 | 2.609375 | 3 | [] | no_license | package com.hckj.yddxst.net;
import com.hckj.yddxst.Constant;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.Protocol;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterF... |
Ruby | UTF-8 | 263 | 2.71875 | 3 | [
"MIT"
] | permissive | class PhoneReader < FormIO::Output::Transformer
def value
phone = @value.split('')
area_code = phone.take(3).join
first_three = phone.drop(3).take(3).join
last_four = phone.drop(6).join
"(#{area_code}) #{first_three}-#{last_four}"
end
end
|
C# | UTF-8 | 4,076 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TurbineFaultDisplay
{
public partial class TurbineFaultDisplay : Form
{
privat... |
C# | UTF-8 | 2,633 | 2.671875 | 3 | [] | no_license | namespace SkyDean.FareLiz.Service
{
using SkyDean.FareLiz.Core.Utils;
using System;
using System.Windows.Forms;
/// <summary>
/// The program.
/// </summary>
internal static class Program
{
/// <summary>
/// The main entry point for the application.
... |
C# | UTF-8 | 877 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | using System;
namespace NuPattern.VisualStudio.Extensions
{
/// <summary>
/// Defines version range information
/// </summary>
public interface IVersionRange
{
/// <summary>
/// Gets whether a maximum is defined
/// </summary>
bool IsMaximumInclusive { get; }
... |
Python | UTF-8 | 131 | 3.328125 | 3 | [] | no_license | varOne="Hello"
varTwo="World"
varThree="Hey"
#Concat
print(varOne+varTwo)
#repetition
print(varThree*3)
#slice
print(varOne[1:3])
|
Java | UHC | 2,137 | 2.609375 | 3 | [] | no_license | package com.hanshin.example;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.htt... |
C# | UTF-8 | 3,514 | 3.09375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AoC2020
{
partial class Program
{
public delegate void DayProgram(List<string> input);
public static List<List<DayProgram>> years = new List<List<DayProgram>>
{
new List<DayProgram... |
Ruby | UTF-8 | 128 | 3.171875 | 3 | [] | no_license | require 'prime'
class Prime
def self.nth(place)
raise ArgumentError if place < 1
(Prime.first place).last
end
end
|
Markdown | UTF-8 | 3,773 | 3.890625 | 4 | [] | no_license | ## 为什么我们要写 `super(props)`
首先, `super(props)` 出现在我们代码里的次数比我知道的还要多
``` jsx
class Checkbox extends React.Component{
constructor(props) {
super(props)
this.state = {isOn: true}
}
}
```
当然 也可以通过 `class fields proposal` 来省略这个声明
``` jsx
class Checkbox extends React.Component {
state = {isOn: true}
}
```
早... |
Java | UTF-8 | 3,304 | 2.046875 | 2 | [] | no_license | /*******************************************************************************
* Copyright (C) 2011 Atlas of Living Australia
* All Rights Reserved.
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with... |
TypeScript | UTF-8 | 2,499 | 3.09375 | 3 | [] | no_license | import { FormGroup } from '@angular/forms';
/**
* Base class for Angular components with single form
* Designed to simplify and unify work with form and validation messages
*/
abstract class SingleFormBaseComponent {
/**
* @property {FormGroup} Form with fields
*/
public form: FormGroup;
/**
* @pro... |
Java | UTF-8 | 654 | 2.296875 | 2 | [] | no_license | package com.example.hyferion.spotifyrec.Swipe;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
public class FragmentPagerAdapter extends FragmentStatePagerAdapter {
public FragmentPagerAdapter(FragmentManager fm) {
... |
Python | UTF-8 | 1,293 | 3.796875 | 4 | [
"MIT"
] | permissive |
class TreeNode:
def __init__(self, key = None, leftChild = None, rightChild = None):
self.key = key
self.leftChild = leftChild
self.rightChild = rightChild
def setRootValue(self, key = None):
self.key = key
def getRootValue(self):
return self.key
def insertLef... |
Markdown | UTF-8 | 1,215 | 3.390625 | 3 | [
"MIT"
] | permissive | # $contains projection
> Checks if a structure contains an item at the position addressed by `path`
## Signature
**value** *(Any)* - The value to search for
**path** *(String/Array)* - Path to the property to search in
**subject** *(Object)* - The object that contains the requested value
**TYPE SIGNATURES**
```
*... |
Java | UTF-8 | 1,282 | 3.515625 | 4 | [
"MIT"
] | permissive | package com.baeldung.jsonjava;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONObject;
public class JSONObjectDemo {
public static void main(String[] args) {
System.out.println("4.1. Creating JSONObject: ");
jsonFromJSONObject();
System.out.println("\n4.2. Cre... |
PHP | UTF-8 | 5,131 | 2.625 | 3 | [] | no_license | <?php
namespace App\Controller;
use App\Entity\League;
use App\Entity\Match;
use App\Entity\Team;
use App\Service\LeagueService;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
class LeagueController ex... |
Python | UTF-8 | 1,141 | 3 | 3 | [] | no_license | import pandas as pd
from sklearn import metrics
from sklearn.tree import DecisionTreeClassifier
from sklearn.modal_selection import train_test_split
from sklearn.tree import export_graphviz
from sklearn.externals.six import StringIO
from IPython.display import Image
import pydotplus
col_names = ['PassengerId'... |
Java | UTF-8 | 2,096 | 2.859375 | 3 | [] | no_license | package com.ocean.jdbc.adapter;
import com.ocean.exception.ShardException;
import com.ocean.util.MethodInvocation;
import java.lang.reflect.Method;
import java.sql.SQLException;
import java.sql.Wrapper;
import java.util.ArrayList;
import java.util.Collection;
/**
* JDBC Wrapper适配类
*/
public class WrapperAdapter im... |
Markdown | UTF-8 | 438 | 2.90625 | 3 | [] | no_license | # QUIZ_APP
Developed a Quiz Website where the questions will be fetched from an API and HighScores(Top-5) can be seen.
**Functionality:**
1. A Registration Page where user enters the basic details.
2. Questions (1 on each Page) with a Timer. Once the time is up, the quiz (or the question) ends and the result is s... |
Java | UTF-8 | 7,967 | 2.390625 | 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 lims;
import java.io.IOException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;... |
C++ | UTF-8 | 177 | 2.765625 | 3 | [] | no_license | #include <iostream>
extern "C" {
float f(float);
}
float f(float p)
{
std::cout << "Hello" << std::endl;
std::cout << "the value of p = " << p << std::endl;
return p;
}
|
Java | UTF-8 | 1,286 | 3.109375 | 3 | [] | no_license | package com.spring.test.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
// 애노테이션
// 기본적으로 애노테이션은 주석이나 마찬가지... 기능은 몇 가지 더 있지만 주석과 같은 취급 소스, 클래스도 남지만 바이트 ... |
Python | UTF-8 | 2,308 | 3.125 | 3 | [
"MIT"
] | permissive | from typing import List
# https://leetcode.com/explore/featured/card/january-leetcoding-challenge-2021/579/week-1-january-1st-january-7th/3589/
class Solution:
def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool:
found_js = set()
master_i = 0
while master_i <= len(arr) - ... |
TypeScript | UTF-8 | 277 | 3.5625 | 4 | [] | no_license | interface User{
name : string,
age : number,
date : string
}
class UserAdd{
users : User [ ];
add ( user : User){
this.users.push( user);
}
}
var user_1 : User= {
name : 'Josue',
age : 30,
date : '20/12/2016'
}
var u = new UserAdd();
u.add( user_1);
|
Ruby | UTF-8 | 576 | 2.59375 | 3 | [] | no_license | class Banco < ActiveRecord::Base
acts_as_audited
has_many :cheques
validates_presence_of :numero, :message => "não pode ser vazio"
validates_presence_of :nome, :message => "não pode ser vazio"
validates_uniqueness_of :numero, :on => :create, :message => ": já existe um banco com este número."
validates_... |
Markdown | UTF-8 | 1,615 | 2.65625 | 3 | [] | no_license | # Stark Chat Rooms
[](https://github.com/git-shashwat/Open-Chat-Rooms)
[](https://github.com/git-shashwat/Open-Chat-Rooms)
[![contributions welc... |
Ruby | UTF-8 | 558 | 2.921875 | 3 | [] | no_license | class Cart < ActiveRecord::Base
has_many :line_items, :dependent => :destroy #depend on if line_item exist
def total_items
line_items.sum(:quantity)
end
#add a product to cart, if exist, add the quantity instead
def add_product(product_id)
current_item = line_items.find_by_product_id(product_id)
if current... |
JavaScript | UTF-8 | 1,076 | 3.484375 | 3 | [] | no_license | function getDiceIcon(dicenumber) {
const dice_icon = [
'<i class="fas fa-dice-one"></i>',
'<i class="fas fa-dice-two"></i>',
'<i class="fas fa-dice-three"></i>',
'<i class="fas fa-dice-four"></i>',
'<i class="fas fa-dice-five"></i>',
'<i class="fas fa-dice-six"></i>'... |
Shell | UTF-8 | 843 | 2.65625 | 3 | [] | no_license | alias xterm='xterm -fbx -ls &'
export HISTCONTROL=ignoredups
export HISTCONTROL=ignoreboth
export HISTSIZE=10240
export HISTTIMEFORMAT='%F %T'
PS1="\[\033[0;31m\]\u\[\033[0;37m\]@\[\033[0;31m\]\h \[\033[0;36m\]\w\[\033[0;37m\] :\[\033[0m\]"
#make sure directory colors work
if [ -x /usr/bin/dircolors ]; then
eval... |
PHP | UTF-8 | 2,553 | 2.9375 | 3 | [] | no_license | <?php
require(dirname(__FILE__) . '/vendor/autoload.php');
require_once(dirname(__FILE__) . '/auth.php');
class AssignBadge
{
/**
* @var string
*/
public $authToken;
public function isDryRun() {
return ($this->authToken == null || empty($this->authToken));
}
/**
* AssignBad... |
Java | UTF-8 | 3,352 | 2.109375 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (c) 2012-2014 Nord Trading Network.
*
* 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 l... |
Python | UTF-8 | 509 | 4.46875 | 4 | [] | no_license | # Alise Bruevich
# In this file a program will draw the letter A
import turtle
def drawA(theTurtle):
""" drawA takes in a Turtle object and draws an A """
theTurtle.left(60)
theTurtle.forward(100)
theTurtle.right(120)
theTurtle.forward(50)
theTurtle.right(120)
theTurtle.forward(50)
theT... |
Python | UTF-8 | 838 | 3.90625 | 4 | [
"CC-BY-4.0"
] | permissive | # Uebungsblatt 00
# Double arithmetics
pi = 3.14
e = 2.78
print
print('Float')
print(pi,'/',e,'=',pi / e)
print(pi,'//',e,'=',pi // e)
print(pi,'%',e,'=',pi % e)
print(pi,'**',e,'=',pi ** e)
# print(pi,'&',e,'=',pi & e)
# print(pi,'^',e,'=',pi ^ e)
# print(pi,'|',e,'=',pi | e)
# Integer arithmetics
pi = 32
e = 5
prin... |
Python | UTF-8 | 322 | 3.765625 | 4 | [] | no_license | n=str(input("Enter your name:"))
p=str(input("Enter Password:"))
if (p=="Avengers"):
num=int(input("Enter a number:"))
print("Factors of the given number {0} are".format(num))
for value in range (1,num+1):
if (num%value == 0):
print("{0}" .format(value))
else:
print("Wrong Password",... |
Shell | UTF-8 | 2,835 | 3.71875 | 4 | [] | no_license | #!/bin/bash
# construit les paths et envoye les requêtes getCoverage au WCS
# $1 est le le coverageID
# $2 est la résolution du modèle AROME (0025 ou 001)
resol=$2
echo "****************************************************************************************"
echo "getCoverage du coverageID : "$1 # le coverage... |
JavaScript | UTF-8 | 8,167 | 2.6875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | (function() {
describe("Fiscal quarters", function() {
it("Jan is Q4", function() {
expect(moment("2013-01-01").fquarter()).toEqual({
quarter: 4,
year: 2012,
nextYear: 2013
});
return expect(moment("2013-01-01").fquarter().toString()).toEqual("Q4 2012/13");
});
it("Feb is Q4", function() {
expect(mom... |
Python | UTF-8 | 568 | 2.96875 | 3 | [] | no_license | # Download a subdomain file and put it in the same folder as this script
import requests
domain = "CHANGE THIS"
# CHANGE IT FOR YOUR OWN SUBDOMAIN'S WORDLIST, like - https://github.com/assetnote/commonspeak2-wordlists/blob/master/subdomains/subdomains.txt
file = open("subdomains.txt", "r")
content = file.read()
sub... |
Markdown | UTF-8 | 1,416 | 2.90625 | 3 | [] | no_license | ## pbc
[](https://github.com/ltman/pbc/actions/workflows/npm-publish.yml)
A CLI tool for generating protobuf description from a schema repository.
**Supported output format**
- .desc
- .json (JSON descriptors of *[pro... |
Markdown | UTF-8 | 14,578 | 2.828125 | 3 | [] | no_license | ---
layout: post
title: "Integrate syslog-ng with Kafka"
date: 2016-12-21 19:14:01 -0400
categories: syslog syslog-ng kafka logging linux
logo: kafka.jpg
---
Tutorial on how to integrate [syslog-ng](https://syslog-ng.org/) with [Apache Kafka](https://kafka.apache.org/)
to allow forward and store of syslog logging fo... |
Java | UTF-8 | 479 | 1.710938 | 2 | [] | no_license | package com.rongdu.p2psys.crowdfunding.service;
import java.util.List;
import com.rongdu.p2psys.crowdfunding.domain.ProjectLog;
import com.rongdu.p2psys.crowdfunding.model.ProjectLogModel;
import com.rongdu.p2psys.user.domain.User;
public interface ProjectLogService {
public List<ProjectLog> getAudit();
... |
Markdown | UTF-8 | 1,139 | 2.5625 | 3 | [] | no_license | Assign USB Flash Disk Drive Letter
==================================
When a flash disk is inserted into a lab computer, it is automatically assigned the driveletter F:\. However, this causes problems as F:\ is already mapped to the student's network drive, meaning that the flash disk isn't assigned a valid handle in ... |
Python | UTF-8 | 151 | 3.265625 | 3 | [] | no_license | a=int(input())-1
b=" "*(a-1)+"*"
if a!=0:
print(" "+b)
c=" *"
for i in range(a-1):
b=b[1:]
print(" "+b + c)
c=" "+c
print("*"*(2*a+1)) |
Java | UTF-8 | 2,011 | 2.484375 | 2 | [] | no_license | package sg.edu.nus.cs3218tut_yipjiajie;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;
public class tutorial5b extends Activity {
public static CSurfaceViewLiveFFT surfaceView;
private SoundSamplerLive... |
Markdown | UTF-8 | 905 | 2.71875 | 3 | [] | no_license | # nestjs-swagger with reverse proxy
Tried to replicate the AWS gateway using nginx as reverse proxy.
## Working
Exposes nestjs with a global prefix `nest/global/prefix` and use this global prefix and expose it on `/docs`. The reverse proxy adds an extra `reverse-proxy-prefix` in front, we do not control the proxy, i... |
Markdown | UTF-8 | 2,139 | 2.828125 | 3 | [] | no_license | # Birthday Reminder Generator - Google App Script
This is a Google App Script that generate birthday reminder on Google Calendar based on Google Birthday Calendar (Contact's Birthday)
This is built on Google App Script. It aims to automatically get user's Google Calendar "`Birthday`" and generate another calendar "`B... |
Markdown | UTF-8 | 2,374 | 2.59375 | 3 | [
"MIT"
] | permissive | ---
title: "Week 2 & 3 Roundup: Aims & Objectives"
date: 2016-09-26 16:00:00
layout: post
---
The main goal those past two weeks was to work on getting the project's aim and
objectives down, and start working on the research question. My working title
for the project is **"Designing a standard communications platform ... |
Java | UTF-8 | 2,047 | 4.125 | 4 | [] | no_license | package LeetCode.Easy;
import java.util.LinkedList;
import java.util.List;
public class DeleteNode {
// Write a function to delete a node in a singly-linked list. You will not be given access to the head of the list,
// instead you will be given access to the node to be deleted directly.
//
// It is guarante... |
C++ | UTF-8 | 1,127 | 3.234375 | 3 | [] | no_license | #include "Conta.h"
Conta::Conta()
{
nomeCliente = " ";
numeroConta = 0;
salarioMensal = 0.0;
saldo = 0.0;
}
Conta::Conta(string n,int nc,double sm,double sal)
{
nomeCliente = n;
numeroConta = nc;
salarioMensal = sm;
saldo = sal;
}
string Conta::getNomeCliente()
{
... |
Markdown | UTF-8 | 23,076 | 2.625 | 3 | [
"MIT"
] | permissive | # Equanimity
- [Equanimity](#equanimity)
- [Preamble](#preamble)
- [Installation](#installation)
- [Pre-Installation](#pre-installation)
- [Installing Microsoft Visual C++ Redistributable Package](#installing-microsoft-visual-c-redistributable-package)
- [Steam Config](#steam-config)
- [Dis... |
Java | UTF-8 | 1,322 | 3.109375 | 3 | [] | no_license | package leetcode;
import org.junit.Assert;
import org.junit.Test;
/**
* 通配符匹配
* https://leetcode-cn.com/problems/wildcard-matching/solution/tong-pei-fu-pi-pei-by-leetcode-solution/
*/
public class Question44 {
@Test
public void test() {
Assert.assertTrue(isMatch("aa", "*"));
}
public bool... |
Java | GB18030 | 1,750 | 2.296875 | 2 | [] | no_license | package action;
import java.util.List;
import service.ProductService;
import service.ShopCarService;
import com.opensymphony.xwork2.ActionSupport;
import entity.Goods;
import entity.Product;
public class ProductAction extends ActionSupport {
/**
* Ʒ
*/
private Product product;
/**
* Ʒб
*/
private Lis... |
C++ | UTF-8 | 1,620 | 3.5625 | 4 | [] | no_license | //
// leetcode7_Reverse_Integer.cpp
// string으로 접근시 예외 처리 발생 직접 해결
// Created by HesSong on 2018. 1. 1..
// Copyright © 2018년 Hes Song. All rights reserved.
//
/*
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example... |
Markdown | UTF-8 | 4,451 | 2.703125 | 3 | [
"MIT"
] | permissive | ---
date: 2011-01-23 00:00
layout: post
publish: true
categories: [mumblings]
title: "Old And New But Both Classics"
comments: true
---
I've had fun recently spending some Christmas money by buying some classic items. One was old, the other was new, but both are classics.
<p><a class="image" href="http://www.flickr.... |
Python | UTF-8 | 1,075 | 3.84375 | 4 | [] | no_license | """
Largest Time for Given Digits
Given an array of 4 digits, return the largest 24 hour time that can be made.
The smallest 24 hour time is 00:00, and the largest is 23:59. Starting from 00:00, a time is larger if more time has elapsed since midnight.
Return the answer as a string of length 5. If no valid time ca... |
Java | UTF-8 | 3,636 | 2.21875 | 2 | [] | no_license | package com.example.suimon;
import android.content.Intent;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.util.Patterns;
impor... |
Python | UTF-8 | 9,448 | 3 | 3 | [] | no_license | '''
music21.trecento.tonality
These functions show how music21 can be used to analyze whether the idea
of tonal closure applies in the music of the Italian fourteenth century
by seeing how often the first note of the tenor (or the given voice stream
number) and the last note of that same voice are the same note.... |
Markdown | UTF-8 | 3,009 | 3.671875 | 4 | [] | no_license | [105. Copy List with Random Pointer](http://www.lintcode.com/problem/copy-list-with-random-pointer)
- [prev: 104. Merge k Sorted Lists](104-merge-k-sorted-lists.md)
- [next: 106. Convert Sorted List to Balanced BST](106-convert-sorted-list-to-balanced-bst.md)
---
```java
/**
* Definition for singly-linked list with... |
C++ | UTF-8 | 2,458 | 2.71875 | 3 | [] | no_license | #include "Settings.h"
#include "Level.h"
Level::Level() {
// Default nothing map
for (int i = 0; i < LEVEL_HEIGHT; i++)
{
for (int j = 0; j < LEVEL_WIDTH; j++)
{
levelMatrix[i][j] = -1;
}
}
// Load map from file
std::ifstream myfile("level.txt");
if (myfile.is_open())
{
for (int i = 0; i < LEVEL... |
Python | UTF-8 | 294 | 3.640625 | 4 | [] | no_license | import math
n = int(input())
is_prime = True
if n < 2:
print('Not prime')
else:
end_prob = int(math.sqrt(n))
for i in range(2, end_prob + 1):
if n / i == n // i:
is_prime = False
if is_prime:
print('Prime')
else:
print('Not prime')
|
C++ | UTF-8 | 900 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define LL long long
#define ALL(x) x.begin(), x.end()
template<typename... Args>
void cline(Args... args){ ((cout << args << " "), ...);}
bool meetCriteria(LL a) {
string s = to_string(a);
bool two_same = false;
vector<LL> v (10, 0);
f... |
Markdown | UTF-8 | 13,074 | 3.796875 | 4 | [
"MIT"
] | permissive | ### **一、fork()函数解析**
fork()函数通过系统调用创建一个与原来进程几乎完全相同的进程,这个新产生的进程称为子进程。一个进程调用fork()函数后,系统先给新的进程分配资源,例如存储数据和代码的空间。然后把原来的进程的所有值都复制到新的新进程中,只有少数值与原来的进程的值不同。相当于克隆了一个自己。**需要注意的一点:就是调用fork函数之后,一定是两个进程同时执行的代码段是fork函数之后的代码,**而之前的代码以及由父进程执行完毕。下面来看一个很简单的例子。
```
#include <unistd.h>
#include <stdio.h>
int main ()
{
... |
C# | UTF-8 | 2,267 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace Aop.Api.Util
{
public class StringUtil
{
public static string ToString(object obj)
{
if (obj == null)
{
return "null";
... |
C | UTF-8 | 597 | 3.90625 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {
printf("arg[1]: %s\n", argv[1]);
printf("arg[2]: %s\n", argv[2]);
int n1 = atoi(argv[1]);
int n2 = atoi(argv[2]);
printf("sum: %d\n", n1 + n2);
int x = 0;
int y = 0;
printf("Input any 2 numbers: ");
scanf("%d,... |
JavaScript | UTF-8 | 2,192 | 2.65625 | 3 | [
"Unlicense"
] | permissive | /*global VisibleSpacesEditor*/
(function() {
'use strict';
function getAllEvents(element) {
var result = [];
for (var key in element) {
if (key.indexOf('on') === 0) {
result.push(key.slice(2));
}
}
return result;
}
function dispatchAllEvents(src, dest) {
getAllEvents(dest).forEach(function(eve... |
C# | UTF-8 | 2,435 | 2.859375 | 3 | [] | no_license | using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Xml.Linq;
namespace AromasEstoque.Controllers
{
class XmlImportController
{
private XDocument _xmlDocument;
private readonly XNamespace _xmlNamespace = "http://www.portalfiscal.inf.br/nfe";
pu... |
Python | UTF-8 | 569 | 3.25 | 3 | [] | no_license | month = input()
nights = int(input())
studio = 0
apartment = 0
bill = 0
if month == "May" or month == "October":
studio = 50
apartment = 65
if 7 < nights < 14:
studio *= 0.95
elif nights > 14:
studio *= 0.70
elif month == "June" or month == "September":
studio = 75.20
apartment =... |
JavaScript | UTF-8 | 559 | 3.46875 | 3 | [] | no_license | function sumarLento( numero ) {
return new Promise( ( resolve, reject ) => {
setTimeout(() => {
// reject( 'Sumar Lento falló' );
resolve( numero + 1 );
}, 800);
});
}
let sumarRapido = ( numero ) => {
return new Promise( ( resolve, reject ) => {
setTimeout((... |
Markdown | UTF-8 | 2,857 | 2.859375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Structures17- Memory-Augmented Networks
desc: 2017-team
tags:
- 2Structures
categories: 2017Reads
keywords: meta-learning, memory-augmented,
---
| Presenter | Papers | Paper URL| Our Slides |
| -----: | -------------------------------------: | :----- | :----- |
| Muthu | Matching Networks for... |
C# | UTF-8 | 3,116 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.CompilerServices;
using System.Text;
namespace PhotoStudio.Model
{
class Order : ... |
JavaScript | UTF-8 | 19,515 | 2.5625 | 3 | [
"MIT"
] | permissive | // read personal info
var id = parseInt($.url().param('id'));
var emp = alasql('SELECT * FROM emp WHERE id=?', [ id ])[0];
$('#number').text(emp.number);
$('#name').text(emp.name);
$('#sex').text(DB.choice(emp.sex));
$('#birthday').text(emp.birthday);
$('#tel').text(emp.tel);
$('#email').text(emp.email);
$('#ctct_name'... |
JavaScript | UTF-8 | 710 | 2.59375 | 3 | [] | no_license | describe( 'field', function() {
var field;
beforeEach( function() {
field = new SkyBlocks.field();
});
it( 'has a width of 10', function() {
expect( field.width ).toEqual( 10 );
});
describe( 'lines', function() {
it( '20 lines high', function() {
expect( field.lines.length ).toEqual( ... |
JavaScript | UTF-8 | 499 | 2.625 | 3 | [] | no_license | function crate Table (list, languages) {
var table = document.createElement("table");
}
function edit (rowElt) {
function textToInput (elt){
var text = elt.textContent;
elt.textContent = "";
var button = document.createElement("input");
button.textContent = text;
... |
C | UTF-8 | 1,898 | 3.3125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include "cellChecker.h"
#include "gridContainer.h"
#include "StatisticsContainer.h"
int main(int argc, char** argv){
stats_t* stats = (stats_t*)malloc(sizeof(stats_t));
stats->totalDeaths = 0;
stats->totalCreations = 0;
grid_t* grid = (grid_t*)malloc(sizeof(grid_t));
grid->... |
JavaScript | UTF-8 | 747 | 3.140625 | 3 | [] | no_license | //check of completed to dos
$("ul").on("click", "li", function(){
$(this).toggleClass("completed")
});
//clicking on delete to remove to do
$("ul").on("click", "span", function(event){
$(this).parent().fadeOut(500, function(){
$(this).remove();
});
event.stopPropagation();
})
//adding a new to do on user input... |
PHP | UTF-8 | 1,172 | 3.25 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: Moritz
* Date: 26.09.2017
* Time: 09:25
*/
class Flag{
var $Bezeichnung;
var $Farbe;
var $Form;
var $Flaecheninhalt;
public function __construct(string $Bezeichnung, string $Farbe, string $Form, string $Flaecheninhalt){
$this->Bezeichnung = $Bez... |
Java | UTF-8 | 4,036 | 1.867188 | 2 | [
"Apache-2.0"
] | permissive | /*
* 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 agreed to in writing, software
* distribut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.