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 |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 800 | 2.953125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Library;
/**
* Class ResponseMessages
* @author Adeyemi Olaoye <yemi@cottacush.com>
* @package App\Library
*/
class ResponseMessages
{
private static $messages = [
ResponseCodes::METHOD_NOT_IMPLEMENTED => 'method not implemented',
ResponseCodes::INTERNAL_SERVER... |
Python | UTF-8 | 12,254 | 2.5625 | 3 | [] | no_license | #! /usr/bin/python
import cgi
import cgitb
import json
cgitb.enable()
us_state_abbrev = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'District of Columbia': 'DC',
'Florida': 'F... |
Shell | UTF-8 | 1,306 | 4 | 4 | [] | no_license | #!/bin/sh
unmountusb() {
[ -z "$drives" ] && exit
chosen=$(echo "$drives" | dmenu -i -p "Unmount which drive?" | awk '{print $1}' | sed 's/\\/\\\\/g')
[ -z "$chosen" ] && exit
device="$(lsblk -nrpo "name,type,size,mountpoint" | grep "$chosen" | awk -F\ '{ print $1 }')"
[ -L "$HOME"/Media ] && rm "$HOME"/Media
u... |
Java | UTF-8 | 314 | 2.265625 | 2 | [
"Apache-2.0"
] | permissive | package de.diedavids.refactoring.codingdojo.step2_moving_features_between_objects.example1_move_method;
public class AccountType {
private boolean premium;
public boolean isPremium() {
return premium;
}
public void setPremium(boolean premium) {
this.premium = premium;
}
}
|
Java | UTF-8 | 474 | 2.6875 | 3 | [] | no_license | package dreamschool.csourse.chapter10;
public class AccoutTest {
public static void main(String[] args) {
FundAccount fun1 = new FundAccount("111-2222", "홍길동", 5000000, 4.7);
FundAccount fun2 = new FundAccount("666-7777", "홍길순", 1000000, 2.9);
fun1.openAccount();
System.out.println("수익이 발생했습니다.")... |
Java | UTF-8 | 944 | 2.359375 | 2 | [
"MIT"
] | permissive | package com.amatkivskiy.gitter.sdk.async.faye.listeners;
import com.google.gson.Gson;
import com.amatkivskiy.gitter.sdk.async.faye.model.UserPresenceEvent;
import com.amatkivskiy.gitter.sdk.async.faye.model.UserPresenceEvent.PresenceStatus;
import static com.amatkivskiy.gitter.sdk.async.faye.FayeConstants.FayeChanne... |
Java | UTF-8 | 6,590 | 1.90625 | 2 | [] | no_license | package com.example.admin.restro.Signing;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import an... |
Java | UTF-8 | 3,568 | 2.171875 | 2 | [] | no_license | package lt.codeacademy.project.api.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lt.codeacademy.project.api.EndPoint;
import lt.codeacademy.project.api.dto.PostDto;
import lt.codeacademy.project.api.entity.Post;
import lt.codeacademy.project.api.entity.User;
import l... |
C++ | UTF-8 | 2,583 | 2.6875 | 3 | [] | no_license | #include "Debug.hpp"
#include <cstdio>
#include <cstdarg>
#include <iostream>
#if defined(_WIN32) || defined(_WIN64)
#define RENDERFISH_LOG_IS_WINDOWS 1
#include <windows.h>
static HANDLE hstdout;
#define vsprintf vsprintf_s
#elif defined(__APPLE__)
#define RENDERFISH_LOG_IS_APPLE 1
#else //defined(__linux__)
#define ... |
Java | UTF-8 | 1,361 | 2.03125 | 2 | [] | no_license | package com.example.administrator.wankuoportal.fragment.pingjia;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import com.example.administrator.wankuoportal.R;
import c... |
Markdown | UTF-8 | 2,491 | 3.296875 | 3 | [] | no_license | # DataMadnessKickstarter
An analysis on the success of Kickstarter Projects (UM Project)
This was a short project which is summarized in the following video. The dataset can be obtained from https://www.kaggle.com/kemical/kickstarter-projects?select=ks-projects-201801.csv
https://vimeo.com/401928960
Brian Huynen, I... |
C++ | UTF-8 | 1,515 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Zlib",
"MIT"
] | permissive | #include <cassert>
#include "pack.hpp"
#include "netstring.hpp"
#include "compress.hpp"
int main( int argc, char **argv )
{
bistring name = bistring( "name", "description" );
bistring data = bistring( "data", "im a descriptor" );
bistrings bi;
bi.push_back( name );
bi.push_back( data );
std:... |
Ruby | UTF-8 | 465 | 2.734375 | 3 | [] | no_license | class Link < ApplicationRecord
validates :url, presence: true, uniqueness: true
validates :read_count, presence: true
def add_read
update(read_count: read_count + 1)
end
def self.top_ten
Link.all.sort_by do |link|
link.read_count
end.reverse[0..9]
end
def status
top_ten = self.cla... |
Python | UTF-8 | 731 | 3.296875 | 3 | [] | no_license | def solution(n):
n = str(n)
if len(n) == 0:
return [0, n]
count = 0
while len(n) > 1:
q = len(n) // 2
left_num, right_num = n[:q], n[q:]
pos_right = 0
while pos_right < len(right_num) and right_num[pos_right] == '0':
pos_right += 1
if pos_r... |
JavaScript | UTF-8 | 1,230 | 2.6875 | 3 | [] | no_license | const LocalStrategy= require('passport-local').Strategy
const User=require('../models/user')
const bcrypt= require ('bcrypt')
function init(passport){
passport.use(new LocalStrategy({usernameField:'email'},async (email,password,done) => { //to use await its parent function should be asynchronus
//Login
//chec... |
JavaScript | UTF-8 | 322 | 3.328125 | 3 | [] | no_license | // 给定一个数组。如何实现按顺序请求每一个地址
// ['baidu.com','aliyun.com','aaaaa.com']
function fetchSyn(arr) {
async function fn(arr) {
const res = [];
for (let i = 0; i < arr.length; i++) {
await window.fetch(arr[i]);
}
}
fn(arr);
}
fetchSyn(["baidu.com", "aliyun.com"]);
|
C | UTF-8 | 1,045 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
#include "lib.h"
char *alfb = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" ;
char *p ;
long int outnum = 0;
long int exp = 1;
long int index;
int istr = 0;
long int i_alfb(char c) {
if((p=strchr(alfb, c))) {
return (long int)(p - alfb);
} else {
return ... |
C# | UTF-8 | 803 | 2.515625 | 3 | [] | no_license | using System;
using System.Globalization;
using System.Windows.Data;
namespace FMA.View.Helpers
{
//public class SubstractionConverter : IValueConverter
//{
// public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
// {
// try
// {
/... |
C++ | ISO-8859-7 | 6,120 | 2.59375 | 3 | [] | no_license | /*
* cereal2.h
*
* Created on: 31 2017
* Author: IsM
*/
#ifndef SERIALIZATION_CEREAL2_H_
#define SERIALIZATION_CEREAL2_H_
#include <DALFramework/serialization/helpers2.h>
#include <DALFramework/serialization/traits2.h>
#include <utility>
#include <cstdint>
#include <WString.h>
namespace cereal2 {
//!... |
Markdown | UTF-8 | 1,349 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | # xml_parse
Parsing XML, and retrieving specific text or attribute.
* **Baseline**: Simple XML with just one tag, no attributes.
* **Attributes**: 1 tag with 1000 attributes.
* **Serial**: 1000 tags, opening and closing, opening and closing. No nesting.
* **Nested**: 1000 nested entries, each inside of the other.
| |... |
Python | UTF-8 | 1,329 | 2.625 | 3 | [] | no_license | from udacity import atoms
from udacity.utils.object_dict import ObjectDict
from udacity.utils.renderer import ClassRenderer
class Course(ClassRenderer):
def __init__(self, seq=None, **kwargs) -> None:
super().__init__(seq, **kwargs)
self['lessons'] = [self.Lesson(self, lesson) for lesson in self['... |
Python | ISO-8859-1 | 713 | 2.90625 | 3 | [] | no_license | '''
Created on 4 févr. 2017
@author: mathi
'''
class PacketUpdate():
'''
classdocs
'''
#Initialisation de la class avec les variables par dfault
def __init__(self):
self.id = -1
self.main = None
#Fonction utiliser pour ENVOYER : Permet d'initier les variables... |
PHP | UTF-8 | 7,496 | 2.5625 | 3 | [] | no_license | <?php
class QuestionnaireController extends Controller
{
/**
* @var string the default layout for the views. Defaults to '//layouts/column2', meaning
* using two-column layout. See 'protected/views/layouts/column2.php'.
*/
public $layout='//layouts/column2';
/**
* @return array action filters
*/
public ... |
C++ | UTF-8 | 722 | 3.671875 | 4 | [
"MIT"
] | permissive | // This program calculates hourly wages, including overtime.
#include <iostream>
using namespace std;
int main()
{
double regularWages,
basePayRate = 18.25,
regularHours = 40.0,
overtimeWages,
overtimePayRate = 27.78,
overtimeHours =... |
JavaScript | UTF-8 | 42,280 | 2.578125 | 3 | [] | no_license | 'use strict';
/*
basic strategy for using SVG:
In SVG you can draw on an arbitrarily large plane and have a 'viewbox' that shows a sub-area of that.
Because of this, for a piano roll, you can 'draw' a piano-roll at an arbitrary size and move around
the viewbox rather than 'redrawing' the piano roll when you want to zoo... |
C | UTF-8 | 1,098 | 3.28125 | 3 | [] | no_license | //3. Napisati program koji prikazuje zaglavlje koverte koristeci formatere.
//Prva 3 reda treba da sadrze na koga je naslovljena koverta i da budu s u gornjem lijevom uglu koverte.
//Datum treba da bude u gornjem desnom uglu koverte a zadnjih nekoliko redova treba da sadrze ko salje kovertu i da budu u donjem desnom ... |
Python | UTF-8 | 578 | 3.96875 | 4 | [] | no_license | '''
Write a program to check whether a given number is an ugly number.
https://leetcode.com/problems/ugly-number/
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
'''
class Solution:
def maxDivide(self,a,b):
while a%b == 0:
a = a // b
return a
def isUgly(se... |
JavaScript | UTF-8 | 8,666 | 3.8125 | 4 | [] | no_license | function game() {
this.player1 = '';
this.player2 = '';
this.players = '';
this.currPlayer = '';
this.board = {'00':'',
'01':'',
'02':'',
'10':'',
'11':'',
'12':'',
'20':'',
'21':'',
... |
Ruby | UTF-8 | 122 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env ruby
File.open('data') do |f|
num = 0
f.each_line do |l|
num = num + l.to_i
end
puts num
end
|
Java | UTF-8 | 3,723 | 2.515625 | 3 | [] | no_license | package dinhphu.com.Controller;
import dinhphu.com.Model.Product;
import dinhphu.com.Service.ProductService;
import dinhphu.com.Service.ProductServiceImpl;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletReq... |
Java | UTF-8 | 950 | 2.34375 | 2 | [
"Apache-2.0"
] | permissive | package com.dream.android.sample.base;
import android.os.Bundle;
import com.dream.android.sample.di.component.ActivityComponent;
import com.dream.android.sample.lib.base.BaseFragment;
import com.dream.android.sample.lib.base.HasComponent;
/**
* Description:base dependency injection manager class
*
* Copyright: Cop... |
Java | UTF-8 | 916 | 3.03125 | 3 | [] | no_license | public class Solution {
public ArrayList<ArrayList<Integer>> levelOrderBottom(TreeNode root) {
Stack<ArrayList<Integer>> resultStack = new Stack<ArrayList<Integer>>();
ArrayList<ArrayList<Integer>> result = new ArrayList<ArrayList<Integer>>();
List<TreeNode> pre = new LinkedList<TreeNode>();
... |
Markdown | UTF-8 | 466 | 3.0625 | 3 | [] | no_license | # TriviaGame
My code for a simple My Little Pony Trivia Game.
This project was part of a coding bootcamp assignment to further understand the functions in JavaScript.
Included in the app.js file is the function setInterval(), which can be used to increment (or in this case decrement) a variable every time a set period... |
Ruby | UTF-8 | 701 | 2.578125 | 3 | [] | no_license | # Review objects contain a text review of a company.
#
# They have to be approved by an user of that company to
# appear on their company's profile.
#
class Review < ActiveRecord::Base
belongs_to :author_user, :class_name => 'User'
belongs_to :author_company, :class_name => 'Company'
belongs_to :company
searcha... |
Java | UTF-8 | 161 | 1.648438 | 2 | [] | no_license | package ph.txtdis.app;
import ph.txtdis.exception.InvalidException;
public interface Edited {
void save() throws InvalidException;
void refresh();
}
|
C++ | UTF-8 | 1,334 | 3.359375 | 3 | [] | no_license | /*
백준 1062 가르침
input의 크기가 작기 때문에 완전탐색 사용 후 이중반복문까지 사용.
익힌 알파벳을 알기 위한 visit배열
k개만큼 배웠다면 모든 단어를 검사하여 알 수 있는 단어의 개수를 파악.
최대 개수와 비교 후 최신화.
*/
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
using namespace std;
int n,k;
vector<string> v;
int ans... |
Java | UTF-8 | 534 | 2.9375 | 3 | [] | no_license | package tree.nodes.functionals.logicals.logical_operators;
import tree.nodes.Context;
/**
* Created by itzhak on 24-Mar-18.
*/
public class OrNode extends LogicalOperatorNode {
public OrNode() {
super(2);
}
@Override
public Double parse(Context context) {
if(this.parseChild(0,cont... |
Java | UTF-8 | 683 | 3.703125 | 4 | [] | no_license | package com.cognitran.classes.topic2;
public class Method2Example {
static int calculate(int a, int b) {
int c = a + b;
System.out.println("\nargument a: " + a);
System.out.println("argument b: " + b);
System.out.println("obliczono: " + c);
return c;
}
public stati... |
Python | UTF-8 | 2,387 | 2.671875 | 3 | [] | no_license | from process import Ca
import os, random, re
import fnmatch
from PIL import Image
def naturallysorted(L, reverse=False): # helper from http://peternixon.net/news/2009/07/28/natural-text-sorting-in-python/
"""Similar functionality to sorted() except it does a natural text sort
which is what humans expect when t... |
Java | UTF-8 | 864 | 2.171875 | 2 | [
"MIT"
] | permissive | package xcode.springcloud.dispatchservice;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
public interface OrderService {
@RequestMapping(value = "/orders", method = RequestMethod.POST, produces = "application/json")
Order cre... |
JavaScript | UTF-8 | 1,806 | 3.125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import './App.css';
//importing Components
import Form from './components/form';
import ToDoList from './components/ToDoList';
function App() {
//setState variables
const [inputText, setInputText] = useState('');
const [toDos, setToDos] = useState([]);
const ... |
Shell | UTF-8 | 4,301 | 3.59375 | 4 | [] | no_license | #!/bin/bash
#*****************************************************************************************
# *用例名称:RAID_3108_Firmware_HBA_008
# *用例功能:1、测试LSI SAS3108是否可以通过storcli对物理硬盘进行各级别的数据擦除
# 2、是否可以停止数据擦除动作
# *作者:fwx... |
C# | UTF-8 | 3,895 | 2.765625 | 3 | [] | no_license | using ITM.Courses.DAOBase;
using ITM.Courses.Utilities;
using MySql.Data.MySqlClient;
using System;
using System.Data.Common;
namespace ITM.Courses.DAO
{
public class ApplicationLogoHeaderDAO
{
public string Q_AddLogoHeaderDetails = "Insert into applicationlogoheader(collegeName, logoimage,logoimagepa... |
Ruby | UTF-8 | 1,665 | 3.515625 | 4 | [] | no_license |
class EditorTexto
def initialize()
end
def mostrarMenu()
puts "Bienvenido al editor de texto"
puts ""
puts "Menú"
puts "1- Nuevo"
puts "2- Abrir"
puts "3- Escribir archivo existente"
puts "4- Salir"
puts "Por favor selecci... |
Java | UTF-8 | 1,381 | 2.171875 | 2 | [] | no_license | package kr.green.springwebproject.service;
import java.util.ArrayList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import kr.green.springwebproject.dao.Board;
import kr.green.springwebproject.dao.BoardComment;
import kr.green.springwebproject.dao.Boar... |
C# | UTF-8 | 1,402 | 3.34375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ListeZad5
{
class Program
{
static void Main(string[] args)
{
//Dictionary<TKey, TValue>
Dictionary<string, int> gradovi = new Dictionary<strin... |
PHP | UTF-8 | 3,020 | 2.734375 | 3 | [] | no_license | <?php
namespace App\Http\Api\Authentication\Services;
use App\Http\Api\Authentication\Requests\LoginUserRequest;
use App\Http\Api\Authentication\Requests\RegisterUserRequest;
use App\Http\Api\Role\Constants\Roles;
use App\Http\Api\User\Resources\UserResource;
use App\Http\Api\User\Models\User;
use App\Http\Api\User\I... |
Markdown | UTF-8 | 561 | 2.796875 | 3 | [] | no_license | # bash_yt_mp3_downloader
A simple bash script that uses youtube-dl to download mp3 from youtube.
# How to use:
Install youtube-dl from: https://github.com/rg3/youtube-dl/blob/master/README.md#readme
Write in your terminal chmod +x dw.sh in order to give it the right privilages
Execute as ./dw.sh '<youtube... |
Java | UTF-8 | 2,471 | 2.03125 | 2 | [] | no_license | package com.icw.pronounciationpractice.endpoints;
import com.icw.pronounciationpractice.dto.UsuarioQuestaoDTO;
import com.icw.pronounciationpractice.entity.UsuarioQuestao;
import com.icw.pronounciationpractice.entity.UsuarioQuestaoId;
import com.icw.pronounciationpractice.mapper.UsuarioQuestaoMapper;
import com.icw.pr... |
C++ | UTF-8 | 1,801 | 2.921875 | 3 | [
"LGPL-2.0-or-later",
"LGPL-3.0-or-later",
"LGPL-2.1-or-later",
"MIT"
] | permissive | /**
* This is a minimal example, see extra-examples.cpp for a version
* with more explantory documentation, example routines, how to
* hook up your pixels and all of the pixel types that are supported.
*
* On Photon, Electron, P1, Core and Duo, any pin can be used for Neopixel.
*
* On the Argon, Boron and Xenon,... |
Java | UTF-8 | 1,354 | 3.046875 | 3 | [] | no_license | /**
* Copyright 2016 Jasper Infotech (P) Limited . All Rights Reserved.
* JASPER INFOTECH PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package src.mytest;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.con... |
Markdown | UTF-8 | 3,277 | 3.40625 | 3 | [] | no_license | ## 数据库相关概念的学习
1. 不可重复读
不能重复读是指在事务开始之后, 第一次读取的结果集和第二次读取的结果集不一致。
| TRANSACTION1 | TRANSACTIONS2 |
| ---------------------------- | ------------------------ |
| select * from p where id < 5 | |
| | insert into p values (2) |
| ... |
Python | UTF-8 | 288 | 2.625 | 3 | [] | no_license | #!/usr/bin/env python3
"""Convert a parquet file to CSV."""
import pandas
import io
import sys
IN_FILE, OUT_FILE = sys.argv[1], sys.argv[2]
if not OUT_FILE:
print("Output file argument required.")
exit(1)
data = pandas.read_parquet(IN_FILE)
data.to_csv(OUT_FILE, index=False)
|
C# | UTF-8 | 1,329 | 2.765625 | 3 | [] | no_license | using MQHelper;
using Newtonsoft.Json;
using SMS.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SMSService
{
/// <summary>
/// 短信提交到MQ
/// </summary>
public class SMSSubmit
{
private RabbitMQHelper mq;
private SMSSubmit()
... |
Java | UTF-8 | 1,334 | 2.421875 | 2 | [] | no_license | package org.noranj.core.server.servlet;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Logger;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.servlet.http.*;
/**
* This is a general MailHandler... |
Markdown | UTF-8 | 1,078 | 3.65625 | 4 | [
"MIT"
] | permissive | ```cpp
/**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
int height(TreeNode *root)
{
if (!root)
return 0;
else
return 1 + max(height(root->left), height(roo... |
C++ | UTF-8 | 16,717 | 3.984375 | 4 | [
"BSD-2-Clause"
] | permissive | #include <iostream>
#include "bstree.hpp"
/*
*
********* BSTREE CLASS
*
********* Public Methods
*
*/
/*
* Function: Destructor
*
* Description: Destroys the tree by freeing all nodes it possesses
*
*/
template <typename TKey, typename TVal> BSTree<TKey, TVal>::~BSTree() {
_deleteTree(root);
}
/*
*... |
Java | UTF-8 | 15,514 | 2.015625 | 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 rs.ac.bg.fon.silab.gui.form;
import rs.ac.bg.fion.silab.gui.general.GeneralGUINew;
import rs.ac.bg.fion.silab.gui.general.Gene... |
C | UTF-8 | 488 | 3.640625 | 4 | [
"MIT"
] | permissive | #include<stdio.h>
#include<stdlib.h>
// void print_vector(int *m, int n);
// void print_vector(int m[], int n);
// void print_vector(int m[5], int n);
void print_vector(int *n, int tam){
/*Prints an array as follows: vet[index] = value*/
for (int i = 0; i < tam; i++)
{
printf("vet[%... |
Markdown | UTF-8 | 3,706 | 2.546875 | 3 | [] | no_license | ---
copyright:
years: 2019, 2020
lastupdated: "2020-02-25"
keywords: catalog, private catalogs, visibility, filter catalog, hide offering, catalog filtering
subcollection: account
---
{:shortdesc: .shortdesc}
{:codeblock: .codeblock}
{:screen: .screen}
{:tip: .tip}
{:note: .note}
{:important: .important}
{:exter... |
Python | UTF-8 | 1,339 | 2.6875 | 3 | [] | no_license | # -*- coding:UTF-8 -*-
import socket,os,hashlib
import time
from crypt import PrpCrypt
server = socket.socket()
server.bind(('0.0.0.0',9999))
server.listen()
while True:
conn,addr = server.accept()
print("new conn:",addr)
while True:
print("server on....")
data = conn.r... |
Markdown | UTF-8 | 3,963 | 2.96875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | # _Super Battle Game_
#### _This is a RPG that will allow a person to battle their inner child. | Feb 5th. 2020_
#### By _**Alex Skreen & Dusty McCord**_
[link to demo site coming](#)
## Description
This was a Epicodus class project. It is an RPG that allows a user to create a character and battle another ... |
C++ | UTF-8 | 341 | 2.953125 | 3 | [
"MIT"
] | permissive | #include <iostream>
int main(){ // outer block
int n(5); // n created and initialized here
{ // begin nested block
double d(4.0); // d created and initialized here
} // d goes out of scope and is destroyed here
// d can not be used here because it was already destroyed!
return 0;
} // n goes out f scope a... |
C# | UTF-8 | 289 | 2.546875 | 3 | [
"MIT"
] | permissive | // CustomItemProperty
using System;
[Serializable]
public struct CustomItemProperty
{
public string customName;
public string customType;
public object customValue;
public override string ToString()
{
return $"Name: {customName}, Type: {customType}, Value: {customValue}";
}
}
|
Java | UTF-8 | 428 | 2.28125 | 2 | [] | no_license | package com.ds.swagger.service.beans;
public class AbstractService {
private String serviceName;
public AbstractService(String serviceName) {
this.serviceName = serviceName;
System.out.println("----> " +this.serviceName);
}
public String getServiceName() {
return serviceName;
... |
Java | UTF-8 | 2,608 | 1.835938 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2017
* All rights reserved.
*
* Contributors:
* <mrostren> Initial code
*******************************************************************************/
/**
*/
package fr.rostren.tracker.provider.dev;
... |
C# | UTF-8 | 879 | 2.71875 | 3 | [] | no_license | using System;
using System.Globalization;
using Gtk;
//using System.Text.RegularExpressions;
namespace calendar
{
public partial class AddWindowView
{
public long GetTime(){
return this.time;
}
public long GetDistance(){
Console.Write ("dist "+distance);
return this.distance;
}
public long G... |
Python | UTF-8 | 4,169 | 3.078125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# @Time : 17-12-7 下午5:27
# @Author : J.Y.Zhang
# @File : PreFeatureEngineering.py
# @Description:
import pandas as pd
import numpy as np
from collections import Counter
def dealNan(df):
# 票价Nan setting silly values to nan
df.Fare = df.Fare.map(lambda x: np.nan if x == ... |
Python | UTF-8 | 2,661 | 3.796875 | 4 | [] | no_license | import re
class Step(object):
def __init__(self, name):
self.name = name
self.relies_on = set()
self.finished = True
def __repr__(self):
"""Helps me debug a bit"""
return self.name
class OrderOfOps(object):
def __init__(self):
self.steps = dict()
... |
Java | UTF-8 | 21,309 | 1.640625 | 2 | [
"Apache-2.0"
] | permissive | package org.apache.batik.ext.awt.image.renderable;
public interface TurbulenceRable extends org.apache.batik.ext.awt.image.renderable.FilterColorInterpolation {
void setTurbulenceRegion(java.awt.geom.Rectangle2D turbulenceRegion);
java.awt.geom.Rectangle2D getTurbulenceRegion();
int getSeed();
double ge... |
Java | UTF-8 | 5,833 | 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 com.marksmana.beans;
import com.marksmana.controllers.ApiHelper;
import com.marksmana.info.SingleInformation;
import com.marks... |
Shell | UTF-8 | 1,087 | 3.375 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/bash
# fasttext.bash: run experiment with fasttext
# usage: fasttext.bash [ -w ]
# 20180118 erikt(at)xs4all.nl
FASTTEXTDIR=$HOME/software/fastText
FASTTEXT=$FASTTEXTDIR/fasttext
WIKIVEC=$FASTTEXTDIR/wiki.nl.vec
EVAL=$HOME/projects/online-behaviour/machine-learning/eval.py
TRAIN=TRAIN-TEST.fasttext
TEST=TEST... |
Markdown | UTF-8 | 6,651 | 2.890625 | 3 | [] | no_license | #Blog 2: Five Weeks Over, Two Weeks Left.#
Five weeks are over already, yet I feel like the internship has barely started. Since the submission for Blog 1, the interns and I have gone on two field trips to New Brighton State Beach and Pinnacles National Park.
##New Brighton State Beach##
I finally got to visit New Br... |
PHP | UTF-8 | 751 | 2.59375 | 3 | [] | no_license | <?php
namespace Popo1h\PhaadminProvider\ActionLoader;
use Popo1h\PhaadminCore\Action;
use Popo1h\PhaadminProvider\ActionLoader;
class SimpleActionLoader extends ActionLoader
{
/**
* @var Action[]
*/
private $actionMap;
public function __construct()
{
$this->actionMap = [];
}
... |
Java | UTF-8 | 3,193 | 1.59375 | 2 | [] | no_license | package org.pdtextensions.core.ui.preferences;
/**
* Constant definitions for plug-in preferences
*/
public class PreferenceConstants {
public static final String ENABLED = "enabled"; //$NON-NLS-1$
public static final String LINE_ALPHA = "line_alpha"; //$NON-NLS-1$
public static final String LINE_STYLE = "line_s... |
C# | UTF-8 | 1,624 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using Bookmarks.Data;
namespace SimpleBookmarksSearch
{
public class SimpleBookmarksSearchMain
{
static void Main(string[] args)
{
BookmarksEntities context = new BookmarksEntities();
u... |
C++ | UTF-8 | 219 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
//printing the multiple lines
cout << "first statement";
cout << "second statement";
//here both the lines are print in a straight line
return 0;
}
|
Python | UTF-8 | 1,677 | 3.15625 | 3 | [
"MIT"
] | permissive | import numpy as np
from grabscreen import grab_screen
import cv2
import time
from getkeys import key_check
import os
def keys_to_output(keys):
'''
Convert keys to a ...multi-hot... array
[A,W,D] boolean values.
'''
output = [0,0,0]
if 'A' in keys:
output[0] = 1
elif 'D' in keys:
... |
C# | UTF-8 | 1,039 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace CustomProgressBar
{
public partial class ProgressBarImage : UserControl
{
public ProgressBarImage()
... |
Python | UTF-8 | 1,105 | 3.484375 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 09:19:42 2021
@author: sidtrip
"""
# inititallizse C to zero
# need to consider twom matrices A and B
# need to find the dot product of two lsits
# need to pick ith tow and jth column in matrix
def initialize_mat(dim):
#code verified, works... |
JavaScript | UTF-8 | 706 | 3.59375 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var musicians = [];
var instruments = [];
var facts = [];
var aNumber;
function theBeatlesPlay(musicians, instruments) {
var emptyArray = [];
for( let i = 0 ; i < musicians.length ; i++ ) {
emptyArray[i] = `${musicians[i]} plays ${instruments[i]}`;
}
return emptyArray;
}
function johnLennonFac... |
Markdown | UTF-8 | 3,260 | 2.671875 | 3 | [] | no_license | ---
lastUpdated: "03/26/2020"
title: "Module-related Functions"
description: "For an overview of the Momentum module API see Section 1 3 1 Module API and for an overview of hooks see Section 1 3 2 Hooking API..."
---
| Name ... |
Java | UTF-8 | 4,300 | 2.03125 | 2 | [] | no_license | package com.example.android.firebase;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widge... |
Python | UTF-8 | 380 | 3.234375 | 3 | [] | no_license | #Solved
import prime
sieve = prime.sieve(100)
sieve2 = sieve[0:-1]
def product(L):
i = 0
prod = 1
while(i < len(L)):
prod *= L[i]
i += 1
return prod
def totRatio(L):
totList = [x-1 for x in L]
return product(L)/product(totList)
l = [sieve2.pop(0) for x in range(5)]
print(sieve2[0])
while(product(l) < 10000... |
JavaScript | UTF-8 | 7,328 | 3 | 3 | [
"Apache-2.0"
] | permissive | var boardNumbers =[];
var getNumber = [];
var checker = [];
var getChecker = [];
var clickColor;
var fillColor;
var restartCount = 0;
var numberOfClicks = 0;
for (var p = 1; p <= 75; p++){
boardNumbers.push(p);
checker.push(p);
}
function in_array(array, el) {
for(var i = 0 ; i < array.length; i++)
i... |
Java | UTF-8 | 1,436 | 2.453125 | 2 | [] | no_license | package com.smartrestaurants.demo.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity(name = "menu")
public class Menu {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int menu_id;
... |
JavaScript | UTF-8 | 1,539 | 3.03125 | 3 | [] | no_license | var cadastrarUsuario = document.getElementById('cadastrarUsuario');
var loginUsuario = document.getElementById('loginUsuario')
cadastrarUsuario.addEventListener('submit', function(e){
e.preventDefault();
var dados = new FormData(cadastrarUsuario)
console.log(dados);
console.log(dados.get('CadNome'));
console.lo... |
C++ | UTF-8 | 1,244 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include "MidiInput.h"
#ifdef __platform_mac__
#define MIDI_DEVICE_ID 0
#else
#define MIDI_DEVICE_ID 3
#endif
MidiInput::MidiInput()
{
PmError err;
err = Pm_Initialize();
if (err != pmNoError) {
std::cout << "Error initializing: " << Pm_GetErrorText(err) << std::endl;
}
int numDevices = P... |
JavaScript | UTF-8 | 1,659 | 2.765625 | 3 | [] | no_license |
User.save = function (aUser, callback) {
var myKey = aUser.emailAddress;
var shasum = crypto.createHash('sha1');
shasum.update(aUser.password);
aUser.password = shasum.digest('hex');
User.findOne(myKey, function(error, existingUser){
if(error) {
//an error occurred
callback("ERR_DB", null);
} el... |
C | UTF-8 | 1,351 | 4.1875 | 4 | [] | no_license | /*
Programa: cardinales.c
Sinopsis: Nos ofrece el cardinal de un número natural de cero a nueve
tecleado por consola
Ejemplo de sentencia alternativa múltiple
Version: Marzo 2018
Autor: Paco González Moya
*/
#include<stdio.h>
//Función de validación
int validaNumero (unsigned int num);
//Función para obtener el... |
Markdown | UTF-8 | 1,097 | 2.515625 | 3 | [] | no_license | # LeagueRelog 0.1
A way to startup the League of Legends client with a Server selected before starting the client.
This safes time and since it only changes the server not the language used it stops the client from patching 1GB of data every time you relog e.g. from NA to EUW.
## How to use
Simply start the LeagueRe... |
Java | UTF-8 | 13,074 | 2.125 | 2 | [] | no_license | package com.narendra.sams.core.service.impl;
import com.narendra.sams.core.dao.AcademicYearDAO;
import com.narendra.sams.core.domain.AcademicYear;
import com.narendra.sams.core.domain.AcademicYearClass;
import com.narendra.sams.core.domain.AcademicYearCourse;
import com.narendra.sams.core.domain.AcademicYearFee;
impor... |
Java | UTF-8 | 5,442 | 1.8125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Python | UTF-8 | 1,026 | 3.46875 | 3 | [] | no_license | """
@author Lucas
@date 2019/4/2 9:51
"""
# 堆排序
# 建大顶堆
def heap(a):
while True:
flag = True
for i in range(len(a)):
if (2*i + 1) < len(a) and (2*i + 2) < len(a):
if a[2*i + 1] > a[2*i + 2]:
max = 2*i + 1
else:
max ... |
Python | UTF-8 | 425 | 3.140625 | 3 | [] | no_license | import streamlit as st
st.title('Penguin Classifier')
st.write("This app uses 6 inputs to predict the species of penguin using "
"a model built on the Palmer's Penguin's dataset. Use the form below"
" to get started!")
password_guess = st.text_input('What is the Password?')
if password_g... |
Shell | UTF-8 | 559 | 3.8125 | 4 | [
"BSD-2-Clause"
] | permissive | #!/bin/bash
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
. $BASEDIR/conf/settings
FILE="$1"
if [ -z "$FILE" ]; then
echo "Error: Missing file. "
echo "Usage: vms_download_file <file>"
exit 1
fi
if [ ! -d $BASEDIR/downloaded ]; then
mkdir $BASEDIR/downloaded
fi
for VM in $(cat $BASE... |
Markdown | UTF-8 | 3,133 | 3.015625 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 推荐算法之Embeding技术
subtitle:
date: 2018-10-01
author: horizon-z40
header-img: img/post-bg-cook.jpg
catalog: true
tags:
- 推荐系统
---
每个user/item可以表示为一个向量,向量之间的相似度可以用来改善推荐。
##### 1. denoising autoencode
Yahoo Japan的新闻推荐团队利用denoising autoencode的技术来学习新闻的vector表示。Autoencode大... |
Java | UTF-8 | 798 | 2.953125 | 3 | [] | no_license | package com.khan.academy.infection;
import java.util.HashSet;
import java.util.Set;
public class UserGraph {
Set<User> infected;
Set<User> uninfected;
public UserGraph() {
infected = new HashSet<User>();
uninfected = new HashSet<User>();
}
public void addInfected(User user) {
user.moveUserFromOldToNewVe... |
Java | UTF-8 | 696 | 2.9375 | 3 | [] | no_license | package com.nextyu.book.study.source.chapter8_testing_concurrent_applications._2_monitoring_a_Lock_interface;
import java.util.Collection;
import java.util.concurrent.locks.ReentrantLock;
/**
* created on 2016-07-14 9:28
*
* @author nextyu
*/
public class MyLock extends ReentrantLock {
/**
* returns the... |
C | UTF-8 | 310 | 2.921875 | 3 | [] | no_license | #include "../fe.h"
char *fe_xdirname(char const *path) {
/* Strdup the path, dirname chops it up. The caller is responsible for
* freeing the return value. */
char *copy = fe_xstrdup(path);
char *dirn = dirname(copy);
char *ret = fe_xstrdup(dirn);
free(copy);
return ret;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.