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 |
|---|---|---|---|---|---|---|---|
Shell | UTF-8 | 515 | 3.171875 | 3 | [] | no_license | #!/bin/bash
if [ -e /etc/dynamodb/config.cfg ]; then
source /etc/dynamodb/config.cfg
else
shared=true
dbPath=/var/lib/dynamodb
port=8000
fi
librarypath=/usr/share/dynamodb/DynamoDBLocal_lib
jar=/usr/share/dynamodb/DynamoDBLocal.jar
args=("-Djava.library.path=$librarypath" "-jar $jar" "-port $port")
if [ $sh... |
C | UTF-8 | 601 | 3.671875 | 4 | [] | no_license | //
// exercise_1.c
// Question:
//Write a C program to print your name, date of birth. and mobile number.//
//
// Created by Rob the deer on 13.04.2021.
//
#include <stdio.h>
int main(void){
//declaration of variables
int dd;
int mm;
int yyyy;
long int mobile_num;
printf("/////________WELCOME TO MY DATABASE__... |
C# | GB18030 | 1,669 | 2.734375 | 3 | [] | no_license | using System;
using System.Data;
namespace PMS.Model
{
/// <summary>
/// TNews(ʵ)
/// </summary>
[Serializable()]
public class News
{
/// <summary>
/// id
/// </summary>
public int NewsId { get; set; }
/// <summary>
///
/// </sum... |
Java | UTF-8 | 277 | 1.875 | 2 | [] | no_license | package pe.g5.upc.service;
import java.util.List;
import pe.g5.upc.entity.Autoevaluacion;
public interface iAutoevaluacionService {
public void insertar(Autoevaluacion autoevaluacion);
public List<Autoevaluacion>listar();
public void eliminar ( int idAutoevaluacion);
}
|
Markdown | UTF-8 | 985 | 2.96875 | 3 | [] | no_license | # blood-rage-translations
This project contains (addable) translations for the board game Blood Rage.
You can search for cards by their English titles and get translation in other Languages (In this case Georgian Or any language you add).
You can add translation of any language.
## DEMO
see here: http://blood-rag... |
Java | UTF-8 | 156 | 1.84375 | 2 | [
"BSD-2-Clause"
] | permissive | package cz.librarymanager.model.enums;
/**
* Created by Zdenca on 4/23/2016.
*/
public enum BookForm {
OPTICAL,PAPERBACK, HARD_COVER, MAP, ONLINE;
}
|
C# | UTF-8 | 4,752 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EnigmaNet.Bus
{
public static class SubscriberUtils
{
static void Subscriber(ICommandSubscriber commandSubscriber, object commandHandler)
{
var handlerTypes... |
Java | UTF-8 | 191 | 2.53125 | 3 | [] | no_license | package app.exceptions;
public class InvalidCommandException extends Exception {
public InvalidCommandException(String command) {
super("Invalid command : " + command);
}
}
|
Markdown | UTF-8 | 3,448 | 3.3125 | 3 | [
"MIT"
] | permissive | # NumPadUltra
笔记本小键盘输入扩展(键盘钩子)
## 功能
目前主流笔记本个人电脑为节省键盘占用空间,一般不搭载数字小键盘;但是在一些情景下,小键盘按键的功能并不能被上方横排数字键所完全替代。例如:某些设计软件(如Adobe系列)和大型单机游戏的快捷键必须用到小键盘按键;以及在统计时、需要输入大量数据的情况,小键盘的九宫格布局可大幅加快输入速度。
本程序的开发动机主要是P大的一门名为“物理化学实验”的必修课:
* 经常要向Excel/Origin里输入几页的原始数据,用上方横排数字键实在太慢;
* 要在实验记录本里抄电子版讲义的原理/步骤等内容,本子压在键盘上写字容易误触按键。
本程序的主... |
Python | UTF-8 | 7,957 | 2.890625 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
import sys
import os
import regret as rg
import class_Auction
import numpy as np
import regret as rg
import matplotlib.pyplot as plt
from scipy.optimize import linprog
from scipy.stats import gaussian_kde
import math
#how_much_regret is a function that takes three arguments:
# 1) filename = the n... |
Shell | UTF-8 | 522 | 2.9375 | 3 | [] | no_license | #!/bin/sh
# $Id: thump.sh 55 2008-09-30 19:26:52Z mando $
# AgentSDK
# stop/start the local agent
#
# Mike ERWIN mikee@symbiot.com
# Paco NATHAN paco@symbiot.com
# Jamie PUGH jamie@symbiot.com
nuke ()
{
ps axl | grep $1 | grep -v grep | perl -e 'while (<STDIN>) { s/\s+/ /g; @l = split(/ /); print $l[2] . "\n"; }'... |
JavaScript | UTF-8 | 15,104 | 3.15625 | 3 | [
"CC-BY-4.0"
] | permissive | /* eslint-disable no-param-reassign */
/* eslint-disable class-methods-use-this */
import { clean } from './Utils.js';
export class MdGenerator {
/**
* Generates a markdown content from an Element.
* @param {Element} root
* @returns {string} The generated markdown.
*/
generate(root) {
clean(root);... |
C | UTF-8 | 1,967 | 2.59375 | 3 | [] | no_license | #include "headers.h"
int check_pinfo(int noarg)
{
for(int i=0;i<noarg;i++)
{
if(strcmp(eachcommand[i],">") == 0)
return 0;
else if(strcmp(eachcommand[i],"<") == 0)
return 0;
else if(strcmp(eachcommand[i],">>") == 0)
return 0;
}
if(strcmp(eachcommand[0],"pinfo")==0) return 1;
return 0;
}
void do... |
Markdown | UTF-8 | 1,083 | 2.5625 | 3 | [
"MIT"
] | permissive | _Portfolio_
_webpage document my progress in Epicodus so far, 8.9.19_
_By Duncan Robbins_
## Description
_This webpage documents my understanding of the information taught at Epicodus. It also provides information about me and how I grew up what previous jobs I had and why I chose Epicodus as a place to learn how t... |
Python | UTF-8 | 2,676 | 3.203125 | 3 | [
"MIT"
] | permissive | import re
from utils.form.fields import Fields
fields = Fields()
class Validate:
"""
Validator of the user input
"""
def fullValidation(self, data):
"""
It runs a full validation of all the keys in the data parameter.
It validates that matchs exactly the requested fields for ... |
C | UTF-8 | 508 | 2.59375 | 3 | [] | no_license | #include<stdio.h>
void main()
{
int x;
/*char c;
char d;*/
// (eligibility test program)
printf("enter your marks\t");
scanf("%d",&x);
if(x<90 && x>20){
// printf("enter your name\t");
printf("you are qualified\t");
}
else if(x>90){
printf("you are brillient\t"... |
Python | UTF-8 | 1,798 | 3.671875 | 4 | [] | no_license | from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def start():
title = "Flowers don't growl"
text = """It is a warm day and you are in the woods, getting some fresh air. All of a sudden, a man jumps out of the bushes.
He starts telling you that he was picking flowers and... |
C# | UTF-8 | 857 | 3.328125 | 3 | [] | no_license | public class Solution {
public IList<int> FindAnagrams(string s, string p) {
var baseM = new int[26];
var tm = 26;
foreach(var c in p){
if(baseM[c-'a']++ == 0)
tm--;
}
var m = new int[26];
var low = 0;
var len = s.Length;
... |
Python | UTF-8 | 2,328 | 3.03125 | 3 | [
"Apache-2.0"
] | permissive | """
Copyright 2020 Tianshu AI Platform. All Rights Reserved.
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... |
Java | UTF-8 | 2,796 | 2.203125 | 2 | [] | no_license | package com.baidu.shop.web;
import com.baidu.shop.base.BaseApiService;
import com.baidu.shop.base.Result;
import com.baidu.shop.config.JwtConfig;
import com.baidu.shop.dto.UserInfo;
import com.baidu.shop.entity.UserEntity;
import com.baidu.shop.service.UserOauthService;
import com.baidu.shop.status.HTTPStatus;
import ... |
Java | UTF-8 | 560 | 2.703125 | 3 | [] | no_license | package implementation.visitor;
import implementation.visitable.Accessories;
import implementation.visitable.Clothes;
import implementation.visitable.Shoes;
import interfaces.Visitor;
import java.text.DecimalFormat;
public class NoDiscount implements Visitor {
public NoDiscount() {
}
public double visi... |
JavaScript | UTF-8 | 893 | 2.828125 | 3 | [] | no_license | // Enter key for email input field
document.getElementById("email_field").addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
ResetPassword();
}
});
function ResetPassword() {
// Send Reset Code
firebase.auth().sendPasswordResetEmail(document.getElementById("email_f... |
JavaScript | UTF-8 | 210 | 3.015625 | 3 | [] | no_license | function tres(num, arreglo) {
var total = 0;
for (var i = 0; i < arreglo.length; i++) {
if (num === arreglo[i]) {
total++;
}
}
console.log("el numero " + num + " se repite: " + total);
}
|
Java | UTF-8 | 1,290 | 2.78125 | 3 | [] | no_license | package com.xk.player.uilib;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.layout.FillLayout;
public class VideoBox extends MessageBox{
protected Object result;
protected Shell shell;
/**
* Create the... |
Java | UTF-8 | 2,370 | 2.5625 | 3 | [] | no_license | package com.intristicmc.core.commands;
import java.util.HashMap;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.intristicmc.core.IntristicCORE;
import com.intristicmc.core.mis... |
Java | UTF-8 | 218 | 1.554688 | 2 | [] | no_license | package com.wallet.security.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
//todo: SpringSecurity+Jwt 8.6.3 - TolkenDTO class
@Data
@AllArgsConstructor
public class TokenDTO {
private String token;
}
|
SQL | UTF-8 | 428 | 3.015625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS PATIENT (
ID INT AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR(50) NOT NULL,
SURNAME VARCHAR(50) NOT NULL,
BIRTHDAY DATE NOT NULL,
SECURITY_NUMBER VARCHAR(50) NOT NULL
);
CREATE TABLE IF NOT EXISTS VISIT (
ID INT AUTO_INCREMENT PRIMARY KEY,
ID_PATIENT INT NOT NULL,
VISIT_DATE DA... |
Java | UTF-8 | 2,168 | 2.125 | 2 | [] | no_license | package ui.view;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import static org.junit.Assert.*;
public class DeleteTest {
private static final String url... |
Python | UTF-8 | 1,060 | 2.546875 | 3 | [] | no_license | #We are using Tweepy library in order to access Twitter API.
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import time
###################
#All below tokens & consumer key& secert are from our dev. account on twitter.
access_token = ""
access_token_secret ... |
Java | UTF-8 | 829 | 3.15625 | 3 | [] | no_license | package by.bsuir.lab01.actions;
public class Validators {
protected Boolean isEmpty(String value) {
if (value.length() == 0) {
return true;
}
return false;
}
protected Boolean between(String value, int from, int to) {
int len = value.length();
if (len... |
C# | UTF-8 | 1,977 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using BloggerDocuments.Database.Entities;
using BloggerDocuments.Tests.Assemblers;
using BloggerDocuments.Tests.Environment.Mocks;
using NSubstitute;
namespace BloggerDocuments.Tests.Environment.Tables
{
public class DocumentsTable
{
p... |
PHP | UTF-8 | 1,459 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
require_once dirname(dirname(__FILE__)).'/vendor/autoload.php';
use Slim\App;
use Zeuxisoo\Whoops\Provider\Slim\WhoopsMiddleware;
$app = new App([
'settings' => [
'debug' => true, // On/Off whoops error
'whoops.editor' => 'sublime',
'displayErrorDetails' => t... |
Markdown | UTF-8 | 3,014 | 2.625 | 3 | [] | no_license | 淘宝页面小图切换大图
```
(function () {
var box = document.getElementById('box');
//数组存放假数据
var data = [{
imgurl: ['../img/images/1.webp', '../img/images/2.webp', '../img/images/3.webp'],
title: '领带男正装商务韩版男士手打',
pingjia:... |
Markdown | UTF-8 | 6,804 | 3.15625 | 3 | [] | no_license | ---
title: 在 Spring Webflux 使用 Spring Integration Redis 实现分布式锁
date: 2019-09-28 23:17:37
tags:
- java
- webflux
categories:
- Java
---
### 分布式锁
在传统单体应用中,我们用锁来保证非幂等操作在并发调用时不会产生意外的结果。最常见的应用场景应该就是 MySQL 用锁保证写表时不会重复写入或读表时读到脏数据。
进入微服务时代,整个业务系统可能是由数十个不同的服务节点组成,每个服务节点还包括多个实例确保高可用。在这样的环境下,一个写请求可能会由于负载均衡通过不同的服务实例操作数据,大多 NoSQL... |
Markdown | UTF-8 | 845 | 2.59375 | 3 | [] | no_license | +++
name = "Solitwork"
weight = 10
ID = 3
title = "Hands-on mentoring"
subtitle = "Technical leadership"
date = "2014-07-07"
img = "../clients/solitwork.png"
preview = "../clients/solitwork.png"
client = "Solitwork"
clientLink = "//www.solitwork.com/"
category = "Technical Leadership"
+++
Solitwork are a BI Consultanc... |
JavaScript | UTF-8 | 680 | 2.609375 | 3 | [] | no_license | (function () {
var write = function writeCss(view, className) {
ASSERT(view instanceof jQuery, "expected jQuery object");
/* Remove the old class if there is one. */
var old = view.data("hd-klass");
if (old) {
view.removeClass(old);
}
/* Add the new class and remember it. */
view.... |
C++ | UTF-8 | 643 | 2.703125 | 3 | [] | no_license | /*************************************************************************
> File Name: ID.cpp
> Author: Xu
> Created Time: 2019年05月31日 星期五 19时26分35秒
************************************************************************/
#include"ID.h"
int ID::getscore()
{
return score;
}
string ID::getname()
{
return name;... |
PHP | UTF-8 | 6,490 | 2.640625 | 3 | [] | no_license | <?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "encuesta";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if($_POST['tiempo'] == ""){
$sql = "I... |
Java | UTF-8 | 1,872 | 3.96875 | 4 | [] | no_license | package offer66;
/**
把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转。
输入一个非减排序的数组的一个旋转,输出旋转数组的最小元素。例如数组{3,4,5,1,2}为{1,2,3,4,5}的一个旋转,该数组的最小值为1。
NOTE:给出的所有元素都大于0,若数组大小为0,请返回0。
**/
public class A6 {
public static int minNumberInRotateArray(int [] array) {
if(array.length <=0){
return 0;
}
int i... |
SQL | UTF-8 | 2,936 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 24 Mei 2019 pada 09.06
-- Versi Server: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
C++ | GB18030 | 17,659 | 2.640625 | 3 | [] | no_license | // Utils.cpp: implementation of the Utils class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Utils.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#include <direct.h>
#define is_space(c) \
(((c) == ' ') || ... |
C# | UTF-8 | 1,204 | 3.421875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Shape.ShapeComponents;
namespace Shape
{
abstract class AbstractQuadrilateral : IShape
{
protected Random rnd = new Random();
protected Line height;
protected Line ... |
Java | UTF-8 | 1,784 | 2.5625 | 3 | [] | no_license | /*
* Copyright (C) 2008 Universidade Federal de Campina Grande
*
* This file is part of OurGrid.
*
* OurGrid 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 version 3 of the License, o... |
Ruby | UTF-8 | 157 | 3.140625 | 3 | [] | no_license | def combine_anagrams(words)
hash = Hash.new([])
words.each { |str| hash[str.downcase.split(//).sort.join] += [str] }
hash.values
hash.values.to_s
end |
JavaScript | UTF-8 | 1,407 | 3.765625 | 4 | [] | no_license | var prize = [];
var get = [];
function gachaSystem() {
for (var count = 1; count <= 100; count++) {
if (count % 10 == 0) {
var prize0;
prize0[count] = "A";
} else if (count % 10 == 1 || count == 1) {
var prize1;
prize1[count] = "B";
} else if (count % 10 == 2) {
var prize2;
... |
C++ | UTF-8 | 3,571 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <cassert>
#include <climits>
using namespace std;
#define MAX_SONGS 55
#define MAX_SUM 55000
int dp[MAX_SONGS];
int dp2[MAX_SONGS][2][MAX_SUM];
/* 0 is no touch; 1 is chosen */
int choice[MAX_SONGS];
void fill_dp(int val) {
for(int i = 0; i < MAX_SON... |
Java | UTF-8 | 20,734 | 1.929688 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (C) 2009 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.financial.interestrate;
import static org.testng.AssertJUnit.assertEquals;
import static com.opengamma.financial.interestrate.SimpleInstrumentFactory.*;
impo... |
Markdown | UTF-8 | 569 | 2.671875 | 3 | [
"CC0-1.0"
] | permissive | # マークダウン
1改行で`<br/>`。2改行で`<p>`。
## リスト
* あ
* い
* う
* え
* お
* か
## 順序リスト
1. あ
1. い
1. う
1. え
1. お
1. か
`A`,`a`,`i`では使えなかった。
## テーブル
A|B
-|-
a|b
c|d
e|f
## リンク
* https://www.google.co.jp
* [https://www.google.co.jp]
* [Google](https... |
Java | UTF-8 | 3,724 | 2.671875 | 3 | [] | no_license | package Biblioteca.contoller;
import Biblioteca.model.Library;
import Biblioteca.model.valueObject.Author;
import Biblioteca.model.Book;
import Biblioteca.model.valueObject.Title;
import Biblioteca.model.valueObject.Year;
import Biblioteca.view.InputDriver;
import Biblioteca.view.OutputDriver;
import org.junit.jupiter... |
C++ | UTF-8 | 2,997 | 2.53125 | 3 | [] | no_license | #ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QListWidgetItem>
#include <QSqlQuery>
#include <QSqlError>
#include <QSqlRecord>
#include <QDebug>
#include <QString>
#include <QFile>
#include <QFileDialog>
#include <QVector>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMai... |
SQL | UTF-8 | 587 | 2.78125 | 3 | [
"MIT"
] | permissive | # --- !Ups
ALTER TABLE label_point
DROP COLUMN canvas_height,
DROP COLUMN canvas_width,
DROP COLUMN alpha_x,
DROP COLUMN alpha_y;
ALTER TABLE gsv_link DROP COLUMN road_argb;
# --- !Downs
ALTER TABLE gsv_link ADD COLUMN road_argb CHARACTER VARYING(2044) COLLATE pg_catalog."POSIX" NOT NULL DEFAULT '';
... |
C++ | UTF-8 | 987 | 2.96875 | 3 | [] | no_license | #pragma once
#include <GLFW\glfw3.h>
class Mouse
{
public:
enum Mouse_Button
{
LEFT,
RIGHT,
CENTER
};
static void Init();
static void Update();
static bool IsButtonPressed(Mouse_Button button);
static double GetPosX() { return posX; }
static double GetPosY() { return posY; }
static double GetPrevPo... |
Java | UTF-8 | 1,427 | 2.296875 | 2 | [] | no_license | package com.dexels.r2dbc;
import java.io.IOException;
import java.nio.ByteBuffer;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.reactivestreams.servlet.ResponseSubscriber;
import i... |
JavaScript | UTF-8 | 1,387 | 4.625 | 5 | [] | no_license | // In JS the WAY a function is called determines what
// 'this' keyword represents (depends on a context)
function first() {
return this;
};
console.log('Equal to Global space: ' + (first() === global));
////////////////////////////////////////////////////////////////////////////////
function second() {
'... |
Python | UTF-8 | 228 | 3.265625 | 3 | [] | no_license | import operator
x = {
1: 'd) one',
2: 'e) two',
3: 'a) three',
4: 'c) four',
5: 'b) five'
}
sorted_x = sorted(
x.items(),
key=operator.itemgetter(1),
# reverse=True
)
print sorted_x
|
Python | UTF-8 | 686 | 3.515625 | 4 | [] | no_license | class Ninja:
def __init__(self, first_name, last_name, treats, pet_food, pet):
self.first_name = first_name
self.last_name = last_name
self.treats = treats
self.pet_food = pet_food
self.pet = pet
def walk(self):
self.pet.play()
print(self.first_... |
C# | UTF-8 | 1,140 | 2.71875 | 3 | [
"MS-PL"
] | permissive | using System;
using System.Diagnostics;
namespace SPMeta2.Containers.Utils
{
public class TraceUtils
{
#region static
public static void WithScope(Action<TraceUtils> action)
{
action(new TraceUtils());
}
#endregion
#region properties
prot... |
Java | UTF-8 | 911 | 1.992188 | 2 | [] | no_license | package com.czxy.changgou3.mapper;
import com.czxy.changgou3.pojo.SkuPhoto;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;... |
Java | UTF-8 | 182 | 2.015625 | 2 | [] | no_license | package ca.uvic.seng330.assn3;
import java.util.UUID;
public interface Device {
public Status getStatus();
public void setStatus(Status s);
public UUID getIdentifier();
}
|
Ruby | UTF-8 | 1,603 | 2.546875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | module Trample
class Session
include Logging
include Timer
attr_reader :config, :response_times, :cookies, :last_response
def initialize(config)
@config = config
@response_times = []
@cookies = {}
end
def trample
@config.login.each {|page| hit page} un... |
Markdown | UTF-8 | 5,101 | 3.296875 | 3 | [] | no_license | # TP2
#### :alarm_clock: [Date de remise le dimanche 10 octobre à 23h59](https://www.timeanddate.com/countdown/generic?iso=20211010T2359&p0=165&msg=Remise&font=cursive&csz=1#)
## Objectif
Ce TP poursuit votre apprentissage de l'algorithmie avec le langage de programmation Python.
Plus particulièrement l'utilisation d... |
C# | UTF-8 | 2,172 | 2.6875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MappingDB;
namespace DL
{
public class DatVenta
{
public int Insertar(VENTA P)
{
try
{
ContextoDB ct = new ContextoDB();
... |
Markdown | UTF-8 | 1,551 | 3.390625 | 3 | [
"MIT"
] | permissive | # Actions
## Action life cycle
Actions runs by State, when Adam FSM entering to this state. Every action have a runtime context. Actions can be interruped or not executed, if Adam FSM will change their state during other state execution. When State is leaving, all actions in this state call "release" callback to clea... |
Java | UTF-8 | 3,252 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package org.littleshoot.proxy;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.handler.codec.http.HttpChunk;
import org.jboss.netty.handler.codec.http.HttpRequ... |
Rust | UTF-8 | 2,089 | 3.28125 | 3 | [
"MIT"
] | permissive | use std::fs::{File,read_dir};
use std::io::{BufReader,BufRead};
use std::path::Path;
/// Return true if a file should regenerated
pub fn source_changed<P: AsRef<Path>>(source: P, dest: P) -> bool {
let file_mod = source.as_ref().metadata().unwrap().modified().unwrap();
if let Ok(metadata) = dest.as_ref().metad... |
Markdown | UTF-8 | 4,843 | 3.515625 | 4 | [] | no_license | ### 代理模式
***
> 代理模式就是由代理对象去帮核心对象完成一些前期和后期工作。
>
> 代理对象先调用自己的方法完成前期铺垫,然后调用核心对象的方法完成核心功能,然后再调用自己的方法完成后期扫尾
>
> 朝阳经纪公司可以看作一个代理对象,歌手周杰伦可以看作核心对象。经纪公司调用自己的方法去签合同,布置场地,接送歌手完成前期铺垫。然后调用周杰伦的方法唱歌完成核心功能,再调用自己的方法打扫场地完成后期扫尾
>
> 代理类和核心类最好是实现同一个接口,这样后期用起来比较方便。例如Thread类也实现了Runnable接口,也有run方法
#### 静态代理模式
> 静态代理模式表示代理类是我们自己写的。动态代理模式表示代... |
C | UTF-8 | 1,377 | 3.296875 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct Stack
{
int data;
struct Stack *next;
};
struct Stack *InitStack()
{
struct Stack *pHead;
pHead=(struct Stack*)malloc(sizeof(struct Stack));
pHead->next=NULL;
}
void Push(struct Stack *stack,int n,int e)
{
struct Stack *pTai=stack;
while(stack->nex... |
PHP | UTF-8 | 563 | 2.6875 | 3 | [] | no_license | <?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "UTS";
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (!$conn) {
die ("Connection failed: " . mysqli_connect_error());
}
$sql = "CREATE TABLE regis (
NAMA VARCHAR(200) NOT NULL,
PHONE INT(15),
EMAIL VARCH... |
C | UTF-8 | 2,888 | 3.28125 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "shell.h"
#include <string.h>
//buffer is the input string of characters
//args is the output array of arguments. It has already been created with argsSize slots.
//nargs as the number filled in that is passed back
void parseArgs(char* buffer, char**... |
Python | UTF-8 | 2,208 | 3.375 | 3 | [] | no_license | #*****PYTHON POLL*****
#import os module
import os
#import csv module
import csv
csvdata = os.path.join('..', 'Resources', 'election_data.csv')
Voter_ID = []
County = []
Candidate = []
with open(csvdata) as csvfile:
#csv reader read file based on column separated values
csvreader = csv.reader(csvfile, deli... |
SQL | UTF-8 | 537 | 3.296875 | 3 | [] | no_license | /*
Convert Unnormalized Data to Normalized Table
Example data;
TableA: StudentID, StudentName, Mark1, Mark2, Mark3
TableB is normalized with the following columns:
TableB: StudentID, StudentName, SubjectID, Marks
Use the following SQL in SQL Server:
*/
Insert into TableB (StudentID, StudentName, SubjectID, Mark... |
Go | UTF-8 | 679 | 3.390625 | 3 | [] | no_license | package cmd
import (
"log"
"sync"
"time"
)
func New() *Command {
return &Command{
wg: &sync.WaitGroup{},
quit: make(chan struct{}),
}
}
type Command struct {
wg *sync.WaitGroup
quit chan struct{}
}
func (c *Command) Open() error {
c.wg.Add(1)
go c.monitor()
return nil
}
func (c *Command) Close()... |
Shell | UTF-8 | 3,517 | 4.34375 | 4 | [] | no_license | #!/bin/sh
# Script to sanitize the input files of password dumps, and to send it to a logstash instance running on localhost:3515
#
# Run: ./sanitizePasswordDump.sh $inputfile $DumpName
#
# Inputfile is expected to contain per line: username:password
# Exports to logstash in the form of: DumpName EmailAddress Passowrd ... |
C++ | UTF-8 | 195 | 2.640625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
cout<<"Intituto Tecnologico Superior de los Rios"<<endl;
cout<<"Mi nombre es: Eder Juarez Montuy" <<endl;
cout<<"I am programmer" <<endl;
} |
Markdown | UTF-8 | 877 | 2.796875 | 3 | [] | no_license | Events
======
Java Listener framework
More detailed description will be ready soon
import static ru.vmsoftware.events.Events.*;
emit(this, KeyboardEvent.KEY_DOWN, keyCode);
Registrars
Emitters
Emitter is a holder of real emitter instance and allow to simplify event emitting,
especially when emitting from inner ... |
Python | UTF-8 | 253 | 2.78125 | 3 | [] | no_license | def ru (numero,fila):
"""
>>> ru(5,[1,2,3,4,5])
'135-24'
"""
alunos = ""
stas = ""
for elem in fila:
if elem%2!=0:
alunos = alunos + str(elem)
else:
stas = stas + str(elem)
return alunos + "-" + stas
import pydojo
pydojo.testmod()
|
JavaScript | UTF-8 | 261 | 3.453125 | 3 | [] | no_license | /**
* @author goggio
*/
//exercise02
function fibonacci (n) {
fibonacci[0] = 0;
fibonacci[1] = 1;
if (!(n in fibonacci)) {
fibonacci[n] = fibonacci(n - 1) + fibonacci(n - 2);
}
return fibonacci[n];
}
//esempio con n=4
console.log(fibonacci(4));
|
Markdown | UTF-8 | 13,283 | 2.609375 | 3 | [] | no_license | # INDIGO DataCloud Tutorial: testing Ophidia for an astronomical image calibration task
Dear User,
in order to test Ophidia for the reduction of astronomical images you are kindly requested to follow
the procedure listed below. Before you start you should have already registered a new OphidiaLab
account and have recei... |
Python | UTF-8 | 2,261 | 3.375 | 3 | [] | no_license | '''
This module includes some commonly used algorithms.
Created on Oct 17, 2013
@author: zhil2
'''
import math
def subsetSumToX(dictCost,targetSum):
'''
Return a subset in dictCost that sum to targetSum.
Example:
>>> subsetSumToX({'x':3,'y':1,'z':5,'w':8},13)
['w', 'z']
>>> subsetSumToX... |
Go | UTF-8 | 2,403 | 3.4375 | 3 | [] | no_license | package server
import (
"net"
"strings"
)
type User struct {
Name string
Addr string
C chan string
conn net.Conn
server *Server
}
// 创建一个User的API
func NewUser(conn net.Conn, server *Server) *User {
userAddr := conn.RemoteAddr().String()
user := &User{
Name: userAddr,
Addr: userAddr,
C:... |
C# | UTF-8 | 538 | 2.875 | 3 | [] | no_license | using System;
using Xunit;
using InsertQuery;
namespace InsertQueryTest
{
public class QueryTest
{
[Fact]
public void Simple()
{
var expect = "INSERT Foo SET (A, B) VALUES (@A, @B)";
var actual = Query.Construct(new Foo());
Assert.Equal(... |
C++ | UTF-8 | 808 | 2.84375 | 3 | [] | no_license | #ifndef _BASE64_H_
#define _BASE64_H_
#include <string>
/**
* @brief Helpers namespace aggregates functions that are not part of core functionalities but are involved in some
* code procedure.
*
*/
namespace Helpers {
/**
* @brief Base64 encoder and decoder.
*
*/
class Base64 {
p... |
Python | UTF-8 | 2,811 | 2.828125 | 3 | [] | no_license | import gzip
import math
import pickle
from pathlib import Path
import numpy as numpy
import requests
import torch
from matplotlib import pyplot
from tqdm import tqdm
# mnist is a dataset of black-white img of digits
data_path = Path('data')
path = data_path / 'mnist'
path.mkdir(parents=True, exist_ok=True)
url = "... |
Java | UTF-8 | 375 | 3.28125 | 3 | [] | no_license | package com.d4.InnerClasses;
class Test
{
public void calc()
{
class Add
{
int sum(int n1,int n2)
{
return n1+n2;
}
}
Add o=new Add();
System.out.println(o.sum(1, 2));
System.out.println(o.sum(11, 22));
}
}
class MLICDemo {
public static void main(String[] args) {
// TODO Auto-generat... |
C++ | UTF-8 | 5,632 | 2.921875 | 3 | [] | no_license | // ---------------------------------------------------------------------------
// This shows a simple application that uses an lp3::input::Controller to
// move a face around the screen. It also shows all device keys that being
// pressed.
// ---------------------------------------------------------------------------
#... |
Python | UTF-8 | 785 | 2.8125 | 3 | [] | no_license | import unittest
import os
import sys
lib_path = os.path.abspath('../src')
sys.path.append(lib_path)
from mapredoopy import mappy
def square(x):
return x*x
class TestSumOfSquares(unittest.TestCase):
def test_wordcount_p1(self):
seq = range(518)
m = reduce(lambda x,y: x+y, mappy(square, seq, 1))
r = r... |
C++ | UTF-8 | 1,318 | 3.265625 | 3 | [] | no_license | #include <iostream>
using namespace std;
bool store[1000][1000];
int main (void)
{
unsigned int n, m, r1, c1, r, c, testcase;
cin >> testcase;
while (testcase--)
{
memset(store, false, sizeof(store));
cin >> n >> m;
cin >> r1 >> c1;
cin >> r >> c;
r1--; c1--;
... |
Markdown | UTF-8 | 3,605 | 2.78125 | 3 | [] | no_license | #### **Title**
Add `incubate_before` and `temperature` to spectrophotometry instructions
#### **Authorship**
Peter Lee <peter@transcriptic.com>
Ross Trundy <ross@transcriptic.com>
#### **Motivation**
Addition of `incubate_before` and `temperature` parameters to spectrophotometry instructions allow for the possi... |
TypeScript | UTF-8 | 2,174 | 2.671875 | 3 | [
"MIT"
] | permissive | import { extendMethod, extension } from './utils'
export default extension('canvas.to-data-url-promise', (fabric) => {
/**
* Extend object.
*/
fabric.util.object.extend(fabric.Object.prototype, {
loadingPromise: null,
})
/**
* Extend image.
*/
fabric.util.object.extend(fabric.Image.prototype... |
Java | UTF-8 | 4,656 | 2.71875 | 3 | [] | no_license | package agent.aiwolf.kajiClient.reinforcementLearning;
import java.util.Map.Entry;
import org.aiwolf.common.data.Agent;
import org.aiwolf.common.data.Role;
import agent.aiwolf.kajiClient.lib.EnemyCase;
import agent.aiwolf.kajiClient.lib.Pattern;
/**
* Patternを抽象化したもの.Agentが違っていても,状態として同じならば同じものとして捉える
* @author k... |
Java | UTF-8 | 1,758 | 4.21875 | 4 | [] | no_license | /**
* This program shifts all characters within a string incrementally depending on the user's input.
* Authors: Sarah Peng
* Created: May 18th, 2019
*/
//Imports scanner.
import java.util.Scanner;
//Encrypts the user's message by shifting all the characters by a certain amount based on the input.
public class Co... |
TypeScript | UTF-8 | 302 | 2.5625 | 3 | [
"MIT"
] | permissive | module BP3D.Items {
/** Meta data for items. */
export interface Metadata {
/** Name of the item. */
itemName?: string;
/** Type of the item. */
itemType?: number;
/** Url of the model. */
modelUrl?: string;
/** Resizeable or not */
resizable?: boolean;
}
} |
PHP | UTF-8 | 2,120 | 2.953125 | 3 | [] | no_license | <?php
///////////////////////////////////////////////
// Semesterproject - ECIN //
// Fachbereich Medien FH-Kiel - 4. Semester //
// Beschreibung : Footer //
// Ersteller : Sven Krumbeck //
// Stand : 22.05.19 //
// Version : 1.0 ... |
C++ | UTF-8 | 1,635 | 3.046875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
using namespace std;
string justification(vector<string> s, int w){
int num = 0;
for(int i = 0; i < s.size(); ++i) num += s[i].size();
int remain = w - num;
int even;
if(s.size() > 1){
even = remain / (s.size()-1);
remain = remai... |
C | UTF-8 | 676 | 3.375 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int ispalindrome(long int num)
{
long long int x=num, num1=0;
int r;
while(x!=0)
{
r=x%10;
num1=num1*10+r;
x=x/10;
}
if(num1==num)
return 1;
else return 0;
}
int findbinary(long long int newnum )
{
int arr1[1000],i=0,j,flag=1,x;
while(newnum>0)
{
j=newnum%2;
arr1... |
Markdown | UTF-8 | 886 | 2.75 | 3 | [] | no_license | ### Schedule
If there are the backup jobs scheduled to run, they are listed here.
Select **+**, then select the type and time to add a backup schedule.
Select >**Edit** or **Delete** to edit or delete a backup schedule.
- **Delta Run** is an incremental backup th... |
Markdown | UTF-8 | 593 | 2.875 | 3 | [
"MIT"
] | permissive | # Tor IP Checker
Checks if given IP is coming from Tor (exit) node.
## Installation
The best way to install Tor IP Checker is using [Composer](http://getcomposer.org/):
```sh
$ composer require licvido/tor-ip-checker
```
## Usage
```php
// prepare required list
$exitNodeList = new ExitNodeList;
$fullNodeList... |
C++ | UTF-8 | 4,928 | 3.65625 | 4 | [] | no_license | #include "pch.h"
#include <iostream>
using namespace std;
void printBoard(char board[9]) {
std::cout << " " << board[0] << " | " << board[1] << " | " << board[2] << " \n";
std::cout << " --|---|--\n";
std::cout << " " << board[3] << " | " << board[4] << " | " << board[5] << " \n";
std::cout << " --|--... |
Markdown | UTF-8 | 695 | 2.671875 | 3 | [] | no_license | ## C5 <img src="../images/empty-star.png" width="23px"/>
**Applying Design Principles**<br/>
Acts as the technical design authority for multiple teams <b>within a domain</b>, ensuring the appropriateness, quality and suitability of complex designs.
**Reusability**<br/>
Ensures that their team designs solutions contai... |
C++ | UTF-8 | 4,484 | 2.546875 | 3 | [] | no_license | #include "../include/Brick.h"
#include "SDL2/SDL.h"
#include "../include/InitUtils.hpp"
#include "../include/CustomEventUtils.hpp"
#include "../include/GlobalConstants.h"
#include <SDL2/SDL_mixer.h>
Brick::Brick() {
this->value = 20;
this->sound = NULL;
this->destroyed = false;
this->textureWithPosition... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.