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 | 1,810 | 2.828125 | 3 | [] | no_license | import React,{useState,useEffect} from 'react'
import './weather.css'
import Weathercard from './Weathercard'
const Weather = () => {
const [searchValue, setSearchValue] = useState("kathmandu")
const [weatherInfo,setWeatherInfo] = useState("{}")
const getWeatherInfo = async() => {
try{
let url =... |
JavaScript | UTF-8 | 1,304 | 2.59375 | 3 | [] | no_license | import React, { Component ,Fragment} from "react";
import Breadcrumb from "react-bootstrap/Breadcrumb";
import Spinner from "react-bootstrap/Spinner";
class Perfil extends Component {
constructor(props) {
super(props);
/* Estado */
this.state = {
usuario: {},
isLoading:true
};
}
com... |
C | UTF-8 | 458 | 3.03125 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int arr[10],i,j,n,temp,num;
printf("enter the value of n");
scanf("%d",&n);
printf("enter the value one by one");
for(i=0;i<n;i++);
{
scanf("%d",&arr[i]);
}
printf("enter the input arr[i]");
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<num;i++)
{
for(j=0;i<(num-i-1);j++)
{
if (arr[... |
Markdown | UTF-8 | 2,039 | 2.578125 | 3 | [
"MIT"
] | permissive | # Cours Exploration du Web
## IMT Atlantique [ELU 525](https://portail.telecom-bretagne.eu/portal/pls/portal/pkg_df.programmes.SHOW_FICHE?p_id_mod_er=32168)
* Première session : Avril - Juin 2018
* Seconde session : octobre - décembre 2018
## Avertissement
Ce site est un site web qui sera progressivement construit pen... |
C | UTF-8 | 249 | 3.515625 | 4 | [] | no_license | #include <stdio.h>
int main() {
printf("Size of short int is %lu\n", sizeof(short int));
printf("Size of int is %lu\n", sizeof(int));
printf("Size of long int is %lu\n", sizeof(long int));
int num = 0;
printf("%d\n", num);
return 0;
}
|
PHP | UTF-8 | 810 | 2.546875 | 3 | [] | no_license | <?php
namespace Tests\Unit\Models;
use App\Models\Plateau;
use App\Models\Rover;
use App\Repositories\RoverRepository;
use Exception;
use Tests\TestCase;
class RoverRepositoryTest extends TestCase
{
/**
* @test
* @throws Exception
*/
public function test_turn_left()
{
$x = random_i... |
Java | UTF-8 | 765 | 3.375 | 3 | [] | no_license | package com.week3;
import java.util.Scanner;
class point
{
double x,y ;
public point(double a,double b)
{
this.x = a ;
this.y = b ;
}
public point() {
}
void distance(point p1,point p2)
{
double dis = Math.sqrt((p2.x-p1.x)*(p2.x-p1.x) + (p2.y-p1.y)*(p2.y-p1.y))... |
Markdown | UTF-8 | 2,650 | 2.84375 | 3 | [
"Apache-2.0"
] | permissive | ---
layout: post
title: "Catching Up With New Broadband Methods"
author: "Dave Jacoby"
date: "2021-08-31 23:28:31 -0400"
categories: ""
---
I've written on this before, but can't think of where I wrote it or how to find it. But my thoughts, until now, were that before the year 2000, there were three wires that came to... |
Java | UTF-8 | 1,122 | 3.140625 | 3 | [] | no_license | package com.ailo.zombies.effect;
import com.ailo.zombies.entity.InfectableThing;
import com.ailo.zombies.entity.Thing;
import java.util.Objects;
import static java.lang.String.format;
public class InfectionStatusEffect implements StatusEffect {
private final String movementInstruction;
public InfectionSta... |
PHP | UTF-8 | 1,236 | 2.59375 | 3 | [] | no_license | <?php
class YourActiveRecordClass extends TRecord
{
const TABLENAME = 'tablename';
const PRIMARYKEY= 'id';
const IDPOLICY = 'max'; // {max, serial}
public function __construct($id = NULL)
{
parent::__construct($id);
parent::addAttribute('name');
}
public function o... |
Markdown | UTF-8 | 1,485 | 2.65625 | 3 | [] | no_license | # New York Taxi Pipeline
## Pipeline Usage
### requirements:
```
Docker + Docker-compose
```
### Installation
- Clone repository `git clone https://github.com/robomillo/new_york_taxis.git`
- Navigate to root of directory
- run `docker-compose up`. (if airflow webserver gets stuck in a cycle of restarting, run `doc... |
Python | UTF-8 | 2,267 | 3.203125 | 3 | [] | no_license | import random
# import matplotlib.pyplot as plt
class node:
interset = 100
def __init__(self, status, value):
self.infected = status
self.value = value
k =0.96
currentTimes = 0
nodes = []
isolated = 0
amount = int(input("输入节点总数:"))
infected = int(input("输入感染的节点数:"))
tempY=[]
tempX=[]
valueX=[... |
C++ | UTF-8 | 2,218 | 2.890625 | 3 | [] | no_license | #ifndef TREEVIEWER_H
#define TREEVIEWER_H
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "../tree/Tree.h"
#include <iostream>
#include <math.h>
using namespace std;
class TreeViewer;
TreeViewer *globalViewer;
void error_callback(int i, const char *message) {
cout << "Error: " << message << endl;
}
void wi... |
Python | UTF-8 | 1,855 | 2.78125 | 3 | [] | no_license | from BasicDatabase.db_operations import DBOperation, SetOperation, UnsetOperation
from BasicDatabase.errors import NoOpenTransactionError
class Database:
def __init__(self):
self._persistent_dict: dict = {}
self.open_transactions = []
@property
def _db(self):
db = self._persistent... |
JavaScript | UTF-8 | 1,949 | 2.765625 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import axios from 'axios';
import { navigate } from '@reach/router';
const SearchComponenet = (props) => {
const [formState, setFormState] = useState ({
id: props.id,
category: props.category
});
const [responsedata, setResponseData] = ... |
Markdown | UTF-8 | 524 | 2.53125 | 3 | [
"MIT"
] | permissive | # A Simple Neural Attentive Meta-Learner implementation in PyTorch
A PyTorch implementation of the SNAIL building blocks.
This module implements the three blocks in [_A Simple Neural Attentive
Meta-Learner_](https://openreview.net/forum?id=B1DmUzWAW¬eId=B1DmUzWAW) by Mishra et al.
The three building blocks are th... |
Java | UTF-8 | 1,205 | 3.4375 | 3 | [] | no_license | package com.sda.socketExample;
import java.io.*;
import java.net.Socket;
public class Client {
private Socket socket = null;
public Client(String host, int port) {
while (true) {
try {
socket = new Socket(host, port);
//take input from terminal
... |
Java | UTF-8 | 302 | 1.875 | 2 | [] | no_license | package com.scuse.mapper;
import com.scuse.entity.Register;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface RegisterMapper {
int insert(Register record);
int insertSelective(Register record);
List<Register> selectByCandId(int id);
} |
C++ | UTF-8 | 2,399 | 3.15625 | 3 | [] | no_license | /**
@file main.cpp
@author Gregório da Luz
@date February 2021
@brief main.cpp for Othello game
**/
#include <iostream>
#include "Game.h"
using namespace std;
#define WHITE 1
#define BLACK 2
int main() {
Game othello;
Player white(WHITE);
Player black(BLACK);
int user_input_x = -... |
Python | UTF-8 | 2,832 | 2.65625 | 3 | [] | no_license | import boto3
import os
from botocore.exceptions import ClientError
# Code adjusted from https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-using-sdk-python.html
class SendEmail:
# Send notification to recipient
def send(RECIPIENT):
# Replace sender@example.com with your "From" address.
... |
Python | UTF-8 | 1,142 | 4.03125 | 4 | [
"MIT"
] | permissive | #!/usr/bin/env python3
def solution(array):
"""
When splitting the array in two parts a and b,
with array = a + b,
returns the minimal difference that can be achieved between
the sum of elements in a and
the sum of elements in b.
Solution using Dynamic Programming.
"""
# left_side[i] i... |
Markdown | UTF-8 | 308 | 2.578125 | 3 | [] | no_license | ## 组别管理
组别管理通过将节点分组的形式来管理,通过这种方式,将同一用途的节点划分到相同的组。

* “组别名称”:用户自定义的名称
* “组类型”:节点属于的组类型,类型包括节点组,规则组
|
PHP | UTF-8 | 4,829 | 2.609375 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: 0300962
* Date: 06-Apr-18
* Time: 3:43 PM
*/
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
?>
<html lang="en">
<head>
<link rel="stylesheet" href = "CSS/message.css" type="text/css">
<script>
function changemsg(even... |
Go | UTF-8 | 1,230 | 2.9375 | 3 | [
"BSD-2-Clause"
] | permissive | package gorest
import (
"encoding/json"
"github.com/dimonrus/porterr"
"net/http"
)
// New Json Response without error
func NewOkJsonResponse(message interface{}, data interface{}, meta interface{}) *JsonResponse {
return &JsonResponse{HttpCode: http.StatusOK, Message: message, Data: data, Meta: meta}
}
// New Js... |
Java | UTF-8 | 2,099 | 2.828125 | 3 | [] | no_license | package com.kingschan.blog.common.aop;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Aspect;
//import org.springframework.stereotype.Component;
/**
*
* <pre>
* 类名称:ErrorLogAdvice
* 类描述:
* 创建人:陈国祥 (kingschan)
* 创建时间:2015-4-8 下午7:47:01 ... |
C# | UTF-8 | 492 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace MarsRoverLibrary
{
public class SurfaceFactory
{
public static ISurface CreateSurface(string Coordinates)
{
Validation.ValidateCoordinates(Coordinates);
string[] coordinates = Coordinates.Split... |
Java | UTF-8 | 148 | 1.664063 | 2 | [
"Apache-2.0"
] | permissive | package com.elepy.describers.props;
import com.elepy.describers.Property;
public interface PropertyConfig {
void config(Property property);
}
|
C# | UTF-8 | 1,237 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AskTheCode.Common;
namespace AskTheCode.ControlFlowGraphs.Cli
{
internal struct BuildNodeId : IOrdinalId<BuildNodeId>
{
private readonly int value;
#if DEBUG
private reado... |
Java | UTF-8 | 1,095 | 2.1875 | 2 | [] | no_license | package pl.testeroprogramowania.pages;
import net.serenitybdd.core.Serenity;
import net.serenitybdd.core.annotations.findby.FindBy;
import net.serenitybdd.core.pages.WebElementFacade;
import net.thucydides.core.pages.PageObject;
public class MyAccountPage extends PageObject {
@FindBy(id = "reg_email")
priva... |
Java | UTF-8 | 9,351 | 2.375 | 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 InterfazGrafica;
import java.awt.Toolkit;
/**
*
* @author Luis Vasquez
*/
public class crearEstudiante extends javax.swin... |
JavaScript | UTF-8 | 821 | 2.703125 | 3 | [] | no_license | import React from 'react';
class Form2Information extends React.Component {
render() {
let nameValueArray = [];
for (let i = 0; i < this.props.numCategories; i++) {
nameValueArray.push(<NameValueField key={i}/>);
}
return (
<div className="information__form2">
<h2>En... |
Markdown | UTF-8 | 1,696 | 2.75 | 3 | [
"MIT"
] | permissive | # Ansible Role: artifactory_exporter
## Description
Deploy prometheus [artifactory_exporter](https://github.com/peimanja/artifactory_exporter) using ansible.
## Requirements
- Ansible >= 2.9 (It might work on previous versions, but we cannot guarantee it)
## Role Variables
All variables which can be overridden ar... |
Java | UTF-8 | 4,441 | 2.0625 | 2 | [] | no_license | package com.drore.controller;
import com.alibaba.fastjson.JSONObject;
import com.drore.cloud.sdk.common.resp.RestMessage;
import com.drore.cloud.sdk.domain.Pagination;
import com.drore.cloud.sdk.util.LogbackLogger;
import com.drore.model.LeaseInfo;
import com.drore.service.LeaseService;
import com.drore.util.JSONObjRe... |
Python | UTF-8 | 2,197 | 3.15625 | 3 | [] | no_license | import pandas as pd
BASE_DIR = './data'
# County_cd,State_nm,County_nm,2006,2007,2008,2009,2010,2011,2012
def fetch_data():
# Load the data to be processed
file_name="{}/pills_sold_by_county_and_years.csv".format(BASE_DIR)
data_set = pd.read_csv(file_name, sep=',',converters={'County_cd': lambda x: str(x)... |
PHP | UTF-8 | 478 | 2.578125 | 3 | [] | no_license | <?php
/**
* Articles Models
*/
class ArticleCategories extends Eloquent
{
/**
* @var array
*/
protected $fillable = array('id', 'parent_id', 'title', 'main_image', 'description', 'keywords', 'permalink');
/**
* The database table used by the model.
*
* @var string
*/
p... |
JavaScript | UTF-8 | 2,967 | 2.765625 | 3 | [] | no_license | //Dependencies
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var exphbs = require('express-handlebars');
const mongoose = require('mongoose');
var request = require('request');
var morgan = require('morgan');
var axios = require('axios');
var cheerio = require('cheerio... |
Swift | UTF-8 | 2,435 | 2.84375 | 3 | [] | no_license | //
// AddOrderViewController.swift
// CoffeeOrderApp
//
// Created by Veldanov, Anton on 9/17/20.
//
import UIKit
class AddOrderViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
private var viewModel = AddCoffeeOrderViewModel()
private var coffeeSizesSegmentedControl: UISegment... |
JavaScript | UTF-8 | 6,087 | 3.03125 | 3 | [] | no_license | var scores =[0,0];
var roundscore = 0;
var activePlayer = 0;
var dice;
var gameplaying=true;
var store =0;
//document.querySelector('#current-'+ activePlayer).textContent = dice;
document.querySelector('.dice').style.display = 'none';
document.getElementById('score-0').textContent = '0';
document.getElementById('... |
PHP | UTF-8 | 967 | 3.40625 | 3 | [] | no_license | <?php
//Gestion de la connexion à la base
Class ConnectionFactory
{
public static $cnx;
//---------------------------------------------------------
/* méthode reçoit un tableau contenant les
paramètres de connexion, établit cette connexion en
créant un objet PDO, stocke cet objet dans une variable
s... |
SQL | UTF-8 | 2,093 | 3.78125 | 4 | [
"Apache-2.0"
] | permissive | create database lowcode;
use lowcode;
-- ------------------------------------------------
-- 基本权限配置表
-- ------------------------------------------------
create table user
(
id int unsigned auto_increment comment '自增主键' primary key,
user_id varchar(32) not null comment '用户标识',
user_name varchar(32) not null... |
Ruby | UTF-8 | 128 | 3.296875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive |
def square_array(array)
index = 0
a = []
while array[index] do puts a.push array[index] ** 2
index += 1 end
a
end
|
Python | UTF-8 | 551 | 4.25 | 4 | [] | no_license | #La funcion input se utiliza cuando queremos interactuar con el usuario
#se declara dos variables donde se le pide al usuario su nombre y su apellido
nombre=input("Nombre:")
apellidos=input("Apellidos:")
#se concatena los dos valores str que otorga el usuario
#declaramos otra variable donde se guardara el nombre... |
Java | UTF-8 | 6,984 | 2.265625 | 2 | [] | no_license | package com.sos.jitl.checkrunhistory;
import java.math.BigInteger;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import java.util.Gregor... |
JavaScript | UTF-8 | 1,313 | 2.5625 | 3 | [
"MIT"
] | permissive | const redis = require('./redis');
const R = require('ramda');
const KEY_PREFIX = 'games-';
const GAME_LIFETIME_MINS = 15;
function getGameKey(key) {
return KEY_PREFIX + key;
}
module.exports = function(app) {
app.get('/games', function (req, res) {
redis.keys(KEY_PREFIX + '*')
.then(keys => Promise.all... |
Java | UTF-8 | 527 | 1.8125 | 2 | [] | no_license | package com.ssh.dao;
import java.util.List;
import com.ssh.model.Nav;
public interface NavDAO {
void save(Nav transientInstance);
void delete(Nav persistentInstance);
Nav findById(java.lang.Integer id);
List<Nav> findByExample(Nav instance);
List findByProperty(String propertyName, Object value);
List<Na... |
Python | UTF-8 | 2,917 | 3.46875 | 3 | [
"Apache-2.0"
] | permissive | import numpy
import random
from enum import Enum
class Grid:
def __init__(self, tuples=None):
if tuples:
self.grid = numpy.array(tuples)
else:
self.grid = numpy.zeros((4, 4))
def get_array(self):
return self.grid
def fill_random(self):
empty_cells = []
for p, value in numpy.... |
PHP | UTF-8 | 2,170 | 2.796875 | 3 | [] | no_license | <?php
// Name: Deep Patel
// Date: 03/22/2015
// Class: CMSC331
// Project1: Allows COEIT students to make an individual or group appointment,
// or cancel any or all of the previous appointments
//
// loggedIn.php: User Logged In successfully!
// Now the user may manage the appointments by given tasks to pe... |
Python | UTF-8 | 8,895 | 3.046875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
"""Utility and General purpose functions."""
import inspect
import warnings
import os
import re
import shatter.constants as cts
__author__ = 'juan pablo isaza'
def read_file(absolute_path):
"""
:param absolute_path: string path.
:return: list with lines of the file.
"""
re... |
C++ | UTF-8 | 663 | 3.125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int &test (int arr[],int &position){
int data= arr[position];
//position = position +1;
return arr[position];
}
void test1 (int *p){
cout<<*p<<endl;
*p=40;
}
int main(){
int a=10;
int &b=a;
int *c=&a;
*c=20;
int **pp=&c;
int ***ppp... |
Java | GB18030 | 16,982 | 2.140625 | 2 | [] | no_license | package db_12306.gui;
import java.io.IOException;
import java.sql.SQLException;
import db_12306.db_operation_update.DatabaseOperation;
import db_12306.gui.view.AdministratorPageController;
import db_12306.gui.view.LoginviewController;
import db_12306.gui.view.NormalUserPageController;
import db_12306.gui.view.SignUpC... |
Markdown | UTF-8 | 33,889 | 3.0625 | 3 | [] | no_license |
### Questions
*
### Objectives
YWBAT
* compare and contrast the various methods for SVMs
* implement SVMs using sklearn
* use model analysis to tailor SVM
### Outline
- Introduce dataset
- Go through various svm models and their use case
- Tweak SVMs to suit the problem
### What do SVMs do?
SVMs (Support Vector Ma... |
C# | UTF-8 | 3,002 | 2.890625 | 3 | [] | no_license | using Backend;
using Objects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Logic
{
public class PeekFilter
{
public string[,] PeekArray(SRTMtile tile, Coordinates coordinates, int range)
{
... |
Markdown | UTF-8 | 7,744 | 2.78125 | 3 | [] | no_license | 七五
两人以快速的脚程,奔向太湖双蚊的秘窟、绕渔村走了两趟,除了一些老少妇隘夕)人连噶个少年也没留下,能提刀弄棍做贼的人都跑光了,显然在他前来讨口供之后,水贼们知道不妙,躲到别处避祸去了。
他俩却没发现‘不远处小山脊上的树林里,有人居高临下监视村中的动静,他俩却看不见藏在林中,不言不动向下窥伺的人。
小姑娘的行囊留在莫厘镇的客店,必须返回客店取行囊,约定在杨湾霍然的泊舟处见面,一同乘船离开东山,他不再前往西山游览了。
小姑娘兴高采烈走了,他一身轻松前往泊舟处等候。
泅州水怪三个人,到达莫厘镇不敢停留,穿越市街奔向码头,急于雇船离去。
码头停泊了不少大小船只,其中有不少是华丽的... |
Markdown | UTF-8 | 1,426 | 2.625 | 3 | [] | no_license | # Below are the places where you can learn Android Dev:
- Udacity NanoDegree Courses + Other Related:
- It is a set of 9 courses from Udacity:
- List:
- [User Interface](https://classroom.udacity.com/courses/ud834)
- [User Input](https://classroom.udacity.com/courses/ud836)
- [Multiscreen apps](https://classroo... |
C++ | UTF-8 | 1,409 | 2.765625 | 3 | [] | no_license | #ifndef REGIMOT_H_REGIMOT
#define REGIMOT_H_REGIMOT
#include<iostream>
#include "Estate.h"
using namespace std;
class RealEstates
{
private:
Estate **estates;
int capacity;
int current;
protected:
void Erase();
void Copy(const RealEstates& x);
void resize();
void printEstatesByTypeAndVip(c... |
Java | UTF-8 | 11,194 | 1.882813 | 2 | [] | no_license | package app.utic.appventas;
import android.content.ContentValues;
import android.content.DialogInterface;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import ... |
Shell | UTF-8 | 1,227 | 2.921875 | 3 | [] | no_license | #!/bin/bash
if [ $# != 2 ]
then
echo -n "\n******************** This program is used for CHD ****************************\n"
echo -n " Usage: bash $0 <bin_dir> <result_dir(abs_path)>\n"
echo -n " exmaple: bash $0 /home/bioadmin/YingyingXia/bin/CHD ./xxx/xxx/***\n"
echo -n "******************************... |
JavaScript | UTF-8 | 1,577 | 3.46875 | 3 | [] | no_license | function start_quiz(){
var score = 0;
var q1 = document.getElementById("q1").value;
var q2 = document.getElementById("q2").value;
var q3 = document.getElementById("q3").value;
var q4 = document.getElementById("q4").value;
var q5 = document.getElementById("q5").value;
var a1 = docume... |
Markdown | UTF-8 | 3,892 | 2.546875 | 3 | [] | no_license | # Reproducible Research: Peer Assessment 1
```r
library(dplyr)
```
```
## Warning: package 'dplyr' was built under R version 3.2.2
```
```
##
## Attaching package: 'dplyr'
```
```
## The following objects are masked from 'package:stats':
##
## filter, lag
```
```
## The following objects are masked from 'pac... |
C# | UTF-8 | 1,542 | 3.109375 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Blindspot.ViewModels
{
/// <summary>
/// Contains a collection of BufferLists
/// </summary>
public class BufferListCollection : List<BufferList>
{
private int _cur... |
C++ | UTF-8 | 688 | 3.34375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int largestSubarraySum1(int *arr,int n)
{
//Prefix Sum technique
int ps[100];
ps[0]=arr[0];
for(int i=1;i<n;i++)
{
ps[i]=ps[i-1]+arr[i];
}
// Largest sum
int largest_sum=0;
for(int i=0;i<n;i++)
{
for(int j=i;j<n;j+... |
Java | UTF-8 | 1,487 | 1.960938 | 2 | [] | no_license | package com.hxgd.onemap.entity;
import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Route {
@Id
private Integer id;
/**
* 路线名称
*/
privat... |
PHP | UTF-8 | 697 | 2.578125 | 3 | [] | no_license | <?php
/**
* Table Definition for html
*/
require_once 'DB/DataObject.php';
class DataObjects_Html extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'html'; // table name
public $html_id; ... |
Python | UTF-8 | 2,828 | 3.328125 | 3 | [] | no_license | import numpy as np
import re
import itertools
import nltk
from string import digits
from collections import Counter
def clean_str(string):
"""
Regex used to seperate compound words
Original from : https://github.com/yoonkim/CNN_sentence/blob/master/process_data.py
Input: string
Outp... |
Markdown | UTF-8 | 5,968 | 2.875 | 3 | [] | no_license | # Slowfast Model tutorial
## Basics
Requirement:
- Python >3.7
- Pytorch: >=1.9
- Pytorchvideo
- Torchvision >= 0.10.0
### Bringing slowfast model
There is two ways we can bring a slowfast model with random weights initialised.
- **torch.load**: Will give us the model directly.
```
model_name = "slowfast_r50" # ... |
Rust | UTF-8 | 3,837 | 3.0625 | 3 | [
"MIT"
] | permissive |
extern crate crypto;
use v3::types::*;
use v3::errors::{Result, Error, ErrorKind};
use self::crypto::aes;
use self::crypto::blockmodes;
use self::crypto::buffer::{WriteBuffer, ReadBuffer, RefReadBuffer, RefWriteBuffer, BufferResult};
/// A "Decryptor", which is nothing more than a data structure to keep around the R... |
Java | UTF-8 | 795 | 2.078125 | 2 | [] | no_license | package dev.chel_shev.tg_bot_quickstart.entity;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.*;
import java.util.List;
@Entity
@Data
@Table(name = "user")
@NoArgsConstructor
public class UserEntity {
@Id
@GeneratedValue
private Long id;
private String firstName;
... |
Java | UTF-8 | 472 | 2.265625 | 2 | [] | no_license | package mobomobo.dto;
public class BookBestCommentLike {
private int commentno;
private int userno;
@Override
public String toString() {
return "BookBestCommentLike [commentno=" + commentno + ", userno=" + userno + "]";
}
public int getCommentno() {
return commentno;
}
public void setCommentno(int commentn... |
Markdown | UTF-8 | 858 | 2.578125 | 3 | [] | no_license | # REPL
REPL enviroment to play with Elixir & Erlang, Mix project.
```
# Erlang
erl
# Elixir
iex
# With Mix project loaded
iex -S mix
# With Phoenix server started
iex -S mix phx.server
```
# Debugging
## IO.inspect
Simply prints out given data
```
IO.inspect(some_data, label: "A label")
```
## IEx.pry
or halt a ... |
JavaScript | UTF-8 | 1,652 | 3 | 3 | [] | no_license | /**
* This reducer adds or updates state keys for action types with
* async suffixes and does nothing for other action types.
* Then, make-action-creator selectors may access specific actions
* statuses and error messages easily.
*/
export const reducer = (state = {}, action) => {
if (isAsync(action.type)) {
... |
C++ | UTF-8 | 479 | 3.234375 | 3 | [] | no_license | /*OVERLOADING OF FUNCTION*/
#include<iostream>
#include<conio.h>
using namespace std;
add(int a)
{
cout<<"a+a="<<a+a<<endl;
}
add(int a,int b)//number of parameters
{
cout<<"a+b="<<a+b<<endl;
}
add(int a,float c)//type of parameters
{
cout<<"a+c="<<a+c<<endl;
}
add(float c,int a)//sequence of parameters
{
cout<<"a+... |
JavaScript | UTF-8 | 3,913 | 2.65625 | 3 | [] | no_license | /**
* Level state.
*/
function Level() {
Phaser.State.call(this);
}
/** @type Phaser.State */
var proto = Object.create(Phaser.State);
Level.prototype = proto;
Level.prototype.create = function() {
this.game.score = 0;
this.gameover = false;
this.physics.startSystem(Phaser.Physics.ARCADE);
this.player = this... |
C++ | UTF-8 | 644 | 3.21875 | 3 | [] | no_license | // Author: Chris Darnell
// Date: 6/2/2016
// Description: Project 10.a - Board.hpp
#ifndef Board_hpp
#define Board_hpp
#include <iostream>
#include <cstdlib>
using namespace std;
// Write a class called Board that represents a tic-tac-toe board. It should have a 3x3 array as a data member, which will store the loc... |
C++ | UTF-8 | 3,151 | 2.71875 | 3 | [] | no_license | /*
Copyright (c) 2015, Elias Aebi
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following dis... |
PHP | UTF-8 | 2,797 | 2.625 | 3 | [] | no_license | <?php
namespace Entities;
use Doctrine\ORM\Mapping as ORM;
use Ilmatar\BaseEntity;
use Ilmatar\Exception\TranslatedException;
/**
* Permission
*/
class Permission extends BaseEntity
{
//Test PHPUnit ImportHelper, name don't exist.
public static $allowedFieldsToImport = ['type.code'];
const ACCESS_... |
Python | UTF-8 | 2,631 | 3.671875 | 4 | [] | no_license | from random import random
from scipy.stats.distributions import chi2
import math
N = 50
P = 0.7
CANT = 10
def generator_v_a_bin(n, p):
'''
Esta funcion simplemente me genera un valor
de la variable aleatoria binomial(n,p)
'''
U = random()
c = p / float(1-p)
i = 0
pr = (1-p)**n
F = pr
while (U > F):
pr = (... |
Python | UTF-8 | 9,004 | 2.78125 | 3 | [] | no_license | import sqlite3
from sqlite3 import Error
from datetime import datetime
from time import sleep
acc_index = 100
database = r"bank_management.db"
# creates Object_1 database if it doesn't exist, or creates Object_1 connection if the database exists
def create_connection(db_file):
conn = None
try:
... |
Python | UTF-8 | 1,232 | 2.921875 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from io import BytesIO
import tarfile
from urllib.request import urlopen
url = 'http://www.dcc.fc.up.pt/~ltorgo/Regression/cal_housing.tgz'
b = BytesIO(urlopen(url).read())
fpath = 'CaliforniaHousing/cal_housing.data'
with tarfile.open(mode='r', fileobj=b) as arch... |
Markdown | UTF-8 | 831 | 2.875 | 3 | [] | no_license | # daily_account_book
基于nebulas的日常记账本小程序
网址:http://www.luoam.com/daily_account_book/index.html
记账本这个小东西,我们平时生活中也用得到,而且记账是一个好习惯。
基于星云链开发这个日常记账本,具有一些优点:
1. 账单信息保存在星云链,账单信息不可更改,一点记了一笔,就永久存在了。
2. 账单数据永久在线,无论何时何地,可以随时从星云链上把所有自己记过的账单下载下来。
3. 无限制的记账,不用担心账本用完了,也就是永远不需要换账本。
。。。
目前,主要提供了NAS,美元以及人民币作为记账单位。
可以批量查看所有的账单
![... |
Python | UTF-8 | 4,036 | 2.53125 | 3 | [] | no_license | # 1012.py
import cv2
import numpy as np
#1
roi = None
drag_start = None
mouse_status = 0
tracking_start = False
def onMouse(event, x,y, flags, param = None):
global roi
global drag_start
global mouse_status
global tracking_start
if event == cv2.EVENT_LBUTTONDOWN:
drag_start = (x,y)
... |
Go | UTF-8 | 3,462 | 2.671875 | 3 | [] | no_license | package io
/*
#cgo CFLAGS: -std=c99
#cgo LDFLAGS: -lcomedi -lm
#include "io.h"
#include "channels.h"
#include "elev.h"
*/
import "C"
import "Heisprosjekt/src"
import "fmt"
import "time"
import "os"
/* Name-conventions:
FC = From Controller
TC = To Controller
*/
type Command struct{
CommandType int
SetValue int
Flo... |
SQL | UTF-8 | 1,189 | 4.1875 | 4 | [
"MIT"
] | permissive | -- perform a SELECT query on Orders table available in the database SNOWFLAKE_DEMO_DB, schema TPCH_SF1000.
select *
from "SNOWFLAKE_SAMPLE_DATA"."TPCH_SF1000"."ORDERS"
sample row (1000 rows);
--execute a count on the O_CUSTKEY column while applying grouping on O_ORDERPRIORITY.
select
O_ORDERPRIORITY
,count(O_CUSTK... |
Markdown | UTF-8 | 25,601 | 3.375 | 3 | [
"MIT"
] | permissive | ---
path: '/Algorithm-Design-Manual--Chapter-Six'
cover: '../Programming-Foundations-Coding-Efficiency/speed.jpg'
slug: 'Algorithm-Design-Manual--Chapter-Six'
date: '2019-01-18'
title: 'Algorithm Design Manual:'
chapter: 'Chapter Six'
subtitle: 'Weighted Graph Algorithms'
tags: ['algorithms', 'graphs', 'Algorithm Desig... |
Java | UTF-8 | 158 | 1.65625 | 2 | [] | no_license | package com.qingbo.sell.enums;
/**
* @Auther: gaoqingbo
* @Date: 2018/11/7 17:42
* @Description:
*/
public interface CodeEnum {
Integer getCode();
}
|
TypeScript | UTF-8 | 407 | 3.0625 | 3 | [] | no_license | import * as fs from 'fs'
//in
// 5
// 4 2 5 1 3
//out
// 3
const input: string[] = fs.readFileSync('/dev/stdin', 'utf8').split('\n');
const n: number = parseInt(input[0]);
const p: number[] = input[1].split(' ').map(Number);
let result: number = 0;
let min :number = Infinity;
for (let i: number = 0; i < n; i++) {
... |
PHP | UTF-8 | 1,748 | 2.953125 | 3 | [] | no_license | <?php
/**
*/
class core {
/**
* Core constructor
*/
function __construct() {
//_set_error_handler( array(&$this, 'throwError'));
}
/**
* Create a new DB connection, or continues an existing
* one if present
*/
function &db(){
$dbConnect = new dbconnector;
return $dbConnect;
}
/* Severity is 1 or ... |
Java | UTF-8 | 934 | 1.929688 | 2 | [] | no_license | /**
*
* Project Name: Geniisys Web
* Version:
* Author: Computer Professionals, Inc.
*
*/
package com.geniisys.giac.dao;
import java.sql.SQLException;
import java.util.Map;
/**
* The Interface GIACModulesDAO.
*/
public interface GIACModulesDAO {
/**
* Validates user module function.
* @param use... |
JavaScript | UTF-8 | 727 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react';
import Car from './Car.js'
function searchingFor(term){
return function(x){
return x.name.toLowerCase().includes(term.toLowerCase()) || !term;
}
}
class Cars extends Component {
handleDelete(id){
this.props.handleDelete(id);
}
onUpdate(car){
this.props.... |
Shell | WINDOWS-1252 | 23,246 | 3.234375 | 3 | [] | no_license | #!/bin/bash
# $Id: snapshot.sh 10857 2007-05-19 03:01:32Z bberndt $
#
# Copyright 2008, Sun Microsystems, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# # Redistributions of source code must retain the ab... |
Java | UTF-8 | 3,043 | 2.953125 | 3 | [] | no_license | package client;
import data.Offer;
import data.Request;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.*;
public class UdpClientSocket {
private DatagramSocket clientSocket;
byte[] receiveData;
byte[] sendDat... |
C++ | UTF-8 | 1,443 | 3.765625 | 4 | [] | no_license | /*
Next larger
Send Feedback
Given a generic tree and an integer n. Find and return the node with next larger element in the Tree i.e. find a node with value just greater than n.
Return NULL if no node is present with the value greater than n.
Input Format :
Line 1 : Integer n
Line 2 : Elements in level order form sep... |
JavaScript | UTF-8 | 3,211 | 2.59375 | 3 | [] | no_license | const BASE_URL = 'https://kapi-lineas-ruddy.now.sh/api';
//const BASE_URL = 'http://localhost:3001';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
const randomNumber = (min = 0, max = 1) =>
Math.floor(Math.random() * (max - min + 1)) + min;
const simulateNetworkLatency = (min = 30, max = 1500)... |
Java | UTF-8 | 453 | 2.078125 | 2 | [] | no_license | package com.cyb.jetty.demo.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@Value("${value}")
private String value;
@GetMa... |
Python | UTF-8 | 1,355 | 2.96875 | 3 | [] | no_license | import os
import shelve
def search(d, query):
Found_List=[]
dict1_words=shelve.open(d)
if ("or" in query) and ("and" not in query): #"OR" search
query.remove("or")
print("Performing OR search for: ", query)
for phrase in query:
if (phrase in dict1_words):
... |
PHP | UTF-8 | 387 | 2.59375 | 3 | [] | no_license | <?php
namespace Vellum\Actions;
class BaseAction
{
public function getAttributes($data)
{
if(count($this->attributes($data)) === 0) {
return null;
}
return arrayToHtmlAttributes($this->attributes($data));
}
public function getStyles($style = 'normal')
... |
JavaScript | UTF-8 | 1,671 | 2.53125 | 3 | [] | no_license | const express = require("express");
const path = require('path');
const port = 9000;
const db = require('./config/mongoose')
const Contacts = require('./models/contacts');
const app = express();
app.use(express.urlencoded());
app.use(express.static('assets'));
app.set('view engine', 'ejs');
app.set('views', path.jo... |
C# | UTF-8 | 12,611 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;... |
Java | UTF-8 | 1,648 | 1.890625 | 2 | [] | no_license | package com.msk.ssc.logic;
import com.hoperun.jdbc.mybatis.BaseDao;
import com.msk.common.base.BaseLogic;
import com.msk.common.logic.CommonLogic;
import com.msk.ssc.bean.SSC1130801RsBean;
import com.msk.ssc.bean.SSC1130801RsParam;
import com.msk.ssc.bean.SSC11308RsBean;
import com.msk.ssc.bean.SSC11308RsParam;
import... |
C | UTF-8 | 1,930 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <nng/nng.h>
#include <nng/protocol/pair0/pair.h>
#define NODE0 "node0"
#define NODE1 "node1"
void fatal(const char *func, int rv) {
fprintf(stderr, "%s: %s\n", func, nng_strerror(rv));
exit(1);
}
int send_name(nng_socket... |
JavaScript | UTF-8 | 6,743 | 2.515625 | 3 | [] | no_license | /**
*
* @author Алексей
*/
function ControlsView() {
var self = this
, model = P.loadModel(this.constructor.name)
, form = P.loadForm(this.constructor.name, model);
self.show = function (panel) {
panel ? panel.add(form.view, new P.Anchors(2, null, 2, 2, null, 2)) : form.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.