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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 1,183 | 2.921875 | 3 | [
"MIT"
] | permissive | using Mike.Utilities.Desktop;
namespace Model.Entidades
{
public class Categoria
{
private int _id;
public int ID
{
get { return _id; }
set
{
if (int.MaxValue == value)
{
MyErro.MyCustomExceptio... |
Python | UTF-8 | 805 | 2.53125 | 3 | [
"MIT"
] | permissive | import os.path
import sys
from .loader import Loader, I18nFileLoadError
class PythonLoader(Loader):
"""class to load python files"""
def __init__(self):
super(PythonLoader, self).__init__()
def load_file(self, filename):
path, name = os.path.split(filename)
module_name, ext = os.... |
Java | UTF-8 | 580 | 1.765625 | 2 | [] | no_license | package com.idream.commons.lib.dto.activity;
import com.idream.commons.lib.dto.PagesParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* @Description :
* @Created by xiaogang on 2018/5/2.
*/
@ApiModel(value = "动态ID参数")
pu... |
Shell | UTF-8 | 1,968 | 4 | 4 | [
"MIT"
] | permissive | #!/bin/bash
set -e
ROOTDIR=`dirname "$0"`
ROOTDIR=`cd "$ROOTDIR/.." && pwd`
source "$ROOTDIR/shared/lib/library.sh"
INPUT_DIR=
ARCHITECTURE=
OUTPUT_DIR=
function usage()
{
echo "Usage: ./package [OPTIONS]"
echo "Package built Passenger binaries."
echo
echo "Required options:"
echo " -i DIR The output direct... |
PHP | UTF-8 | 4,092 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
/**
* Generate image thumbnail URL
*
* @param string $imagePath
* @param int $width
* @param int $height
* @param bool $zoom_crop
* @param bool $upsize
* @return string Thumbnail URL
* @throws Exception if image dimensions are missing
*/
function th... |
Markdown | UTF-8 | 4,201 | 3.40625 | 3 | [
"MIT"
] | permissive | ---
categories:
- golang
tags:
- golang,从零开始golang
keywords: 知识铺
date: 2019-10-20T22:37:27+08:00
title: golang入门圣经 ch11- 11.2.2. 测试一个命令
author: 知识铺
weight: -1
---
### 11.2.2. 测试一个命令
对于测试包`go test`是一个有用的工具,但是稍加努力我们也可以用它来测试可执行程序。如果一个包的名字是 main,那么在构建时会生成一个可执行程序,不过main包可以作为一个包被测试器代码导入。
让我们为2.3.2节的echo程... |
PHP | UTF-8 | 1,604 | 2.640625 | 3 | [] | no_license | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateActivitiesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activities', function(Blueprint $table)
{
$table->string('id', ... |
Java | UTF-8 | 223 | 2.140625 | 2 | [] | no_license | package feuchtwanger.weather;
import java.io.IOException;
public class WeatherMain {
public static void main(String[] args) throws IOException{
WeatherJFrame frame = new WeatherJFrame();
frame.setVisible(true);
}
}
|
Java | UTF-8 | 802 | 1.703125 | 2 | [] | no_license | package org.c2psi.gpointvente.services.facture.factureappro;
import org.c2psi.gpointvente.entities.facture.factureAppro.Factureappro;
import org.c2psi.gpointvente.entities.facture.factureAppro.Factureapproespece;
import org.c2psi.gpointvente.entities.produit.Arrivageparespece;
import java.util.Optional;
public inter... |
Java | UTF-8 | 266 | 1.539063 | 2 | [] | no_license | package com.tmt.document.tb;
import com.sg.business.commons.dataset.AbstractTableDataSetFactory;
public class ProductProposalSet extends AbstractTableDataSetFactory {
@Override
protected String getDataEditorFieldName() {
return "product";
}
}
|
Python | UTF-8 | 586 | 2.890625 | 3 | [
"MIT"
] | permissive | from domHttpx.colors import Color
def tab():
print('\n')
def info(text):
print('[' + Color.CBLUE2 + 'INFO' + Color.ENDC + '] ' + text)
def success(text):
print('\n[' + Color.CGREEN2 + 'SUCCESS' + Color.ENDC + '] ' + text)
def error(text):
print('[' + Color.CRED2 + 'ERROR' + Color.ENDC + '] ' + text... |
Markdown | UTF-8 | 2,867 | 2.828125 | 3 | [
"MIT"
] | permissive | # admob_banner_stabilizer
A package to use banner ads in firebase_admob package easily.

## Features
### Banner ads appear in the same position as the Widget
The build method of AdmobBannerW... |
Python | UTF-8 | 134 | 2.640625 | 3 | [] | no_license | l=[1,2,2,6,6,6,6,7,10]
a=l.count(6)
print(a)
print(0.25*len(l))
for i in l:
if (l.count(i)>.25*len(l)):
print(i)
break |
C++ | UTF-8 | 1,422 | 2.78125 | 3 | [
"BSL-1.0"
] | permissive | // Author(s): Wieger Wesselink
// Copyright: see the accompanying file COPYING or copy at
// https://svn.win.tue.nl/trac/MCRL2/browser/trunk/COPYING
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
/// \file... |
JavaScript | UTF-8 | 2,751 | 3.09375 | 3 | [] | no_license | // TODO: Paste the Firebase initialization code first
// Initialize Firebase
var config = {
apiKey: "AIzaSyAvqFB4q2j7ZektW6_wvSk_4c2zm3odccc",
authDomain: "fir-project-7fa52.firebaseapp.com",
databaseURL: "https://fir-project-7fa52.firebaseio.com",
storageBucket: "",
};
firebase.initializeApp(config);
// TODO: Yo... |
JavaScript | UTF-8 | 1,269 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | export function Readme({ asyncapi, params }) {
return `# ${asyncapi.info().title()}
${asyncapi.info().description()}
## Install Maven
For instructions on installing maven for your operating system, please see the [Apache Maven site](https://maven.apache.org/install.html).
## Running the Publisher/Subscriber templa... |
C# | UTF-8 | 3,796 | 2.546875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
namespace OnixLibrary.CustomControls
{
public partial class FlatOnix... |
C# | UTF-8 | 660 | 2.734375 | 3 | [] | no_license | using System;
using System.Globalization;
using Xamarin.Forms;
namespace TodoList.Converters
{
public class StatusToSymbol : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var isDone = (bool) value;
var isD... |
C# | UTF-8 | 1,715 | 2.703125 | 3 | [
"MIT"
] | permissive | using System;
using System.Windows.Input;
namespace PremiseWebClient {
public class PremiseCommand : ICommand {
private string _propertyName;
private dynamic _holdingObject;
public PremiseCommand(PremiseObject holdingObject, string propertyName) {
_holdingObject = hol... |
JavaScript | UTF-8 | 1,606 | 2.546875 | 3 | [] | no_license | import Api from 'services/api';
const initialState = {
loading: false,
error: false,
result: {
categories: [],
products: [],
},
};
const actionTypes = {
FETCH_SEARCH_PENDING: 'app/search/FETCH_SEARCH_PENDING',
FETCH_SEARCH_SUCCESS: 'app/search/FETCH_SEARCH_SUCCESS',
FETCH_SEARCH_ERROR: 'app/sear... |
C++ | UTF-8 | 606 | 2.984375 | 3 | [
"Unlicense"
] | permissive | //
//
//
/// @brief A private member function to set zero all the
/// current rank's length and the @c data pointer to @c
/// NULL. Its usage is highly recommended just after any
/// delete or move operation of the data members.
//
/// @return None.
//
inline void clear_internals()
{
#if CURRENT_RANK == 1
{
data = ... |
C++ | UTF-8 | 1,772 | 2.984375 | 3 | [] | no_license | // ------------------------------------------------ ROBUS KIDSY -------------------------------------------------
// EJEMPLO DE USO DEL NEOPIXEL
// Este ejemplo es de uso libre y esta pensado para dar una introduccion al hardware del robot Robus Kidsy.
// Autor: Fabian Alfonso Flores
// Empresa: Proyectil Mx
// Fecha: ... |
PHP | UTF-8 | 2,252 | 2.640625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
use App\Utils\Utils;
use Illuminate\Support\Facades\Hash;
use Validator;
class UserController extends Controller
{
public function register(Request $request)
{
$validator = Validator::make($request->all(), [
... |
Python | UTF-8 | 422 | 3.859375 | 4 | [] | no_license | #05-019.py
class SimpleA:
value = 0
def add (self, a, b):
return a+b
def sub (self, a, b):
return a-b
s = SimpleA()
print(s.add(20, 10))
print(s.sub(20, 10))
fadd = lambda self, a, b : a+b
fsub = lambda self, a, b : a-b
members = {'value' : 0, 'add' : fadd, 'sub' : fsub }
... |
C | UTF-8 | 461 | 3.1875 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int abs(int n)
{
if(n<0)
return -n;
return n;
}
int main()
{
int n,i,max=0,j,a;
scanf("%d",&n);
int ara[n];
for(i=0;i<n;i++)
{
scanf("%d",&ara[i]);
}
for(i=0;i<n-1;i++)
{
a=0;
for(j=i;j<n-1;j++)
{
... |
C++ | UTF-8 | 1,003 | 2.796875 | 3 | [] | no_license | #include "SerialJson.h"
void SerialJson::init(int bps){
Serial.begin(bps);
}
String SerialJson::getJson(){
return _incomingMessage;
}
bool SerialJson::isThereNewJson(){
bool result = false;
_incomingMessage = "";
_bracketCount = 0;
if (Serial.available() > 0) {
unsigned long previousMillis = millis();
do... |
C# | UTF-8 | 1,977 | 2.921875 | 3 | [] | no_license | namespace Faktura.GUI
{
/// <summary>
/// This is class for managing all the windows in the application.
/// </summary>
class WindowManager
{
// Window's fields are static because the general in concern is
// that there can be only one instance of each window class.
// Upon ... |
Python | UTF-8 | 969 | 2.78125 | 3 | [] | no_license | from datetime import timedelta
class abstractTime:
def __init__(self,item):
self.item=item
class newTime(abstractTime):
def time(self):
objc={}
objc['hours']=houer(self.item)
objc['minutes'] = minutes(self.item)
objc['weeks'] = weeks(self.item)
objc['days'] = week... |
Java | UTF-8 | 171 | 1.75 | 2 | [] | no_license | package cz.system.police.services;
import cz.system.police.data.RadarData;
public interface ReceiveDataService {
Long checkAndStoreDataFromRadar(RadarData data);
}
|
Markdown | UTF-8 | 545 | 3.03125 | 3 | [
"MIT"
] | permissive | # ArrayUtility.Clone<T> method
Clones the specified array.
```csharp
public static T[] Clone<T>(T[] array)
```
| parameter | description |
| --- | --- |
| array | The array to clone. |
## Return Value
A clone of the specified array.
## Remarks
This method is merely useful in avoiding the cast that is other... |
Markdown | UTF-8 | 501 | 2.515625 | 3 | [] | no_license | ---
layout: post
status: publish
date: 2010-07-20 03:09:50+00:00
title: The creativity crisis (Newsweek) « Scott Berkun
link: http://www.scottberkun.com/blog/2010/the-creativity-crisis-newsweek/
type: aside
categories:
- creativity
- culture
- education
- scott berkun
---
Scott Berkun reflects on the American creativi... |
Markdown | UTF-8 | 22,968 | 2.609375 | 3 | [
"BSD-2-Clause",
"LGPL-3.0-only",
"LGPL-2.1-only",
"W3C",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
title: DocxConverter Attributes Conversion Spec
author: Vladimir Schneider
version: 1.0
date: '2019-11-15'
license: '[CC-BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/)'
...
---
# DocxConverter
## Form Controls
### Text
text, class name `.text`
attributes:
* `name` - name for the form field
* `def... |
C# | UTF-8 | 2,528 | 2.75 | 3 | [] | no_license | using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using NetCoreConfiguration.Models;
namespace NetCoreConfiguration.Pages
{
public class OptionsPatternModel : PageModel
{
private readonly IConfigurati... |
Java | UTF-8 | 1,089 | 2.171875 | 2 | [] | no_license | package com.roc.mapper;
import com.roc.pojo.PraiseOrDisagree;
/**
* @author Roc
* @version 1.0
* @date 2019/12/18 16:30
* @description 点赞(踩) mapper接口
*/
public interface PraiseOrDisagreeMapper {
/**
* 插入实体
* @param praiseOrDisagree 对象
* @return
*/
int insertPojo(PraiseOrDisagree prai... |
C# | UTF-8 | 1,300 | 2.609375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
[System.Serializable]
public class MappedListID : IDeepCopyable {
//TODO: make this a generic class for all IDs like ItemID, SkillID, PerkID, implement == operators
[ValueDropdown("DropdownValues"), Se... |
Java | UTF-8 | 1,435 | 1.648438 | 2 | [] | no_license | package net.simplifiedcoding.mvvmsampleapp.util;
import java.lang.System;
@kotlin.Metadata(mv = {1, 1, 16}, bv = {1, 0, 3}, k = 2, d1 = {"\u0000 \n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\n\u0010\u0000\u001... |
Java | UTF-8 | 4,078 | 2.21875 | 2 | [] | no_license | package jp.co.asahi.util;
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import jp.co.asahi.dao.db.OrderDetailDao... |
C++ | GB18030 | 1,396 | 3.453125 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
while (cin >> s) {
int S_length = s.length();
string new_S = "";
for (int i = 0; i < S_length;) {
int j = i + 1;
while (s[i] == s[j]) { //ҵȵǸj
j++;
}
if (j - i == 1) { // ظǰһֵ
... |
C++ | UTF-8 | 37,277 | 3 | 3 | [] | no_license | #include "Cube.h"
#include "UnitTest++.h"
#include <iostream>
/*
* This file contains unit tests for the turn function of the Cube class
* there are 18 tests (1 for each possible configuration of the turn)
* for a Cube 3x3x3. Later on more unittest may be added
* for the solve function of Cube and some other utility ... |
Python | UTF-8 | 350 | 3.125 | 3 | [] | no_license | N=int(input())
d= [[0]*N for _ in range (N)]
x,y,r =map(int,input().split())
a = 0
for i in range(0,N):
for j in range(0,N):
a=abs(x-1-i)+abs(y-1-j)
if a<=r :
d[i][j]=a
else:
d[i][j]=0
if i+1==x and j+1==y :
d[i][j]='x'
for i in range(0,N):
for j in range(0,N):
pri... |
C++ | UTF-8 | 2,809 | 3.4375 | 3 | [] | no_license | //
// Created by hqnddw on 2019/9/24.
//
#include <vector>
#include <stack>
using namespace std;
//双指针
class Solution1 {
public:
int trap(vector<int> &height) {
int left = 0;
int right = height.size() - 1;
int max_left = 0;
int max_right = 0;
int res = 0;
while (lef... |
Markdown | UTF-8 | 6,052 | 2.546875 | 3 | [
"OGL-Canada-2.0"
] | permissive | > [Go to French version](/fr/Règlements/Textes%20réglementaires/2010/81.md)
# Statistics Canada Census and Survey Related Term Employment Exclusion Approval Order
**SI/2010-81**
Enabling authorities:
- [PUBLIC SERVICE EMPLOYMENT ACT](/en/Acts/Statutes%20of%20Canada/2003/c.%2022,%20ss.%2012,%2013%20.md)
Da... |
C++ | UTF-8 | 3,274 | 3.328125 | 3 | [] | no_license | #include "stdafx.h"
#include "book.h"
Book::Book(int bookID,std::string title, std::string author, std::string genre, int numberOfPages, Date dateOfPublication, bool availability) : bookID(bookID), title(title), author(author), genre(genre),
numberOfPages(numberOfPages), dateOfPublication(dateOfPublication), ava... |
Shell | UTF-8 | 2,016 | 2.9375 | 3 | [] | no_license | #!/usr/bin/env zsh
function VmOpp(){
vmrun
}
function git_init_gitignore(){
echo "#----autogenerated gitignore----
.idea
*.iml
public/assets
.DS_Store
.ember.pid
node_modules/
bower_components/
/vendor/bundle
disabledServer/
/public/
#CocoaPods
Pods/
GpeneratedDocumentation/
Carthage.checkout/
/.bundle
#i... |
Java | UTF-8 | 424 | 2.640625 | 3 | [] | no_license | package com.buyalskaya.bookstorage.utility;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class DataParser {
private static final String REGEX_COMMA = ",";
public List<String> authorParser(String author) {
String[] authorsArray = author.split(REGEX... |
Java | UTF-8 | 9,003 | 2.21875 | 2 | [] | no_license | package com.example.rene.myarrow.misc;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Parcelable;
import... |
C# | UTF-8 | 3,785 | 2.59375 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using ReactiveValidation.Validators.PropertyValueTransformers;
namespace ReactiveValidation
{
/// <summary>
/// Builder which allow create validation rules for properties.
/// </summary>
/// <typeparam name="TObject">Valida... |
C++ | UTF-8 | 1,132 | 2.640625 | 3 | [] | no_license | #ifndef SPECIES_H
#define SPECIES_H
#include "player.h"
class Species
{
public:
Species(Genome *g);
bool isSameSpecies(const Genome &gen); // Is current genome in the same species as 'gen'
void calcAverageFitness(); // Average fitness (setter, not getter)
void sortGenomesByFitness();
... |
C++ | UTF-8 | 770 | 3.15625 | 3 | [] | no_license | /**
* @file bitByte.h
* @author Jan Wielgus (jan.wielgus12@gmail.com)
* @brief
* @date 2021-04-26
*
*/
#ifndef BITBYTE_H
#define BITBYTE_H
#include <IByteType.h>
class bitByte : public IByteType
{
union
{
bool bits[8];
uint8_t byte;
} data;
public:
bitByte()
{
}
bitByte(const bitByte& other)
... |
Java | UTF-8 | 5,829 | 3.921875 | 4 | [] | no_license | import java.io.*;
import java.util.*;
public class expressionEvaluator {
static String delimiters="+-*%()";
/* This method evaluates the given arithmetic expression and returns
* its Integer value. The method throws an Exception if the expression
* is malformed.*/
static Integer evaluate( S... |
C++ | UHC | 1,806 | 3.4375 | 3 | [] | no_license | // https://www.acmicpc.net/problem/1316
/*
ܾ ܾ ϴ ڿ ؼ, ڰ ؼ Ÿ 츸 Ѵ. , ccazzzzbb c, a, z, b ؼ Ÿ, kin k, i, n ؼ Ÿ ܾ, aabbbccb b Ÿ ܾ ƴϴ.
ܾ N Է ܾ ϴ α ۼϽÿ.
Է
ù° ٿ ܾ N ´. N 100 ۰ų ڿ̴. ° ٺ N ٿ ܾ ´. ܾ ĺ ҹڷθ Ǿְ ߺ , ̴ ִ 100̴.
ù° ٿ ܾ Ѵ.
*/
#include<iostream>
#include<vector>
#include<al... |
PHP | UTF-8 | 2,518 | 3.078125 | 3 | [] | no_license | <?php
namespace DevBoardLib\GithubCore\Commit;
use DevBoardLib\GithubCore\User\GithubUserId;
/**
* @todo: Reason this class exists
*/
class GithubCommitCommitter
{
/** @var string */
private $name;
/** @var string */
private $email;
/** @var GithubUserId */
private $githubUserId;
/** @v... |
Java | UTF-8 | 377 | 1.9375 | 2 | [
"Apache-2.0"
] | permissive | package org.singularitylab.infakt.client;
import org.singularitylab.infakt.client.model.Invoice;
import org.singularitylab.infakt.client.model.InvoiceLanguage;
import java.util.List;
/**
* @author Jakub Dzon
*/
public interface InvoiceClient {
List<Invoice> findAll();
Invoice create(Invoice invoice);
... |
Java | UTF-8 | 1,299 | 2.109375 | 2 | [] | no_license | package com.ruhul.study.controller;
import org.camunda.bpm.engine.ProcessEngine;
import org.camunda.bpm.engine.variable.Variables;
import org.camunda.bpm.model.dmn.instance.Variable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import or... |
JavaScript | UTF-8 | 598 | 4.09375 | 4 | [] | no_license | // Generators
// functions that can be paused resume cycle midway through executions
// allows us to create a special type of iterator, whose execution can
// be suspended and retained while keeping the context
// it contains one or more yield expressions
// it uses the function * syntax
function *gen() {
yield "... |
Java | UTF-8 | 177 | 1.875 | 2 | [] | no_license | package dao;
import model.Admin;;
public interface AdminDao {
//-------- 관리자 id 찾기
public Admin findByAdminId(Admin admin);
public String findId(String id);
}
|
PHP | UTF-8 | 9,516 | 2.859375 | 3 | [] | no_license | <?php
//namespace phpProject;
class Post
{
private $image;
private $image_text;
/**
* Get the value of image.
*/
public function getImage()
{
return $this->image;
}
/**
* Set the value of image.
*
* @return self
*/
public function setImage($image... |
Java | UTF-8 | 5,831 | 1.664063 | 2 | [] | no_license | package com.platform.top.xiaoyu.run.service.finance.controller.backstage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.platform.top.xiaoyu.run.service.api.auth.annotaions.ButtonDefine;
import com.platform.top.xiaoyu.run.service.api.auth.enums.InternalResource;
import com.platform.top.x... |
JavaScript | UTF-8 | 2,004 | 2.984375 | 3 | [] | no_license | export const ADD_DATA = 'LOAD_DATA';
export const SET_SORTING_FIELD = 'SET_SORTING_FIELD';
function requestApi(url) {
const promise = new Promise((resolve, reject)=>{
let xhr = new XMLHttpRequest();
xhr.open("GET", url);
xhr.onload = () => {
if (xhr.status == 200) {
resol... |
Java | UTF-8 | 13,920 | 1.945313 | 2 | [] | no_license | package com.ysmind.modules.form.model;
import java.util.Date;
import com.ysmind.modules.sys.model.BaseModel;
public class CreateProjectModel extends BaseModel{
private String serialNumber;//流水号
private String flowStatus;//表单状态,即流程状态,因为一个表单只允许发起一条流程
private String officeId; // 归属机构(分公司/办事处)
private String office... |
TypeScript | UTF-8 | 787 | 2.578125 | 3 | [] | no_license | import Knex from 'knex'
import { Acronym } from 'db/interfaces/acronyms'
import { ResponseError } from 'helpers/errors'
import { getRandomNonAdjacentItems } from './helpers'
type Params = {
db: Knex
count: number
}
async function getRandomAcronyms({ db, count }: Params): Promise<Acronym[]> {
const getAcronyms... |
Java | UTF-8 | 981 | 3.328125 | 3 | [] | no_license | package com.example;
public class Main {
private static void quicksort(int[] ar, int low, int high) {
if (low >= high)
return;
int pivot = ar[high];
int q = low;
for (int i = low; i < high; i++) {
if (ar[i] <= pivot) {
int temp = ar[q];
... |
Markdown | UTF-8 | 350 | 2.53125 | 3 | [] | no_license | ## About
h-rs is a Rust port of the [h](https://github.com/savetheinternet/h) program. It aims to be entirely compatible with the original [h](https://github.com/savetheinternet/h) program.
H is a small program which, upon execution, prints the lowercase letter `h` (ASCII character 104).
## Usage
1. `cargo build --re... |
Java | UTF-8 | 940 | 2.375 | 2 | [] | no_license | package edu.nefu.gdms.daoImpl;
import java.util.List;
import edu.nefu.gdms.dao.PaperDao;
import edu.nefu.gdms.domain.Grour;
import edu.nefu.gdms.domain.Paper;
import edu.nefu.gdms.support.GdmsHibernateDaoSupport;
public class PaperDaoHibernate extends GdmsHibernateDaoSupport implements PaperDao{
@Override
public ... |
Java | UTF-8 | 1,372 | 2.390625 | 2 | [] | no_license | package com.stackroute.apigateway.apiauthenticate;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.Jwts;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.Serializable;
@Component
public class JWTSecurityTokenUtil implements Serializable ... |
Java | UTF-8 | 844 | 1.953125 | 2 | [] | no_license | package com.example.demo;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.json.JsonTest;
import org.springframework.boot.test.json.JacksonTester;
import org.springframework... |
Markdown | UTF-8 | 1,808 | 3.09375 | 3 | [] | no_license | ---
layout: blog
title: "Error Simulation And API Testing"
author: "Vanessa"
description: "There are many tools for API testing out there, and although APItools is not specifically designed for testing, its flexible structure allows us to use it for that."
gh-author: vramosp
categories: blog
tags: middleware testing
--... |
Markdown | UTF-8 | 2,728 | 3.75 | 4 | [] | no_license | ---
draft: true
title: "Object Orientated Database (Static Schema)"
description: How classic object-oriented databases encode their data
date: 2018-02-19
tags:
- IPT
- Data-Structure
hide:
- navigation
---
# Object Orientated Database (Static Schema)
Since object-oriented databases are an evolution of Relationa... |
C | UTF-8 | 568 | 3.5625 | 4 | [] | no_license | #include<stdio.h>
#include <conio.h>
copy(int a[], int b[],int n,int i)
{
if(i<n)
{
b[i]=a[i];
copy(a,b,n,++i);
}
}
print(int a[],int n){
int i;
for(i=0; i<n; i++)
{
printf("%d ",a[i]);
}
}
int main()
{
int a[1000],b[1000],i,n;
printf("Enter size of the array... |
Go | UTF-8 | 1,424 | 2.875 | 3 | [] | no_license | package dataputter
import "testing"
func TestSetTicketStatus(t *testing.T) {
var err error
err = SetTicketStatus("ticketID", TicketStatus[TicketNew])
if err != nil {
t.Errorf("Expected no error, got %v\n", err)
}
status, err := GetTicketStatus("ticketID")
if err != nil {
t.Errorf("Expected no errors, got %... |
Markdown | UTF-8 | 3,359 | 2.984375 | 3 | [
"MIT"
] | permissive | linotify
========
A Lua binding for the Linux inotify library
Building
--------
To build `inotify.so`, simply type `make`.
Usage
-----
All of the constants are contained in the `inotify` table returned by
require. Constants are named after their counterparts in the C header
file (for example: `inotify.IN_ACCESS`).... |
Python | UTF-8 | 782 | 2.796875 | 3 | [] | no_license | import pylab
import pickle
import matplotlib.pyplot as plt
import numpy as np
data = pickle.load(open("enron.pkl", "r"))
salary = list()
bonus = list()
poi = list()
for ii in data.keys():
if data[ii]['total_stock_value'] == 'NaN' or data[ii]['total_payments'] == 'NaN':
continue
else:
salary.append(data[ii]... |
C# | UTF-8 | 2,749 | 2.515625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
using System.Text;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Tokens;
using OnlineCourse.Business.Model;
using OnlineCourse.Business.Model.Helpers;
using Online... |
C++ | UTF-8 | 7,538 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstring>
#include <sstream>
#include <string>
#include <thread>
#include "MemoryTrace.hh"
MemoryRequest::MemoryRequest(const int tid, const int size, const int bundle_kind,
const bool is_write, const uint64_t address,
... |
Python | UTF-8 | 251 | 4.9375 | 5 | [] | no_license | # Write a program to check whether a character is vowel or consonant
c = input("Enter a character: ")
if c.lower() in ["a", "e", "i", "o", "u"]:
print("The entered character is a vowel")
else:
print("The entered character is a consonant")
|
Java | UTF-8 | 4,121 | 2.34375 | 2 | [] | no_license | package com.diffpath.hackday;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.A... |
Python | UTF-8 | 641 | 2.84375 | 3 | [] | no_license | from sklearn.ensemble import RandomForestRegressor
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_digits
data, labels = load_digits(return_X_y=True)
model = RandomForestRegressor(random_state=1, max_depth=10)
# df=pd.get_dummies(df)
model.fit(data,labels)
features = data.columns... |
C# | UTF-8 | 10,020 | 2.5625 | 3 | [] | no_license | using System.Collections.ObjectModel;
namespace FalloutRPG.Constants
{
public static class Pages
{
#region HELP GROUP
#region Index Help Pages
public static readonly ReadOnlyCollection<string> HELP_PAGE1_TITLES = new ReadOnlyCollection<string>(new []
{
"$help genera... |
Ruby | UTF-8 | 3,911 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/ruby
# Used to prepare a directory for commit to Subversion. This is necessary for certain file types on Mac OS X because what appear to be files in the Finder
# are actually directories (Mac uses the term "bundle" for this concept). It is useless to put the .svn folder inside such a directory, because it w... |
JavaScript | UTF-8 | 653 | 3.265625 | 3 | [] | no_license | function getinput(){
var pa = document.getElementById('myinput1').value;
var ia = document.getElementById('myinput2').value;
var y = document.getElementById('myinput3').value;
calculate(pa,ia,y);
}
function calculate(pa,ia,y){
var r = ia/12/100;
var a = Math.pow(r+1,y*12);
var b = a/(a-1)
var res = ... |
Ruby | UTF-8 | 929 | 3.640625 | 4 | [] | no_license |
require_relative './instacart'
items = {
"bread" => 200,
"chicken" => 300,
"spinach" => 150,
"fish" => 600
}
purchase = ""
cart = {}
puts "--------------------"
puts "Welcome to Instacart"
puts "--------------------"
puts "In our store today:"
items.each{|i... |
Markdown | UTF-8 | 2,579 | 2.515625 | 3 | [] | no_license | # sqlview -- A simple browser-based viewer for seeing output of SQL queries
sqlview is a tool for running SQL queries on a remote database using an ODBC (or similar) style connection mechanism and displaying the results in a web browser.
I wrote this because I prefer to edit my SQL code in my editor (SublimeText), an... |
Markdown | UTF-8 | 826 | 2.5625 | 3 | [] | no_license | # c-projects
<h2>Personal projects to practice fundamentals and learn C</h2>
<h5>/mini-db</h5>
This project is a small database like SQLite. I'm following a tutorial found [here](https://cstack.github.io/db_tutorial/).
It is divided into the following sections:
* Part 1 - Introduction and Setting up the REPL
* Par... |
Java | UTF-8 | 3,408 | 1.789063 | 2 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Generated by data binding compiler. Do not edit!
package com.ajdi.yassin.popularmovies.databinding;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
impor... |
Java | UTF-8 | 622 | 2.59375 | 3 | [
"CC-PDDC",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package org.mapdb.impl.binaryserializer;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.mapdb.ValueSerializer;
public class LongValueSerializer implements ValueSerializer<Long>
{
@Override
public void serialize(DataOutput out, Long value) throws IOException
{
... |
C++ | UTF-8 | 5,873 | 3.75 | 4 | [] | no_license | #include "User.h"
#include "HighScoreManager.h"
#include <string>
#include <cstring>
#include <iostream>
#include <fstream>
User User::login(string userName){
User currentUser;
bool existingUser = CheckIfUserExists(userName);
if (existingUser == true) {
string line;
size_t pos = 0;
string delimiter = ",";
b... |
Java | UTF-8 | 1,266 | 2.5625 | 3 | [] | no_license | package com.example.shubhampandey.parceldrop.util;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
/**
* Created by SHUBHAM PANDEY on 3/6/2016.
*/
public class FetchPickupRates {
public static JSONObject getJSO... |
JavaScript | UTF-8 | 3,041 | 4.34375 | 4 | [] | no_license | /*
In the exercise below, write your own code where indicated
to achieve the desired result.
Make sure to run the file with node in your command line.
*/
//-------------------
// Part 1: Syntax and Naming Conventions
//-------------------
// For each prompt:
// Write a class skeleton
// Create 2 object instances... |
Java | UTF-8 | 2,324 | 2.59375 | 3 | [] | no_license | package com.dh.project.Face_Recognition.gui;
import com.dh.project.Face_Recognition.service.MyVideoCapture;
import org.opencv.core.Core;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
public class MyFrame extends JFrame {
private static fina... |
Java | UTF-8 | 795 | 2.5 | 2 | [] | no_license | package com.vinodshivaram.practice.springboot.model;
import sun.security.util.Password;
public class Authentication {
private String userName;
private Password password;
private String token;
public Authentication(String userName, Password password) {
this.userName = userName;
this.pa... |
JavaScript | UTF-8 | 865 | 2.515625 | 3 | [] | no_license | import React, { Component } from "react";
import { connect } from "react-redux";
import { addTodo } from "../action";
class AddTodo extends Component {
render() {
return (
<div>
<form
onSubmit={e => {
e.preventDefault();
this.addTodoClick(this.input);
}}
... |
Java | UTF-8 | 2,016 | 2.484375 | 2 | [] | no_license | package pages;
import io.appium.java_client.MobileElement;
import io.appium.java_client.pagefactory.AndroidFindBy;
import io.appium.java_client.pagefactory.WithTimeout;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.Assert;
import java.time.temporal.ChronoUnit;
... |
JavaScript | UTF-8 | 1,492 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | var Jasmine = require('jasmine')
var jasmine = new Jasmine()
jasmine.loadConfig({
spec_dir: 'test',
spec_files: ['test.js'],
random: false,
seed: null,
stopSpecOnExpectationFailure: false,
})
class MyConsoleReporter {
constructor() {
this.suiteSeq = 1
}
_indentPrint(str) {
str
.trim()
... |
Java | UTF-8 | 1,288 | 4.21875 | 4 | [] | no_license | import java.util.*;
public class Question9
{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.println(legal(str, 0, str.length() - 1));
}
public static boolean legal(String str, int index, int n)
{
if... |
JavaScript | UTF-8 | 3,707 | 2.59375 | 3 | [] | no_license | document.addEventListener("deviceready", function () { init(myPath); }, false);
var myPath = 'file:///';
var musicData = [];
var current;
function init(myPath) {
window.resolveLocalFileSystemURL(myPath,
function (dir) {
var reader = dir.createReader();
reader.rea... |
JavaScript | UTF-8 | 1,131 | 2.765625 | 3 | [] | no_license | export function ColourSwatches({ setCurrentColour }) {
const colourSwatches = [
"hsl(352, 100%, 65%)",
"hsl(41, 100%, 65%)",
"hsl(193, 72%, 63%)",
"hsl(0, 0%, 100%)",
"hsl(0, 0%, 50%)",
"hsl(0, 0%, 0%)",
];
return (
<ul className="colour-swatches">
{colourSwatches.map((swatch, i... |
Markdown | UTF-8 | 584 | 2.6875 | 3 | [] | no_license |
Before compiling , please make sure you have the OpenSSL dev package installed .</br>
Compile using : </br>
<b> gcc -Wall -g -o shell shell.c -lssl -lcrypto </b></br>
You will probably want to link statically against the library to avoid dependencies issues on the target .
You can either use ncat (http://edoc... |
Markdown | UTF-8 | 6,571 | 3.28125 | 3 | [] | no_license | ---
layout: post
title: How I Got Into Computers University Edition
date: 2020-08-17T00:00:00.0000000-05:00
---
This is the second post in a series about how I got into computers and how my career has unfolded. [Part 1 was pre-university](https://blog.lhotka.net/2020/08/15/How-I-Got-Into-Computers).
I went to two univ... |
Java | UTF-8 | 733 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package com.ftfl.icare.modelclass;
public class NoteModel {
Integer mNoteId = 0;
String mDate = null;
String mNote = null;
public NoteModel() {
}
public NoteModel(int eNoteId, String eDate, String eNote) {
this.mNoteId = eNoteId;
this.mDate = eDate;
this.mNote = eNote;
}
public NoteModel(String eDate,... |
C++ | UTF-8 | 6,635 | 2.671875 | 3 | [] | no_license | #include "komi.h"
#include <QString>
#include <QFile>
#include <QTextStream>
QFile mainSize("C:/Users/79194/Documents/test/MatrixSize.txt");
QTextStream MainstreamSize(&mainSize);
QFile mainMatrix("C:/Users/79194/Documents/test/Matrix.txt");
QTextStream MainstreamMatrix(&mainMatrix);
Komi::Komi()
{
}
void Komi::Se... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.