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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 2,645 | 2.6875 | 3 | [
"MIT"
] | permissive | /**
* @file http.js
* @brief The http module of the HTTP subsystem.
* @author Yiwei Chiao (ywchiao@gmail.com)
* @date 07/18/2017 created.
* @date 06/04/2018 last modified.
* @version 0.1.0
* @since 0.1.0
* @copyright MIT, © 2017-2018 Yiwei Chiao
* @details
*
* Th... |
Markdown | UTF-8 | 1,252 | 3.203125 | 3 | [] | no_license | # Rocket maze
This is my first Samsung Watch (Tizen) app.
It's a game inspired by an old game called [Crazy Gravity](https://classicreload.com/win9x-crazy-gravity.html).
Basically the goal is to fly your rocketship from the starting position to the ending position without crashing into a wall.
Crashing into a wall r... |
Markdown | UTF-8 | 4,694 | 2.765625 | 3 | [] | no_license | # Sobre dudas y creencias - Francis responde - 238
>Estimado Francis, soy consciente de que esta pregunta sigue muy de cerca a la última que hice. Debo hacer una breve introducción. Es sobre la duda, específicamente sobre la duda después de haber visto la Verdad con toda claridad. Tras muchas experiencias menores, la ... |
Java | UTF-8 | 549 | 2.453125 | 2 | [
"MIT"
] | permissive | package edu.gatech.hypower;
import java.io.IOException;
import java.io.OutputStream;
import javax.swing.JTextArea;
public class PhysicloudConsoleStream extends OutputStream {
private JTextArea PhysicloudConsole;
public PhysicloudConsoleStream(JTextArea TextAreaFromClojure) {
this.PhysicloudConsole = Te... |
C++ | UTF-8 | 458 | 2.75 | 3 | [] | no_license | /*
* @Author: your name
* @Date: 2021-05-03 16:52:24
* @LastEditTime: 2021-05-03 17:21:28
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \Programs\Hello World\myFirstApp.cpp
*/
#include <iostream>
using namespace std;
int main()
{
cout << (int)'a' << endl;
cout ... |
JavaScript | UTF-8 | 1,821 | 3.53125 | 4 | [] | no_license | var name = "Nguyen Van Vuong";
document.writeln("Learning about toUpperCase: "+name.toUpperCase()+"<br>");
var name2 = "Đại Học Bách Khoa Đà Nẵng";
document.writeln("Learning about slice: "+name.slice(3,12)+"<br>");
var name3 = "Trường Đại Học Bách Khoa Đà Nẵng - Khoa Công Nghệ Thông Tin";
document.writeln("Learning ... |
C | UTF-8 | 288 | 3.328125 | 3 | [] | no_license | #include <stdio.h>
int main(void) {
int wiek;
float majatek;
char zwierzatko[40];
printf("Podaj swoj wiek, majatek i ulubione zwierzatko.\n");
scanf_s("%d %f", &wiek, &majatek);
scanf_s("%s", zwierzatko, 40);
printf("%d, %.0f zl, %s\n.", wiek, majatek, zwierzatko);
return 0;
} |
Java | UTF-8 | 1,151 | 2.515625 | 3 | [] | no_license | package confdb.data;
/**
* EDAliasReference
* ---------------
* @author Bogdan Sataric
*
* CMSSW framework EDAlias reference.
*/
public class EDAliasReference extends Reference {
//
// construction
//
/** standard constructor */
public EDAliasReference(ReferenceContainer container, EDAliasInstance edalias)... |
Python | UTF-8 | 494 | 3.21875 | 3 | [] | no_license | class Solution:
def findTheDifference(self, s: str, t: str) -> str:
d = {}
for i in range(len(s)):
if s[i] not in d:
d[s[i]] = 0
d[s[i]] -= 1
for i in range(len(t)):
if t[i] in d:
d[t[i]] +=... |
C# | UTF-8 | 5,273 | 2.8125 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using NetTopologySuite.Geometries;
using NetTopologySuite.IO.VectorTiles.Tiles;
using NetTopologySuite.Operation.Overlay;
[assembly: InternalsVisibleTo("NetTopologySuite.IO.VectorTiles.Tests")]
namespace NetTopologySuite.IO.VectorTi... |
Java | UTF-8 | 5,111 | 2.109375 | 2 | [] | no_license | package com.rds.upc.web.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
... |
Java | UTF-8 | 4,091 | 2.4375 | 2 | [] | no_license | /**
*
*/
package com.softsec.tase.store.util.db;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.MongoClient;
import com.mongo... |
Shell | UTF-8 | 735 | 3.234375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #!/bin/bash
VERSION=`date "+%Y%m%d%H"`
APP_NAME="node_exporter"
GO_ARCH=`go env| grep GOARCH|awk -F\" '{print $2}'`
cd `dirname $0`
WORKDIR=`pwd| sed 's#.*/src#/go/src#g'`
docker run --rm -it -v ${GOPATH}:/go -w ${WORKDIR} golang:latest go build -o ${APP_NAME}-${VERSION}.linux.${GO_ARCH} -v
echo "Linux Packaging Bi... |
JavaScript | UTF-8 | 2,661 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | var config = require('dgeni/lib/utils/config').Config;
var processor = require('../../processors/inline-tags');
var di = require('di');
var log = require('winston');
describe("inline-tags processor", function() {
it("should be called 'inline-tags'", function() {
expect(processor.name).toEqual('inline-tags');
... |
C | UTF-8 | 1,514 | 3.25 | 3 | [] | no_license | //
// Created by apple on 2017/3/17.
//
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
static char* mystrtok(char *pstr, char *split)
{
char *px = pstr;
_Bool isfind = true;
while(*px != '\0')
{
char *p1 = px;
char *p2 = split;
isfind = true;
while(*p2 != '\... |
SQL | UTF-8 | 7,373 | 3.265625 | 3 | [] | no_license | /*==============================================================*/
/* DBMS name: PostgreSQL 8 */
/* Created on: 23/02/2016 16:12:01 */
/*==============================================================*/
/*===============================================... |
Java | UTF-8 | 31,514 | 1.921875 | 2 | [
"Apache-2.0"
] | permissive | package edu.harvard.iq.policymodels.parser.decisiongraph;
import edu.harvard.iq.policymodels.parser.decisiongraph.DecisionGraphRuleParser;
import edu.harvard.iq.policymodels.parser.decisiongraph.DecisionGraphTerminalParser;
import edu.harvard.iq.policymodels.parser.decisiongraph.ast.AstAnswerSubNode;
import edu.harvar... |
Python | UTF-8 | 3,706 | 2.546875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from colorthief import ColorThief
from collections import Counter
from colour import Color
from colorthief import ColorThief
import webbrowser
import unirest
import json
import csv
import urllib
import urllib2, cookielib
import os
import sys
import glob
reload(sys)
sys.setdefaultencoding('utf... |
Java | UTF-8 | 2,980 | 2.40625 | 2 | [] | no_license | package edu.utm.dao.cliente;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import edu.utm.bd.domain.Cliente... |
Markdown | UTF-8 | 417 | 2.5625 | 3 | [
"MIT"
] | permissive | # hausaSentiment
Sentiment Prediction of Hausa comments using Lexicon & Machine Learning
Twitter Dataset was first extracted and preprocessed!
R programming was first used to create sentiment scores for comments, whereby negative comments have negative scored while positive comments have positive scores.
Machin... |
PHP | UTF-8 | 379 | 2.71875 | 3 | [] | no_license | <?php
namespace App\Controllers;
abstract class Controller
{
/**
* @param array $vars
* @return mixed
*/
protected function render(array $vars = [])
{
extract($vars);
ob_start();
require(__DIR__ . "/../views/{$this->viewName()}.php");
return ob_get_clean()... |
JavaScript | UTF-8 | 2,003 | 2.640625 | 3 | [] | no_license | /* eslint-disable */
const common = {};
/*
common.loadingObjects = {};
// 参数 id: 需要loading遮罩覆盖的元素 id ,body 元素直接传入body字符串即可
// 作用:会在 id所对应的元素/body 上添加loading效果
common.setLoading = (id = 'body') => {
common.removeLoading(id);
let ele,
loadingStyles = 'ajax-async-loading';
if (id !== 'body') {
// 局部
... |
Python | UTF-8 | 3,096 | 2.5625 | 3 | [] | no_license | import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle
po = 6.7e-7
e_0 = 8.85e-12
a = 5
# Grid of x, y points on a Cartesian grid
nx, ny = 64, 64
XMAX, YMAX = 40, 40
x = np.linspace(-XMAX, XMAX, nx)
y = np.linspace(-YMAX, YMAX, ny)
X, Y = np.meshgrid(x, y)
r, phi = np.hypot... |
Java | UTF-8 | 2,060 | 2.09375 | 2 | [] | no_license | package pt.ua.easyCaching;
import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class MenuUserActivity extends Activity implements OnClick... |
C# | GB18030 | 6,647 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace WWStock.App
{
public partial class SetupForm : Form
{
Dictionary<string, string> stockSH = new Dictionary<string, string>();
Dictionary<string, string> stockSHIndex = new D... |
Markdown | UTF-8 | 5,042 | 3.078125 | 3 | [] | no_license | # Insert / Select
## 데이터 삽입 : INSERT
- INSERT INTO 테이블명 [(속성 리스트)] VALUES (속성의 값 리스트);
DB에서는 작은 따옴표를 무조건 써야 한다
```mysql
INSERT INTO 부서 (부서번호, 부서이름)
VALUES (1, '홍보부');
```
```mysql
INSERT INTO MEMBER (NUM, NAME, EMAIL, PHONE)
VALUES (1, 'A', 'aaa@gmail.com', '010-0001');
INSERT INTO MEMBER (NAME, EMAIL, NUM,... |
Java | UTF-8 | 2,318 | 1.835938 | 2 | [] | no_license | package com.arkainfoteck.dabagalli.activitys;
import android.database.Cursor;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Toast;
import com.android.volley.AuthFailureErr... |
Java | UTF-8 | 758 | 2.125 | 2 | [] | no_license | package com.devon.demo.springaoppractice;
import com.devon.demo.pojointercept.Login;
import com.devon.demo.pojointercept.LoginFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
impo... |
JavaScript | UTF-8 | 287 | 2.515625 | 3 | [] | no_license | import React from "react";
function Joke(props) {
let question = props.joke.question;
if (question == null) {
question = "Default";
}
return (
<div>
Question: {question}
<br />
PunchLine: {props.joke.punchLine}
</div>
);
}
export default Joke;
|
PHP | UTF-8 | 2,390 | 2.828125 | 3 | [] | no_license | <?php
namespace pandaac\OAuth2OtLand\Providers;
use Psr\Http\Message\ResponseInterface;
use pandaac\OAuth2OtLand\Entities\User;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
class OtLand extends A... |
Java | UTF-8 | 2,270 | 3.1875 | 3 | [] | no_license | package org.chandra.zebra.interview.bowling.game.validation;
import org.chandra.zebra.interview.bowling.game.exceptions.InvalidInputDataException;
import java.util.List;
import java.util.function.Predicate;
import java.util.logging.Logger;
import static org.chandra.zebra.interview.bowling.game.constants.Constants.*;... |
C++ | UTF-8 | 2,614 | 3.0625 | 3 | [] | no_license | #pragma once
#include <memory>
#include <atomic>
#define MMAP_ALLOCATOR 0
class MemoryCounter
{
public:
typedef std::size_t size_type;
MemoryCounter(size_type limit) : bytes_allocated(0), limit_(limit) {}
void allocate(size_type delta)
{
auto result = (bytes_allocated += delta);
... |
Java | UTF-8 | 162 | 1.945313 | 2 | [] | no_license | package com.company;
public class Pantalon extends Prenda{
public Pantalon(String marca, String modelo) {
super(marca, modelo);
}
}
|
C | ISO-8859-1 | 503 | 3.609375 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char *argv[]) {
//Faa um algoritmo para calcular o volume de uma esfera de raio R,
// em que R um valor fornecido pelo usurio.
float ... |
Java | UTF-8 | 974 | 3.9375 | 4 | [] | no_license | package com.corejava;
public class March11_Loops {
public static void main(String[] args) {
checkPrime();
}
public static void checkEvenOrOdd()
{
int num = 48;
if( num % 2 == 0)
{
System.out.println("The number is Even ");
}
else
{
System.out.println("The number ... |
C++ | UTF-8 | 803 | 3.265625 | 3 | [] | no_license | //
// 2-2part4.cpp
// HW2
//
// Created by Rukmaiah Bhupalam on 1/19/13.
// Copyright (c) 2013 Nihar Bhupalam. All rights reserved.
//
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
template <class myType>
myType findMedian(vector<myType> vec){
int size=vec.size();
if(size... |
Markdown | UTF-8 | 20,534 | 2.625 | 3 | [] | no_license | # React Course
Progress of the course React Hooks, and redux context
**Summary Of course:**
I am Gabriel Jiménez a cybersecurity student and I love programming, so I started to learn Javascript, to be able to develop projects and web applications, and I decided to create this summary to rethink the concepts, if you r... |
PHP | UTF-8 | 3,112 | 2.890625 | 3 | [] | no_license | <?php
namespace Services;
class SessionHandler{
public function __construct()
{
$this->buildSession();
}
public function __get($key){
if(property_exists($this,$key)){
$return = $this->$key;
return $return['value'];
}
else{
return null;
... |
JavaScript | UTF-8 | 921 | 3.203125 | 3 | [] | no_license |
let texTarea = document.getElementById("text");
let button = document.getElementById("button");
let ul = document.getElementById("ul");
let API = "http://localhost:3000/tweets"
// console.log(ul)
button.addEventListener('click', () => {
let obj = {
body: texTarea.value
}
fetch(API, {
me... |
Python | UTF-8 | 1,673 | 3.421875 | 3 | [] | no_license | # produkt = input("Podaj jaki produkt chcesz kupić: ")
#
# produkt = print ("produkt")
#
# waga = input("Podaj wagę produktu")
#
# waga = print("waga")
#
# Cena = 1,99
# kg = 0
# cena_za_kg = dict(cena )
produkty = {"Ziemniaki": 2, "Bataty": 4, "Pomidory": 6}
magazyn = {"Ziemniaki": 10, "Bataty": 10, "Pomidory": 10}
d... |
Java | UTF-8 | 254 | 2.484375 | 2 | [] | no_license |
public class mainProgram2 {
public static void main(String[] args) {
Car c = new Car("Audi", "A4", 25000.0f, 200, 4, 4);
Car clone = c.clone();
c.setPrice(30000.0f);
c.vehicleInfo();
clone.vehicleInfo();
}
}
|
SQL | UTF-8 | 1,925 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 17, 2018 at 04:00 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
C++ | ISO-8859-1 | 4,037 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
//PARTE 1: Verificar se o nmero primo
bool ehPrimo(int n){
int cont = 0, i;
for(i = 2; i <= n; i++){
if(n%i == 0){
cont++;
}
}
if(cont == 1)
return true;
else
return false;
}
//PARTE 2: Posio do nmero
int pos_primo(int num){
int cont_pos = 0, i;
for(i ... |
PHP | UTF-8 | 5,906 | 2.5625 | 3 | [] | no_license | <?php
class SiteController extends Controller
{
/**
* Declares class-based actions.
*/
public function actions()
{
return array(
// captcha action renders the CAPTCHA image displayed on the contact page
'captcha'=>array(
'class'=>'CCaptchaAction',
... |
Markdown | UTF-8 | 8,864 | 2.859375 | 3 | [] | no_license | ```
概論
學習方式
監督式 小學
非監督式 自已找規則
半監督式 電腦找規則
強化式 錯誤中找路徑
監督式
連續反應(回歸) 離散反應(分類) 數據
非監督式
分群(或聚類)(連續數據)
降維(向量)欄(column) 資訊(row) 非負矩陣因式分解
分類 回歸
人以類聚 物以群分
半監督式
將少量的標記數據與大量的未標記數據結合
強化式
嘗試錯誤
硬分群:其中每個數據點只屬於一個集群
軟分群:其中每個數據點可以屬於多個集群
訓練 取資料 提特徵 訓練模型 優化參數 模型
1.取資料
數據集 訓練 驗證 測試 用於評估
2.提特徵
可以遵循蠻力計算法
也可以從特定分類任務的
... |
Shell | UTF-8 | 3,674 | 4.34375 | 4 | [] | no_license | #!/bin/sh
INPUT_FILE="stats_input$$"
TMP_FILE="stats_tmp$$"
function stats () {
}
function row_separator () {
}
function column_separator () {
}
function average_calculator () {
}
function median_calculator () {
}
function average_printer () {
}
function median_printer () {
}
function rows () {
prin... |
JavaScript | UTF-8 | 861 | 3.03125 | 3 | [] | no_license | function myTask() {
var num = document.getElementById("myNumberToCath").value;
// document.getElementById("myNumberToShow").innerText = num;
if (num > 300) {
document.getElementById("myNumberToShow").innerText = 300;
alert("not more than 300");
} else if (num < 1) {
docu... |
C | UTF-8 | 7,420 | 3.671875 | 4 | [] | no_license | #include"slinklist.h"
/*
在静态单链线性表L中查找第一个值为e的元素
若找到,则返回它在L中的位序,否则返回0
*/
int LocateElem_SL(SLinkList L,ElemType e){
int i;
i = L[0].cur;
while (i && L[i].data != e)
i = L[i].cur;
return i;
}
/*
将一维数组space中各分量链成一个备用链表,sapce[0].cur为头指针
“0”表示空指针
*/
void InitSpace_SL(SLinkList space){
int i;
... |
Java | UTF-8 | 877 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | package sh.isaac.solor.direct.rxnorm;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.HashSet;
public class ChildTagSet {
HashSet<String> childTags = new HashSet<>();
private final String setName;
public ChildTagSet(String setName) {
this.setNam... |
Java | UTF-8 | 1,667 | 3.234375 | 3 | [] | no_license | package think.seventeen;
import java.util.*;
/**
* @author z
**/
public class Synchronization {
public static void main(String[] args) {
Synchronization synchronization = new Synchronization();
synchronization.failFast();
}
public void dump() {
Collection<String> collection = C... |
Java | UTF-8 | 739 | 3.765625 | 4 | [] | no_license | import java.util.Scanner;
public class Divide {
public static void main(String arg[]) {
try {
int a, b, c;
Scanner KB = new Scanner(System.in);
System.out.println("Enter the 2 numbers ");
a = KB.nextI... |
Java | UTF-8 | 1,213 | 2.09375 | 2 | [] | no_license | package org.iana.rzm.init.ant;
import org.apache.tools.ant.*;
import org.hibernate.*;
/**
* @author Jakub Laszkiewicz
*/
public abstract class HibernateTask extends Task {
private String configurationFile = null;
private String annotationConfiguration = null;
public void setConfigurationFil... |
Java | UTF-8 | 2,957 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2015 LingoChamp Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
Python | UTF-8 | 363 | 4.8125 | 5 | [] | no_license | #2-2 Simple Messages: Store a message in a variable, and print that message.
#Then change the value of your variable to a new message, and print the new message.
#This time we use the variable message twice, first with "Hello World!" and then we change it to "Python is great!"
message = "Hello world!"
print(message)
m... |
Java | UTF-8 | 5,550 | 2.28125 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2009 - 2012 hCentive Inc. All rights reserved.
******************************************************************************/
/**
* Copyright (c) 2009 - 2012 hCentive Inc. All rights reserved.
*/
/**
* Copyright (c) 2... |
Java | UTF-8 | 2,438 | 2.265625 | 2 | [] | no_license | package com.dlwx.wisdomschool.bean;
import java.util.List;
/**
* Created by Administrator on 2018/1/19/019.
*/
public class GroupList {
/**
* code : 200
* result : 获取成功
* body : [{"groupid":"1","group_name":"我的群名称","imgid":"6","imgurl":"http://192.168.0.199/school//Uploads/20161223/585c9226aae... |
PHP | UTF-8 | 1,589 | 2.734375 | 3 | [] | no_license | <?php
namespace kbwp\Integration;
use kbwp\kbwp as kbwp;
class FaceIt
{
private static $_instances = [];
private $_api_key;
private $_id;
private $_debug;
private $_api_url;
private function __construct(string $id, string $api_key, bool $debug_mode_enabled = false)
{
$this->_api_k... |
Java | UTF-8 | 750 | 2.734375 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package br.edu.ifes.composite.menu;
/**
*
* @author pchan
*/
public class ItemMenu extends Item {
public Item... |
C# | UTF-8 | 464 | 2.640625 | 3 | [] | no_license | using System;
namespace CrudRapido.Models
{
public class Pessoa
{
public int Id{get; set;}
public string Nome{get; set;}
public int Idade{get; set;}
public DateTime Data{get; set;}
public Pessoa(){}
public Pessoa(int id, string nome, int idade, DateTime data)
... |
Markdown | UTF-8 | 2,719 | 3.59375 | 4 | [] | no_license | #### Sumatoria
La suma o la reducción por la suma es definido en: Dado una lista de `MonetaryAmount` este retornará un elemento con la sumatoria de esos valores.
```java
public class ReduceSumMonetaryAmount {
public static void main(String[] args) {
CurrencyUnit dollar = Monetary.getCurrency("USD");
... |
JavaScript | UTF-8 | 417 | 2.640625 | 3 | [] | no_license | // anonymous, self-invoking function to limit scope
(function() {
const NewsfeedView = {}
/* Renders the newsfeed into the given newsfeedElement element. */
NewsfeedView.render = newsfeedElement => {
// TODO
}
/* Given post information, renders a post element into newsfeedElement. */
NewsfeedView.rend... |
PHP | UTF-8 | 7,572 | 2.875 | 3 | [] | no_license | <?php
namespace Models;
class Truck extends DBmanager
{
public $currentUser;
public function __construct($currentUser, $conn)
{
$this->currentUser = $currentUser;
parent::__construct($conn);
}
public function addOrder($carna... |
C | UTF-8 | 3,525 | 3.953125 | 4 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include "single_linked_list.h"
int addElementSingleLinkedList(struct singleLinkedList *list, int value)
{
struct singleLinkedListElement *newElement = (struct singleLinkedListElement *)malloc(sizeof(struct singleLinkedListElement));
struct singleLinkedLi... |
C# | UTF-8 | 449 | 2.53125 | 3 | [] | no_license | using UnityEngine;
public class GameScreen
{
public Bounds Bounds { get; private set; }
public GameScreen(Camera gameCamera)
{
Vector3 center = gameCamera.transform.position;
Vector2 size = new Vector2();
size.y = gameCamera.orthographicSize * 2f;
float screenAspect = ((f... |
PHP | UTF-8 | 12,999 | 3 | 3 | [
"Apache-2.0"
] | permissive | <?php
/**
* @package JAMA
*
* For an m-by-n matrix A with m >= n, the singular value decomposition is
* an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and
* an n-by-n orthogonal matrix V so that A = U*S*V'.
*
* The singular values, sigma[$k] = S[$k][$k], are ordered so that
* sigma[0] >= sigma[1] >... |
Java | UTF-8 | 1,351 | 2.40625 | 2 | [] | no_license | package com.qa.choonz.persistence.domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.validation.const... |
Python | UTF-8 | 4,618 | 3.796875 | 4 | [
"MIT"
] | permissive | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
渐渐用多了,才发现,整理的这些东西,并非是用来提供直接调用的。
主要是方便对于python各种数据类型的理解,方便用到什么的时候,
可以直接拿来作为参考
'''
# -------------- python3.6 ----------------------
'''
1-3 主要涉及Hex,Bytes,List之间的相互转换
这里的Hex指的是诸如 str("313233414234") (即相当于是2个字符表示一位十六进制数据)
则可定Hex不能有[^0-9A-Fa-f]数据
4-6 涉及到s... |
Java | UTF-8 | 3,703 | 3.890625 | 4 | [] | no_license | package cs.homework1;
/**
* Comes up with the song to add in the PlayList. Including title, artist,
* minutes, and seconds.
*
* Author Albert Cheng
* AuthorID 113332562
* Recitation R30
*
*/
public class SongRecord {
private String title;
private String artist;
private int minutes;
private int seconds;
... |
Swift | UTF-8 | 1,166 | 3.296875 | 3 | [] | no_license | //
// Expense.swift
// BudgetApp
//
// Created by joe rho on 1/18/20.
// Copyright © 2020 joe rho. All rights reserved.
//
import Foundation
class Expense: Transaction {
fileprivate var category_raw: String
init(id: Int64? = nil, description: String = "", date: String = "", amount: Int = 0, category... |
Python | UTF-8 | 1,772 | 3.578125 | 4 | [] | no_license | from sklearn.model_selection import train_test_split
from typing import Optional, Tuple, Dict
import pandas as pd
def fetch_csv_data(url: str, separator: Optional[str]) -> pd.DataFrame:
"""
This functions fetch the CSV data from a given path (or url) and returns a Pandas DataFrame.
:param url: a string co... |
Python | UTF-8 | 512 | 3.390625 | 3 | [] | no_license | from node import Node
class GridNode(Node):
"""Modification of Node to only have four cardinal neighbors and store location."""
def __init__(self, x=0, y=0):
self.x, self.y = x, y
Node.__init__(self, (x, y))
def is_neighbor(self, other):
if self == other:
return False... |
Markdown | UTF-8 | 1,951 | 2.96875 | 3 | [
"MIT"
] | permissive | ---
layout: text/textblock
---
Content authors should use the main content section of the template to write.
The template also allows anyone involved in creating content to:
- have context of the content and the user’s need
- provide a checklist for reviewers, according to expertise
- guide those not experienced in w... |
C++ | UTF-8 | 6,124 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <variant>
#include <string>
#include <vector>
#include <unordered_set>
#include <fstream>
#include <utility>
#include <algorithm>
#include <map>
using namespace std;
enum class SleepEvent { Wake, Sleep };
struct Event {
long timestamp;
variant<int, SleepEvent> info;
};
string remove_a... |
C# | UTF-8 | 4,144 | 3.453125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace BinPacker
{
public sealed class Program
{
public static void Main(string[] args)
{
if (args.Length != 3)
{
PrintHelp();
return;
... |
C# | UTF-8 | 6,094 | 2.703125 | 3 | [] | no_license | /// <summary>
/// LOSocket.
/// Created By 蓝鸥3G 2014.08.23
/// https://www.cnblogs.com/daxiaxiaohao/p/4402063.html
/// </summary>
///
///
using UnityEngine;
using System.Collections;
using System.Net;
using System.Net.Sockets;
using System.Text;
//收到消息后的委托回调
public delegate void ReceiveCallBack(string content);
pu... |
C++ | UTF-8 | 1,204 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <memory>
#include <unistd.h>
#include "../Include/Utils.h"
#include "../Include/ProgramInfo.h"
#include "../Include/Debugger.h"
TinyDBG::ProgramInfo ParseArguments(size_t argc, char **argv) noexcept {
TinyDBG::ProgramInfo program{};
program.name = argv[1];
program.arguments_n =... |
C | UTF-8 | 2,173 | 2.90625 | 3 | [] | no_license | #include <math.h>
#include <stdlib.h>
#include <string.h>
#include "newton.h"
#include "myinterp.h"
void addPoly(my_interp * a, my_interp * b){
if(a->size == b->size) {
int i = a->size;
while(i--) {
a->coeff[i] += b->coeff[i];
}
}
}
my_interp * copy(my_interp * p){
... |
Java | UTF-8 | 618 | 2.984375 | 3 | [] | no_license | //https://leetcode.com/problems/course-schedule-iii/
// 3rd May
class Solution {
public int scheduleCourse(int[][] courses) {
PriorityQueue<Integer> pq = new PriorityQueue<>((a,b)->b-a);
Arrays.sort(courses,(a,b)->a[1]-b[1]);
int time = 0;
int i=0;
int n = courses.l... |
Python | UTF-8 | 4,126 | 2.546875 | 3 | [] | no_license | import pyrebase
import firebase_admin
from firebase_admin import credentials
from firebase_admin import firestore
import os
import requests
import json
import pyrebase
import firebase_admin
import random
from flask import Flask, request, jsonify, make_response
from yelp.client import Client
from bussiness import distan... |
Java | UTF-8 | 750 | 1.796875 | 2 | [] | no_license | package com.springboot.microservice.ccyconversion.services;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* CurrencyC... |
JavaScript | UTF-8 | 1,332 | 2.609375 | 3 | [] | no_license | // During the test the env variable is set to test
process.env.NODE_ENV = "test";
const { expect } = require("chai");
const mongoose = require("mongoose");
const MongoMemoryServer = require("mongodb-memory-server");
const { guid } = require("./guid");
let mongoServer;
before(done => {
mongoServer = new MongoMemor... |
Markdown | UTF-8 | 1,839 | 2.59375 | 3 | [
"Apache-2.0"
] | permissive | # IOTA-Timestamping
## Overview
Iota-Timestamping is a Rest API that can be used to create and retrieve timestamps from a public ledger.
It uses the cryptocurrency IOTA to achieve this free of cost.
You can find the documentation [here](https://github.com/GabrielScheibler/iota-timestamping/wiki).
## Getting Started
T... |
JavaScript | UTF-8 | 1,812 | 2.78125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause",
"MIT"
] | permissive | $(document).ready(function () {
procAdStats();
});
function procAdStats() {
$('#adStat').find('.sparkline').each(function () {
var url = $(this).attr('data-url');
var e = $(this);
if (url) {
$.ajax({
url: url,
type: 'get',
da... |
Java | UTF-8 | 863 | 2.21875 | 2 | [] | no_license | package com.example.demo.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Component;
import co... |
Markdown | UTF-8 | 3,479 | 2.921875 | 3 | [] | no_license | # 一、Vim是什么?
**Vim** 是从 [vi](https://zh.wikipedia.org/wiki/Vi "Vi") 发展出来的一个 [文本编辑器](https://zh.wikipedia.org/wiki/%E6%96%87%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8 "文本编辑器")。其代码补完、编译及错误跳转等方便编程的功能特别丰富,在程序员中被广泛使用。和 [Emacs](https://zh.wikipedia.org/wiki/Emacs "Emacs") 并列成为 [类 Unix 系统](https://zh.wikipedia.org/wiki/%E7%B1%BBUnix... |
Ruby | UTF-8 | 1,102 | 3.4375 | 3 | [] | no_license | ## Memento ##
# ブラックジャックを行うプレイヤーがいるとする
#+BEGIN_SRC
class Player
attr_accessor :cards
def initialize
@cards = []
end
def take
@cards << rand(1..13)
end
def score
@cards.sum
end
end
#+END_SRC
# 5回カードを引くゲームを3回行うと全部21を越えてしまった
#+BEGIN_SRC
3.times do
player = Player.new
5.times { player.t... |
JavaScript | UTF-8 | 738 | 3.640625 | 4 | [] | no_license | // link to the problem: http://judge.telerikacademy.com/problem/27maxsuminmatrix
let dimensions = gets().split(' ').map(Number);
let arr = [];
for (let i = 0; i < dimensions[0]; i += 1) {
const currentRow = gets().split(' ').map(Number);
arr.push(currentRow);
}
let max = -Infinity;
let count = 0;
for (let r... |
JavaScript | UTF-8 | 2,429 | 3.578125 | 4 | [] | no_license | var userBalance = 0;
var lastClick = 0;
var timeArray = [0];
// Gets called whenever the money finished tweening to the bottom.
function addFromCatch(value) {
timeArray.unshift(lastClick);
var timeBetween = timeArray[0] - timeArray[1];
var delay = 2000 - timeBetween;
setTimeout(function() {
userBalance +=... |
Java | UTF-8 | 1,686 | 2.65625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | package edu.cmu.sphinx.demo;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import java.util.TreeMap;
import edu.cmu.sphinx.demo.aligner.AlignerDemo;
import edu.cmu.sphinx.demo.allphone.AllphoneDemo;
import edu.cmu.sphinx.demo.dialog.DialogDemo;
import edu.c... |
Java | UTF-8 | 946 | 3.34375 | 3 | [] | no_license | public abstract class Plus extends Seq{
public Plus() {} //blank fucking constructor
public static Seq plus(Constant c1, Constant c2) {
//create consant sequences for c1, c2
//implement plus algorithm
int n = (c1.num < c2.num) ? c1.num : c2.num;
int v = c1.value + c2.value;
return new Constant(n, v);
}
... |
TypeScript | UTF-8 | 1,138 | 3.140625 | 3 | [
"MIT"
] | permissive | /*external modules*/
import {
PipeTransform,
Injectable,
ArgumentMetadata,
BadRequestException,
} from '@nestjs/common';
import { validate } from 'class-validator';
import { plainToClass } from 'class-transformer';
@Injectable()
export class ValidationPipe implements PipeTransform<any> {
async transform(valu... |
Java | UTF-8 | 3,509 | 2.296875 | 2 | [] | no_license | package rcs.auth.controllers;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.GrantedAuthority;
import org.springframewo... |
C++ | UTF-8 | 2,820 | 3.390625 | 3 | [] | no_license | /*
*
//********************************************2521. Distinct Prime Factors of Product of Array.*****************************************
https://leetcode.com/problems/distinct-prime-factors-of-product-of-array/
*******************************************************************TEST CASES:*********************... |
Ruby | UTF-8 | 784 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | require 'test_helper' #调用test——helper里的函数
class CardTest < ActiveSupport::TestCase
def setup
@card=Card.create(:content => "我是小卡片的内容")
end
test "the truth" do
assert true
end
test "should be valid" do #测试card是否存在
assert @card
end
test "card should not be... |
Markdown | UTF-8 | 5,185 | 3.375 | 3 | [
"MIT"
] | permissive |
# Concerning Immutability
Immutable data structures can help us to create simpler applications by being able to rely on the state of data at any point in time. When coupled with top-down rendering suddenly we have the ability to reason about the affects our actions will take on our state and be confident that our sta... |
JavaScript | UTF-8 | 1,347 | 2.5625 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
/* 表示中のグローバルナビのアクティブ化 -----------------*/
var myServer; //サーバ
var myUrl = location.href;
myServer = 'www.aaa.com/'; //本番サーバ(最後のスラッシュ"/"までつけること)
myUrl = myUrl.substr( myUrl.indexOf('//') + 2, myUrl.length);
myUrl = myUrl.substr(myServer.length,myUrl.length);
myUrl = myUrl.substr(0,... |
Markdown | UTF-8 | 2,661 | 2.890625 | 3 | [] | no_license | # Entrega trabajo práctico Bioinformática Nº1
Integrantes:
- Leonardo Di Carlo
- Lucio Francioni
- Nahuel Pereyra
---
#### RETO I: ¿Podrías buscar un ejemplo de macromoléculas que almacenen información sobre la ‘identidad’ de un organismo dado?
*Los ácidos nucleicos son macromoléculas que guardan identidad de los... |
Java | UTF-8 | 938 | 2 | 2 | [
"MIT"
] | permissive | package br.com.vehicle.support.handler;
import java.util.Locale;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.stereotype.Component;
import br.com.vehicle.model.I18nMessage;
@Component
public class I18nHandler
... |
Java | UTF-8 | 411 | 2.25 | 2 | [] | no_license | package entidade;
public class RetornoVeiculo extends RetornoPadrao{
private Veiculo veiculo;
private Cliente cliente;
public Cliente getCliente() {
return cliente;
}
public void setCliente(Cliente cliente) {
this.cliente = cliente;
}
public Veiculo getVeiculo() {
return veiculo;
}
... |
Java | UTF-8 | 10,793 | 2.875 | 3 | [] | no_license | package com.michaelzanussi.astar;
/**
* Provides global access to various puzzle statistics and file
* handles. Being global, all methods can be called from anywhere.
*
* @author <a href="mailto:iosdevx@gmail.com">Michael Zanussi</a>
* @version 1.0 (29 Mar 2004)
*/
public class Global {
// Debug mo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.