language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,208 | 3.203125 | 3 | [] | no_license | package Citizens;
import Citizens.Model.Animal;
import com.opencsv.CSVReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class AnimalReader {
private String fileLocation = "C:\\Users\\Użytkownik\\Desktop\... |
C | UTF-8 | 464 | 3.625 | 4 | [] | no_license | #include<stdio.h>
void strong_number()
{
int num,i,p,r,sum=0,save_num;
printf("\n Enter a number");
scanf("%d",&num);
save_num=num;
while(num)
{
i=1,p=1;
r=num%10;
while(i<=r)
{
p=p*i;
i++;
} //while
sum=sum+p;
num=num/10;
} /... |
C++ | UTF-8 | 7,639 | 2.859375 | 3 | [] | no_license | #include "PPintrin.h"
#include <stdlib.h>
#include <math.h>
// implementation of absSerial(), but it is vectorized using PP intrinsics
void absVector(float *values, float *output, int N)
{
__pp_vec_float x;
__pp_vec_float result;
__pp_vec_float zero = _pp_vset_float(0.f);
__pp_mask maskAll, maskIsNegative, mas... |
Markdown | UTF-8 | 5,732 | 3.6875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | ## Objectives
1. Understand the concept of AR Lifecycle methods
2. Use `before_save`, `before_create`, and `before_validation`
3. Understand when to use `before_validation` vs. `before_save`
## Callbacks
Now that you are integrating ActiveRecord into Rails, we must first have a quick discussion about how devel... |
Java | UTF-8 | 1,878 | 2.46875 | 2 | [] | no_license | package Control;
import Model.InfoConfig;
import NewGUI.Preferences;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFrame;
i... |
C++ | UTF-8 | 837 | 3.546875 | 4 | [] | no_license | #include <Servo.h>
Servo myservo; // create an object called myservo using the Servo library
int pos = 0; // declare a variable for storing the position of the servo arm
void setup()
{
myservo.attach(9); // attach the object myservo to the servo on pin 9
}
void loop()
{
for(pos = 0; pos < 180; pos ... |
Java | UTF-8 | 1,425 | 2.484375 | 2 | [] | no_license | package com.example.bootstrap;
import com.example.domain.Product;
import com.example.repositories.ProductRepository;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRef... |
Java | UTF-8 | 11,305 | 2.109375 | 2 | [] | no_license | package com.audio.libary.app;
import android.content.ContentResolver;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.preference.PreferenceManager;
import com.audio.libary.encoders.Factory;
import org.json.JSONException;
import... |
Markdown | UTF-8 | 10,024 | 2.65625 | 3 | [
"MIT"
] | permissive |
[上一章](https://github.com/xiaominghe2014/spider_book/blob/master/book/知北游/第82章.md) [下一章](https://github.com/xiaominghe2014/spider_book/blob/master/book/知北游/第84章.md) [返回目录](https://github.com/xiaominghe2014/spider_book/blob/master/book/知北游/README.md)
<br /> 第五册 第三章(上)让我欢喜让我忧... |
JavaScript | UTF-8 | 434 | 2.859375 | 3 | [] | no_license | function loadspinner() {
var element = document.querySelector(".main");
const container = document.createElement("div");
const tag = document.createElement("div");
container.classList.add("loader-container");
tag.classList.add("loader");
element.appendChild(container);
container.appendChild(... |
Java | UTF-8 | 891 | 3.53125 | 4 | [] | no_license | package com.sda.patterns.creational.factory;
import com.sda.patterns.creational.factory.factory.RoadLogistics;
import com.sda.patterns.creational.factory.factory.SeaLogistics;
import java.util.Scanner;
public class DemoFactoryPattern {
public static void main(String[] args) {
// create the right facto... |
Rust | UTF-8 | 2,230 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | use super::{MessageQueue, MessageQueueConfig, ReplicationEvent};
use log::{error, info};
use std::{
process,
sync::{mpsc, Arc},
};
use tokio::{runtime::Handle, sync::oneshot};
use utils::messaging_system::publisher::CommonPublisher;
pub async fn replicate_db_events(
config: MessageQueueConfig,
recv: mp... |
TypeScript | UTF-8 | 2,838 | 2.625 | 3 | [] | no_license | //-----------------------------------------------------------------------------
// src/models/__tests__/user.dao.tes.ts
//-----------------------------------------------------------------------------
import '../../config/config'
import { ObjectId } from 'bson'
import MongoDAO from '../../config/mo... |
Java | UTF-8 | 1,052 | 1.984375 | 2 | [] | no_license | package TAL.Repository;
import TAL.model.Locataire;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import java.util.ArrayList;
public interface RequetesLocataire extends JpaRepository<Locatair... |
C++ | UTF-8 | 1,525 | 2.734375 | 3 | [] | no_license | // LCD, KEYPAD, SERVO SMART SAFE WITH RASPBERRY PI CAM
#include <LiquidCrystal.h> //include LCD library (standard library)
#include <Servo.h>
#include <Keypad.h>
Servo ServoMotor;
char* password = "1234"; // change the password here, just pick any 3 numbers
int position = 0;
const byte ROWS = 4;
const byte COLS = 3;... |
Java | UTF-8 | 1,601 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | package com.mogade.java.tests.unit;
import com.mogade.java.protocol.Response;
import com.mogade.java.protocol.SaveScoreResponse;
import org.junit.Test;
import static junit.framework.Assert.*;
public class TestResponse
{
@Test
public void testOkResponse()
{
Response response = new SaveScoreResponse(null... |
Python | UTF-8 | 917 | 2.703125 | 3 | [] | no_license | import numpy as np
#Imp PARAMS :
maxsentence_length=sentence_length
embedding_dim=100
max_num_words=50000
hiddendim=128
word_index = tokenizer.word_index
glove_dir = 'path/Glove Embeddings/glove.6B.100d.txt'
embeddings_index = {}
f = open('/path/Glove Embeddings/glove.6B.100d.txt')
for line in f:
values =... |
Java | UTF-8 | 21,064 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | package org.struts.action.TravelManagement.TravelReports;
import org.apache.commons.collections.map.LinkedMap;
import org.paradyne.bean.TravelManagement.TravelReports.TrvlMainSchdlrReport;
import org.paradyne.model.TravelManagement.TravelReports.TrvlMainSchdlrReportModel;
import org.struts.lib.ParaActionSupport;
... |
JavaScript | UTF-8 | 2,196 | 2.546875 | 3 | [] | no_license | import { React, useState } from 'react'
import { connect } from "react-redux";
import { updateCity, fetchTemperature } from '../redux/temperature/t-act'
const Popup = ({ updateCity, fetchTemperature }) => {
const [cityName, setCityName] = useState('');
const onSubmit = () => {
updateCity(cityName)
... |
Markdown | UTF-8 | 37 | 3.671875 | 4 | [] | no_license | # laravel-simple-restfull-api-sanctum |
Markdown | UTF-8 | 6,118 | 2.515625 | 3 | [] | no_license | SpringBootTemplate
==================
# 简介
随着框架使用的不断的更新,后面使用SpringBoot会多,这边准备构建一个SpringBoot项目使用的模版。
所谓模版,和之前一样,就是一个最简单的项目,包含所有最简单的空实现。
<br/>
<br/>
## 模版目的
- 1、不熟悉SpringBoot项目的人,在学习了SpringBoot的基础部分之后,能根据这个模版快速上手
- 2、开发团队的项目结构和使用装备的统一,包括目录结构,使用的一些组件上面的统一
- 3、不想重复造轮子,每次新建一个项目很麻烦
<br/>
<br/>
## 目录说明
- `src/main... |
Java | UTF-8 | 1,512 | 1.804688 | 2 | [] | no_license | package com.ilikezhibo.ggzb.userinfo.myfav;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import com.ilikezhibo.ggzb.BaseFragmentActivity;
import com.ilikezhibo.ggzb.R;
public class MyFavProjectActivity extends BaseFragmentActivity {
private MyFa... |
Markdown | UTF-8 | 8,356 | 2.859375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: "IIR Filter | Microsoft Docs"
titleSuffix: ML Studio (classic) - Azure
description: Learn how to use the IIR Filter module to create an *infinite impulse response* (IIR) filter.
ms.custom: "formulas"
ms.date: 05/06/2019
ms.service: "machine-learning"
ms.subservice: "studio"
ms.topic: "reference"
author: xi... |
Python | UTF-8 | 516 | 2.703125 | 3 | [] | no_license | import cv2
image=cv2.imread(r'aman.png')
image_gray=cv2.imread(r"aman.png",cv2.IMREAD_GRAYSCALE)
face_teacher=cv2.CascadeClassifier(r"E:\image processing\haarcascades\haarcascade_frontalface_default.xml")
face=face_teacher.detectMultiScale(image_gray,1.3,5)
print(face)
for x,y,w,h in face:
cv2.rectangle(image,(x,y... |
Java | UTF-8 | 319 | 3 | 3 | [] | no_license | public class Exception1 {
public static void main(String[] args) {
int x,y,z = 0;
x=8;
y=0;
try {
z=x/y;
}catch(ArithmeticException e){
System.out.println(e);
}
System.out.println(z);
}
}
|
Java | UTF-8 | 870 | 1.859375 | 2 | [] | no_license | package org.jeesl.api.rest.rs.system;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.jeesl.api.rest.i.system.JeeslTestRestInterface;
import org.jeesl.interfaces.util.qualifier.JeeslRestSecured;
import org.jeesl.model.json.io.ssi.update.JsonS... |
Python | UTF-8 | 3,185 | 2.9375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # -*- coding: utf-8 -*-
"""
Created on Sun Jul 21 21:30:33 2019
@author: yoelr
"""
from numpy import asarray, array
from biosteam._utils import wegstein_secant, aitken_secant
__all__ = ('BubblePoint',)
class BubblePoint:
__slots__ = ('gamma', 'P', 'T', 'y')
rootsolver = staticmethod(aitken_secant)
d... |
Shell | UTF-8 | 643 | 3.0625 | 3 | [
"MIT"
] | permissive | #!/bin/sh
cd $(dirname $0)
source $(dirname $0)/config
if [ $(pgrep -cx panel) -gt 1 ] ; then
printf "%s\n" "The panel is already running." >&2
exit 1
fi
trap 'trap - TERM; kill 0' INT TERM QUIT EXIT
[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"
bspc config top_padding $PANEL_HEIGHT
bspc co... |
Java | UTF-8 | 2,686 | 2.546875 | 3 | [] | no_license | package com.sunmw.web.entity.base;
import java.io.Serializable;
/**
* This is an object that contains data related to the check_repeat_no table.
* Do not modify this class because it will be overwritten if the configuration file
* related to this class is modified.
*
* @hibernate.class
* table="check_repeat_n... |
Markdown | UTF-8 | 2,557 | 3.046875 | 3 | [] | no_license | # Hexagon Enforcement with ArchUnit
In this repository we played around with [ArchUnit](https://www.archunit.org). More specifically we assessed the capabilities to enforce the ideas of the hexagonal architecture.
A very good and elaborate explanation of these ideas can be found in an excellent article from Herberto G... |
Python | UTF-8 | 3,704 | 3.234375 | 3 | [] | no_license | #!/usr/bin/env python
#-*- coding:utf-8 -*-
# 多类别逻辑回归 使用gluon
# 服饰 FashionMNIST 识别 逻辑回归
# 多类模型跟线性回归的主要区别在于输出节点从一个变成了多个
# 简单逻辑回归模型 y=a*X + b
from mxnet import ndarray as nd
from mxnet import autograd
import random
from mxnet import gluon
import sys
sys.path.append('..')
import utils #包含了自己定义的一些通用函数 如下载 载入数据集等
#import ... |
Java | UTF-8 | 819 | 1.773438 | 2 | [] | no_license | package id.delta.whatsapp.implement;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import com.whatsapp.data.ft;
import com.whatsapp.dw;
public class z3 implements OnClickListener {
Activity activity;
/* renamed from: c */
bool... |
Java | UTF-8 | 334 | 2.140625 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | package com.example.hy.wanandroid.event;
/**
* Created by 陈健宇 at 2018/12/12
*/
public class NetWorkChangeEvent {
private boolean isConnection;
public NetWorkChangeEvent(boolean isConnection) {
this.isConnection = isConnection;
}
public boolean isConnection() {
return isConnection;
... |
C# | UTF-8 | 1,143 | 2.859375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Globalization;
namespace Ktulhu_App
{
class ListViewItemComparer : IComparer
{
private int col, por;
public ListViewItemComparer()
{
... |
C# | UTF-8 | 1,873 | 3.4375 | 3 | [
"MIT"
] | permissive | using System;
namespace Loops
{
class Program
{
public static void Main(string[] args)
{
do
{
Console.WriteLine("Which exercise would you like to check? Type 0 to exit.");
byte exerciseNumber = byte.Parse(Console.ReadLine());
... |
C# | UTF-8 | 1,055 | 2.90625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace proyecto
{
class MenuRestaurante
{
public MenuRestaurante()
{
Console.WriteLine("****************MENU RESTAURANTE****************");
... |
Java | UTF-8 | 259 | 2.390625 | 2 | [] | no_license | public class BankTesting {
public static void main(String[] args) {
BankingApp bankingApp = new BankingApp(12345678, 1234);
bankingApp.withdrawCash(1200);
bankingApp.depositCash(2000);
bankingApp.withdrawCash(200);
}
}
|
TypeScript | UTF-8 | 2,864 | 2.875 | 3 | [] | no_license | // PickHelper class for detecting raycast from the mouse.
import {Object3D, Raycaster, Camera} from "three";
import * as $ from "jquery";
const body = $(document.body);
export class PickHelper {
private raycaster: Raycaster;
private hoveredObject: Object3D;
private readonly mouseOverArray: Object3D[];
... |
Java | UTF-8 | 4,419 | 2.265625 | 2 | [] | no_license | package com.thenextmediagroup.dsod.web.controller;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.Req... |
C# | UTF-8 | 5,666 | 3.59375 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace labs6
{
class Program
{
static void Print(int[,] Array1, int[,] Array2)//печать матриц(6.2)
{
for (int i = 0; i < 2; i++)
... |
JavaScript | UTF-8 | 3,948 | 2.75 | 3 | [] | no_license | module.exports = function (io, roomId) {
this.players = []
this.board;
this.turn;
this.init = function () {
this.board = this.newBoard();
for (let key in io.sockets.adapter.rooms[roomId].sockets) {
this.players.push(key)
}
let type = Math.floor(Math.random() ... |
C# | UTF-8 | 1,803 | 3.09375 | 3 | [
"MIT"
] | permissive | // PennyLogger: Log event aggregation and filtering library
// See LICENSE in the project root for license information.
using PennyLogger.Internals.Reflection;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
namespace PennyLogger.Internals.Aggregate
{
/// <summary>
/// Base class... |
C# | UTF-8 | 1,235 | 2.75 | 3 | [] | no_license | using AutoMapper;
using Microsoft.EntityFrameworkCore;
using SonicState.Contracts.Repositories;
using SonicState.Models.ViewModels;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace SonicState.Data
{
public class DbRepository<TEntity> : IRepository<TEntity>... |
Java | UTF-8 | 1,168 | 2.703125 | 3 | [] | no_license | package ioexcel;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class Updatingordeletingcellvalue {
public ... |
Markdown | UTF-8 | 2,600 | 2.53125 | 3 | [] | permissive | % tpm2_getsessionauditdigest(1) tpm2-tools | General Commands Manual
# NAME
**tpm2_getsessionauditdigest**(1) - Retrieve the command audit attestation data
from the TPM.
# SYNOPSIS
**tpm2_getsessionauditdigest** [*OPTIONS*]
# DESCRIPTION
**tpm2_getsessionauditdigest**(1) - Retrieve the session audit digest
attest... |
C# | UTF-8 | 1,873 | 2.59375 | 3 | [
"Apache-2.0",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"Zlib",
"MS-PL",
"LicenseRef-scancode-free-unknown",
"MIT",
"LicenseRef-scancode-proprietary-license"
] | permissive | // PasswordDialog.cs
// ------------------------------------------------------------------
//
// Copyright (c) 2009 Dino Chiesa
// All rights reserved.
//
// This code module is part of DotNetZip, a zipfile class library.
//
// ------------------------------------------------------------------
//
// This code is licens... |
TypeScript | UTF-8 | 957 | 2.5625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
import { Item } from '../../shared/model/item';
@Injectable({
providedIn: 'root'
})
export class ProductService {
list: Item;
... |
Java | UTF-8 | 2,925 | 2.734375 | 3 | [] | no_license | package edu.undav.research.tinygarden;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import edu.undav.research.tinygarden.BasicClasses.EdgeRelabelGraph;
import edu.undav.research.tinygarden.BasicClasses.Graph;
import edu.undav.research.tinygarden.BasicClasses.Part... |
C++ | UTF-8 | 1,283 | 2.59375 | 3 | [
"MIT"
] | permissive |
#ifndef FLOW_H_
#define FLOW_H_
#include "common.h"
#include "util.h"
using namespace std;
struct sFlowinfo
{
int sock;
int flowid;
int src_pod;
int src_edg;
int src_index;
int dst_pod;
int dst_edg;
int dst_index;
// unsigned int size;
uint64_t size;
uint64_t rem_size;
/... |
Python | UTF-8 | 889 | 2.875 | 3 | [] | no_license | import time
from collections import defaultdict
from loss import calculate_loss
def test(model, test_loader, device='cpu'):
print("-" * 30, "\nTest:\n")
start_epoch_time = time.time()
model.eval()
metrics = defaultdict(float)
for images, labels in test_loader:
images = images.to(device)
... |
TypeScript | UTF-8 | 3,557 | 2.546875 | 3 | [
"MIT"
] | permissive | import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import * as moment from 'moment';
import { Tea, TeaBuilder } from '../../tea';
class InputTea {
public name: string;
public date: Date;
public type: string;
public leafgrade: string;
public stocked = true;
public aging = ... |
Markdown | UTF-8 | 11,613 | 2.71875 | 3 | [
"MIT"
] | permissive | # Visible changes in LazyAlgebra
## Wish list for future developments
* Traits must be type-stable. That is deciding the value of a specific trait
should be done on the sole basis of the the type of the argument(s).
* Optimizations and simplifications of expressions involving mappings belong to
two categories:
... |
C++ | UTF-8 | 1,929 | 2.84375 | 3 | [] | no_license | #include"ArrayTree.h"
#include"LBT.h"
#include"LLBT.h"
#include <iostream>
using namespace std;
int main(){
ArrayTree<int>a;
a.buildRoot(10);
a.addLeft(10,6);
a.addRight(10,8);
a.addRight(6,20);
a.addLeft(6,12);
a.addRight(8,1);
a.addLeft(8,2);
cout<<"第六章上机第七题"<<endl;
cout<<a.closetRoot(12,2)<<endl; //第六章上... |
C++ | UTF-8 | 408 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
This file belongs to RendererLib.
See LICENSE file in root folder.
*/
#ifndef ___Renderer_MemoryHeap_HPP___
#define ___Renderer_MemoryHeap_HPP___
#pragma once
#include "RendererPrerequisites.hpp"
namespace renderer
{
/**
*\~english
*\brief
* Specifies a memory heap.
*\~french
*\brief
* Spécifie un tas mémoi... |
Markdown | UTF-8 | 1,398 | 2.640625 | 3 | [] | no_license | #### Metodología para crear una relacion ghedsh o extender información ghedsh desde Moodle
* Exporto el calificador desde Moodle a CSV, los campos que me interesan
* Uso [TableTool](https://github.com/jakob/TableTool) un editor de CSV par mac os muy útil
* Con el editor [TableTool](https://github.com/jakob/TableTool) ... |
C | UTF-8 | 3,386 | 2.59375 | 3 | [] | no_license | /*
* OLECLIP.C
*
* Routines to handle placing Native, ObjectLink, and OwnerLink
* information on the clipboard.
*
* Copyright(c) Microsoft Corp. 1992-1994 All Rights Reserved
* Win32 version, January 1994
*/
#ifdef MAKEOLESERVER
#include <windows.h>
#include <ole.h>
#include "cosmo.h"
#includ... |
Java | UTF-8 | 986 | 2.3125 | 2 | [] | no_license | package br.com.rest_assured.steps;
import io.cucumber.java.pt.Quando;
import io.restassured.response.ValidatableResponse;
import static br.com.rest_assured.core.GlobalValidatableResponse.setvResponse;
import static io.restassured.RestAssured.given;
public class DeleteStep{
ValidatableResponse vResponse;
@Qua... |
PHP | UTF-8 | 1,105 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateContractItemsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('contract_... |
Java | UTF-8 | 1,428 | 3.1875 | 3 | [] | no_license | package game.logic.cards;
import game.graphic.GraphicManager;
import game.graphic.PlayerType;
import game.logic.LogicManager;
import game.logic.battleFields.LineType;
public class MagicCatalyst extends CardLogic {
MagicCatalyst(String name, int power, int cost, String imageURL, CardType cardType, int specialPowe... |
Rust | UTF-8 | 1,445 | 3.203125 | 3 | [
"MIT"
] | permissive | use crate::rom::Rom;
pub fn init(rom: Rom) -> Box<Mapper> {
match rom.header.mapper() {
0 => Box::new(MapperZero::new(rom)),
id @ _ => panic!("Unimplemented mapper {}", id),
}
}
pub trait Mapper {
fn read(&self, addr: u16) -> u8;
fn write(&mut self, addr: u16, val: u8);
fn step(&mu... |
C++ | UTF-8 | 1,604 | 3.34375 | 3 | [] | no_license |
#include "Graph.h"
template<class NODE,class EDGE>
Graph<NODE,EDGE>::Graph(bool (*comp_node)(NODE,NODE),bool (*comp_edge)(EDGE,EDGE) ){
fp_compare_node = comp_node;
fp_compare_edge = comp_edge;
}
template<class NODE,class EDGE>
size_t Graph<NODE,EDGE>::add_vertex(NODE node){
std::vector<SpecialNode<NODE,EDGE>> v... |
Markdown | UTF-8 | 2,451 | 3.265625 | 3 | [] | no_license | ### 一、解决方法:当数据库发生这种操作故障时,可以按如下操作步骤可解决此方法,打开数据库里的Sql 查询编辑器窗口,运行以下的命令。
#### 1、修改数据库为紧急模式
```Python
ALTER DATABASE [dbname] SET EMERGENCY
```
#### 2、使数据库变为单用户模式
```Python
ALTER DATABASE [dbname] SET SINGLE_USER
```
#### 3、修复数据库日志重新生成,此命令检查的分配,结构,逻辑完整性和所有数据库中的对象错误。当您指定“REPAIR_ALLOW_DATA_LOSS”作为DBCC CHECKDB命令参数,该程序将检查和修复... |
C++ | UTF-8 | 317 | 2.875 | 3 | [] | no_license | #ifndef DATEIMPL_H
#define DATEIMPL_H
#include <iostream>
#include <iomanip>
#include <string>
class DateImpl {
public:
DateImpl( int day, int month ) { d = day; m = month; }
virtual void tell() = 0;
int getDay() const { return d;}
int getMonth() const { return m;}
protected:
int d, m;
};
#endif
|
Python | UTF-8 | 4,198 | 2.8125 | 3 | [] | no_license | import numpy as np
import random
import pygame
sizePixel = 4
fireWidth = 100
fireHeight = 100
debug = False
fireColorsPalette = [
(7, 7, 7), (31, 7, 7), (47, 15, 7), (71, 15, 7), (87, 23, 7), (103, 31, 7), (119, 31, 7), (143, 39, 7),
(159, 47, 7), (175, 63, 7), (191, 71,... |
PHP | UTF-8 | 756 | 3.21875 | 3 | [
"MIT"
] | permissive | <?php
namespace mle86\Enum\Tests\Helper;
use mle86\Enum\AbstractEnum;
/**
* @internal
* This dummy enum accepts a few different input values
* and they're all different PHP types!
* (Except for "97" and "", just to see if ""/`null`/`false` are treated differently)
*/
class MixedTypeEnum extends AbstractEn... |
Markdown | UTF-8 | 1,726 | 3.296875 | 3 | [] | no_license | # MessageApp
MessageApp is an mobile application (Android only) for secure messaging that implement different cryptographic methods to obtain a secure communication between users.
This project was developed through an Android mobile application that implements the functionalities of a secure communication method. Thos... |
JavaScript | UTF-8 | 186 | 3.140625 | 3 | [] | no_license | function str(number) {
tmp = ""
if (number % 2 == 0) {
tmp = "парне";
console.log(tmp);
} else {
tmp = "непарне";
console.log(tmp);
}
return tmp;
}
|
Markdown | UTF-8 | 213 | 2.578125 | 3 | [] | no_license | ### OO Principles
- Encapsulate what varies.
- Favor composition over inheritance.
- Program to interfaces(or superclases) not implementations.
- Strive for loosely coupled designs between objects that interact.
|
C++ | UTF-8 | 399 | 2.546875 | 3 | [] | no_license | #include "usuario.h"
usuario::usuario(){
}
usuario::~usuario(){
}
void usuario::setUser(string pUser){
user_name = pUser;
}
string usuario::getUser(){
return user_name;
}
void usuario::setCorreo(string pCorreo){
correo = pCorreo;
}
void usuario::setPass(string pPass){
password = pPass;
}
string usuario::getP... |
Markdown | UTF-8 | 2,031 | 3.15625 | 3 | [] | no_license | ---
layout: post
title: How-to-add-custom-TrendLine-in-Chart | Windows Forms | Syncfusion
description: how to add custom trendline in chart
platform: windowsforms
control: chart
documentation: ug
---
# How to add custom TrendLine in Chart
TrendLines are used to draw lines in the ChartArea. They can be added to the ch... |
Java | UTF-8 | 1,057 | 2.734375 | 3 | [] | no_license | package com.sunny._01_static_proxy.proxy;
import com.sunny._01_static_proxy.domain.Employee;
import com.sunny._01_static_proxy.service.EmployeeService;
import com.sunny._01_static_proxy.tx.TransactionManager;
public class EmployeeServiceProxy implements EmployeeService {
private TransactionManager tx; // 事务管理器
... |
C | GB18030 | 977 | 4.125 | 4 | [] | no_license |
#include <stdbool.h>
#include <stdio.h>
/*
* ת Ϊ˼· 1.֪ ʲô 2.m,n֮˳ķŵ һ鵱ȥ 3.forѭ
* Ķ һѪ ϸڵע ҪˡϤ̵ָСнΪѧϰݽṹ
*/
bool isPrime(int number)
{
int i =2;
//жһ Dz
for(i = 2; i < number; ++i)
if(!(number % i))
return false;
return true;
}
int main(void)
{
int n, m, sum = 0; //˼·... |
PHP | UTF-8 | 1,430 | 3.0625 | 3 | [] | no_license | <?php namespace Quince\DataImporter\DataObjects;
class AdditionalFields {
/**
* @var array
*/
protected $base = [];
/**
* @var array
*/
protected $relations = [];
/**
* @param array $additionalFields
*/
public function __construct(Array $additionalFields)
{
if (isset($additionalFields['base']))... |
C# | UTF-8 | 2,711 | 2.953125 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.Linq;
using SampleCashRegister.Discounts;
namespace SampleCashRegister
{
public class Order
{
private readonly IList<OrderItem> _items = new List<OrderItem>();
private readonly IList<Discount> _discounts = new List<Discount>();
p... |
Swift | UTF-8 | 844 | 2.515625 | 3 | [
"MIT"
] | permissive | //
// SwiftGenKit
// Copyright © 2020 SwiftGen
// MIT Licence
//
import Foundation
import PathKit
extension Strings {
final class StringsFileParser: StringsFileTypeParser {
private let options: ParserOptionValues
init(options: ParserOptionValues) {
self.options = options
}
static let extensi... |
PHP | UTF-8 | 1,443 | 2.9375 | 3 | [] | no_license | <?php
require_once 'library/facebook/facebook.php';
class Application_Model_Facebook
{
/**
* Facebook application ID.
*/
const APP_ID = '277351065690291';
/**
* Facebook application secret.
*/
const APP_SECRET = 'a230489cb43bea620029b44414d33176';
/**
* Facebook cookie support.
*/
... |
JavaScript | UTF-8 | 5,808 | 2.921875 | 3 | [] | no_license | const USER = 'USER';
const REST = 'REST';
const getByUserId = async (uid, pool) => {
const getEvents = `SELECT
u.login,
u.firstname,
u.lastname,
u.city AS usercity,
res.*,
... |
PHP | UTF-8 | 1,279 | 2.5625 | 3 | [] | no_license | <div class="horses index">
<table cellpadding="0" cellspacing="0" style="font-size:80%">
<tr>
<th>Posicion</th>
<th>Caballo</th>
<th>Win</th>
<th>Place</th>
<th>Show</th>
</tr>
<tr>
<td>1º </td>
<td>
<?php echo $results[1]['horse'] ?>
</td>
<td>
<?php echo $results[1]['win'] ?>
</td>
... |
Markdown | UTF-8 | 4,677 | 2.734375 | 3 | [
"MIT"
] | permissive | # EzTheme - The Easy Way to Package your Theme for Cydia
Easy (hopefully) way to package the icon themes from all themers.
It should be easy, but I'm not all the way done as of this commit.
## Instructions
To kick things off, clone this repository onto your computer.
*You can use `git` or you can just download th... |
C++ | UTF-8 | 1,685 | 2.890625 | 3 | [] | no_license | class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
vector <int> result;
/*//vector<int>::iterator it;
for (auto it = nums.begin(); it != nums.end()-1;it++)
for (auto it2 = it+1; it2 != nums.end(); it2++)
{
if ((*it) +... |
C++ | UTF-8 | 4,794 | 2.75 | 3 | [] | no_license | #include "GPSFaker.h"
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <csignal>
#include <cstring>
#include <cerrno>
#include <unistd.h>
using namespace std;
/* Bug in old versions of GCC?
using std::atof;
using std::atol;
using std::errno;
using std::strcmp;
using std::memcpy;
*/
GPSFaker* GPSFak... |
Python | UTF-8 | 4,494 | 3.25 | 3 | [] | no_license | '''
该文件主要用于将原始数据集分割为train和test两部分。注意该py文件的工作要求是所有的jpg文件和与其同名的label文件在同一个目录下。
而该程序会将图像分成两部分另存到对应的文件夹下,并在两个文件夹下建立对应的总label文件。
该py文件是针对EAST数据集的分割编写的,通用性不强,需要根据实际情况进行修改
'''
import argparse
import random
import shutil
import sys
import os
FLAGS = None
def getfilelist(path, suffix = '.jpg'):
#迭代获取当前路径下所有的... |
C++ | UTF-8 | 494 | 2.953125 | 3 | [] | no_license | #include<process.h>
#include<iostream.h>
#include<fstream.h>
class bank
{
int acc_no;
char name[20];
long int bal;
public:
void accept(int no)
{
acc_no=no;
cout<<"Enter the name:";
cin>>name;
bal=500;
cout<<"\nOpening Balance:"<<bal;
}
void display()
{
cout<<acc_no<<"\t\t\t";
cout<<name<<"\t\t";
co... |
JavaScript | UTF-8 | 470 | 2.515625 | 3 | [] | no_license | export const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
export default function reducer(state = {
notificationCount: 6,
}, action) {
switch (action.type) {
case REMOVE_NOTIFICATION:
return {
...state,
notificationCount: state.notificationCount - 1
... |
C# | UTF-8 | 1,862 | 3.3125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Net;
using System.Text;
namespace BasicServerHTTPlistener
{
class Header
{
private HttpListenerRequest request;
public Header(HttpListenerRequest httpListenerRequest)
{
... |
C# | UTF-8 | 1,440 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using STPLocalSearch.Graphs;
namespace STPLocalSearch.Solve
{
public static class TMSTV
{
public static Graph RunSolver(Graph graph, Graph tmst)
{
HashSet<Vertex> redundantVertices = new HashSet<Vertex>(graph.Vertic... |
PHP | UTF-8 | 5,974 | 2.921875 | 3 | [] | no_license | <?php
defined('SHOP') or die('Access Denied');
class func {
public $mysqli;
public function __construct() {
$this->mysqli = db::getObject();
}
// Распечатка массива
public function print_arr($x) {
echo '<pre>';
print_r($x);
echo '</pre>';
}
// Редирект
public function redirect($http = false) {
if($ht... |
C++ | GB18030 | 20,734 | 2.921875 | 3 | [] | no_license | #include "biguint.h"
#include<fstream>
#include <stdarg.h>
#include <algorithm>
int BigUInt::Length()const
{
return m_bits.size();
}
int BigUInt::ValidLength() const
{
return (m_bits.size()>0)?(GetNonZeroIdx()+1):(0);
}
void BigUInt::TrimHiZeros()
{
int v = 0;
while (m_bits.size() >=1 && (v=m_bits[m_bits.size()-1... |
Java | UTF-8 | 2,023 | 1.96875 | 2 | [] | no_license | package com.park61.moduel.dreamhouse.bean;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 加入梦想成功后推荐游戏信息
*/
public class AddDreamRecommendGames implements Serializable {
private Long requirementPredictionId;
private String actAddress;
private int actBussinessType;
private String actC... |
Java | UTF-8 | 641 | 2.390625 | 2 | [] | no_license | package com.edu.abhi.expressionlanguage.annotation;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class App {
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("SpringBe... |
Markdown | UTF-8 | 740 | 2.703125 | 3 | [] | no_license | # Digital Humanities
The reason I chose **Digital Humanities** as a study subject is so that I can later on work for a company to help making E-Sports more relevant to our modern society.
A company I am looking forward to woorking for is *Freaks 4u*.
; //метод для ввода
public static int[,] Array(int[,] arr)
{
for (var i = 0; i < arr.GetLength(0); i++)
{
for (var j = 0; j < arr.GetL... |
JavaScript | UTF-8 | 567 | 2.671875 | 3 | [
"MIT",
"CC-BY-4.0",
"CC-BY-SA-4.0",
"CC-BY-NC-SA-4.0",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // @flow
import {stringToMD5} from '../lib/crypto-utils';
import _ from 'lodash';
export const GRAVATAR_DEFAULT =
'https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm';
/**
* Generate gravatar url from email address
*/
export function generateGravatarUrl(email: string = ''): string {
let emailC... |
Python | UTF-8 | 569 | 2.828125 | 3 | [
"MIT"
] | permissive | """
33.11%
"""
class Solution(object):
def longestConsecutive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
maxlen = 0
cur = []
nums = sorted(set(nums))
for num in nums:
if not cur:
cur.append(num)
else... |
Markdown | UTF-8 | 1,396 | 3.140625 | 3 | [
"MIT"
] | permissive | # 双重链表
在计算机科学中, **双向链表**是一种链接数据结构
由一组称为节点的顺序链接记录组成. 每个节点包含
两个字段, 其中称为链接, 是对 节点序列中的 前一个和下一个节点的引用
. 而 开始和结束节点 的 上一个和下一个节点
链接 分别指向某种终结者, 通常是 标记
节点 或 null, 以方便遍历列表. 如果只有一个
标记 节点, 然后列表通过 标记节点 循环链接. 它可以
被概念化为 由 相同数据项 形成的两个单链表,
但是在相反的顺序中.
> 如果只有一个标记节点, 具有 开始节点与结束节点 的 引用, 可以让 闭合链表
 {
String str = "pwwkew";
System.out.println(result(str));
}
static int result(String str) {
int result = 0;
int arrayLength = str.length();
... |
Java | UTF-8 | 968 | 3.171875 | 3 | [] | no_license | package NewThread;
import java.util.Date;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args ) throws Execu... |
Java | UTF-8 | 431 | 2.8125 | 3 | [] | no_license | package exceptionGabarito;
public class ExceptionCapturada {
public static void main(String[] args) {
int i = 0;
try {
String array[] = { "acapulco", "bariloche", "aruba" };
while (i < 4) {
System.out.println(array[i]);
i++;
}
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("... |
Java | UTF-8 | 4,594 | 2.53125 | 3 | [] | no_license | package edu.ucdavis.cs.dblp.text;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.LineIterator;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annota... |
C | UTF-8 | 2,850 | 4.09375 | 4 | [] | no_license | #include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>
struct node {
char data[100];
struct node *next;
struct node *prev;
};
struct node *head = NULL;
struct node *last = NULL;
// struct node *current = NULL;
// Write functions to find from it. Test them.
bool isEmpty() {
retu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.