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,988 | 2.78125 | 3 | [] | no_license | #include "app/HelloTriangle.h"
#include <iostream>
bool HelloTriangle::setup()
{
const char* vertexCode = R"##(
#version 460 core
layout(location = 0) in vec2 vpos_ndc;
in vec3 base_color;
out vec3 fragmentColor;
void main(){
gl_Position = vec4(vpos_ndc, 0.f, 1.f);
fragmentColor = base_color;
}
)##";
... |
C++ | UTF-8 | 1,450 | 2.71875 | 3 | [] | no_license | #include <vector>
#include <stdio.h>
#include <cstring>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
const int N = 22;
const int dx[] = { 0,-1, 0, 1}; // direction
const int dy[] = {-1, 0, 1, 0};
int n, m, g[N][N], ex, ey;
bool vis[N][N], ok; // visited
vector <P> ans;
void printAns(){
for ... |
Java | UTF-8 | 9,468 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright 2018 Institute of Computing Technology, Chinese Academy of Sciences.
* Licensed under the terms of the Apache 2.0 license.
* Please see LICENSE file in the project root for terms
*/
package eml.studio.server.visual.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iter... |
Java | UTF-8 | 5,684 | 1.765625 | 2 | [
"MIT"
] | permissive | /*******************************************************************************
Copyright © 2017 Sankine Corporation Inc. All rights reserved.
Author: Hoang Van Que
Email: quehvbg@gmail.com
Phone : 0983.138.328
Description:
Modifier :
Version : 1.0.0.1
*********************************************************... |
Swift | UTF-8 | 4,573 | 2.734375 | 3 | [] | no_license |
import Foundation
func so3FromTwoVecN(a:Vector3d, _ b:Vector3d, inout result:Matrix3x3d)
{
var so3FromTwoVecNN:Vector3d = Vector3d()
Vector3d.cross(a, b, result: &so3FromTwoVecNN)
if so3FromTwoVecNN.length() == 0.0
{
let dot:Double = Vector3d.dot(a, b)
if ( dot >= 0.... |
Ruby | UTF-8 | 1,725 | 2.890625 | 3 | [] | no_license | #!/usr/bin/env ruby
#http://mtsmfm.github.io/2017/06/03/doukaku-e14.html
#http://qiita.com/mtsmfm/items/89b6634f363bbf5b47f5
def parsefasta(f)
arc={}
seq=[]
line=f.gets
line.chomp!
name=line[1..-1]
while line=f.gets
line.chomp!
if line[0,1]=='>'
arc[name]=seq
seq=[]
name=line[1..-1]
else
seq<<l... |
TypeScript | UTF-8 | 523 | 2.6875 | 3 | [] | no_license | import {Activity} from "../../shared/activity/activity";
export class TimedActivity {
restPeriodInSecs: number;
workPeriodInSecs: number;
activity: Activity;
repeat: number;
constructor(restPeriodInSecs: number,
workPeriodInSecs: number,
activity: Activity,
... |
Java | UTF-8 | 4,707 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package com.paddy.mynotes.data;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
public class NotesDataManager extends SQLiteOpenHelper {
priva... |
C++ | UTF-8 | 1,292 | 3.03125 | 3 | [] | no_license | #include<cstdio>
#include<cmath>
using namespace std;
#define MAX_TAG 64
char tag[MAX_TAG];
const double pi = acos(-1.0);
inline double longitude( double x )
{
return x*pi/180;
}
inline double latitude( double x )
{
return log(tan(pi/4+(x*pi/360)));
}
const double left = longitude(-180);
const dou... |
C# | UTF-8 | 1,278 | 3.234375 | 3 | [
"MIT"
] | permissive | using System;
namespace Firestorm.Data
{
public static class PluralConventionUtility
{
public static string GetTableName<T>()
{
return GetTableName(typeof(T));
}
public static string GetTableName(Type entityType)
{
return Pluralize(entityType.Nam... |
Markdown | UTF-8 | 6,107 | 2.734375 | 3 | [] | no_license | ---
title: "关于“这是命,得认”"
layout: "note"
link: http://www.zhihu.com/question/24721077/answer/28778451
note_date: "2014-08-10"
---
工作好头大,再加上基本没人参加上次的“快速问答”,所以也一直懒得更新。这里先贴一个最近我在知乎上较多人支持的回答吧,触发下更新的开关。点击下方“<span style="color:blue;">阅读原文</span>”链接可跳转到知乎。
## 提问
为什么有些人随着年龄增加,逐渐相信了「宿命」?
今年本命年,依然碌碌无为一事无成。家境不好。性格孤僻,然而在外也能敷衍迎合。... |
Java | UTF-8 | 9,924 | 1.796875 | 2 | [] | no_license | package com.example.dubstep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view... |
Java | UTF-8 | 1,747 | 2.46875 | 2 | [] | no_license | package com.refactorlabs.cs378.assign3;
import junit.framework.Assert;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mrunit.mapreduce.MapDriver;
import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import org.junit.Before;
import org.junit.Test;
import java.io... |
Markdown | UTF-8 | 17,883 | 2.625 | 3 | [] | no_license | ---
templateKey: blog-post
title: Best Belt Sanders – Top 9 List with Buyers Guide
slug: best-belt-sanders
seoTitle: 9 Best Belt Sanders [Buyers Guide & Reviews]
seoDescription: This article is about the best belt sanders 2021. In this
article, I will explain to you the best belt sanders 2021. I will explain the
fe... |
Java | UTF-8 | 1,353 | 3.265625 | 3 | [] | no_license | package World;
import java.util.ArrayList;
import Player.Player;
public class Continent {
private ArrayList<Country> countries;
private int bonus;
private String color;
private String name;
private World world;
public Continent(String color, String name, int bonus, World world){
this.countries = new ArrayL... |
Ruby | UTF-8 | 1,431 | 3.109375 | 3 | [] | no_license | require 'pg'
require_relative '../db/runner'
require_relative '../models/event'
class Discipline
attr_reader :id, :name
def initialize(options)
@id = options['id'].to_i
@name = options['name']
end
def save()
sql = "INSERT INTO disciplines (name) VALUES ('#{@name}') RETURNING *"
discipline_da... |
Python | UTF-8 | 2,385 | 4.59375 | 5 | [] | no_license | #THIS PRACTICE IS ABOUT CONDITIONAL STATEMENTS
#Simple if statement
age = 20
if age >= 18:
print('Your age is',age)
print('adult')
#If and else statements
age = 3
if age >= 18:
print("your age is", age)
print ('adult')
else:
print("Your age is", age)
print("teenager")
#Else i... |
Java | UTF-8 | 4,619 | 2.4375 | 2 | [] | no_license | package com.spanglerware.termtracker;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.vi... |
PHP | UTF-8 | 2,511 | 2.625 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use App\Article;
use EloquentBuilder;
use Illuminate\Http\Request;
class ArticleController extends Controller
{
/**
* Display a listing of the resource.
* @param Request $request
* @return Response
*/
public function index(Request $request)
{
... |
Java | UTF-8 | 343 | 1.921875 | 2 | [] | no_license | package com.ehr.framework.worker.workhandler;
import com.ehr.framework.context.BatchParaManager;
/**
* 在线程中存放,读取,清除BatchPara参数的管理类
* @author zoe
*/
public interface WriteBatchParaManager extends BatchParaManager{
public void openThreadLocal(String[] parameter);
public void closeThreadLocal();
}
|
Markdown | UTF-8 | 4,617 | 2.78125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: Extracting Images and Files From SQL Server
image: ../img/ExtractingImage/vacuum.jpg
tags: [SQL, SQL Server, BLOBs, Images]
---
[Last time](https://andyspecht.github.io/2017-06-12-inserting-images/) we looked at the fairly straightforward process of inserting images and file into SQL Server. N... |
Java | UTF-8 | 5,126 | 2.5625 | 3 | [] | no_license | package net.burgin.racetrack.gui;
import com.github.sarxos.webcam.*;
import net.burgin.racetrack.detection.HotSpotDetector;
import net.burgin.racetrack.detection.OneTimeHotSpotDetector;
import net.burgin.racetrack.gui.adapters.WebcamAdapter;
import net.burgin.racetrack.gui.heats.RacetrackWebcamPanel;
import javax.swi... |
C# | UTF-8 | 2,052 | 2.765625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
namespace ADPhotoPrep
{
public class ImageAdjustment
{
protected float _brightness = 1f;
protected float _contrast = 1f;
protected float _gamma = 1f;
protec... |
Java | UTF-8 | 3,663 | 2.078125 | 2 | [
"Apache-2.0"
] | permissive |
package com.google.api.ads.adwords.jaxws.v201409.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
/**
*
* Represents... |
PHP | UTF-8 | 869 | 2.578125 | 3 | [] | no_license | <?php
require_once("config.php");
/*$root = new Usuario(); //carrega somente um usuario
$root->loadById(3);
echo $root;*/
/* $lista = Usuario::getList(); //carrega lista de usuario
echo json_encode($lista); */
/* $search = Usuario::search("jo");
echo json_encode($search); */
/* $pesquisa = new S... |
C++ | UTF-8 | 4,094 | 2.953125 | 3 | [] | no_license | #include "Cube.h"
#include "Types.h"
#include <iostream>
static const GLfloat CubeVertices_Duplicated[] =
{
/* Front */
0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f,
1.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f,
1.0f, 1.0f, 0.0f,
1.0f, 0.0f, 0.0f,
/* Back */
0.0f, 0.0f, 1.0f,
0.0f, 1.0f, 1.0f,
... |
C++ | UTF-8 | 2,446 | 3.9375 | 4 | [] | no_license | /*
You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2.
Find all the next greater numbers for nums1's elements in the corresponding places of nums2.
The Next Greater Number of a number x in nums1 is the first greater number to its right in nums2. If it does not e... |
C# | UTF-8 | 2,855 | 2.609375 | 3 | [] | no_license | using Contracts;
using Entities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Repository
{
public class RepositoryWrapper : IRepositoryWrapper
{
private readonly RepositoryContext _repoContext;
private IUserRepository _user;
private IPodcastRepository _p... |
TypeScript | UTF-8 | 311 | 2.625 | 3 | [] | no_license | function Main(input: string[]) {
const [N, X, Y] = input[0].split(" ").map((value) => parseInt(value, 10));
}
//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)
Main(require("fs").readFileSync("/dev/stdin", "utf8").split("\n"));
|
TypeScript | UTF-8 | 952 | 2.53125 | 3 | [] | no_license | import {
CallHandler,
ExecutionContext,
Injectable,
NestInterceptor,
Logger,
} from '@nestjs/common';
import { Observable, throwError } from 'rxjs';
import { tap, catchError } from 'rxjs/operators';
@Injectable()
export class LoggerInterceptor implements NestInterceptor {
private readonly context = 'REQUES... |
Java | UTF-8 | 1,576 | 2.59375 | 3 | [] | no_license | package de.legoshi.speedplugin.inventory;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import java.util.ArrayList;
public class InventoryObject {
Player player;
Invent... |
C++ | UTF-8 | 2,515 | 2.625 | 3 | [] | no_license | // This file is a part of quicksave project.
// Copyright (c) 2017 Aleksander Gajewski <adiog@quicksave.io>.
#pragma once
#include <filesystem>
#include <fstream>
#include <qs/server/RequestContext.h>
#include <qs/storage/Storage.h>
namespace qs {
namespace storage {
class LocalStorage : public storage::Storage
{... |
Python | UTF-8 | 7,046 | 2.546875 | 3 | [] | no_license | ####################################################################################
## For comparison with PileUpBunchTrains2011Config8_DigitConfig.py
## Quadruple-Train: A train made up of a sub-trains of 36 filled bunch
## crossings with intra train spacings of 50ns, followed by a 225ns gap
## then a second sub-trai... |
Java | UTF-8 | 9,340 | 2.421875 | 2 | [] | no_license | package com.kcom.javatest;
import com.kcom.javatest.exception.ChangeNotGivenException;
import com.kcom.javatest.utils.FileOperations;
import com.kcom.javatest.vo.Coin;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.theories.DataPoints;
import org.junit.experimental.theories.Theories;
imp... |
SQL | UTF-8 | 1,206 | 2.921875 | 3 | [
"MIT"
] | permissive | DROP table if EXISTS member;
CREATE TABLE `member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) NOT NULL DEFAULT '',
`group` int(3) NOT NULL DEFAULT 1,
`status` tinyint(2) NOT NULL DEFAULT 0,
`file_name` varchar(128) DEFAULT NULL,
`filesize_total` int(11) NOT NULL DEFAULT 0 COMMENT 'Total file... |
Markdown | UTF-8 | 10,122 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | # 附录
## 附录A 梯度下降法
梯度下降法(gradient descent)或最速下降法(steepest descent)是求解无约束最优化问题的一种最常用的方法 有实现简单的优点.梯度下降法是迭代算法,每一步需要求解目标函数的梯度向量
假设f(x)是R^n上具有一阶连续偏导数的函数.要求解的无约束最优化问题是:minf(x) x*表示目标函数f(x)的极小点.x*表示目标函数f(x)的极小点.
梯度下降法是一种迭代算法.选取适当的初值x(0),不断迭代,更新x的值, 进行目标函数的极小化,直到收敛.由于负梯度方向是使函数值下降最快的方向, 在迭代的每一步,以负梯度方向更新x的值,从而达到减少函数值的目的.
由于f(x)具... |
Python | UTF-8 | 3,696 | 2.828125 | 3 | [] | no_license | from game_class.all_class import Player, Card, Deck
import game_class.explain as explain
def choose_pokemon(plyr):
global choice
if (len(plyr.plyr_crd) > 1 ):
print("Player {0} - Your Pokemon's are - {1}" .format(plyr.plyr_nm,plyr.plyr_crd))
print("Your Pokemon Details are as below.")
explain.sepr(len("Your Po... |
TypeScript | UTF-8 | 528 | 2.65625 | 3 | [] | no_license | import { readFileSync } from "fs";
const seasons = ['1718', '1819'];
export class DataHelper {
static getSeasonData(prefix) {
let data = [];
for (let j=0; j<seasons.length; j++) {
let seasonData = JSON.parse(readFileSync('../data/' + prefix + seasons[j] + '.json').toString());
... |
PHP | UTF-8 | 2,027 | 2.515625 | 3 | [] | no_license | <?php
add_action( 'wp_login_failed', 'wpesec_on_login_failed' );
function wpesec_on_login_failed( $username ) {
// $username is already sanitize_user'ed
$addr = $_SERVER['REMOTE_ADDR'];
$prefix = 'wpe_rate_limits_login_failed_' . floor( time() / 300 );
$bump = array(
"${prefix}_addr_$addr",
"${prefix}_user_$... |
Shell | UTF-8 | 576 | 2.90625 | 3 | [] | no_license | # create directories for local FileSystem
# mkdir -p /tmp/csv /tmp/ssn
# create a destination directory on HDFS
# sudo -u hdfs hdfs dfs -mkdir /tmp/nossn
# sudo -u hdfs hdfs dfs -chmod -R 777 /tmp/nossn
# download the latest HDF release
cd ~
wget http://public-repo-1.hortonworks.com.s3.amazonaws.com/HDF/centos6/1.x/u... |
Shell | UTF-8 | 1,469 | 3.5 | 4 | [
"MIT"
] | permissive | #/bin/sh
#start or stop the im-server
function start() {
cd login_server
if [ -e loginserver.conf ]; then
echo "loginserver.conf exist"
../daeml ./login_server
fi
cd ../route_server
if [ -e routeserver.conf ]; then
../daeml ./route_server
fi
cd ../msg_server
if [ -e msgserver.conf ]; then
../daeml ./... |
TypeScript | UTF-8 | 527 | 2.71875 | 3 | [
"MIT"
] | permissive | import { AxiosTransformer } from "../types";
/**
* @description:处理转换函数调用逻辑
* @param {fn} 处理函数
* @return {type}
*/
const transform: (data: any, headers: any, fns?: AxiosTransformer | AxiosTransformer[]) => any = (data, headers, fns) => {
if (!fns) return data
if (!Array.isArray(fns)) {
fns = [fns]
... |
C++ | GB18030 | 2,432 | 2.6875 | 3 | [] | no_license | #include"header.h"
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
/********************************/
/******EXAMPLES IN TEXTBOOK******/
/********************************/
/*Chapter1*/
//P1_1();
//P1_2();
//P1_3();
/*Chapter2*/
//P2_1();
//P2_2();
//P2_3();
//P2_4();
//P2_5(... |
Python | UTF-8 | 877 | 3.25 | 3 | [] | no_license | #!/usr/bin/env python
import sys
if len(sys.argv) != 2:
sys.ext("Usage: " + sys.argv[0] + "<input>")
f = open(sys.argv[1], 'r')
def solve( c, f, x ):
cps = 2
num_farms = 0
# x = (cps * t) + (f * t * num_farms) - (c * num_farms)
sum_t = 0;
t = 0 # don't buy a new farm
T = x / cps # time to complete after buy... |
Java | UTF-8 | 496 | 1.859375 | 2 | [] | no_license | package com.xlauncher.entity.deployment.spec;
/**
* @author YangDengcheng
* @date 2018/2/28 14:09
*/
public class ConfigMapIn {
private Integer defaultMode;
private String name;
public Integer getDefaultMode() {
return defaultMode;
}
public void setDefaultMode(Integer defaultMode) {
... |
Markdown | UTF-8 | 14,548 | 3.234375 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "Kaggle: Digit Recognition"
date: 2018-07-19T10:20:00Z
categories: Kaggle
---
<br>
So this blog post is actually going to be a little different because this has nothing to do with GSOC(Google Summer of Code) but well it could because some of the projects have to deal with NLP(Natural Language Pr... |
Markdown | UTF-8 | 8,306 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | # CLOUD AZURE EVENTHUB DataDog monitors
## How to use this module
```hcl
module "datadog-monitors-cloud-azure-eventhub" {
source = "claranet/monitors/datadog//cloud/azure/eventhub"
version = "{revision}"
environment = var.environment
message = module.datadog-message-alerting.alerting-message
}
... |
TypeScript | UTF-8 | 313 | 2.890625 | 3 | [
"MIT"
] | permissive | export type TupleToUnion<T> = T extends Array<infer ITEMS> ? ITEMS : never;
export type ReduceTupleOn<
T extends any[],
FIELD extends keyof TupleToUnion<T>,
EXTRACTFIELD extends keyof TupleToUnion<T>
> = { [key in TupleToUnion<T>[FIELD]]: Extract<TupleToUnion<T>, { [exc in FIELD]: key }>[EXTRACTFIELD] };
|
C# | UTF-8 | 7,491 | 3.03125 | 3 | [] | no_license | //Author: Nicholas Marshman
using System.Collections.Generic;
using UnityEngine;
public class AStar : MonoBehaviour {
private int initAix; //the initial Ai X coordinate
private int initAiy; //the initial Ai Y coordinate
private int xTarget; //the x coordinate of the target location
private int yTarget;... |
PHP | UTF-8 | 3,360 | 3 | 3 | [
"MIT"
] | permissive | <?php
require_once ('com/gmo_pg/client/output/BaseOutput.php');
/**
* <b>Paypal決済実行 出力パラメータクラス</b>
*
* @package com.gmo_pg.client
* @subpackage output
* @see outputPackageInfo.php
* @author GMO PaymentGateway
* @version 1.0
* @created 12-24-2009 00:00:00
*/
class ExecTranPaypalOutput extends Base... |
Markdown | UTF-8 | 4,601 | 2.828125 | 3 | [] | no_license | ## About
### Profession
Currently, I am a freelance full-stack developer and looking for a full-time front-end developer job. By job I mean, not just a job, but also an environment in which I could continually improve my professional and human skills. As a programmer, I value clean and quality code the most. Because ... |
Python | UTF-8 | 1,074 | 2.671875 | 3 | [
"MIT"
] | permissive | #
# Author: Sunil
# credits: https://rpubs.com/dvorakt/144238
#
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.naive_bayes import GaussianNB, BernoulliNB, MultinomialNB
from sklearn.linear_model import LogisticRegression
from sklearn import preprocessing
import json
from pprint import pprint... |
Markdown | UTF-8 | 648 | 3.078125 | 3 | [] | no_license | - 1: Canvas – Use your mouse to draw
- 2: Colors – Click to switch between the four available shades
- 3: History – Use these icons to undo or redo an action
- 4: Title – Give your sprite a name
- 5: Description – Optional description
- 6: Save – Make sure to save regularly
With PixBoy, you can quickly and easily crea... |
C# | UTF-8 | 2,971 | 2.546875 | 3 | [] | no_license | using System.Collections.Generic;
using Newtonsoft.Json;
using NUnit.Framework;
using Optional.Serialization;
using Optional.Tests.Dtos;
namespace Optional.Tests
{
[TestFixture]
public class OptionalSerializationTests
{
[Test]
public void WhenSerializingWithOptionalJsonConverterAndOptional... |
PHP | UTF-8 | 802 | 2.5625 | 3 | [] | no_license | <?php
// session_start();
header('charset=utf-8');
include './baza.class.php';
$baza = new Baza();
$datum = date('Y-m-d H:i:s');
header('charset=utf-8');
if (isset($_REQUEST['sezona'])) {
$sezona = $_REQUEST['sezona'];
} else {
$sezona = null;
}
if ($sezona != null){
$upit="SELECT * FROM sezone_has_lovina... |
PHP | UTF-8 | 2,496 | 2.625 | 3 | [] | no_license | <?php class User extends CI_Controller{
public function __construct() {
parent::__construct();
$this->load->model('admin/role_model');
$this->load->model('admin/user_model');
}
function index()
{
$this->load->helper('login_helper');admin_log();
$data['title'] = "U... |
Markdown | UTF-8 | 3,477 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | # Attrapez Les Tous!!!
This simple app is a .Net Core 5.0 Web Api, exposing two endpoints to retrieve Pokemons's details, with or without a funny description.
# Pre-requisites
To be able to build and run the application, make sure you have .Net 5.0 SDK installed.
This app can also be run in Docker contai... |
Java | UTF-8 | 337 | 1.859375 | 2 | [] | no_license | package net.jupic.spring.security.sso;
import java.io.Serializable;
import java.util.Date;
public interface SignedSession extends Serializable {
String getSignedSessionId();
Date getCreatedTime();
Date getExpiredTime();
boolean isExpired();
Object getPrincipal();
Object getCredential();
String getPrinci... |
C# | UTF-8 | 2,275 | 3.265625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BoardgameInc.Logic_layer
{
public class PlayField
{
private List<Ship> ships;
private List<int> grid;
private int shipsLeft;
private string name;
... |
Python | UTF-8 | 691 | 2.546875 | 3 | [] | no_license | #!/usr/bin/python
import binascii
import sys
from termcolor import colored
txt = sys.argv[1]
n = 4
base="0x01010101"
pieces = [txt[i:i+n] for i in range(0, len(txt), n)]
for reverted in pieces[::-1]:
if (len(reverted) < n):
parsed = binascii.hexlify(reverted[::-1])
parsed = hex(int(parsed,16) + ... |
Java | GB18030 | 5,583 | 3.625 | 4 | [] | no_license | package tree;
import java.util.Scanner;
import java.util.Stack;
public class SortedBiTree {
protected SortedBiNode root;
protected int nodeNum;
public int CreateSortedBiTree(){
Scanner sc = new Scanner(System.in);
SortedBiNode pointer = null;
System.out.println("ڵ");
nodeNum = sc.nextInt();
System.out... |
C# | UTF-8 | 1,683 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Core.Enums;
namespace Core.Entities
{
public class Autor
{
public int Id { get; set; }
public string Nome { get; set; }
public string Email { get; set; }
public virtual IEnumerable<Artigo> Artigos { get; set; }
public... |
Java | UTF-8 | 4,353 | 2.140625 | 2 | [] | no_license | package com.quwb.web.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.util.Date;
public class ShopDetail {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column ShopDetail.DetailID
*
* @mbg.generated
*/
priv... |
Java | UTF-8 | 2,697 | 2.09375 | 2 | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | permissive | /*
*
* Copyright [2022] [DMetaSoul Team]
*
* 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 la... |
C | UTF-8 | 7,700 | 3.09375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
#include <omp.h>
#include <sys/time.h>
inline void scanint(int *x)
{
register char c = getchar_unlocked();
*x = 0;
for(; (c<48)||(c>57);c = getchar_unlocked());
for(; (c>47)&&(c<58);c = getchar_unlocked())
*x = (int)((((*x)<<1) + ((*x)<<3)) + c -... |
Markdown | UTF-8 | 6,491 | 2.609375 | 3 | [] | no_license | <div>
<p>Khoai lang có nhiều chất dinh dưỡng tốt cho cơ thể, dễ ăn và giúp bạn giảm cân hiệu quả.</p>
</div>
<div id="maincontent">
<div>
<p>Giảm cân là mục tiêu khó đạt được do mọi người không thể kiểm soát mong muốn ăn những món yêu thích. Trong trường hợp đó, bạn phải lựa chọn thực phẩm có lợi cho sức khỏe và tạo c... |
C++ | GB18030 | 2,433 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "EGraph.h"
using namespace std;
int x[11][3]= {
1,2,19,
2,3,5,
1,7,18,
1,5,14,
2,5,12,
2,4,7,
3,4,3,
7,5,16,
5,4,8,
4,6,21,
7,6,27,
};
void CreateGraph (EGraph *g){
int i;
g->vexnum=7; g->edgenum=11;
for(i=0... |
Ruby | UTF-8 | 2,471 | 3.296875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | # frozen_string_literal: true
module TTY
class ProgressBar
# Responsible for converting values to different formats
#
# @api public
module Converter
HOURSECONDS = 3600
# Convert seconds to time notation
#
# @param [Numeric] seconds
# the seconds to convert to time
... |
JavaScript | UTF-8 | 7,979 | 3.140625 | 3 | [] | no_license | $(document).ready(function() {
//v1.02
//variables
var wins = 0;
var losses = 0;
var lettersGuessed = [];
var wordBank = [];
var guessesLeft;
var dashWordClue = [];
var guessesMade = 0;
var pickedWord;
var isWinner;
var pickedWordArray = [];
var pickedWordPlaceholde... |
Java | UTF-8 | 937 | 2.140625 | 2 | [] | no_license | package com.mop.qa.test.CAT;
import org.testng.annotations.Test;
import com.mop.qa.pageobject.JdeHomePage;
import com.mop.qa.pageobject.SignOnPage;
import com.mop.qa.pageobject.TMSShipConfirmCatPage;
import com.mop.qa.pageobject.WorkWithShippmentPage;
import com.mop.qa.testbase.TestBase;
public class TC510 extends ... |
Python | UTF-8 | 1,173 | 4.5 | 4 | [] | no_license |
'''
Простейшие арифметические операции (1)
Написать функцию arithmetic, принимающую 3 аргумента:
первые 2 - числа, третий - операция, которая должна быть произведена над ними.
Если третий аргумент +, сложить их; если —, то вычесть; * — умножить; / — разделить (первое на второе).
В остальных случаях вернуть строк... |
C# | UTF-8 | 1,563 | 2.921875 | 3 | [] | no_license | using System;
using Veam.Domain.Core.ValueObjects;
namespace Veam.Domain.Core.ValueObjects
{
/// <summary>
/// person Value Object
/// </summary>
public class Person : ValueObject<Person>
{
public Person(string firstName, string lastName, string middleName, string nickName, string gender, ... |
C# | UTF-8 | 565 | 2.734375 | 3 | [] | no_license | using REVISAO_H1.Entidades;
using System;
namespace REVISAO_H1
{
class Program
{
static void Main(string[] args)
{
FilaEstaticaInteiros f = new FilaEstaticaInteiros(10);
f.Enfilera(10);
f.Enfilera(20);
f.Enfilera(30);
f.Enfilera(40);
... |
JavaScript | UTF-8 | 1,688 | 3.34375 | 3 | [] | no_license | (function(){
const Data = [];
function newNote(){
//elements
const dialog = document.getElementById('dialog');
const title= document.getElementById('inputTile');
const description = document.getElementById('description');
const createBtn = document.getElementById('createBtn');
const saveB... |
Python | UTF-8 | 1,301 | 2.984375 | 3 | [
"WTFPL"
] | permissive | import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler
class FileWatcher():
def __init__(self, path_to_watch="."):
self.path_to_watch = path_to_watch
self.event_handler = LoggingEventHandler()
self.observer = Observer()
... |
TypeScript | UTF-8 | 1,575 | 3.625 | 4 | [
"MIT"
] | permissive | /// ----- Shopping Cart Billing ----- ///
/*
* Complete the 'findLowestPrice' function below.
*
* The function is expected to return an INTEGER.
* The function accepts following parameters:
* 1. 2D_STRING_ARRAY products
* 2. 2D_STRING_ARRAY discounts
*/
function findLowestPrice(products: string[][], discount... |
Java | UTF-8 | 3,773 | 2.234375 | 2 | [] | no_license | package lwj.app;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.securi... |
Java | UTF-8 | 255 | 2.71875 | 3 | [] | no_license | package com.alliswell.hashcode;
public class Human {
String name;
int adharano;
public Human(String name, int adharano) {
this.name = name;
this.adharano = adharano;
}
@Override
public int hashCode() {
return adharano;
}
}
|
C# | UTF-8 | 3,287 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using PBingenering.SQL;
using PBingenering.Model;
namespace PBingenering
{
public partial class Cre... |
C | UTF-8 | 432 | 3.734375 | 4 | [] | no_license | #include <stdio.h>
#include <string.h>
//Find some digits in a fractional part of a number and multiply what you get
int main(int argc, char **argv)
{
char s1[10], s2[1100000];
strcpy(s2, "");
int i;
for(i=1; i<190000; i++){
sprintf(s1, "%d", i);
strcat(s2, s1);
}
printf("The product of those digits is %d\n"... |
Python | UTF-8 | 3,536 | 3 | 3 | [] | no_license | from experta import *
from questions import ask_question
from .facts import Question, Confirmed, DepartureTime, Input, DepartingFrom
class DepartureTimeRules:
# No departure date specified
@Rule(Question('departure_time') & ~Fact(departure_date=W()))
def ask_departure_date(self):
self.output_que... |
Java | UTF-8 | 208 | 2.09375 | 2 | [] | no_license | package ba.bitcamp.ludogame;
import java.util.Random;
public class Utility {
public static int getRandomNumber() {
Random rand = new Random();
int option = rand.nextInt(6) + 1;
return option;
}
}
|
C | UTF-8 | 1,167 | 3.171875 | 3 | [
"MIT"
] | permissive | /*
例程187. 字符左右排序
整理优化by:千百度QAIU
QQ:736226400
编译环境:gcc/tcc
2017/10/25
*/
#include<stdio.h>
#include<string.h>
#include<conio.h>
char xx[20][80];
void jsSort()
{
int i,strl,half,j,k;
char ch;
for(i=0;i<20;i++) /*行循环*/
{
strl=strlen(xx[i]); /*每行长度*/
half=strl/2;
for(j=0;j<half-1;j++) /*每行的第j个位置*/
for(k=j+1;... |
Markdown | UTF-8 | 720 | 2.65625 | 3 | [] | no_license | # Article 16
Si, lors d'un contrôle en un lieu situé dans une zone protégée, il apparaît que les exigences prévues à l'article 15 ne sont pas respectées, sans préjudice des mesures prévues à l'article R. 251-9 du code rural qui peuvent être prises lorsque les exigences phytosanitaires ne sont pas remplies, les agents ... |
Python | UTF-8 | 2,736 | 3.125 | 3 | [
"Apache-2.0"
] | permissive | import copy
from hashlib import md5
class TestingDataFrame:
def __init__(self, df):
self._df = df
self._df = self._df.fillna('').astype('str')
def __repr__(self):
columns = ', '.join(self._df.columns)
values = str(self._df.values)
return f'Columns: {columns}\n{values}... |
Python | UTF-8 | 680 | 3.078125 | 3 | [
"MIT"
] | permissive | """
Style Transfer
"""
import os
import base64
def transfer(input_image_name, style, color, ratio):
"""
Load model and perform style transfer on input image
:param input_image_name: filename of an input image
:param style: a style name before '-' in image filename
:return: output_image
"""
... |
PHP | UTF-8 | 4,057 | 3.09375 | 3 | [] | no_license | <?php
require_once("Connection.php");
class Model
{
protected static $pk;
protected static $fields;
protected static $identityMap;
protected $dirty;
public $data;
public function __construct($data = [])
{
$this->data = $data;
$this->dirty = false;
static::$identityMa... |
Rust | UTF-8 | 138 | 2.921875 | 3 | [
"MIT",
"LicenseRef-scancode-other-permissive",
"Apache-2.0",
"BSD-3-Clause",
"BSD-2-Clause",
"NCSA"
] | permissive | fn main() {
let x = 3;
match x {
1 | 2 || 3 => (), //~ ERROR unexpected token `||` after pattern
_ => (),
}
}
|
JavaScript | UTF-8 | 951 | 4.0625 | 4 | [] | no_license | let arr = [1, [2, [3, 4]]]
// function flatten(arr) {
// let res = []
// function fla(arr) {
// for (item of arr) {
// if (typeof item === 'object') {
// fla(item)
// } else {
// res.push(item)
// }
// }
// }
// fla(arr)
// return res
// }
// console.log(flatten(ar... |
C# | UTF-8 | 1,155 | 2.96875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
public class TestOrderedInt : MonoBehaviour
{
void Start()
{
TestAddMiddle();
TestRemoveMiddle();
}
void TestAddMiddle()
{
OrderedInt array = new OrderedInt();
array.Add(40... |
JavaScript | UTF-8 | 4,508 | 2.5625 | 3 | [
"MIT"
] | permissive | 'using strict';
const fs = require("fs");
const path = require('path');
function _retrieveConfigurationOverrides(argv, profileNameDefault, configLocationDefault) {
let temp;
let profileNameFinal = profileNameDefault;
let configLocationFinal = configLocationDefault;
ret = {
}
for (let j = 0; j <... |
Markdown | UTF-8 | 7,547 | 2.875 | 3 | [] | no_license | ---
title: Ruby vs Language Classics
---
C • C++ • Perl • Python • PHP • Lua • Java • JavaScript • Erlang
## First Appeared
| Lang | First Appeared |
|----------------|---------------------|
| **Ruby** | 1995; 23 years ago |
| | - vs - |
| **C** |... |
C# | UTF-8 | 4,422 | 2.875 | 3 | [] | no_license | using Blueberry;
using Blueberry.Graphics;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DN
{
public enum CellType:byte
{
Free = 0,
Wall = 1,
Ladder = 2,
VRope ... |
Java | UTF-8 | 3,377 | 2.421875 | 2 | [] | no_license | /*
* Copyright (C) 2012 Krawler Information Systems Pvt Ltd
* All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your optio... |
Java | UTF-8 | 1,777 | 2.265625 | 2 | [] | no_license | package ru.taxofon.dao.impl;
import ru.taxofon.dao.DamageListDao;
import ru.taxofon.entity.DamageList;
import javax.persistence.Query;
import java.util.List;
public class DamageListDaoImpl extends BasicDaoImpl<DamageList> implements DamageListDao {
public DamageListDaoImpl(Class<DamageList> entityClass) {
... |
PHP | UTF-8 | 380 | 2.53125 | 3 | [] | permissive | <?php
namespace common\fixtures\helpers;
interface FixtureTester {
public function haveFixtures($fixtures);
public function grabFixture($name, $index = null);
public function seeRecord(string $class, array $array);
/**
* @param string $className
* @param array $attributes
* @return mixed
*/
public fu... |
Python | UTF-8 | 1,752 | 3.015625 | 3 | [
"MIT"
] | permissive | __author__ = 'Robert Havelaar, with help from group c Study group. '
from morse_dict import MORSE_2_ASCII
import re
# This module provides regular expression
# matching operations similar to
# those found in Perl.
#
def decode_bits(bits):
pattern_one = re.split(r'(0+)', bits.strip('0'))
unit_rate = len(sorte... |
Markdown | UTF-8 | 6,344 | 2.609375 | 3 | [] | no_license | # disk io 阻塞引发 golang 线程数暴涨的问题
我们知道golang对用户抽象了协程,协程要跑起来必然是需要系统线程来承载上下文,因为线程是最小的调度单元。golang的scheduler会帮你调度关联 PMG,这里的M是线程,G就是我们在golang里用go关键字spawn的协程。 对于用户来说,你是看不到也无法创建native thread原生线程的。 不管是golang nuts和golang issue里有人提过native thread feature的需求,但社区给出的论调是没必要,如果有必要那么可以用cgo,或者手动触发runtime.LockOSThread绑定。
golang抽象了pmg,我们通常... |
PHP | UTF-8 | 2,066 | 3.328125 | 3 | [] | no_license | <?php
class Eleve
{
private $_id;
private $_nom;
private $_prenom;
private $_adresse;
private $_ville;
private $_cp;
private $_tel;
public function __construct(array $donnees)
{
$this->hydrate($donnees);
}
public function hydrate (array $donnees)
... |
C++ | UTF-8 | 486 | 3.09375 | 3 | [] | no_license | #include<vector>
using namespace std;
class Solution {
public:
int maxProfit(vector<int> &prices) {
int pre = -1;
int profit = 0;
for(int& i: prices) {
if (pre == -1) {
pre = i;
} else {
if (i >= pre) {
profit += (i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.