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,138 | 2.828125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package controller;
import exceptions.UnexpectedOSException;
import model.OsInfoMac;
import model.OsInfoLinux;
import model.OsInfo;
im... |
C# | UTF-8 | 2,472 | 3.03125 | 3 | [] | no_license | using Microsoft.International.Converters.PinYinConverter;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 仓库管理系统
{
class PinyinHelper
{
/// <summary>
/// 取得中文字符串的拼音
/// </summary>
/// <param name="str... |
Markdown | UTF-8 | 1,456 | 3.484375 | 3 | [] | no_license | # pythonPractice
## By Jon Sweeney
### Notes
This is a collection of simple Python projects that I created for fun. Often, my code
is overkill. But I figured I would have a little fun with this. After working in QA, I
appreciate trying to handle edge cases.
Also, this was a nice refresher on using command line a... |
Java | UTF-8 | 579 | 3.4375 | 3 | [] | no_license | import java.util.Comparator;
/**
* The comparator for the pizza shack class
* @author Anirudh Gubba
* @version 1.1
*/
public class CustComparator implements Comparator<Customer> {
/**
* Compares two customers to determine the disparity
* in prices of their orders
*
* @return an int detailing... |
Python | UTF-8 | 3,749 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | """Common utility functions."""
import jwt
import logging
import re
import sys
import time
IS_PY3 = sys.version_info >= (3, 0)
# For compatibility with both Python 2 and 3.
# pylint: disable=redefined-builtin,invalid-name
if IS_PY3:
unicode = str
long = int
# pylint: enable=redefined-builtin,invalid-name
EXP... |
Java | UTF-8 | 1,191 | 2.625 | 3 | [] | no_license | package LightDJGUI;
import java.util.ArrayList;
import SoundEngine.VisualizationEngineParty;
import Visualizors.Visualizer;
public class VisualizerChooser implements MouseAcceptorPanel {
protected VisualizationEngineParty engine;
protected int x;
protected int y;
protected int width;
protected int height;
prot... |
JavaScript | UTF-8 | 3,048 | 3.140625 | 3 | [] | no_license | const calFuncs = require('./calc_functions.js');
const fs = require('fs');
const version = '1.0.0';
process.stdin.resume();
process.stdin.setEncoding('utf8');
const firstArg = process.argv[2];
// if starts with flag
if (firstArg && firstArg.startsWith('-')) {
if (calFuncs.checkForValidFlag(firstArg)) {
if (f... |
JavaScript | UTF-8 | 1,881 | 2.59375 | 3 | [
"MIT"
] | permissive | // {
// id: 0,
// name: "xxxxxx",
// cardType: CardType.CHARACTER,
// cost: 3,
// content: `xxxxxxxxxx`,
// attack: 2,
// life: 1,
// attackBase: 2,
// lifeBase: 1,
// type: [""],
// isStrong: true,
// isFullOfEnergy: true,
// isDedication: true,
// onStart: funct... |
Markdown | UTF-8 | 4,032 | 2.84375 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: Azure Cosmos DB'de SQL sabitleri
description: Azure Cosmos DB'deki SQL sorgu sabitlerinin belirli bir veri değerini temsil etmek için nasıl kullanıldığı hakkında bilgi edinin
author: timsander1
ms.service: cosmos-db
ms.topic: conceptual
ms.date: 05/31/2019
ms.author: tisande
ms.openlocfilehash: cca62c358037d... |
JavaScript | UTF-8 | 272 | 3.1875 | 3 | [] | no_license | function divide(x, y) {
return y === 0 ?
{ value: null, error: new Error("Division by zero") } :
{ value: x / y, error: null };
}
const { value, error } = divide(10, 0);
if (error) {
console.error(error);
} else {
console.log(value);
} |
Python | UTF-8 | 2,399 | 2.828125 | 3 | [] | no_license | import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
window = tk.Tk()
window.title("Widget Look")
window.geometry("400x570")
window.wm_iconbitmap("images/ok.ico")
#### A LabelFrame with only tk widgets <-- observe! is tk.... just one 't': tk
tk_lbl_frame = tk.LabelFrame(wi... |
Java | UTF-8 | 566 | 2.234375 | 2 | [] | no_license | package converter.api.sng;
public class SngFileProperty {
private String propertyName;
private String propertyValue;
public SngFileProperty(String name, String value) {
this.propertyName = name;
this.propertyValue = value;
}
public String getPropertyName() {
return this.propertyName;
}
public void s... |
PHP | UTF-8 | 2,047 | 2.78125 | 3 | [] | no_license | <?php
if(isset($_POST['submit'])){
$role = mysqli_real_escape_string($con, $_POST['role']);
$natid = mysqli_real_escape_string($con, $_POST['natid']);
$fname = mysqli_real_escape_string($con, $_POST['fname']);
$sname = mysqli_real_escape_string($con, $_POST['sname']);
$email = mysqli_... |
Shell | UTF-8 | 5,501 | 3.125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | #! /usr/bin/env bash
#
# (c) 2019 Copyright, Real-Time Innovations, Inc. All rights reserved.
#
# RTI grants Licensee a license to use, modify, compile, and create derivative
# works of the Software. Licensee has the right to distribute object form
# only for use with RTI products. The Software is provided "as is", ... |
C++ | UTF-8 | 494 | 3.140625 | 3 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
class Solution
{
public:
vector<int> searchRange(vector<int> &nums, int target)
{
vector<int> ans(2, -1);
auto lower = lower_bound(nums.begin(), nums.end(), target);
if (lower == nums.end() || *lower != target) {
return ans;
}
... |
Python | UTF-8 | 1,055 | 2.953125 | 3 | [] | no_license | from django.shortcuts import render,HttpResponse
# Create your views here.
from .models import Student
def insert(request):
#Student.objects.create(name="gzci")
#Student.objects.create(age="18")
for i in range(100):
if i%3==0:
sexValue = False
else:
sexValue = True
... |
C++ | UTF-8 | 211 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int i, a;
scanf("%i",&i);
i*= 2;
a = sqrt(i);
if(a * (a+1) == i) puts("YES");
else puts("NO");
return 0;
} |
Java | UTF-8 | 1,025 | 2.125 | 2 | [
"Apache-2.0"
] | permissive | package iae.home.money2011.v2.charts;
import iae.home.utils.text.CurrencyCode;
import java.io.Serializable;
public class GraphicsBarFilter implements Serializable {
private static final long serialVersionUID = -8208449337424989486L;
public static final Integer DEPOSIT=1;
public static final Integer WITHDRAWAL=0... |
JavaScript | UTF-8 | 2,169 | 2.578125 | 3 | [] | no_license | function ClickSearch(){
//alert("searchClick")
// alert(document.readyState)
var log_win_content = document.getElementById("log_win_content")
// alert(log_win_content.innerHTML)
}
function parseEveryLine(trEl){
var str = trEl.getElementsByTagName("td")[1].innerHTML
var fields = str.split("|")
var newStr = ""
... |
Python | UTF-8 | 3,939 | 2.703125 | 3 | [] | no_license | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
Python | UTF-8 | 3,776 | 3.140625 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
class History(ABC):
''' Random-access to past market events. '''
@abstractmethod
async def get_reader(self, description):
''' Get a reader handle for a market feed description.
:param ~cryptomate.market.data.FeedDescription description: identification ... |
Python | UTF-8 | 896 | 3.140625 | 3 | [] | no_license | import numpy as np
import pandas as pd
import random
from scipy.stats import truncnorm
import matplotlib.pyplot as plt
import scipy.stats as ss
'''数组写入excel表'''
def excelWriter(A):
data = pd.DataFrame(A)
writer = pd.ExcelWriter('B.xlsx') # 写入Excel文件
data.to_excel(writer, 'page_1', float_format='%.5f',inde... |
Ruby | UTF-8 | 3,828 | 2.6875 | 3 | [] | no_license | require 'simple_message_queue/configuration'
require 'simple_message_queue/core_ext/string'
require 'simple_message_queue/errors'
require 'simple_message_queue/notification'
require 'aws-sdk-v1'
module SimpleMessageQueue
class << self
# Class Methods only available to SimpleMessageQueue
attr_accessor :config... |
Python | UTF-8 | 2,205 | 3.515625 | 4 | [] | no_license | import os
import matplotlib.pyplot as plt
import datetime
class Portfolio:
def __init__(self, coins = {}):
# coins is a map associating each coin name to its amount in the portfolio.
#Ex : coins = {"bitcoin" : 1.5, "ethereum" : 3,"litecoin" : 10}
self.coins = coins
#adds an amount of a coin to the portfolio
... |
Markdown | UTF-8 | 1,605 | 2.921875 | 3 | [
"MIT",
"CC-BY-NC-SA-4.0",
"CC-BY-NC-4.0"
] | permissive | ---
title: 寄信
date: '2014-03-09'
slug: mail-in-us
---
(一)
今天打开邮箱,一封前几天寄出去的信居然寄回来了。一看信封,原来某大人把收信人和寄信人的位置写反了。尽管上面也写了"To:..."和"From:...". 因为现在所有的邮件,除了上下车的时候外,都没有人会碰邮件的。都是机器扫描信封,然后自动分类。而机器不会扫描你的"From, To"。
在中国,我们写信的时候,通常是左上角写邮编,中间写收信人信息,右下角写寄信人信息。
但是在美国,格式却又不一样了。[这里](http://www.nhcs.net/parsley/curriculum/postal/envelope... |
Java | UTF-8 | 3,246 | 2.203125 | 2 | [] | no_license | package org.xbill.DNS;
import java.io.IOException;
import java.util.BitSet;
public class NXTRecord extends Record {
private static final long serialVersionUID = -8851454400765507520L;
private BitSet bitmap;
private Name next;
NXTRecord() {
}
Record getObject() {
return new NXTRecord(... |
Markdown | UTF-8 | 4,106 | 2.78125 | 3 | [
"Unlicense"
] | permissive |
# Trump awards posthumous Presidential Citizens Medal to Sept. 11 hero Rick Rescorla
Published at: **2019-11-07T22:06:38+00:00**
Author: **Morgan Phillips**
Original: [Fox News](https://www.foxnews.com/us/trump-awards-presidential-citizens-medal-posthumously-to-sept-11-hero-rick-rescorla)
President Trump awarded a... |
C++ | UTF-8 | 24,017 | 2.9375 | 3 | [] | no_license | #ifndef __INCLUDE_UPSAMPLE_H__
#define __INCLUDE_UPSAMPLE_H__
#ifndef CLIP3
#define CLIP3(x,min,max) ( (x)<(min)?(min):((x)>(max)?(max):(x)) )
#endif
#ifndef TURN3
#define TURN3(x,min,max) ( (x)<(min)?(-x): ((x)>(max)?(2*(max)-(x)):(x)) )
#endif
#ifndef BYTE
#define BYTE unsigned char
#endif
template... |
TypeScript | UTF-8 | 1,472 | 2.578125 | 3 | [
"MIT"
] | permissive | import { AbstractAppender, LogAppender, LogEvent, LogFormatter } from "@betomorrow/logging-core";
import { Mutex } from "async-mutex";
import * as RNFS from "react-native-fs";
import { FileAppender } from "./fileAppender";
export class RollingFileAppender extends AbstractAppender implements LogAppender {
private maxF... |
C++ | UTF-8 | 468 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<stdio.h>
using namespace std;
/*
struct articulos{
int codigo;
char nombre[20];
int precio;
int cantidad;
}producto1;
*/
struct Persona{
char nombre[20];
int edad;
}persona1;
int main(){
cout<<"Nombre 1: ";
cin.getline(persona1.nombre,20,'\n');
cout<<"Edad:... |
Java | UTF-8 | 1,058 | 2.203125 | 2 | [] | no_license | package br.com.code.sinqia.service;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.U... |
Python | UTF-8 | 272 | 4.3125 | 4 | [] | no_license | # Write a program to check whether a given number is armstrong or not.
n = int(input('Enter the number : '))
l = n
s = 0
while(n>0):
d = n%10
n = n/10
s = s+d*d*d
if(s==l):
print('It is an armstrong number')
else:
print('It is not an armstrong number') |
Java | UTF-8 | 5,499 | 2.03125 | 2 | [] | no_license | package com.mdy.dzs.data.domain.server;
import java.io.Serializable;
import java.util.Date;
/**
* ServerInfo类表示一个服务器的信息
*
*/
public class ServerInfo implements Serializable{
private static final long serialVersionUID = 1L;
//
/**准备*/
public static final int RUN_STATUS_READY=0;
/**启动*/
publi... |
Java | UTF-8 | 2,311 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | /**
*
*/
package com.prokarma.pkmst.pkmst.security;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.ann... |
Java | UTF-8 | 223 | 2.28125 | 2 | [] | no_license | package com.aor.numbers;
import com.aor.numbers.GenericListFilter;
public class PositiveFilter implements GenericListFilter {
@Override
public boolean accept(Integer integer) {
return integer > 0;
}
}
|
C++ | UTF-8 | 476 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm> // __gcd
#define ll long long
using namespace std;
int main() {
int n;
int G[105];
int res=1;
cin >> n;
for(int i=1; i<=n;i++)
cin >> G[i];
for(int i=1;i<=n;i++){
int p = G[i];
int t = 1;
... |
Python | UTF-8 | 762 | 3.15625 | 3 | [
"MIT"
] | permissive | from sklearn.preprocessing import MultiLabelBinarizer
import numpy as np
import pickle
import nltk
import re
nltk.download('stopwords')
wpt = nltk.WordPunctTokenizer()
stop_words = nltk.corpus.stopwords.words('english')
# Function courtesy: http://bit.ly/2N17Clt
def clean_title(title: np.ndarray) -> np.ndarray:
... |
Java | UTF-8 | 5,082 | 2 | 2 | [] | no_license | package com.elmakers.mine.bukkit.plugins.crowd;
import java.util.List;
import java.util.Random;
import java.util.logging.Logger;
import net.minecraft.server.EntityChicken;
import net.minecraft.server.EntityCow;
import net.minecraft.server.EntityCreeper;
import net.minecraft.server.EntityGhast;
import net.minecraft.se... |
Java | UTF-8 | 1,174 | 3.484375 | 3 | [] | no_license | package best_practise;
import java.util.LinkedList;
public class BracketsValidationRunner {
public static void main(String[] args) {
String bracketsIsValid = "[{{[]}}]";
String bracketsIsNotValid = "[{{[]}]]";
String bracketsIsValid2 = "[]{{}}[{}]";
System.out.println(isValid(... |
Java | UTF-8 | 19,106 | 1.53125 | 2 | [] | no_license | /*******************************************************************************
* @author
* Ybrant Digital
* Copyright (C) Ybrant Digital
* http://www.ybrantdigital.com
*******************************************************************************/
package com.micaja.servipunto.activities;
import java.util... |
Python | UTF-8 | 81 | 3.5 | 4 | [] | no_license | #for문 _ range 구구단2
for i in range(1,10,2):
print(f"3 x {i} = {3*i}") |
Java | UTF-8 | 2,191 | 2.5625 | 3 | [] | no_license | package com.surajbokey.moshiparsing.support;
import android.support.annotation.Nullable;
import com.squareup.moshi.JsonAdapter;
import com.squareup.moshi.JsonReader;
import com.squareup.moshi.JsonWriter;
import com.squareup.moshi.Moshi;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.... |
Java | UTF-8 | 2,063 | 2.578125 | 3 | [] | no_license | package com.owlet.game.draw.ui;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JPanel;
import com.owlet.game.draw.controler.GameMasterController;
import com.owlet.game.draw.ui.panels.CustomJPanel;
import com.owlet.game.draw.ui.panels.MainM... |
PHP | UTF-8 | 849 | 2.703125 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: LongPC
* Date: 01/07/2019
* Time: 09:44
*/
namespace App\Http\Controllers\Website\Traits;
/**
* Trait SlugableTrait
* @package App\Http\Controllers\Website\Traits
*/
trait SlugableTrait
{
/**
* @param $slug
* @return \Illuminate\Contracts\View\Factory|\Illuminate\... |
Markdown | UTF-8 | 4,803 | 2.765625 | 3 | [
"MIT"
] | permissive | ---
title: How to Make your VoIP Application Always Reachable
date: 2019-03-19 12:30:00
author: Emmanuel QUENTIN
category: Wazo IPBX
tags: Mobile, notification, VoIP, CallKit, ConnectionService, PushKit
slug: how-to-make-your-voip-application-always-reachable
status: published
---
 {
$config = array();
if ($type == '*') {
$type = '*';
}if ($type == 'image') {
$type = 'gif|png|jpg|jpeg';
}
ini_set('memory_limit', '128M');
... |
Python | UTF-8 | 348 | 3.5 | 4 | [] | no_license | #raw_input pega a informacao e o if compara para ver se e igual
user = raw_input('digite o nome do usuario: ')
if user == 'root':
print 'Usuario logado como, %s' % user
#elfi adiciona mais uma comparacao
elif user == 'admin':
print 'Usuario logado como, %s utilizando o elif' % user
#else e a saida
else:
... |
Java | UTF-8 | 3,440 | 3.859375 | 4 | [] | no_license | package pinzen.utils.mathsfog;
/**
* Represents a Vector/Vertex with 3 float components (x, y and z)
*/
public class Vertex3f {
public float x, y, z;
/**
* Create a Vertex3f
* @param x : component in the X axis
* @param y : component in the Y axis
* @param y : component in the Z axis
*/
public Vertex... |
Markdown | UTF-8 | 3,183 | 2.921875 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-public-domain"
] | permissive | ---
permalink: /components/search-bar/
redirect_from:
- /search-bar/
layout: styleguide
type: component
title: Search bar
category: UI components
lead: A box that allows users to search for specific content if they know what search terms to use or can’t find desired content in the main navigation
---
{% include code/p... |
Java | UTF-8 | 2,263 | 3.125 | 3 | [] | no_license | package com.bingo.helloworld;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ht... |
JavaScript | UTF-8 | 9,571 | 2.8125 | 3 | [] | no_license |
var divRoot = $("#affdex_elements")[0]; //DEBEMOS CREAR UN DIV Y ASIGNARLE UN ID
var width = 0; //MARCO QUE SE CAPTURA
var height = 0;//MARCO QUE SE CAPTURA
//CONFIGURACION DEL DETECTOR DE ROSTROS
//LARGE_FACE PARA ROSTROS QUE OCUPAN GRAN PARTE DEL MARCO
var faceMode = affdex.FaceDe... |
Java | UTF-8 | 8,783 | 2.046875 | 2 | [
"MIT"
] | permissive | package com.capstone490.nitesh.datadashboard.Views;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import a... |
Java | UTF-8 | 1,963 | 2.21875 | 2 | [] | no_license | package com.data_rest_example.web;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.NO_CONTENT;
import static org.springframework.http.HttpStatus.OK;
import java.security.Principal;
import javax.validation.Valid;
import org.springframework.bean... |
Java | UTF-8 | 533 | 3.5 | 4 | [] | no_license | public class two {
public static void main(String[] args) {
for (int i = 1; i <= 2000; i++) {
if (checkPalindrome(String.valueOf(i * i * i))) {
System.out.println(i + " cubed is " + i * i * i);
}
}
}
public static boolean checkPalindrome(String cube)... |
C# | UTF-8 | 6,442 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Security;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Beweb;
namespace Site.tests {
public partial class TestFTP : System.Web.UI.Page {
protected v... |
JavaScript | UTF-8 | 1,508 | 3.59375 | 4 | [] | no_license | // function arrayManipulation(n, queries) {
// let array = [];
// for (var i=0; i<n; i++) {
// array[i]=0
// }
// console.log(array);
// queries.forEach((el,i) => {
// let a = el[0] - 1;
// let b = el[1] - 1;
// let k = el[2];
// console.log(a,b,k);
// ... |
C# | UTF-8 | 1,579 | 2.640625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using JWT;
using JWT.Algorithms;
using JWT.Serializers;
using OscarWeb.Constants;
namespace OscarWeb.Services
{
/// <summary>
/// Class for creating JSON web tokens which are required to consume any of the Web APIs
/// </summary>
public static class Js... |
Java | UTF-8 | 1,709 | 2.859375 | 3 | [] | no_license | package com.li.mySpringFrameWork;
import com.li.mySpringFrameWork.httpServerAsController.MyController;
import com.li.mySpringFrameWork.utils.CotrollerMappingAnnotation;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* @program: GradleTestUseSubModule
* @author: Yafei Li
* @cr... |
C# | UTF-8 | 486 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace EventsExercise.Entities
{
public class Subscriber1
{
public string Name { get; set; }
public Subscriber1()
{
}
public Subscriber1(string name)
{
Name = name;
}
... |
JavaScript | UTF-8 | 3,092 | 2.953125 | 3 | [] | no_license | class Scheduler {
constructor(maxNum) {
this.waiting = [];
this.doing = [];
this.count = 0;
this.maxNum = maxNum;
this.cur = 0;
this.queue = [];
}
add(promiseCreator) {
return new Promise((resolve, reject) => {
promiseCreator.resolve = res... |
Java | UTF-8 | 1,257 | 2.171875 | 2 | [] | no_license | package com.example.gastroit.controller;
import java.util.List;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.s... |
C++ | UTF-8 | 5,086 | 3.9375 | 4 | [
"MIT"
] | permissive | // Count smaller elements on right side of each element of an array
#include <stdio.h>
#include <stdlib.h>
#define lli long int
// An AVL tree node
struct node
{
lli key;
struct node *left;
struct node *right;
lli height;
lli size; // size of the tree rooted with this node
};
// A utility functio... |
C# | UTF-8 | 2,659 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using NineBitByte.Common;
using NineBitByte.Common.Structures;
using NineBitByte.FutureJourney.Items;
using NineBitByte.FutureJourney.World;
using UnityEngine;
namespace NineBitByte.FutureJourney.Programming
{
/// <summary> An item that ca... |
Python | UTF-8 | 2,446 | 2.625 | 3 | [] | no_license | import sqlite3
#maindb = sqlite3.connect('C:/Users/Igor/Documents/Dev/projects/IGE/db/MAIN.db')
#c = maindb.cursor()
def create_db(name):
conn = sqlite3.connect("C:/Users/Igor/Documents/Dev/projects/IGE/db/"+name+".db")
c = conn.cursor()
c.execute("CREATE TABLE "+name+" (id, username, full_name, profil... |
Java | UTF-8 | 13,547 | 3.140625 | 3 | [] | no_license | package framework.core;
import framework.utils.File2String;
import framework.utils.Vector2d;
import javax.swing.*;
import java.util.LinkedList;
import java.util.Random;
/**
* This class represents the map where the game is played. An interesting method of this class is LineOfSight, that can be used
* to check the l... |
C++ | UTF-8 | 803 | 3.21875 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <algorithm>
using namespace std;
class UnionSet {
public:
vector<int> parent;
vector<int> rank;
int n;
UnionSet(int nIn) : n(nIn), parent(nIn), rank(nIn, 0) {
for (int i=0; i<n; ++i) {
parent[i] = i;
}
}
// these methods CANNOT b... |
C++ | GB18030 | 1,759 | 2.921875 | 3 | [] | no_license | const int maxn=100010;//ֵ
const int maxm=400010;//ֵ,
const int inf = 0x3f3f3f3f;
int head[maxn], tol;
int cur[maxn], dis[maxn];
bool vis[maxn];
struct edge{
int to, next, cap, flow;
}e[maxm];//עmaxm
void init() { //ʼ
tol = 0;
memset(head, -1, sizeof(head));
}
//ӱߣͼ˫ͼĸ
inline void addedge(i... |
JavaScript | UTF-8 | 628 | 2.6875 | 3 | [] | no_license | const { Board, Led, Sensor } = require("johnny-five");
const loudness = require("loudness");
const brightness = require("brightness");
const board = new Board();
board.on("ready", () => {
const volMeter = new Sensor({ pin: "A1", threshold: 5 });
const brightMeter = new Sensor({ pin: "A0", threshold: 5 });
volM... |
C# | UTF-8 | 1,312 | 3.484375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Workspace
{
class IsFibo
{
private static void Main(string[] args)
{
int size = Convert.ToInt32(Console.ReadLine());
long[] i... |
SQL | WINDOWS-1252 | 1,956 | 3.578125 | 4 | [] | no_license |
CREATE OR REPLACE PACKAGE USUARIOYUCRA.PKG_UTIL AS
TYPE T_ARRAY_STRING IS TABLE OF VARCHAR2(1000)
INDEX BY BINARY_INTEGER;
FUNCTION SPLIT(P_DATA VARCHAR2, P_DELIMITADOR VARCHAR2 )
RETURN T_ARRAY_STRING;
END PKG_UTIL;
CREATE OR REPLACE PACKAGE BODY USUARIOYUCRA.PKG_UTIL AS
FUNCTION SPLIT(P_DATA VARCHAR2, P_DE... |
Java | GB18030 | 274 | 2.421875 | 2 | [] | no_license | package com.droneSystem.util;
/**
* һṹ壺-ֵ
*/
public class KeyValue {
public String m_keyName;
public Object m_value;
public KeyValue(String keyName,Object value){
this.m_keyName=keyName;
this.m_value=value;
}
public KeyValue(){
}
}
|
PHP | UTF-8 | 1,446 | 2.671875 | 3 | [] | no_license | <?php
namespace App\Controllers\Auth;
use Core\Render\RendererInterface as Render;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface as Request;
use \Core\Controller\Controller;
use \Core\session\FlashMessage;
use GuzzleHttp\Psr7\Response;
use App\modules\Auth\authenticate\AccessInter... |
Python | UTF-8 | 259 | 2.921875 | 3 | [] | no_license | """We create the items which will be positioned randomly in the maze"""
class Item:
def __init__(self, position, symbol, *args, **kwargs):
super().__init__(*args, **kwargs)
self.x, self.y = position
self.symbol = symbol
|
Java | UTF-8 | 449 | 3.171875 | 3 | [] | no_license |
class MultipleCatch{
public static void main(String args[]){
try{
int a[]=new int[5];
a[10]=20/0;
}
catch(Exception e){System.out.println("Expection");}
catch(ArithmeticException e){System.out.println("Divide by zero not possible");}
catch(ArrayIndexOutOfBoundsE... |
Markdown | UTF-8 | 804 | 2.9375 | 3 | [] | no_license | # VisualRank-Using-Image-Similarity
This project is based on the well-known PageRank algorithm developed by Google to help in ranking web pages.
A similar simplistic version of it is utilized here to rank images based on similarity. An 1400x1400 similarity matrix (sim.mat)
is provided, which represents 1400 images fro... |
Java | UTF-8 | 173 | 2.390625 | 2 | [] | no_license | import java.io.*;
import java.util.*;
public class UseMain{
public static void main(String[] args) {
Square s1 = new Square(4);
s1.calArea();
}
} |
JavaScript | UTF-8 | 343 | 3.09375 | 3 | [] | no_license | define(function() {
return {
add: function() {
var values = Array.prototype.slice.call(arguments, 0),
result = 0;
while(values.length > 0) {
result += Number(values.shift());
}
return result;
},
subtract: function(value, fromValue) {
return fromValue -... |
Swift | UTF-8 | 4,008 | 2.75 | 3 | [] | no_license | //
// calTVC.swift
// pushupCounter
//
// Created by Ben Yorke on 1/9/15.
// Copyright (c) 2015 Ben Yorke. All rights reserved.
//
import UIKit
import CoreData
class calTVC: UITableViewController {
var delegate: pushupVC?
var countPerDay: [String: Int] {
let appDel = UIApplication.sharedAppl... |
Java | UTF-8 | 5,012 | 1.804688 | 2 | [] | no_license | /*
* Copyright (c) 2004-2013 The YAWL Foundation. All rights reserved.
* The YAWL Foundation is a collaboration of individuals and
* organisations who are committed to improving workflow technology.
*
* This file is part of YAWL. YAWL is free software: you can
* redistribute it and/or modify it under the terms of... |
PHP | UTF-8 | 1,264 | 2.640625 | 3 | [] | no_license | <?php
require_once("conex.inc");
require_once("validacoes.inc");
$nome=$_POST['txtNome'];
$sobrenome=$_POST['txtSobrenome'];
$email = $_POST['txtEmail'];
$tel=$_POST['txtTelefone'];
$msg=$_POST['txtMensagem'];
$flag=false;
$erros="";
if(empty($nome)){
$erros .= "Nome, ";
$flag = true;
}
if(empty($sobrenome)){... |
C++ | UTF-8 | 26,218 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "pyhelp.h" // include first to avoid annoying redef warning
#include "math/nemlmath.h"
#include "nemlerror.h"
namespace py = pybind11;
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>)
namespace neml {
PYBIND11_MODULE(nemlmath, m) {
m.doc() = "Various mathematical helper functions.";
m.def("tran... |
PHP | UTF-8 | 2,695 | 2.640625 | 3 | [] | no_license | <?php
include("lock.php");
// are we the result of a Submit click then try to login
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// username sent from Form
$myusername=$_POST['username'];
// prepared stmt follwos
/*
$sql="SELECT id, username, comment FROM users WHERE username = ?";
$stmt = $bd-... |
Markdown | UTF-8 | 625 | 3.0625 | 3 | [] | no_license | # AWS KMS based Ethereum Tx Signing
This repo shows how to sign an Ethereum transaction using AWS KMS.
## Medium
Please see my [medium article](https://luhenning.medium.com/the-dark-side-of-the-elliptic-curve-signing-ethereum-transactions-with-aws-kms-in-javascript-83610d9a6f81) for a detailed code walk-through.
##... |
Markdown | UTF-8 | 672 | 2.578125 | 3 | [] | no_license | ---
layout: post
title: "POJ 2918 - Tsudoku"
---
[http://poj.org/problem?id=2918](http://poj.org/problem?id=2918)
## 概要
簡単に機械的に解くことができる数独のサブセット Tsudoku を解く.
Tsudoku は,いずれかの行,列,3 x 3 のブロックがちょうど8個の数字で埋まっていたら,最後の一つを残りの数字で埋める,という手順を繰り返すと解くことができる.
## 制約
特になし
## 解法
やるだけ.
数字が埋められていない場所を覚えて,それが空になるまで手順を繰り返すという方法で実装した.
{%... |
Java | UTF-8 | 9,450 | 2.171875 | 2 | [] | no_license | package com.cloud.icenter.base.service.impl;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.... |
PHP | UTF-8 | 2,518 | 2.546875 | 3 | [] | no_license | <?php
include 'SessionCreatedCheck.php';
include 'MysqlConnectionCreated.php';
include 'TempHeader.html';
$noOfQuests = $_REQUEST['noOfQuests'];
$quest = $_REQUEST['quest'];
$ans = $_REQUEST['ans'];
$marks = $_REQUEST['marksForQuestion'];
$nameOfUser = $_SESSION['username'];
$domainOfUser = null;
$c... |
PHP | UTF-8 | 16,341 | 2.734375 | 3 | [] | no_license | <!DOCTYPE html>
<html lang="es">
<head>
<title>Susana Fabián Antón</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="../webroot/css/estilo.css">
<style>
form {
... |
C | UTF-8 | 265 | 2.65625 | 3 | [] | no_license | char *getPresentWorkingDirectory()
{
char *pwdBuffer=malloc(256*sizeof(char));
pwdBuffer[255]='\0';
pwdBuffer=getcwd(pwdBuffer,256);
if(pwdBuffer==NULL)
{
perror("error occoured");
}
else
{
return pwdBuffer;
}
} |
Java | UTF-8 | 16,832 | 1.695313 | 2 | [] | no_license | //
// -----------------------------------------------------------------------------------
// Source file: ProductQueryAPI.java
//
// PACKAGE: com.cboe.interfaces.presentation.api;
//
// -----------------------------------------------------------------------------------
// Copyright (c) 2000-2003 The Chicago Board Optio... |
Ruby | UTF-8 | 1,332 | 2.671875 | 3 | [
"MIT"
] | permissive | describe Digest::UUID do
context "clean" do
let(:expected) { '01234567-89ab-cdef-abcd-ef0123456789' }
it "handles a valid lowercase guid" do
expect(described_class.clean('01234567-89ab-cdef-abcd-ef0123456789')).to eq(expected)
end
it "handles a Microsoft-style guid" do
expect(described_c... |
Python | UTF-8 | 198 | 3.375 | 3 | [] | no_license | # Loop
# - While
# - For In
# orang = ['hilman', 'boss', 'komeng']
# for nama in orang:
# print('nama namanya adalah: ', nama)
text = 'python'
for huruf in text:
print("cekidot: ", huruf)
|
JavaScript | UTF-8 | 3,066 | 3.0625 | 3 | [] | no_license | describe("BoidCollection", function() {
describe("average velocity", function () {
it("is [0,0] when no boids specified", function() {
var averageVelocity = Flocking.BoidCollection.getAverageVelocity([]);
expect(averageVelocity.x).toBe(0);
expect(averageVelocity.y).toBe(0);
});
it("is cal... |
C# | UTF-8 | 6,470 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Day = Organizer.Model.Day;
namespace Organizer
{
public partial class RepeateConfig : Form
{
private readonly string[] _commands = { "Единожды", "Ежедневно", "Еженедельно", "Ежемесячно", "Ежегодно" };
private Dat... |
Markdown | UTF-8 | 8,188 | 2.765625 | 3 | [] | no_license | > 해당 문서는 [Do it! 자료구조와 함께 배우는 알고리즘 입문 : 파이썬 편 (시바타 보요 저)](http://www.yes24.com/Product/Goods/91219874)을 보고 정리한 내용입니다.
- 본 문서에 작성된 코드는 **파이썬 (Python)** 으로 작성하였습니다.
- 책을 보며 공부하면서 도움이 된 파이썬 문법과 개념은 [Python 폴더](https://github.com/dudtjakdl/TIL/blob/main/Python)의 문서에 정리하였습니다.
- 그 외 추가 내용은 인터넷 검색을 통해 공부하고 덧붙여 정리하였습니다.
# 재귀
... |
C++ | UTF-8 | 1,013 | 3.546875 | 4 | [] | no_license | #include<iostream>
int* lower_bound(int* first,int* const last,short target ){
//lower bound
int count = last - first;//capturing the size of Array
while (count!=0)
{
int step = count/2;//the step that wid will take
int* mid = first + step;//mid
if(*mid < target){
//if ... |
Go | UTF-8 | 550 | 2.6875 | 3 | [
"MIT"
] | permissive | package json
import (
"encoding/json"
"github.com/v2ray/v2ray-core/common/log"
)
type RouterConfig struct {
StrategyValue string `json:"strategy"`
SettingsValue json.RawMessage `json:"settings"`
}
func (this *RouterConfig) Strategy() string {
return this.StrategyValue
}
func (this *RouterConfig) Sett... |
TypeScript | UTF-8 | 371 | 3.5 | 4 | [] | no_license | class Rombo {
DiagonalV: number;
DiagonalH: number;
Area: number;
constructor(DiaV:number, DiaH:number){
this.DiagonalV = DiaV;
this.DiagonalH = DiaH;
}
CalculoArea() {
this.Area = this.DiagonalV * this.DiagonalH;
return this.Area;
}
}
let... |
C# | UTF-8 | 1,151 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using CodeArt.Log;
namespace CodeArt.Concurrent.Pattern
{
/// <summary>
/// 基于信号的行为
/// 每触发一次信号,就执行一次行为,在行为执行的过程中,触发信号的线程将等待
/// 异步由thread实现
/// </summary>
... |
Markdown | UTF-8 | 2,282 | 3.796875 | 4 | [] | no_license | ---
PermaID: 100013
Name: Async Operations
---
# Async Operations
When working with outside systems, like making calls to an external database, web API, etc., we typically use async operations to optimize our code while waiting for these external systems to respond, especially if they take more than a few millisecond... |
Java | UTF-8 | 872 | 3.25 | 3 | [] | no_license | package day7;
import java.util.Stack;
public class CollectionDemo {
public static void main(String[] args) {
Stack s = new Stack();
Stack stack=new Stack();
/*s.push("A");
s.push("A"); //3
s.push("B"); // 2
s.push(null); // 1
System.out.println(s);
System.out.println(s.peek());
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.