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 | 6,416 | 2.5 | 2 | [
"Apache-2.0"
] | permissive | package com.huxq17.example.utils;
import android.content.Context;
import android.content.res.AssetFileDescriptor;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.media.MediaScannerConnection;
import android.media.ThumbnailUtils;
impor... |
JavaScript | UTF-8 | 6,588 | 2.546875 | 3 | [
"MIT"
] | permissive | const express = require("express");
const users = express.Router();
//Middleware
const protect = require("../middleware/authMiddleware");
//Functions from Controller
const registerUser = require("../controllers/userController").registerUser;
const loginUser = require("../controllers/userController").loginUser;
const ... |
Markdown | UTF-8 | 5,562 | 2.703125 | 3 | [
"MIT"
] | permissive | ## 2017.7.22.
## Sungkyu Cho - sungkyu1.cho@gmail.com
PWNABLE KR - TODDLER - Passcode - 10pt
์ฝ๊ฒ ํ๋ฆด ์ค ์์๋ ๋ฌธ์ ์ธ๋ฐ, ์์ธ๋ก ์ ๋ง ์ค๋ซ๋์ ์ ๋ฅผ ๋จน์๋ ๋ฌธ์ .
์ด์ ๋ ๋์ค์ ์ค๋ช
์ ํ๊ฒ ์ง๋ง, ์์ ํํธ์ ๋ํด์ ๋๋ฌด ์ฝ๊ฒ ์๊ฐํ๋ ๋ด ์์ดํจ์ด ํฐ ์์ธ์ด์๋ค.
# 0.์ฐ์ ์ ์์ค์ฝ๋ ์ดํด๋ณด๊ธฐ
passcode.c ํ์ผ์ ์ดํด๋ณด๋ฉด welcome() ์์ username ์ ๋ฐ๊ณ , login()์์ ๋ชจ๋ ๋น๊ต ์์
์ ํ๋ ๊ฒ์ ์ ์ ์์. ๋งค์ฐ ๊ฐ๋จํ ์ฝ๋.
๊ทธ๋ผ ์ด์ ์ค์ ๋ก ์ด... |
C++ | UTF-8 | 1,614 | 3.203125 | 3 | [] | no_license | /*
CSE 109: Fall 2018
Lydia Cornwell
lac221
Makes hash map
Program #6
*/
#ifndef HASH_H
#define HASH_H
#include<vector>
#include<cstring>
#include<string>
#include<iostream>
#include<sstream>
using namespace std;
class Hash_t
{
public:
Hash_t();
Hash_t(size_t buckets);
Hash_t(size_t buckets, int(*hashfunc)(const ... |
Java | UTF-8 | 466 | 1.695313 | 2 | [
"Apache-2.0"
] | permissive | package io.ebeaninternal.api;
import io.ebeaninternal.server.querydefn.OrmQueryProperties;
import java.util.List;
/**
* The secondary query paths for 'query joins' and 'lazy loading'.
*/
public interface SpiQuerySecondary {
/**
* Return a list of path/properties that are query join loaded.
*/
List<OrmQu... |
Java | UTF-8 | 380 | 2.859375 | 3 | [] | no_license | package nl.capgemini.diving.assignmentdequeu;
public class Task {
private String personName;
public Task(String personName) {
this.personName = personName;
}
public String getPersonName() {
return personName;
}
public void execute() {
System.out.println("This is a T... |
C# | UTF-8 | 1,901 | 2.71875 | 3 | [] | no_license | ๏ปฟusing System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using fitapp.DAL;
using fitapp.Models;
using fitapp.ViewModels;
using PagedList;
namespace fitapp.Controllers
{
public class HomeController : Controller
{
private FitappDbContext db = new FitappD... |
Java | UTF-8 | 423 | 2.953125 | 3 | [] | no_license | package com.company;
public class Circle extends Shape{
private String name;
public Circle(int height, int width) {
super(height, width);
}
@Override
float AreaCalc() {
return 0;
}
@Override
int getCenter() {
return 0;
}
@Override
int CircumCalc(... |
PHP | UTF-8 | 1,806 | 3.265625 | 3 | [
"BSD-3-Clause"
] | permissive | <?php
if (!function_exists('dd')) {
/**
* Dump the passed variables and end the script.
*
* @param mixed
* @return void
*/
function dd($expression, $_ = null)
{
var_dump(func_get_args());
die(1);
}
}
if (!function_exists('object_get')) {
/**
* Get an... |
Java | UTF-8 | 3,271 | 2.203125 | 2 | [] | no_license | package com.springReactive.practice.utils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.xml.bind.ValidationException;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.BodyInserters;
import org.springframework.web.reactive.function.ser... |
Java | UTF-8 | 1,208 | 3.890625 | 4 | [] | no_license | ///////////////////////////////////////////////////////////////////////////
//
// Java5401 Write a program that implements a Queue data structure.
// Complete the <remove(int i)> method so that it removes
// the parameter number, but leaves the remaining queue intact.
//
// eg.
// 43 92 41 39 10 32 62 17 29 51 35 ... |
Java | UTF-8 | 796 | 2.890625 | 3 | [] | no_license | package com.core;
public class Main {
private static int previousHash;
public static void main(String[] args) {
BlockChain blockchain = new BlockChain();
String[] SecondTransactions = new String[]{"First transaction: Kishore sent 100 dimecoins to Alice","Alice sent 150 dimecoins to Bob"};
String[] ThirdTrans... |
Java | UTF-8 | 2,007 | 4.125 | 4 | [] | no_license | /***********************************************************************************
(Suma elementos columna por columna) Escribe un mรฉtodo que devuelva la suma de todos *
* elementos en una columna especificada en una matriz usando el siguiente encabezado: *
* public static double sumColumnas (double [] [] m, int c... |
Python | UTF-8 | 434 | 2.59375 | 3 | [] | no_license | import sys
import os
#import shutil
import subprocess
#shutil.copy(source,dest)
#os.path.exists('/var')
def List(dirName):
cmd = 'ls l ' + dirName
(status,output) = subprocess.getstatusoutput(cmd)
if status:
sys.stderr.write('there was an error: ' + output)
sys.exit(1)
print('This is ... |
Ruby | UTF-8 | 2,508 | 3.28125 | 3 | [
"MIT"
] | permissive | require 'optparse'
module CompareFiles
class Cli
def self.parse!
args = Struct.new(:left, :right, :remember).new
opt_parser = OptionParser.new do |opts|
opts.banner = <<~BANNER
Usage: compare_files --left=SRC --right=DEST [--remember=file]
compare_files will output item... |
Python | UTF-8 | 1,563 | 3.265625 | 3 | [] | no_license | class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
if not matrix or len(matrix) == 0 or len(matrix[0]) == 0:
return 0
maxarea = 0
rows = len(matrix)
cols = len(matrix[0])
heights = [0] * cols
for i in range(rows):... |
Java | UTF-8 | 27,798 | 2.125 | 2 | [] | no_license | package com.example.rrcasino;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.media.Image;
import android.os.Build;
import android.os.Bundle;
import com.google.android... |
Java | UTF-8 | 2,451 | 3.59375 | 4 | [] | no_license | package com.yang.sh.juc;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
class MyCache{
private volatile Map<String,Object> map = new HashMap<>();
private ReadWrite... |
C++ | UTF-8 | 2,837 | 3.15625 | 3 | [] | no_license | // xml.h
// Leitor XML baseado em eventos. Semi-completo.
// Estruturas de Dados - T1
// 2911524 - Yuri Kunde Schlesner
#ifndef YURIKS_T1_XML_H
#define YURIKS_T1_XML_H
#include <iostream>
#include <stdexcept>
namespace yuriks
{
namespace xml
{
/** Interface a ser implementada por classes que desejarem receber eve... |
Markdown | UTF-8 | 1,705 | 3.046875 | 3 | [
"MIT"
] | permissive | ---
Title: Using build counters in Azure DevOps
Tags:
- Azure DevOps
---
We recently migrated some builds from TeamCity to Azure DevOps at my client, and couldn't
find a feature analog to TeamCity's `%build.counter%` which we've been using
to get automatically incremented version numbers for artifacts.
<!--excerpt--... |
C | UTF-8 | 1,169 | 3.703125 | 4 | [] | no_license | #include<stdio.h>
enum sex {boy,girl,Invalid};
enum season {spring,summer,autumn,winter,fail};
enum sex select1(void){
int temp;
do {
puts("่ฏท้ๆฉๆงๅซ ็ท----0 ๅฅณ----1");
scanf("%d",&temp);
if (temp<boy||temp>Invalid)
puts("่ฏทไธ่ฆๆฟๆจ็ๆงๅซๅผ็ฉ็ฌ");
}while(temp<boy||temp>Invalid);
return temp;
}
enum season select2(void)... |
JavaScript | UTF-8 | 520 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | export function onOriginResponse (request, response) {
response.setHeader('Edge-Cache-Tag', getCacheTagsForPath(request.path));
}
function getCacheTagsForPath (path) {
const cacheTagPrefix = 'path--';
const cacheTagFolderSeparator = '|';
const folderNames = path.split('/');
const cacheTags = [];
for (let i... |
Shell | UTF-8 | 499 | 3.34375 | 3 | [] | no_license | #!/bin/bash
. ~/dotfiles/install-scripts/lib/platform.sh
if [[ $platform != "linux" ]]; then
if [[ $platform != "arch" ]]; then
echo "Backup for Linux only"
exit 1
fi
fi
HOSTNAME=`hostname`
echo "MONTHLY BACKUP"
function cleanup {
sudo umount /backup
echo "Unmounted /backup"
}
trap cleanup EXIT
cd ... |
Markdown | UTF-8 | 1,295 | 3.984375 | 4 | [
"MIT"
] | permissive | ---
layout: post
title: My favorite way of telling if a number is odd or even
published: true
---
My uncle (a CS guy) once gave me an interesting puzzle: write a function to tell if a number is even or odd without using the modulus operator (e.g. "%").
At that time he had just given me ["Let's Talk Lisp"](https://ima... |
C | UTF-8 | 1,033 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*
** EPITECH PROJECT, 2018
** my_rpg
** File description:
** create_fight_container
*/
#include "fight.h"
chrono_t *create_chrono(void)
{
chrono_t *ptr = malloc(sizeof(*ptr));
if (!ptr)
return (NULL);
ptr->clock = sfClock_create();
ptr->my_sec = 0;
return (ptr);
}
bool verify_fight_container(fight_t *ptr)
{... |
Ruby | UTF-8 | 3,803 | 2.828125 | 3 | [] | no_license | require 'open3'
module ADAdapters
module PBIS
extend self
def get_info(group)
LOG.debug "PBIS::get_info: Getting JSON data for group #{group}"
str = `/opt/pbis/bin/adtool -a lookup-object --dn="#{group}" --attr=info`.strip
LOG.debug "PBIS::get_info: Info attr data returned for group #... |
C++ | UTF-8 | 665 | 2.5625 | 3 | [] | no_license | #pragma once
using namespace System;
using namespace System::Windows::Forms;
using namespace System::Drawing;
ref class Mybutton :Button
{
private:
public:
Mybutton(int x, int y, String ^name, String ^color);
};
Mybutton::Mybutton(int x, int y, String ^name, String ^color)
{
if (color == "num")
this->BackColor =... |
JavaScript | UTF-8 | 208 | 2.90625 | 3 | [] | no_license |
let cambiarbtn=document.getElementById('cambiarbtn');
cambiarbtn.onclick=function () {
let titulo=document.getElementById('titulo');
titulo.innerHTML='holaaaaaa';
titulo.style.color='red';
}
|
Ruby | UTF-8 | 429 | 3.6875 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | # prereqs: iterators, hashes, conditional logic
# Given a hash with numeric values, return the key for the smallest value
def key_for_min_value(name_hash)
new_array = []
name_hash.each do |key, value|
new_array << value if new_array.length == 0
new_array << value if value <= new_array[-1]
end
low_value = new_array... |
JavaScript | UTF-8 | 2,811 | 2.609375 | 3 | [] | no_license | #!/usr/bin/env node
import * as fs from 'fs';
import * as commander from "commander";
import Forker from './forker';
import Constants from './constants';
let API = require('./api');
let CONFIG_PATH = Constants.CONFIG_PATH;
class CLI {
private commander: commander.CommanderStatic;
private api: any;
private conf... |
Markdown | UTF-8 | 1,043 | 2.65625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
layout: post
data: 2018-04-22
title: "gdbๅๆฑ็ผ่ฐ่ฏ"
subtitle: "Debugging with GDB disas!"
author: "Zxy"
tags:
- Linux
---
**ๅจๅฉ็จgdb่ฐ่ฏ็ๆถๅ๏ผๆไปฌๅ็ฐ๏ผๆๆถๅฏไปฅ้่ฟๆฅ็ๅฎ็ๆฑ็ผไปฃ็ ่ฟ่กๆฑ็ผ็บงๅซ็่ฐ่ฏ๏ผๅนถ้่ฟ่งๅฏๅฏๅญๅจๅ
ๅผ็ๅๅๆฅๆจๆตๆบๅจๅ
้จๅฑๆฌก็ๆไฝ๏ผๆดๅฅฝ็็่งฃ็จๅบๅจๆบๅจๅ
้จ็่ฟ่ก๏ผ่ฟ้ๅฐฑ็ปๅบgdbไธๆฅ็ๆฑ็ผไปฃ็ ็ๆๆฎตใ**
`(gdb) disas main`็จๆฅๆฅ็mainๅฝๆฐ็ๆฑ็ผไปฃ็ ๏ผ่ฟไธชๆถๅๆฒกๆๅ ไปปไฝ็ๅๆฐ๏ผๆพ็คบๅบๆฅๅฐฑๆฏๅ็บฏ็mainๅฝๆฐๅ
จ้จ็ๆฑ็ผไปฃ็ ใ
`(gdb) disas ... |
C | UTF-8 | 1,837 | 4.46875 | 4 | [] | no_license | /*
* Name : Kuldeep Singh Bhandari
* Roll No. : 111601009
* Aim : To search an element in a circular linked
* Date : 08-08-2017
*/
#include<stdio.h>
#include<stdlib.h>
//structure to store data, previous pointer and next pointer
typedef struct node {
int data;
struct node *next;
stru... |
Java | UTF-8 | 2,068 | 2.109375 | 2 | [] | no_license | package com.android.poinku.viewmodel;
import android.app.Application;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.MutableLiveData;
import com.android.poinku.api.response.BaseResponse;
import com.android.poinku.api.response.DataPoinResponse;
import com.and... |
PHP | UTF-8 | 8,596 | 3.03125 | 3 | [] | no_license | <?php
<<<<<<< HEAD
require_once "conexion.php";
class ModeloUsuarios{
=======
namespace Modelos;
require_once "conexion.php";
use \Modelos\Conexion;
use \Exception, \PDOException;
use PDO;
use Libs\Helper;
class ModeloUsuarios extends Conexion{
>>>>>>> fernando
/*=============================================
MOST... |
Go | UTF-8 | 1,628 | 3.3125 | 3 | [
"MIT"
] | permissive | package repository
import (
"github.com/jinzhu/gorm"
"log"
)
type ExchangeRate struct {
ID int64 `json:"id"`
CurrencyFrom string `json:"currency_from"`
CurrencyTo string `json:"currency_to"`
}
type RateRepositoryItf interface {
GetExchangeRateList() ([]ExchangeRate)
InsertExchangeRate(*ExchangeRa... |
C++ | UTF-8 | 1,067 | 2.734375 | 3 | [
"MIT"
] | permissive | #ifndef NIL_SRC_META_INC_META_NONESUCH_HPP_
#define NIL_SRC_META_INC_META_NONESUCH_HPP_
#include <type_traits>
namespace nil {
struct none_such {
none_such() = delete;
none_such(const none_such&) = delete;
none_such(none_such&&) = delete;
none_such& operator=(const none_such&) = delete;
none_such& operator... |
C++ | UTF-8 | 694 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <windows.h>
#include "Song.h"
using namespace std;
void main() {
Song s1;
Song s2;
Song s3("Ne sum siguren", 1,90);
Song s4;
cout << s3.getName() << " " << s3.getMinutes() << " " << s3.getSeconds() << endl;
//expect Ne sum siguren 1 30
cout << (s1 != s2) << endl;
// expect 0
... |
C++ | WINDOWS-1252 | 610 | 2.859375 | 3 | [] | no_license | /*
* @Author: your name
* @Date: 2020-04-02 16:56:10
* @LastEditTime: 2020-04-02 19:27:49
* @LastEditors: Please set LastEditors
* @Description: Stack
* @FilePath: \Stack\Src\main.cpp
*/
#include <iostream>
#include "Stack.h"
#include <vector>
int main( ){
// std::vector<int> v;
// v.push_back( 1 );... |
Python | UTF-8 | 17,139 | 2.515625 | 3 | [] | no_license | import numpy as np
import itertools
import DIRECT
from scipy.optimize import fsolve, minimize
from scipy.stats import norm, lognorm
from sympy import *
from sklearn.metrics.pairwise import euclidean_distances
import copy
import os
Theta1 = 0.35 #hyperparameter of kernel
Theta2 = 0.005 #hyperparameter of kernel
N_Itera... |
Swift | UTF-8 | 3,475 | 2.78125 | 3 | [] | no_license | //
// PostPinViewController.swift
// On The Map
//
// Created by Jason Yu on 6/15/20.
// Copyright ยฉ 2020 Jason Yu. All rights reserved.
//
import UIKit
import MapKit
class PostPinViewController: UIViewController, MKMapViewDelegate {
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
var ... |
Python | UTF-8 | 1,237 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import pickle
import sys
import getopt
import numpy as np
def main(argv, N_POINTS=100):
# parsing parameters
def usage():
print("""
usage:
-h: help
-n(--n_points): number of real space grid
-f: input files, seperated by '... |
Shell | UTF-8 | 1,687 | 3.375 | 3 | [] | no_license | #!/bin/bash
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# Copyright (C) 2014 Alexander Keller <github@nycroth.com>
# 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 3... |
Java | UTF-8 | 777 | 2.578125 | 3 | [] | no_license | /**
* Gets article count of the specified day.
* @param day the specified day
* @return article count
*/
public int getArticleCntInDay(final Date day){
final long time=day.getTime();
final long start=Times.getDayStartTime(time);
final long end=Times.getDayEndTime(time);
final Query query=new Query().setFil... |
Go | UTF-8 | 1,157 | 2.65625 | 3 | [] | no_license | package cli
import (
"fmt"
"os"
"github.com/bernos/ecso/pkg/ecso"
"github.com/bernos/ecso/pkg/ecso/dispatcher"
"gopkg.in/urfave/cli.v1"
)
func NewEnvironmentCliCommand(project *ecso.Project, dispatcher dispatcher.Dispatcher) cli.Command {
return cli.Command{
Name: "environment",
Usage: "Manage ecso enviro... |
Markdown | UTF-8 | 1,047 | 2.8125 | 3 | [
"MIT"
] | permissive | # ์คํฌ๋ฆฝํธ ๊ฐ ์ฐธ์กฐ
[์ ์ญ ๋ณ์](/AdvancedFunctions/Global_Static_Variables/)๋ [์ฌ์ฉ์ ์ ์ ํจ์](/AdvancedFunctions/Custom_Functions/)๋ฅผ ๊ฐ์ง๋ ๋ชจ๋ ์คํฌ๋ฆฝํธ๋ ์คํฌ๋ฆฝํธ ๊ฐ ์ฐธ์กฐ ๋ชฉ๋ก์ ๋ฑ๋ก๋ฉ๋๋ค.</2> dot-notaion์ ์ฌ์ฉํ์ฌ ์ด ํ๋๋ ํจ์๋ฅผ ์ก์ธ์ค ํ ์ ์์ต๋๋ค.
## ์ค๋ช
- ์คํฌ๋ฆฝํธ ๊ฐ ์ฐธ์กฐ๋ `scripts` ๊ฒฝ๋ก์๋ถํฐ ์์๋ฉ๋๋ค.
- `scripts.mySubfolder.a.zs`์ ๊ฐ์ด ์คํฌ๋ฆฝํธ ๋๋ ํ ๋ฆฌ๋ฅผ ๊ธฐ์ค์ผ๋ก ๊ฒฝ๋ก๋ฅผ ์ง์นญํ ์ ์์ต๋๋ค.
- [import ์ ์ธ]... |
Java | UTF-8 | 818 | 2.71875 | 3 | [] | no_license | package commands.authenicationCommands.login;
import commands.authenicationCommands.AuthenticationCommand;
/**
* The type Login command.
*/
public class LoginCommand extends AuthenticationCommand {
private final String username;
private final String password;
/**
* Instantiates a new Login command... |
Markdown | UTF-8 | 1,473 | 3.109375 | 3 | [] | no_license | # twiggyrj-kshatriya-jquery-slider
This is a basic carousel slider that was built in a day as a learning exercise to get better at JavaScript, jQuery and learn a bit of ES6.
This slider takes the following items when initialised:
| Option | Expected Value | What it is used for | Does it a default fallback |
| ------ ... |
JavaScript | UTF-8 | 1,030 | 4.40625 | 4 | [] | no_license | /*
// Create datatypes.js file and use the JavaScript typeof operator to
// check different data types. Check the data type of each variable
*/
let alineName = 'Aline'
let strong = true
let undefinedVar
let nullVar = null
// Declare four variables without assigning values
let var1
let var2
let var3
let var4
// Dec... |
C | UTF-8 | 2,456 | 2.71875 | 3 | [] | no_license | #define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward d... |
Java | UTF-8 | 4,563 | 2.203125 | 2 | [] | no_license | package cn.onlineexam.exam.servlet;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
i... |
JavaScript | UTF-8 | 1,188 | 2.953125 | 3 | [] | no_license | import { ratingsTemplate } from "./templates";
const ratings = [
{ stars: 1, people: 20 },
{ stars: 2, people: 25 },
{ stars: 3, people: 66 },
{ stars: 4, people: 52 },
{ stars: 5, people: 93 }
];
let prevIdx;
function allPeople(arr) {
return arr.map(item => item.people).reduce((accumulator, currentValue... |
Python | UTF-8 | 75 | 3.734375 | 4 | [] | no_license | n=int(input("enter a number:"))
for i in range(2,n):
if n%i==0:
print(i) |
Python | UTF-8 | 2,786 | 3.03125 | 3 | [] | no_license | import numpy as np
class LMKNN:
def __init__(self, k):
self.__dataTrain = {}
self.__predict = {}
self.__k = k
@property
def dataTrain(self):
return self.__dataTrain
@property
def predict(self):
return self.__predict
@property
def k(self):
re... |
Python | UTF-8 | 219 | 2.625 | 3 | [] | no_license | n=int(input())
if n<1000:
print(1000-n)
else:
str1=""
k=n//1000
l=len(str(n))-len(str(k))
str1=str(k)+'0'*l
if str1==str(n):
print(0)
else:
p=int(str1)+1000
print(p-n) |
Java | UTF-8 | 667 | 2.15625 | 2 | [] | no_license | package com.psl.test;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.psl.business.StudentBo;
import com.psl.model.Student;
public class Client {
public static void main(String[] args) {
ConfigurableApplicatio... |
Java | UTF-8 | 1,787 | 2.875 | 3 | [] | no_license | package mc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
public class ChanceCardSewagePlant extends ChanceCard {
GameMaster gameMaster;
GamePane gamePane;
Player currentPlayer;
JButton sewagePlantButton;
private boolean failed;
public ChanceCardSewag... |
JavaScript | UTF-8 | 1,700 | 2.515625 | 3 | [] | no_license | /** @jsx jsx */
import React, { useState } from 'react';
import { css, jsx } from '@emotion/core'
import ProjectsContent from './ProjectsContent';
import ProjectSlide from './ProjectSlide';
import Arrow from "./Arrow"
import Dots from './Dots'
/**
* @function Projects
*/
const Projects = props => {
const getWidth... |
Markdown | UTF-8 | 3,759 | 3.71875 | 4 | [] | no_license | #####1ใๅ่ฑๆฌๅท
่ฏญๆณ๏ผ
<any>{{่กจ่พพๅผ}}</any>
ไฝ็จ๏ผ
ๅฐ่กจ่พพๅผๆง่ก็็ปๆ ่พๅบๅฝ่ฐ็จๅ
็ด ็innerHTMLไธญ๏ผ่ฟๅฏไปฅๅฐๆฐๆฎ็ปๅฎๅฐ่งๅพ
#####2ใๆไปค-ๅพช็ฏๆไปค
ๅบๆฌ่ฏญๆณ1๏ผ
<any v-for="tmp in array"></any>
ๅบๆฌ่ฏญๆณ2๏ผ
<any :key='value.id' v-for="(value,index) in array"></any>
ไฝ็จ๏ผ
ๅจ้ๅarray่ฟไธช้ๅๆถ๏ผๅฐไธดๆถๅ้ไฟๅญๅจtmpไธญ๏ผๅๅปบๅคไธชanyๆ ็ญพ
v-show:ๆงๅถๅ
็ด ๆพ็คบ้่
v-if๏ผ... |
JavaScript | UTF-8 | 1,766 | 2.984375 | 3 | [] | no_license | const chai = require('chai');
const expect = chai.expect;
const Turn = require('../src/Turn')
const Card = require('../src/Card');
describe('Turn', function() {
it('should be a function', function() {
const turn = new Turn();
expect(Turn).to.be.a('function');
});
it('Turn should be instantiated with a... |
Java | UTF-8 | 1,385 | 2.125 | 2 | [
"MIT"
] | permissive | package de.tudresden.inf.st.mquat.solving;
import de.tudresden.inf.st.mquat.generator.ScenarioDescription;
import de.tudresden.inf.st.mquat.generator.ScenarioGenerator;
import de.tudresden.inf.st.mquat.jastadd.model.Root;
import de.tudresden.inf.st.mquat.jastadd.model.Solution;
import de.tudresden.inf.st.mquat.solving... |
PHP | UTF-8 | 724 | 2.765625 | 3 | [] | no_license | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
/**
* Atributos asignables en masa.
*/
protected $fillable = [
'name', 'email', 'password', 'type',
];
/**
* Atributos que ... |
C++ | UTF-8 | 1,259 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int main() {
char mappings[26];
mappings[0] = 'y'; // a
mappings[1] = 'h'; // b
mappings[2] = 'e'; // c
mappings[3] = 's'; // d
mappings[4] = 'o';
mappings[5] = 'c';
mappings[6] = 'v';
mappings[7] = 'x';
mappings[8] = '... |
C++ | UTF-8 | 397 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
struct Node{
char character;
int value;
struct Node* esq;
struct Node* dir;
};
struct binary_tree{
struct Node* first_node;
};
struct binary_tree* criarArvoreBinaria (){
struct binary_tree* bt = (binary_tree*)malloc(sizeof(binary_tree));
bt->first_node = NULL;
... |
Java | UTF-8 | 812 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | package dea.monitor.tools;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class RegexTester {
public static void main(String[] args) {
String[] response = {
"Station reported <span id=\"update_time\">11 seconds ago</span></span></h2>",
"Station reported <span id=\"update_... |
Swift | UTF-8 | 2,012 | 2.59375 | 3 | [
"MIT"
] | permissive | //
// STPPaymentResult.swift
// StripeiOS
//
// Created by Jack Flintermann on 1/15/16.
// Copyright ยฉ 2016 Stripe, Inc. All rights reserved.
//
import Foundation
/// When you're using `STPPaymentContext` to request your user's payment details, this is the object that will be returned to your application when the... |
Java | UTF-8 | 4,859 | 1.882813 | 2 | [] | no_license | /*
* Copyright(C) 2011-2012 Alibaba Group Holding Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Authors:
* wentong <wentong@taobao.com>
*/
p... |
Java | UTF-8 | 856 | 2.296875 | 2 | [] | no_license | package com.shana.elasticsearch;
public class Command {
private String index;
private String type;
private String queryString;
private Method method;
private Object httpBody;
public enum Method{
POST,DELETE,GET,PUT,PATCH
}
public String getIndex() {
return index;
}
public void setIndex(String index... |
Shell | UTF-8 | 174 | 2.765625 | 3 | [
"WTFPL"
] | permissive | #!/bin/bash
#
# grm - short command to search through Minimy python files
#
cd $HOME/minimy
grep -n "$@" *py */*py */*/*py */*/*/*py 2>/dev/null | sed "s:^:$HOME/minimy/:g"
|
Python | UTF-8 | 101,809 | 3.75 | 4 | [] | no_license | """ Cities. version 1.2 with graphs. Life simulation. """
from re import split as slt # for parsing values while creating a new city
# random is everywhere
from random import weibullvariate as wb, gammavariate as gm, randrange as rdr, \
random as rdm, choice as chc
from json import load, dump # loading and sav... |
Java | UTF-8 | 1,272 | 3.484375 | 3 | [] | no_license | package org.dimigo.collection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MelonGenreChart {
public static void main(String[] args) {
Map<String,List<Music>> map = new HashMap<>();
System.out.println("-- << ๋ฉ๋ก ์ฅ๋ฅด๋ณ ์ฑ ํธ >> --");
List<Music> l... |
Markdown | UTF-8 | 1,206 | 2.578125 | 3 | [
"MIT"
] | permissive | # React Native - The Practical Guide
- 02.Diving into the Basics - [rn-basics - Course Goals App](https://github.com/mdamyanova/Udemy-Courses/tree/master/React%20Native%20-%20The%20Practical%20Guide/rn-basics)
- working with Components, Styles, Flexbox and Scrollable view
- 04.Components, Styling, Layouts - [rn-guess... |
C++ | UTF-8 | 815 | 2.546875 | 3 | [] | no_license | #ifndef __ModuleWindow_H__
#define __ModuleWindow_H__
#include "Module.h"
#include "SDL/include/SDL.h"
#include "Module.h"
#include "Globals.h"
class Application;
class ModuleWindow : public Module
{
public:
//The window we'll be rendering to
SDL_Window * window;
public:
ModuleWindow() {};
~ModuleWindow() {}... |
Java | UTF-8 | 14,672 | 1.90625 | 2 | [] | no_license | package fr.ippon.kompetitors.web.rest;
import fr.ippon.kompetitors.Kompetitors2App;
import fr.ippon.kompetitors.config.TestSecurityConfiguration;
import fr.ippon.kompetitors.domain.ListTechPartners;
import fr.ippon.kompetitors.repository.ListTechPartnersRepository;
import fr.ippon.kompetitors.service.ListTechPartnersS... |
Python | UTF-8 | 1,862 | 2.859375 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pickle
import networkx as nx
import matplotlib.pyplot as plt
FILENAME = "graph_properties_nobel_ger_demand_ger_uniform_Link_Disjoint.pkl"
G = nx.Graph()
def add_proprieties(protection_distance, demands, working_distance):
for key in protection_distance.keys():
... |
C# | UTF-8 | 4,573 | 2.546875 | 3 | [
"MIT"
] | permissive | ๏ปฟ
using Newtonsoft.Json;
using Open.Genersoft.Component.Logging.Facade;
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Xml;
using System.Reflection;
namespace Open.Genersoft.Component.Logging.Default
{
public class DefaultLogger : GeneralLogger
{
pr... |
Markdown | UTF-8 | 3,489 | 3.1875 | 3 | [] | no_license |
# First Timers Contributions
Make sure you have Git installed, If you don't have git on your machine, [install it]( https://help.github.com/articles/set-up-git/).
## Fork this repository
<img align="right" width="300" src="./assets/image/fork.JPG" alt="fork this repository" />
Fork this repo by clicking on the fo... |
C# | UTF-8 | 890 | 2.75 | 3 | [] | no_license | using System.Collections.Generic;
using System.Linq;
using Ecommerce.Dto;
using Ecommerce.UnitOfWork;
namespace Ecommerce.Service.Services
{
public class ProductService : IProductService
{
private readonly IUnitOfWork _uow;
public ProductService(IUnitOfWork uow)
{
_uow = uo... |
Java | UTF-8 | 4,311 | 2.203125 | 2 | [] | no_license | package com.jss.educenter.controller;
import com.google.gson.Gson;
import com.jss.commonutils.JwtUtils;
import com.jss.educenter.entity.UcenterMember;
import com.jss.educenter.service.UcenterMemberService;
import com.jss.educenter.utils.ConstantWxUtils;
import com.jss.educenter.utils.HttpClientUtils;
import com.jss.se... |
Java | UTF-8 | 3,196 | 2.953125 | 3 | [] | no_license | package edu.gatech.virtual_pet_app;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class EventHandler
{
List<REvent> events;
List<Interaction> inter;
List<Illness> illness;
public EventHandler(List<REvent> events, List<Interaction> interaction, List<Illness> illn... |
Java | UTF-8 | 2,601 | 2.1875 | 2 | [
"Apache-2.0"
] | permissive | package com.hs.mail.imap.processor.ext;
import javax.security.auth.login.AccountNotFoundException;
import com.hs.mail.exception.MailboxException;
import com.hs.mail.exception.MailboxNotFoundException;
import com.hs.mail.imap.ImapConstants;
import com.hs.mail.imap.ImapSession;
import com.hs.mail.imap.mailbox.M... |
Java | UTF-8 | 3,318 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package com.example.android.sunshine.app;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.support.v4.view.accessibility.AccessibilityManagerCompat;
import android.util.AttributeSet;
import android.view.View;
import android.view.accessibility.AccessibilityEv... |
C | UTF-8 | 7,060 | 3.3125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <wait.h>
#include <pthread.h>
int item_to_produce; //ํ์ฌ ๋ง๋ค์ด์ผํ๋ ์์ดํ
๋ด๋ ๋ณ์
int curr_buf_size; //ํ์ฌ ๋ฒํผ์ ์๋ ํฌ๊ธฐ
int total_items; //์์ฐํ๊ณ ์ถ์ ์ด ์์ดํ
์ (0~M-1)
int consumed_item_size; //์... |
Ruby | UTF-8 | 224 | 3.5 | 4 | [] | no_license | for num in 1..100 do
if num % 5 == 0 && num % 3 == 0 then
puts num.to_s+":FizzBuzz"
elsif num % 5 == 0 then
puts num.to_s+":Buzz"
elsif num % 3 == 0 then
puts num.to_s+":Fizz"
end
end |
Python | UTF-8 | 681 | 3.265625 | 3 | [] | no_license | import random
import string
import json
class VariousFunctions:
def random_string(self, string_size, chars=string.ascii_uppercase + string.digits):
self.string_size = string_size
final_string = ''.join(random.choice(chars) for i in range(string_size))
return final_string
def create_j... |
Java | UTF-8 | 2,352 | 2.09375 | 2 | [] | no_license | package com.uiet.casehearing;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.T... |
Markdown | UTF-8 | 1,446 | 2.953125 | 3 | [] | no_license | ## About
This project uses Springboot, NodeJS, and ReactJS.
Search for a place to eat if you are hungry. mehungry utilizes the Yelp Developer's API to obtain multiple restaurant search
results based on the type of food you want to eat, and location, as well as sorting by best match, lowest price, or most reviewed.
... |
C++ | UTF-8 | 494 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int gcd(int a, int b)
{
while (b != 0)
{
int tmp = b;
b = a % b;
a = tmp;
}
return a;
}
int main()
{
int n;
while (cin >> n && n != 0)
{
int G = 0;
for (int i = 1; i < n; i++)
{
... |
Java | UTF-8 | 718 | 2.84375 | 3 | [] | no_license |
package skipbo;
public class DiscardPile extends Structure implements Pile
{
public void addCard(Card card)
{
list.add(card);
}
@Override
public Card getTopCard()
{
Card card=list.get(list.size()-1);
list.remove(list.size()-1);
return card;
}
... |
Java | UTF-8 | 2,591 | 2.359375 | 2 | [] | 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 anhnd.rmi.impls;
import anhnd.entity.Registrations;
import anhnd.impl.repos.RegistrationsRepositoryImpl;
import anhnd.inteface... |
Java | UTF-8 | 8,888 | 2.078125 | 2 | [] | no_license | package com.dzf.zxkj.platform.service.common.impl;
import com.dzf.zxkj.base.dao.SingleObjectBO;
import com.dzf.zxkj.base.framework.SQLParameter;
import com.dzf.zxkj.base.framework.processor.ResultSetProcessor;
import com.dzf.zxkj.base.exception.BusinessException;
import com.dzf.zxkj.base.exception.DAOException;
impor... |
TypeScript | UTF-8 | 10,829 | 2.90625 | 3 | [
"MIT"
] | permissive | /**
* Specifies the direction of the ken burns effect.
*/
export const enum Direction {
Normal = 'normal',
Reverse = 'reverse',
Random = 'random',
}
/**
* All available ken burns CSS animations.
*/
export const animationNames = [
'ken-burns-bottom-right',
'ken-burns-top-left',
'ken-burns-bo... |
C++ | UTF-8 | 1,057 | 2.859375 | 3 | [
"Unlicense"
] | permissive | //
// 2018 Rico Schulz
//
#pragma once
#include "actuator.h"
#define GHPI_PWM_CLOCK 384
#define GHPI_PWM_RANGE 1000
#define SERVO_OFF_POS 0
#define SERVO_ON_POS -130
namespace ghpi {
// Class for the Kuman KY72 Servo
class Servo : public Actuator {
public:
void TurnOn() override;
void TurnOff() ov... |
Shell | UTF-8 | 666 | 3.21875 | 3 | [] | no_license | #!/bin/sh
# $Id$
#
#
#set -x
#
URL_SUM_24h="http://192.168.178.10:8080/api/getPlainValue/3862"
URL_SUM="http://192.168.178.10:8080/api/getPlainValue/3858"
#
SCRIPT=`basename $0`
EXITCODE="0"
#-------------------------------
info()
{
logger -t "${SCRIPT}[$$]" $*
}
error()
{
logger -p user.err -t "${SCRIPT}[$$]" "... |
Java | UTF-8 | 746 | 3.140625 | 3 | [
"MIT"
] | permissive |
public class Matriz {
public static float[][] transpose(float A[][]) {
int Rows = A.length,
int Columns = A[0].length;
float[][] resultant = new float[Columns][Rows];
for(int i = 0; i < Rows; i++)
for (int j = 0; j < Columns; j++)
resultan... |
Java | UTF-8 | 661 | 2.875 | 3 | [] | no_license | import java.io.*;
import java.net.*;
public class server_rw
{
public static void main(String args[]) throws Exception
{
ServerSocket s1 = new ServerSocket(1055);
Socket s = s1.accept();
DataInputStream din = new DataInputStream(s.getInputStream());
DataOutputStream dout= new DataOutputStream(s.getOutputSt... |
Shell | UTF-8 | 861 | 3.65625 | 4 | [
"Apache-2.0"
] | permissive | set -e
usage() {
echo "Usage: $0 -o path [-b]"
echo -e "\t-o package files output directory"
echo -e "\t-b opencl backend"
exit 1
}
while getopts "o:hb" opt; do
case "$opt" in
o ) path=$OPTARG ;;
b ) opencl=true ;;
h|? ) usage ;;
esac
done
# clear and create package directory
./schema... |
PHP | UTF-8 | 1,160 | 2.984375 | 3 | [
"MIT"
] | permissive | <?php
namespace core\Http;
class Request
{
/**
* Las peticiones
*
* @var array
*/
protected $requests = [];
/**
* Rescata las peticiones
*
* @return void
*/
public function __construct()
{
$this->requests = $this->mergeData($_POST, $_FILES);
... |
Python | UTF-8 | 730 | 4.71875 | 5 | [] | no_license | ###################################################################
# SORTING BY KEY #
###################################################################
# use of common method for sorting values
example_list = [[1, 4], [5, 8], [5, 4], [3, 2], [9, 1]]
print(example_lis... |
C++ | UTF-8 | 4,752 | 2.71875 | 3 | [] | no_license | ๏ปฟ// _____________________________________
// | FuelTank.cpp - class implementation |
// | Jack Flower - December 2012 |
// |_____________________________________|
//
#include "FuelTank.h"
#include "../../../Rendering/Drawable/Layers.h"
#include "../../../Rendering/Animations/AnimSet.h"
using namespace render... |
Java | UTF-8 | 663 | 3.453125 | 3 | [] | no_license | package array;
/**
* https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
*/
public class BestTimeToBuyAndSellStockII {
public int maxProfit(int[] prices) {
if (prices == null || prices.length < 2) return 0;
int profit = 0;
for (int i = 1; i < prices.length; i++) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.