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 | 3,967 | 1.757813 | 2 | [] | no_license | /*
* XML Type: CT_EmbeddedFontListEntry
* Namespace: http://schemas.openxmlformats.org/presentationml/2006/main
* Java type: org.openxmlformats.schemas.presentationml.x2006.main.CTEmbeddedFontListEntry
*
* Automatically generated - do not modify.
*/
package org.openxmlformats.schemas.presentationml.x2006.main;
... |
Markdown | UTF-8 | 1,148 | 2.59375 | 3 | [
"LicenseRef-scancode-other-permissive"
] | permissive |
## About ##
rsa_tool provides a working example in C of how to use Microsoft Crypto API to digitally sign and verify the integrity of files using the RSA digital signature algorithm.
The private and public keys must be stored in PEM (Privacy Exchange Mail) format.
Signatures are stored as binary using big-endi... |
Markdown | UTF-8 | 1,526 | 3.84375 | 4 | [] | no_license | # 1167. Minimum Cost to Connect Sticks
You have some number of sticks with positive integer lengths. These lengths are
given as an array sticks, where sticks[i] is the length of the ith stick.
You can connect any two sticks of lengths x and y into one stick by paying
a cost of x + y. You must connect all the sticks u... |
C++ | UTF-8 | 1,107 | 3.203125 | 3 | [] | no_license | // 118.pascals-triangle.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <random>
#include "..\Common\Common... |
Java | UTF-8 | 1,513 | 2.203125 | 2 | [] | no_license | package com.atguigu.springcloud;
import com.atguigu.springcloud.dao.UserDao;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
... |
C# | UTF-8 | 649 | 2.75 | 3 | [] | no_license | using System;
using System.Threading;
using Akka.Actor;
namespace Vj05Examples
{
public class CollectorActor : ReceiveActor
{
public CollectorActor()
{
int br = 0;
Receive<Messages.Empty>(x => br++);
Receive<Messages.Print>(x => Console.WriteLine($"{Self.Path... |
PHP | UTF-8 | 827 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace Mibexx\Dependency\Business;
use Mibexx\Kernel\Business\Config\ConfigInterface;
use Mibexx\Kernel\Business\Locator\Locator;
interface ContainerInterface extends \ArrayAccess
{
/**
* @return Locator
*/
public function getLocator();
/**
* @param Locator $locator
*/
p... |
Java | UTF-8 | 1,375 | 2.125 | 2 | [] | no_license | package com.mitosis.timesheet.service.impl;
import java.util.ArrayList;
import java.util.List;
import com.mitosis.timesheet.dao.BankReconcileDao;
import com.mitosis.timesheet.dao.daoImpl.BankReconcileDaoImpl;
import com.mitosis.timesheet.model.CustomerPaymentModel;
import com.mitosis.timesheet.model.InvoiceHdrModel;
... |
PHP | UTF-8 | 123 | 3.03125 | 3 | [] | no_license | <?php
class First{
public function __construct(){
echo "Hello from first class";
}
}
?> |
Java | UTF-8 | 701 | 3.5625 | 4 | [] | no_license |
public class Stack_Queue_06 {
public static int[] solution(int[] prices) {
int[] answer = {};
int size = prices.length;
answer = new int[size];
//answer[size-1] = 0;
for(int i=0; i<size-1; i++) {
for(int j=i+1; j<size; j++) {
answer[i]++;
i... |
Java | UTF-8 | 4,731 | 3.15625 | 3 | [] | no_license | /**
* author Maria.Gavrilova
* copyright 20.07.2018 © Devellar
*/
package collections;
import java.util.*;
public class CollectionsTest {
public static void main(String[] args) {
//ARRAY LIST
// ArrayList<String> list = new ArrayList<>();
// ArrayList<String> listCompare = new ArrayLis... |
Markdown | UTF-8 | 2,224 | 3.09375 | 3 | [] | no_license | # Fantasy-Ashesi-Basketball-Application
Do you know Fantasy Premier League? That is great! If you do not, Fantasy Premier
League (FPL) is an extension of the Premier league app which allows the user to stay in touch
with his favorite team in terms of statistics, transfers, fixtures, results, etc. FPL enables the use... |
TypeScript | UTF-8 | 946 | 4.53125 | 5 | [
"Apache-2.0"
] | permissive | // There are 3 basic types in TypeScript
let isDone: boolean = false;
let lines: number = 42;
let name: string = "Anders";
// But you can omit the type annotation if the variables are derived from explicit literals
let isDone = false;
let lines = 42;
let name = "Anders";
// When it's impossible to know, there is the ... |
Java | UTF-8 | 10,038 | 2 | 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 View;
import KUspital.*;
import java.io.*;
import javax.swing.JFileChooser;
public class Chat extends javax.swing.JFrame {
... |
C++ | UTF-8 | 826 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <set>
#include <cstdint>
#include <cinttypes>
#include <cmath>
int main (int argc, char *argv[])
{
std::set<uint64_t> s_vals;
uint64_t nr, i, j, m, mx3, max_l, v, old_sz;
long double x3 = 1.0/3.0, u;
std::cin >> max_l;
mx3 = 1+std::pow(static_cas... |
C++ | UTF-8 | 767 | 2.890625 | 3 | [] | no_license | #ifndef HOMEWORK_POLICY_H
#define HOMEWORK_POLICY_H
#include "iostream"
class Policy {
char*passport;
long serialNumber;
char *company;
char *policyInformation;
public:
Policy(char*passport, long serialNumber, char *company, char *policyInformation);
Policy(char *passport, long serialNumber,char... |
Markdown | UTF-8 | 62,684 | 2.71875 | 3 | [] | no_license | [toc]
# Spring理解
这篇文章主要是想通过一些问题,加深大家对于 Spring 的理解,所以不会涉及太多的代码!这篇文章整理了挺长时间,下面的很多问题我自己在使用 Spring 的过程中也并没有注意,自己也是临时查阅了很多资料和书籍补上的。网上也有一些很多关于 Spring 常见问题/面试题整理的文章,我感觉大部分都是互相 copy,而且很多问题也不是很汗,有些回答也存在问题。所以,自己花了一周的业余时间整理了一下,希望对大家有帮助。
### Bean周期和作用范围
生命周期:
1. 实例化 Bean 对象。
1. 设置 Bean 属性。
1. 如果我们通过各种 Aware 接口声明了依赖关系,则会注入 Bean ... |
Go | UTF-8 | 4,327 | 2.875 | 3 | [] | no_license | package main
import (
"github.com/gorilla/websocket"
"github.com/gofrs/uuid"
"time"
"log"
"sync"
"encoding/json"
"net/http"
)
type Client struct {
id string
conn *websocket.Conn
sendLock sync.Mutex
// sendCallback is callback based on packetID
sendCallback map[string]func(req WSPacket)
sendCallback... |
Java | UTF-8 | 3,162 | 2.125 | 2 | [] | no_license | package com.alexzh.tutorial.notificationdemo;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.Req... |
Java | UTF-8 | 765 | 1.5625 | 2 | [] | no_license | import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;
import com.tencent.mobileqq.filemanager.util.FileManagerUtil.TipsClickedInterface;
public final class fyj
extends ClickableSpan
{
public fyj(FileManagerUtil.TipsClickedInterface... |
C# | UTF-8 | 1,317 | 2.578125 | 3 | [] | no_license | using TechTalk.SpecFlow;
using NUnit.Framework;
using OpenQA.Selenium;
using AllureReportSample.PageClass;
namespace AllureReportSample.Steps
{
[Binding]
public class LoginSteps
{
private readonly IWebDriver _driver;
private readonly LoginPage loginpage;
public LoginSteps(IWebDriv... |
Markdown | UTF-8 | 582 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | # instalint.vim
Uses Vim's syntax highlighting to instantly bring out trailing whitespaces, tabs, duplicated word or any other regex.
## Installation
Assuming you have Pathogen up and running:
$ cd ~/.vim/bundle
$ git clone git://github.com/adaszko/instalint.vim
Add per-filetype configuration to your `.vim... |
C# | UTF-8 | 2,806 | 2.578125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
/// <summary>
/// Summary description for clsEstudiante
/// </summary>
public class clsEstudiante
{
public clsEstudiante()
{
this.IdEstudiante = _idEstudiante;
this.Nombre = _nombre;
this.Apellido = _a... |
Markdown | UTF-8 | 6,486 | 3.21875 | 3 | [] | no_license | # CS401 Assignment 1
**Name**: 徐逸飞(Yifei Xu)
**SID**: 11611209
## Notion: ##
* Given position: $$\vec P$$ = (x, y)
* GIven field scaling: *K*
* The velocity: $$\vec V$$
* The maximum distance of influence: *R*
* The minimum distance of influence: *r*
## Part 1 - Analysis
**How to generate uniform, perpendicul... |
Java | UTF-8 | 4,002 | 1.921875 | 2 | [] | no_license | package org.apache.maven.plugin;
/*
* Copyright 2001-2005 The Apache Software Foundation.
*
* 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/LICEN... |
Markdown | UTF-8 | 10,320 | 3.21875 | 3 | [] | no_license | ## API
⬆️ [Go to main menu](README.md#laravel-tips) ⬅️ [Previous (Log and debug)](log-and-debug.md) ➡️ [Next (Other)](other.md)
- [API Resources: With or Without "data"?](#api-resources-with-or-without-data)
- [Conditional Relationship Counts on API Resources](#conditional-relationship-counts-on-api-resources)
- [API... |
Python | UTF-8 | 753 | 3.484375 | 3 | [] | no_license | # coding=utf-8
"""
数字的格式化输出,使用format()还是挺有意思的
'[<>^]?width[,]?(.digits)?':其中 width 和 digits 为整数,?代表可选部分。
>>> x = 1234.56789
>>> format(x, '0.1f')
'1234.6'
>>> format(x, '10.1f')
' 1234.6'
>>> format(x, '>10.1f')
' 1234.6'
>>> format(x, '<10.1f')
'1234.6 '
>>> format(x, '*>10.1f')
'****1234.6'
>>> format(x, '^... |
Java | UTF-8 | 337 | 1.773438 | 2 | [] | no_license | package com.bb.favoriteplaces.database;
import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
@Dao
public interface FavoritePlacesDAO {
@Insert
void addFavoritePlaces(FavoritePlacesEntity googlePlacesEntity);
@Delete
void deleteFavoritePlaces(FavoritePlacesEntity google... |
Java | UTF-8 | 2,382 | 2.625 | 3 | [] | no_license | import java.sql.Connection;
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class Test
{
public static void main(String[] args) throws Exception
{
testSelect();
//testUpdate();
// testDelete();
// testInsert();
}
public static void testIn... |
Java | UTF-8 | 512 | 2.3125 | 2 | [] | no_license | package com.geniye.wordit.core.dto;
import com.geniye.wordit.core.models.User;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class UserDTO {
private String username;
private String email;
private String bio;
private String image;
priva... |
Markdown | UTF-8 | 3,216 | 3.40625 | 3 | [
"CC0-1.0"
] | permissive | # 图标与视觉
高质量的视觉设计不仅提升了应用的品质,同时也能传达一定的信息,增强了整体的用户体验。OS X 的用户都习惯了高质量且有意义的视觉设计,他们更愿意使用设计比较优雅的应用。
**所以你要确保你的设计看上去足够专业,足够优雅。** 不要低估这些高质量的视觉设计对用户的价值,渣视觉只能给用户一个很差印象,让用户觉得整个应用的质量都不怎样。为了给用户留下一个不错的印象,在开发的过程中视觉设计必须占有一席之地。
**留心图片在全屏模式下的表现。** 如果你的应用允许使用全屏模式,那么千万不要把直接把拉伸放大,这样图片会变模糊。一般我们可以先从大分辨率开始做视觉设计,然后再缩小成需要的大小,这样会比较科学一点。(译者注:多... |
Python | UTF-8 | 1,859 | 2.75 | 3 | [
"MIT"
] | permissive | import sys
import urllib
import json
import requests
class BingApiResult():
def __init__(self, json_result):
self.response = json.loads(json_result)['SearchResponse']['Web']
self.total = self.response['Total']
def find_libraries(self):
libraries = []
return self.r... |
Java | UTF-8 | 704 | 2.171875 | 2 | [] | no_license | package org.rgn.ajia.around.actions;
import org.rgn.ajia.around.daos.AnotherDao;
import org.rgn.ajia.around.daos.MessageDao;
import org.rgn.ajia.around.infra.BaseAction;
public class ThirdAction extends BaseAction{
public String a;
public ThirdAction() {
}
public void doSomething() {
System.out
.println("\n... |
TypeScript | UTF-8 | 2,685 | 2.671875 | 3 | [] | no_license | import { Injectable } from '@angular/core';
export interface SoccerTeam {
team_name: string;
goals: number;
yellow_cards: number;
red_cards: number;
offsides: number;
}
@Injectable({
providedIn: 'root'
})
export class MatchService {
Teams: SoccerTeam[] = [];
stats;
results;
constructor() { }
... |
JavaScript | UTF-8 | 1,908 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from "react"
import _ from "lodash"
import ErrorList from "./ErrorList"
const ArticleForm = props => {
const [articleRecord, setArticleRecord] = useState({
title: "",
content: ""
})
const [errors, setErrors] = useState({})
const handleChangeInput = event => {
... |
Python | UTF-8 | 346 | 3.171875 | 3 | [
"MIT"
] | permissive | import tkinter as tk
def action_btn_press():
print('Button was pressed')
root=tk.Tk()
root.title('Widget creation')
root.geometry('350x150')
lb=tk.Label(text='Label-1')
bt1=tk.Button(text='Button')
bt2=tk.Button(text='Button')
bt=tk.Button(text='ボタン',command=action_btn_press)
lb.pack()
bt1.pack()
bt2.pack()
bt.pa... |
C++ | UTF-8 | 303 | 2.703125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int nh[2];
for (int i=0; i<2; i++){
cin >> nh[i];
}
int temp, count = 0;
for (int i=0; i < nh[0]; i++){
cin >> temp;
if (temp > nh[1]){
count += 2;
}
else{
count++;
}
}
cout << count;
return 0;
}
|
C++ | UTF-8 | 2,689 | 3.234375 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: Nov 14, 2012
* Author: torghele
*/
#include <iostream>
#include <cmath>
#include <stdlib.h>
#include <errno.h>
#include <sys/socket.h>
#include <sys/un.h>
using namespace std;
void server()
{
int s, s2, len;
socklen_t t;
struct sockaddr_un local_addr, remote_addr;
float ... |
Java | UTF-8 | 956 | 2.046875 | 2 | [] | no_license | package com.appslab.oracle.atthackthon;
import android.app.Application;
import android.os.SystemClock;
import com.datami.smi.SdState;
import com.datami.smi.SdStateChangeListener;
import com.datami.smi.SmiResult;
import com.datami.smi.SmiSdk;
import java.util.concurrent.TimeUnit;
/**
* Created by Osvaldo Villagrana... |
Markdown | UTF-8 | 2,776 | 4.15625 | 4 | [
"MIT"
] | permissive | # Primitive and reference types
in JS we have two kinds of types: *primitive* and *reference*.
primitive types => stored as simple data types
reference types => stored as object
**the tricky part is that JS lets you treat primitive types like reference types
in order to make the language more consistent for the devel... |
Python | UTF-8 | 1,482 | 3.46875 | 3 | [] | no_license | import unittest
from activities import eat, nap, is_funny, laugh
class ActivityTests(unittest.TestCase):
def test_eat_healthy(self):
self.assertEqual(
eat("carrots", is_healthy=True),
"I'm eating carrots, because they are good"
)
def test_eat_unhealthy(self):
se... |
Java | UTF-8 | 1,471 | 2.65625 | 3 | [] | no_license | package com.sy.hibernatetest;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import com.sy.util.db;
public class date {
/**
* @param args
* @throws SQLException
*/
... |
PHP | UTF-8 | 1,437 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
/**
* Class CreateSlackIntegrationTable
*
* The Migrations is Defined for Slack.
*
* PHP version 7.1.3
*
* @category Administration
* @package Modules\Slack
* @author Vip... |
JavaScript | UTF-8 | 2,402 | 2.75 | 3 | [] | no_license | class Tooltip extends HTMLElement {
constructor() {
super();
this._tooltipVisible = false;
this.attachShadow({ mode: 'open' });
this.init();
this.stylesheetPath = '';
}
init() {
this._tooltipTarget = document.createElement('slot');
this.shadowRoot.ap... |
Java | UTF-8 | 11,809 | 2.09375 | 2 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | package com.github.bderancourt.springboot.isolatedrunner.launcher;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.ni... |
Markdown | UTF-8 | 6,144 | 2.84375 | 3 | [
"MIT"
] | permissive | # FAQ
- **Why is my `umi_tool group`/`dedup` command taking so long?**
The time taken to resolve each position is dependent on how many unique UMIs there are and how closely related they are since these factors will affect how large the network of connected UMIs is. Some of the factors which can affect run time are:... |
Python | UTF-8 | 1,261 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | #! /usr/bin/env python
import tensorflow as tf
import numpy as np
import os
import time
import datetime
import data_helpers
from text_cnn import TextCNN
from tensorflow.contrib import learn
x_text = ['This is a cat','This must be boy', 'This is a a dog zouminminzou']
max_document_length = max([len(x.split(" ")) for x ... |
C# | UTF-8 | 1,171 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
namespace ForumSystem
{
public class ForumDBContext : DbContext
{
//This class interact with the DB behind the scenes
public virtual DbSet<Forum> Forums { get; set; }
public ... |
Java | UTF-8 | 259 | 1.5 | 2 | [] | no_license | package com.ims.mapper;
import com.ims.entity.Teacher;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author admin
* @since 2019-12-22
*/
public interface TeacherMapper extends BaseMapper<Teacher> {
}
|
C# | UTF-8 | 1,983 | 2.6875 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
namespace Ice {
public class DebugUI : MonoBehaviour {
public Text debugVarsText;
private Dictionary<string, Dictionary<string, object>> debugValues = new Dictionary<string, Dictio... |
Markdown | UTF-8 | 2,269 | 2.53125 | 3 | [] | no_license | 相應部47相應43經/道經(念住相應/大篇/修多羅)(莊春江譯)
起源於舍衛城。
在那裡,世尊召喚比丘們:
「比丘們!這裡,有一次,我住在優樓頻螺,尼連禪河邊牧羊人的榕樹下,初現正覺。比丘們!當我獨處、獨坐時,心中生起了這樣的深思:『為了眾生的清淨、為了愁與悲的超越、為了苦與憂的滅沒、為了方法的獲得、為了涅槃的作證,這是無岔路之道,即:四念住,哪四個呢?比丘能住於在身上隨觀身,熱心、正知、有念,能調伏對於世間的貪婪、憂;或比丘能住於在受上……(中略)或比丘能住於在心上……(中略)或比丘能住於在法上隨觀法,熱心、正知、有念,能調伏對於世間的貪婪、憂。為了眾生的清淨、為了愁與悲的超越、為了苦與憂的滅沒、為了方法的獲得、為了涅... |
Markdown | UTF-8 | 938 | 2.84375 | 3 | [] | no_license | ---
title: Teaching and Preaching Tidy Data
author: Kevin
date: '2018-05-10'
slug: data-literacy
categories:
- R
- Tidydata
tags: []
description: ''
featured: ''
featuredalt: ''
featuredpath: ''
linktitle: ''
---
I have been a middle manager in the social service sector for approximately 10 years. In order to ma... |
Java | UTF-8 | 404 | 2.3125 | 2 | [] | no_license | package oberon0.ast.variables.types;
import oberon0.environment.Context;
import oberon0.environment.IValue;
import oberon0.environment.IntegerValue;
public class IntegerType implements IType {
@Override
public TypeNames getTypeName(Context context) {
return TypeNames.INTEGER;
}
@Override
public... |
Java | UTF-8 | 1,838 | 2.171875 | 2 | [] | no_license | package io.ticly.mint.mypage.model.dao;
import io.ticly.mint.mypage.model.dto.MyPageDTO;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class MyPageDAO {
private SqlSessionTemplate sqlSessionTemplate;
public MyPageDAO(SqlSessionTemplate sq... |
TypeScript | UTF-8 | 1,263 | 2.65625 | 3 | [
"MIT"
] | permissive | import { isAccessTokenError } from '../../../src/shared/errors/isAccessTokenError';
import { OAuth2Error } from './../../../src/shared/interfaces/OAuth2Error';
import {
ACCESS_TOKEN_REVOKED,
ACCESS_TOKEN_EXPIRED,
ACCESS_TOKEN_INVALID
} from './../../../src/shared/errors/constants';
import { expect } from 'chai';... |
Ruby | UTF-8 | 669 | 2.765625 | 3 | [] | no_license | class MovieDetailsImporter
def call(title)
movie = get_movie(title)
movie ? prepare_movie_details(movie) : NullMovie.new.details
end
private
def get_movie(title)
encoded_title = CGI.escape(title)
response = HTTP.get(
"https://api.themoviedb.org/3/search/movie?api_key=#{ENV['TMDB_API_KEY'... |
JavaScript | UTF-8 | 3,439 | 3.4375 | 3 | [] | no_license | /*Mahdollisiman yksinkertinen chatti Socket.io:lla
* Socket.io:n toimita perustuu eventteihin. Socket
* periin Noden events.eventEmitter -luokan joten se
* voi emittoida eventtejä.
*
* Projektiin pitää asentaa socket.io: npm install socket.io
*/
let http = require('http');
let fs = require('fs');
let Moniker =... |
JavaScript | UTF-8 | 3,559 | 3.203125 | 3 | [] | no_license | class Node {
constructor(cellData) {
this.weight = cellData.weight;
this.isWall = cellData.isWall;
}
}
class Graph {
constructor(start, end, cellArr) {
this.start = start;
this.end = end;
this.matrix = {};
this.rows = cellArr.length;
this.columns = ce... |
C++ | UTF-8 | 916 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
#include "Sortable.h"
class Data {
vector<Sortable*> v;
public:
Data() {
}
~Data() {
}
void add(Sortable* s) {
v.push_back(s);
}
void print() {
for (int i = 0; i < v.size(); i++) {
//cout << "Circle with radius: " << v[i]->r <<... |
C++ | UTF-8 | 10,232 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "XYZ/Core/Ref.h"
#include <memory>
namespace XYZ {
/**
* Represents data Components in shader program
*/
enum class ShaderDataComponent
{
None = 0, Float, Float2, Float3, Float4, Mat3, Mat4, Int, Int2, Int3, Int4, Bool
};
/**
* Return size of specified shader data Component
* @param... |
C# | UTF-8 | 2,151 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.IO;
using DevExpress.Web;
using Image = System.Drawing.Image;
namespace SecurityBestPractices.UploadingFiles {
public partial class UploadControl : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e) {
// This code is not called by ... |
C++ | UTF-8 | 816 | 2.609375 | 3 | [
"MIT"
] | permissive | /*
1. Connect the input pins of relay module (in this case 4 channel) with 3, 4, 5, and 6 digital pins of Arduino Uno
2. Provide 5V power supply in the Vin of Relay Module.
*/
const int relay_1_pin = 3;
const int relay_2_pin = 4;
const int relay_3_pin = 5;
const int relay_4_pin = 6;
void setup() {
pinMode(rel... |
Ruby | UTF-8 | 587 | 4.03125 | 4 | [] | no_license | #Seven Ingredients: Ruby
#VARIABLES
x=10
y="some words"
z=false
puts x
#METHODS (FUNCTIONS)
def hr(x=7)
d=""
x.times do
d+="-"
end
puts d
end
hr()
#CONDITIONALS
if (x>10)
puts y
else
puts x
end
hr()
#SETS
a=["Luke","Leia","Han"]
puts a[0]
b={"first"=>"uno", "second"=>"dos"}
puts ... |
C | UTF-8 | 289 | 3.515625 | 4 | [] | no_license | #include<stdio.h>
int fib(int n);
int main()
{
int i;
for(i=0;i<10;i++)
{
printf("%d\n",fib(i));
}
return 0;
}
int fib(int n)
{
int result;
if(n==0)return 0;
else if(n==1)return 1;
else
{
result=fib(n-1)+fib(n-2);
return result;
}}
|
Markdown | UTF-8 | 7,943 | 3.375 | 3 | [] | no_license | # Supervised_Learning
## Instructions
this project use the imbalanced-learn library to resample the data and build and evaluate logistic regression classifiers using the resampled data. The datasets were inside of the challenge-resources file. This project include two parts: Sampling and Ensemble Learners
## Backgroun... |
C# | UTF-8 | 1,777 | 2.75 | 3 | [
"CC0-1.0"
] | permissive | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PoolManager : MonoBehaviour
{
#region Serializable Private Fields
[SerializeField] private GameObject pooledObject;
[SerializeField] private int initialSize;
#endregion
#region Private Fields
p... |
Java | UTF-8 | 166 | 1.929688 | 2 | [] | no_license | package com.xfhy.flyweight;
/**
* @author : xfhy
* Create time : 2020/1/7 22:38
* Description : 网站接口
*/
interface WebSite {
void use(User user);
}
|
Markdown | UTF-8 | 596 | 2.671875 | 3 | [
"MIT"
] | permissive | # GlibGrade
GlibGrade aims to keep users informed by giving rating s to the verifiability of web apps.
It gives a verbal feedback from our machine learning algorithm and a community numerical rating so that the user has multiple sources to get input from.
### Example:
<strong>Before GlibGrade:</strong><br/>
![News a... |
Markdown | UTF-8 | 816 | 2.546875 | 3 | [] | no_license | # MidiKeys
> Uses WebMIDI to pipe MIDI messages into a browser
### NOTES:
Built to run in browser with global variable available via `<script>` load. Special setup as follows:
* Set entry to './src/midi-keys.js'
* Added output options (from: https://www.made-on-mars.com/blog/how-to-create-a-npm-module-that-works-on-br... |
Markdown | UTF-8 | 1,608 | 2.90625 | 3 | [] | no_license | ## [Solo project] cc8-project.continuous-delivery-vue-3
### This was created during my time as a [Code Chrysalis](https://codechrysalis.io) Student
- full stack project to create search website
<img src="gmap-with-marker.png" alt="attach:filter" title="attach:filter" width="1000" height="600">
<img src="filter.png" al... |
Python | UTF-8 | 772 | 2.640625 | 3 | [] | no_license | import matplotlib
matplotlib.use('TkAgg')
import networkx as nx, pylab
Dt = 0.01
alpha = 0.1
omega = 0.1
lamb = 0.1
def init():
global g, nextg
g = nx.karate_club_graph()
for i in g.nodes():
g.node[i]['state'] = pylab.randint(1,11)
nextg = g.copy()
g.pos = nx.spring_layout(g)
def update():
global g, nextg
... |
Ruby | UTF-8 | 1,866 | 2.65625 | 3 | [
"MIT"
] | permissive | module StateMachinable
module Base
extend ActiveSupport::Concern
class_methods do
def state_class(state)
"#{self}::#{state.classify}".constantize
rescue NameError
nil
end
end
included do
include Statesman::Machine
state :initial, :initial => true
... |
C# | UTF-8 | 561 | 3.5 | 4 | [] | no_license | using System;
namespace ConsoleApp1 // Parameterized and non parameterized method
{
class Method1
{
public void method1()
{
Console.WriteLine(" This is non parameterized method ");
}
public void method2(int a, int b)
{
Console.WriteLine(" T... |
C++ | UTF-8 | 634 | 3.375 | 3 | [] | no_license | #include "6.2.h"
#include "stack.h"
#include <iostream>
using namespace std;
bool eventLoop(Stack* stack, const string& characters) {
for (int i = 0; i < characters.size(); ++i) {
if (head(stack) == nullptr || characters[i] == '(' || characters[i] == '[' || characters[i] == '{') {
push(stack,... |
Python | UTF-8 | 1,054 | 2.953125 | 3 | [] | no_license | from braindump import meta
def test_string_to_identifier(string_to_identifier):
for string, identifier in string_to_identifier.iteritems():
result = meta.recase(unicode(string))
assert result == identifier
def test_identifier_to_string(identifier_to_string):
for identifier, string in identif... |
SQL | UTF-8 | 2,645 | 3.046875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: streetview
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
... |
Markdown | UTF-8 | 3,051 | 3.125 | 3 | [] | no_license | The run_analysis.R script performs a data tidying process on the dataset provided.
First download the dataset.
Dataset was downloaded and extracted under the file/folder called UCI HAR Dataset.
Variables were assigned to each data.
features <- features.txt : 561 rows, 2 columns
The features selected for this database... |
Markdown | UTF-8 | 1,852 | 2.875 | 3 | [] | no_license | # Elm Tetris
[](https://github.com/yonigibbs/yaet/actions)
This repo contains a version of Tetris, written in Elm.
#### Play the game [here](https://yonigibbs.github.io/yaet/).
## Development
To run the project locally clone the r... |
PHP | UTF-8 | 1,305 | 2.5625 | 3 | [] | no_license | <?php
error_reporting(0);
$db_filename = "../db/db.sqlite";
if($db = sqlite_open($db_filename, 0666)) {
$user_id = sqlite_escape_string($_GET['user_id']);
$query = sqlite_query($db, "SELECT code FROM users WHERE id = '$user_id'");
$user = sqlite_fetch_array($query, SQLITE_ASSOC);
sqlite_close($db);
}
if($user === f... |
Java | UTF-8 | 2,679 | 2.328125 | 2 | [] | no_license | package org.uh.hulib.attx.services.ontology;
import static spark.Spark.*;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Random;
public class OntologyService {
public static void main() {
int maxThreads = 6;
int minThreads = 5;... |
JavaScript | UTF-8 | 2,208 | 3.3125 | 3 | [] | no_license | /*
학급 회장(해쉬)
학급 회장을 뽑는데 후보로 기호 A, B, C, D, E 후보가 등록을 했습니다.
투표용지에는 반 학생들이 자기가 선택한 후보의 기호(알파벳)가 쓰여져 있으며 선생님은 그
기호를 발표하고 있습니다.
선생님의 발표가 끝난 후 어떤 기호의 후보가 학급 회장이 되었는지 출력하는 프로그램을 작
성하세요. 반드시 한 명의 학급회장이 선출되도록 투표결과가 나왔다고 가정합니다.
▣ 입력설명
첫 줄에는 반 학생수 N(5<=N<=50)이 주어집니다.
두 번째 줄에 N개의 투표용지에 쓰여져 있던 각 후보의 기호가 선생님이 발표한 순서대로
문자열로 입력됩니다.... |
Java | UTF-8 | 241 | 1.828125 | 2 | [] | no_license | package com.stackroute.authorizeapp.service;
import com.stackroute.authorizeapp.model.UserProfile;
public interface UserprofileService {
UserProfile addUser(UserProfile usernew);
boolean validateUser(String email,String pass);
}
|
Java | UTF-8 | 2,488 | 2.59375 | 3 | [] | no_license | package com.cloud.util;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.mail.EmailAttachment;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;
import org.apache.log4j.Logger;
public class MailUtil {
private static final Logger LOGGER = Logger.get... |
C | UTF-8 | 785 | 3.765625 | 4 | [] | no_license | #include <stdio.h>
#include "NumClass.h"
int main(){
int num1 ,num2;
scanf("%d%d",&num1,&num2);
if(num1>num2){
int temp=num1;
num1=num2;
num2=temp;
}
printf("The Armstrong numbers are:");
for (int i = num1; i < num2; i++)
{
if(isArmstrong(i)==1){
printf(" %d",i);
}
}
printf("\n")... |
Java | UTF-8 | 128 | 2.046875 | 2 | [] | no_license | package com.solid.interfaceseg;
// Interface Segregation
public interface ConvertIntToCharacter {
public void intToChar();
}
|
Python | UTF-8 | 1,228 | 2.640625 | 3 | [] | no_license | from django.db import models
from django.contrib.auth.models import User
class Show(models.Model):
"""
This class contains the name of the show
as well as the id.
The id is not defined here as it is added
by default to every model
"""
name = models.CharField(max_length=200)
def __unic... |
Python | UTF-8 | 1,803 | 3.015625 | 3 | [] | no_license | import requests
from pprint import pprint
version = '5.69'
access_token = '873fcd36b45b3109194fe20b24e973739bd9b9db170a0a251097c651cf93325eeb49895c8a52e170ae358'
def from_list_to_dict(friends_list):
friends_dict = dict()
for friend in friends_list:
try:
if friend['deactivated']:
... |
Ruby | UTF-8 | 6,290 | 2.640625 | 3 | [] | no_license | # frozen_string_literal: true
class BatchImport < ApplicationRecord
PENDING = 'pending'
IN_PROGRESS = 'in_progress'
COMPLETED_SUCCESSFULLY = 'completed_successfully'
COMPLETE_WITH_FAILURES = 'complete_with_failures'
CANCELLED = 'cancelled'
STATUSES = [PENDING, IN_PROGRESS, COMPLETED_SUCCESSFULLY, COMPLETE... |
C# | UTF-8 | 1,925 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace AgendaDeContatos.Entidades
{
public class EntidadePessoa
{
private int id;
private string nome;
private string cpf;
private DateTime dataNascimento;
private string email;
... |
Java | UTF-8 | 1,283 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | package com.vise.bledemo.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.vise.bledemo.R;
import java.util.List;
public class OutPutAdapter extends RecyclerView.Adapter<OutPutAd... |
Java | UTF-8 | 5,036 | 2.84375 | 3 | [
"MIT"
] | permissive | package com.fengwenyi.api_result.entity;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Objects;
/**
* 接口响应实体类 <br>
*
* <br>
*
* 属性介绍:<br>
* <ul>
* <li>success:返回结果标识。true为成功; false为失败</li>
* <li>code:响应码,可根据项目业务指定错误码,便于业务处理</li>
* <li>message:... |
PHP | UTF-8 | 1,536 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
require_once('Helpers/CreateTestResource.php');
/**
* Class UpdateResourceTest
*/
class UpdateResourceTest extends TestCase
{
/**
* @var
*/
protected $testingResource;
/**
* Test updating a resource
*
* @return void
*/
public function testUpdate()
{
... |
Markdown | UTF-8 | 3,451 | 2.796875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: 191119 TIL 뉴스스탠드개발 미션
permalink: /til/:year/:month/:day/:title/
categories: [1.5막, TIL (Today I Learned), 코드스쿼드, React.js]
comments: true
---
### 뉴스스탠드개발 step1
- 비동기로 데이터를 가져오고, 가져온 데이터로 언론사 정보를 뿌리고, 선택된 언론사 정보를 뿌려주는 데까지 구현
:
key = A[low]
while low < high:
while A[high] >= key and low < high:
high -= 1
A[low], A[high] = A[high], A[low]
whil... |
Python | UTF-8 | 428 | 4.53125 | 5 | [] | no_license | #append,insert, pop, del,
letters = ["a", "b", "c","d","e","f"]
letters.append("G")
print(letters[1])
print(letters)
# del letters[2] #dleete the value at the given index
# print(letters)
# letters.pop(2) # remove the elemet given index and retrun the removed value
print(letters)
print(letters[::2]) # ['a'... |
C++ | UTF-8 | 6,841 | 2.828125 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <Config/ServerList.hpp>
using namespace Config;
struct ServerListTests : public ::testing::Test
{
class ServerListMock : public ServerList
{
public:
ServerListMock() : ServerList() {}
Server &add(Server toAdd)
{
return ServerList::add(toAdd);
}
Server const &match(Lis... |
C++ | UTF-8 | 388 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
const double PI = acos(-1);
int main()
{
int a, b, c, d, e;
long long p, q;
double ang, t;
while (scanf("%d%d%d%d%d", &a, &b, &c, &d, &e) == 5)
{
if (a == 0 && b == 0 && c == 0 && d == 0 && e == 0)
{
break;
}
p = a*d;
q = b*e;
ang = atan2(q, p);
t = sqrt(p*p+... |
Markdown | UTF-8 | 401 | 2.609375 | 3 | [
"MIT"
] | permissive | ## Best practices for Vagrant
* If you want to apply a slightly different configuration to many multi-machine machines, you can use a loop to do this.
* Overwrite host locale in ssh session Usually, host locale environment variables are passed to guest. It may cause
failures if the guest software do not support host... |
C# | UTF-8 | 1,771 | 2.5625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace LYH.Infrastructure.Data.Commons.Exceptions
{
/// <summary>
/// 数据访问层异常类,用于封装业务逻辑层引发的异常,以供 UI 层抓取
/// </summary>
[Serializable]
publi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.