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 | 670 | 3.859375 | 4 | [] | no_license | public class MyFirstClass {
private String name;
private int age = 0;
private String school = "Unknown";
MyFirstClass(String Name){ this.name = Name; }
MyFirstClass(String Name, int Age) {
this.name = Name;
this.age = Age;
}
MyFirstClass(String Name, int Age, String School){... |
Swift | UTF-8 | 639 | 2.578125 | 3 | [
"MIT"
] | permissive | //
// Interactor.swift
// YoyoFramework
//
// Created by Amadeu Cavalcante Filho on 04/11/18.
// Copyright © 2018 Amadeu Cavalcante Filho. All rights reserved.
//
import Foundation
final class DetailMovieInteractor: MovieDetailInteractorInputProtocol {
var presenter: MovieDetailInteractorOutputProtocol?
... |
C# | UTF-8 | 662 | 4.0625 | 4 | [] | no_license | void Main()
{
foreach (string word in EnumerateCaveNames())
Console.WriteLine(word);
}
IEnumerable<string> EnumerateCaveNames()
{
for (int i = 0; i < 26 * 26 * 26; ++i)
{
yield return BuildCaveName(i);
}
}
string BuildCaveName(int caveN... |
Java | UTF-8 | 4,845 | 2.484375 | 2 | [
"Apache-2.0"
] | permissive | /*
* Minecraft Forge
* Copyright (c) 2016-2019.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it... |
Python | UTF-8 | 1,738 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | import numpy as np
import torch
from torch import nn
from torch.nn import init
class SpatialGroupEnhance(nn.Module):
def __init__(self, groups):
super().__init__()
self.groups=groups
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.weight=nn.Parameter(torch.zeros(1,groups,1,1))
... |
C | UTF-8 | 1,469 | 3.109375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
int N, L, C;
while(scanf("%d %d %d", &N, &L, &C) != EOF){
char * str = (char *) malloc(N * 70 * sizeof(char));
scanf(" %[^\n]s",str);
int i = 0, j=0, contC = C, nPage = 0, nLine=0;
... |
Python | UTF-8 | 1,280 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 14:41:02 2019
@author: amalvnair
"""
################ URL Extraction ##################
import scrapy
class BookSpider(scrapy.Spider):
name = 'bookurls'
#links = []
allowed_domains = ['']
start_urls = ['']
def pars... |
C# | UTF-8 | 692 | 2.609375 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class DifficultyOptions : MonoBehaviour {
public Slider difficultySlider;
public int difficultyLevel;
// Use this for initialization
void Start () {
this.difficultyLevel = 0;
difficultySlid... |
C++ | UTF-8 | 4,282 | 3.09375 | 3 | [] | no_license | // BWNumber.cpp
// A simple number library
// by Bill Weinman <http://bw.org/>
// Copyright (c) 2014 The BearHeart Group LLC
//
#include "BWNumber.h"
#pragma mark - constructors
BWNumber::BWNumber(const int &n)
{
_lnum = n;
_dnum = double(_lnum = n);
}
BWNumber::BWNumber(const long &n)
{
_lnum = n;
... |
Python | UTF-8 | 823 | 2.5625 | 3 | [] | no_license | import FP_growth
def generateRules(freqItemStatic,freqItem, freqItemsDict, itemSet,Rule,minConf=0.9):
# freqItem : {'t', 'y', 'x'}
if len(freqItem) > 1:
for e in freqItem:
item = set([e]) | itemSet #item 为后件
conf = freqItemsDict[frozenset(freqItemStatic)]/freqItemsDict.get(frozen... |
Java | UTF-8 | 2,531 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | /*
* © [2021] Cognizant. All rights reserved.
*
* 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 requir... |
Python | UTF-8 | 527 | 3.109375 | 3 | [] | no_license | import numpy as np
from matplotlib import pyplot as plt
#Input X1 and Y1 value
X1,Y1=np.meshgrid(np.linspace(-1,1,10),np.linspace(-1,1,10))
Z1=np.exp(-((X1**2)+(Y1**2))) # Function for 2D plot
dx, dy = np.gradient(Z1)
n = -2
# Defining color
color = np.sqrt(((dx-n)/2)*2 + ((dy-n)/2)*2)
fig, ax... |
C | UTF-8 | 22,273 | 2.65625 | 3 | [] | no_license | /**
* @name buffer2
* this library allows the use of buffers in Lua
* these buffers can be resized dynamically and accessed as arrays of any type
*/
/**
* list of functions in the main library:
* new: creates a buffer
* calloc: creates a buffer filled with zeroes
* getsize: returns the size of a buffer
* sets... |
Java | UTF-8 | 2,888 | 3.625 | 4 | [] | no_license | package VBUtils;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
/**
* Read, Write, Clear and Crete files
* @author vinicius.reif
*/
public class VBFile
{
private File file;
/**
* Create new file manager
* @param path
* @throws IOE... |
Java | UTF-8 | 5,867 | 2.109375 | 2 | [] | no_license | package haitham.kinneret.appsusage;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import com.rvalerio.fgchecker.AppChecker;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class AppUsageTrackerService ... |
PHP | UTF-8 | 3,583 | 2.640625 | 3 | [] | no_license | <!DOCTYPE html>
<?php
// connexion a la basse de donnée
$bdd = new PDO('mysql:host=localhost;dbname=workshop2;charset=utf8','root','');
if(isset($_POST['inscription'])){
$nom = htmlspecialchars($_POST['nom']);
$prenom = htmlspecialchars($_POST['prenom']);
$ville = htmlspecialchars($_POST[... |
Python | UTF-8 | 1,417 | 2.90625 | 3 | [] | no_license | N = int(input())
coor = []
for i in range(N):
x,y = [int(x) for x in input().split()]
coor.append((x,y))
count = 0
for i in range(N):
for j in range(i+1, N):
for k in range(j+1, N):
if (coor[i][0] - coor[j][0]) == 0 or (coor[i][0] - coor[k][0]) == 0 or (coor[j][0] - coor[k][0]) == 0:
... |
Java | UTF-8 | 334 | 2.0625 | 2 | [] | no_license | package com.example.myinterface.Model;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class BaseCollectionResponse<T> {
@SerializedName("collection")
private T data;
public T getData() {
return data;
}
public void setData(T data) {
this.data = ... |
Java | UTF-8 | 3,978 | 2.0625 | 2 | [] | no_license | package com.minipg.fanster.armoury.adapter;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Text... |
Java | UTF-8 | 496 | 3.0625 | 3 | [] | no_license | package game;
import java.awt.Color;
import java.awt.Graphics;
public class FrutaTipoFrutaComum extends FrutasDiversas {
public FrutaTipoFrutaComum(int dX, int dY, int tileSize) {
this.dX = dX;
this.dY = dY;
WIDTH = tileSize;
HEIGHT = tileSize;
}
public void draw(Graphics g) {
... |
C++ | UTF-8 | 584 | 3.234375 | 3 | [] | no_license | /**
* @file laguerre.h
* @brief calcule la valeur des polynomes de laguerre
*/
#ifndef LAGUERRE_HPP
# define LAGUERRE_HPP
# include <armadillo>
/**
* Renvoie un cube, contenant les valeurs des polynomes de Laguerre,
* indexé en L[z][m][n]
* @param z un vecteur colonne contenant les abscisses 'z'
* @param mM... |
TypeScript | UTF-8 | 971 | 2.75 | 3 | [] | no_license | /*Aufgabe: <11>
Name: <Franziska Winkler>
Matrikel: <260944>
Datum: <06.06.2019>
Hiermit versichere ich, dass ich diesen Code selbst geschrieben habe. Er wurde nicht kopiert und auch nicht diktiert.*/
namespace Unterwasserwelt {
export class Bubble {
x: number;
y: number;
dx: number;
... |
C++ | UTF-8 | 1,190 | 2.78125 | 3 | [] | no_license | #include "engine/system/render/ShaderParameter.h"
namespace ds_render
{
ShaderParameter::ShaderParameter()
{
}
ShaderParameter::ShaderParameter(const std::string &name,
ShaderParameter::ShaderParameterType dataType,
size_t dataSize,
const void *dataIn)
{
m_name =... |
JavaScript | UTF-8 | 829 | 2.921875 | 3 | [] | no_license | var express=require('express');
var app=express();
app.get('/',function(req,res){
res.send('Welcome to my assignemnt')
});
app.get('/speak/animal:',function(req,res){
var animal={
pig:"oink",
dog:"woof",
cow:"mu",
}
var animal=req.params.animal.toLowerCase();
var sound=sound... |
Java | UTF-8 | 5,307 | 2.078125 | 2 | [] | no_license | package com.washingtonpost.arc.sub.cache;
import com.hazelcast.aws.AwsDiscoveryStrategyFactory;
import com.hazelcast.config.*;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import com.hazelcast.instance.HazelcastInstanceFactory;
import com.hazelcast.spi.properties.GroupProperty;
import o... |
Java | UTF-8 | 1,749 | 2.609375 | 3 | [] | no_license | package org.wpa.DTO;
import org.wpa.BO.Senator;
/**
*
* @author Veronika Maurerova
*/
public class SenatorDto extends ParticipationDto {
private final String ROLE = "Senátor";
CommitteDto commiteDto;
FractionDto fractionDto;
StateDto stateDto;
DistrictDto districtDto;
publ... |
C++ | UTF-8 | 2,391 | 3.453125 | 3 | [] | no_license | /*
There is a 3 lane road of length n that consists of n + 1 points labeled from 0 to n. A frog starts at point 0 in the second lane and wants to jump to point n. However, there could be obstacles along the way.
You are given an array obstacles of length n + 1 where each obstacles[i] (ranging from 0 to 3) describes an... |
C++ | UTF-8 | 1,112 | 2.65625 | 3 | [] | no_license | class Solution {
public:
void
showVec( const vector<int>& v ) {
cout << "[";
for( auto const& i : v )
cout << i << ",";
cout << "]" << endl;
}
bool
containsNearbyDuplicate(vector<int>& nums, int k) {
// showVec(nums1);
... |
Markdown | UTF-8 | 4,310 | 3.21875 | 3 | [
"MIT"
] | permissive | ##### Textarea base
```js
import React from 'react';
import { Textarea } from 'react-rainbow-components';
const containerStyles = {
maxWidth: 700,
};
<Textarea
id="example-textarea-1"
label="Textarea Label"
rows={4}
placeholder="Placeholder Text"
style={containerStyles}
className="rainbow... |
C++ | UTF-8 | 7,390 | 2.890625 | 3 | [] | no_license | #include <iostream>
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <stdexcept>
using namespace std;
using namespace cv;
class Result {
vector<string> name_vec; //每一幅图片的名字
//vector<Mat> image_vec; //Mat格式的每一幅图
vector<strin... |
C++ | UHC | 1,064 | 2.59375 | 3 | [] | no_license |
#include <stdio.h>
#include "CheckSkills/Level_1/Sol1.h"
#include "Practice/StackNQueue/FeaturesDevelop.h"
#include "Practice/StackNQueue/Top.h"
#include "Practice/StackNQueue/Printer.h"
#include "Practice/DFSnBFS/TargetNumber.h"
int main(int argc, char* argv[])
{
//Sol1 sol1;
//sol1.solution("abcde");
//sol1.sol... |
Java | UTF-8 | 4,555 | 2.078125 | 2 | [] | no_license | package intersky.task.receiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Handler;
import android.os.Message;
import intersky.appbase.BaseReceiver;
import intersky.task.TaskManager;
import intersky.task.asks.ProjectAsks;
import intersky.task.... |
PHP | UTF-8 | 4,031 | 2.703125 | 3 | [] | no_license | <?php
/**
* Module Text.
*
* Show text blocks with rich editor.
* @package ThemifyFlow
* @since 1.0.0
*/
class TF_Element_Featured_Image extends TF_Module_Element {
/**
* Constructor.
*/
public function __construct() {
parent::__construct(array(
'name' => __('Featured Image', 'themify-flow'),
'slug... |
Java | UTF-8 | 4,750 | 1.914063 | 2 | [
"MIT"
] | permissive | package com.faforever.api.data;
import com.faforever.api.AbstractIntegrationTest;
import com.faforever.api.data.domain.GroupPermission;
import com.faforever.api.security.OAuthScope;
import org.junit.jupiter.api.Test;
import org.springframework.http.HttpHeaders;
import org.springframework.test.context.jdbc.Sql;
import ... |
Ruby | UTF-8 | 659 | 3.59375 | 4 | [] | no_license | basket = {}
total = 0
loop do
puts "Введите наименование товара и стоп когда список покупок окончен"
name = gets.chomp
break if name == 'стоп'
puts "Количество товара"
quantity = gets.chomp.to_f
puts "Цена за единицу товара"
price = gets.chomp.to_f
cost = price * quantity
total += cost
basket[n... |
Java | UTF-8 | 1,515 | 2.46875 | 2 | [] | no_license | package com.yeollu.getrend.interceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
/**
* @Class ... |
Java | UTF-8 | 610 | 2.796875 | 3 | [] | no_license | package pozoriste;
public class Pozoriste {
private static int next_id = 0;
private int id;
private String naziv;
public Pozoriste(String naziv) {
this.id = next_id++;
this.naziv = naziv;
}
public int getId() {
return id;
}
public String getNaziv() {
r... |
Python | UTF-8 | 2,421 | 2.921875 | 3 | [
"Apache-2.0"
] | permissive | # import the required libraries
import numpy as np
import time
import random
import cPickle
# set numpy output to something sensible
np.set_printoptions(precision=8, edgeitems=6, linewidth=200, suppress=True)
# import our command line tools
# libraries required for visualisation:
from IPython.display import SVG, disp... |
Markdown | UTF-8 | 4,134 | 3.140625 | 3 | [
"Apache-2.0"
] | permissive | # Official Docker Images
Polynote publishes official Docker images upon every release. Most users are recommended to use the `latest` tag by
running `docker pull polynote/polynote:latest`.
## Published Tags
Every release of Polynote will publish four images:
| Description | Tag name ... |
SQL | UTF-8 | 2,679 | 3.703125 | 4 | [] | no_license | DROP TABLE IF EXISTS fa_user;
DROP TABLE IF EXISTS fa_role;
DROP TABLE IF EXISTS fa_user_role;
-- User
CREATE TABLE fa_user(
id BIGINT IDENTITY PRIMARY KEY,
username VARCHAR(50) NOT NULL,
value_sec VARCHAR(255) NOT NULL,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
created_... |
Java | UTF-8 | 743 | 2.96875 | 3 | [] | no_license | package graph.easy;
import utils.info.Enhance;
import utils.info.Question;
@Question(url = "https://leetcode.com/problems/find-the-town-judge/")
@Enhance(details = "Time complexity")
public class FindTheTownJudge {
private static int findJudge(int N, int[][] trust) {
int[] trustCount = new int[N];
... |
Java | UTF-8 | 1,172 | 2.40625 | 2 | [] | no_license | package bg.mdg.pageobjects;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedCondition;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.ope... |
Markdown | UTF-8 | 1,116 | 2.71875 | 3 | [] | no_license | # 正向代理
就是在本地请求服务器数据的时候,中间放置一个代理层。通过代理层的特性来实现跨域请求。
跨域是只在前端浏览器中的才有的。后台请求是不会的。
本地页面地址: http://localhost:8080
服务器接口地址:https://m.aihuishou.com/portal-api/product/category-brands/1
中间代理层(nodejs)http://localhost:8080
前端页面 -> 中间代理层(node) -> 服务器接口地址
#### 实现方式
1. 自己动手实现一个 nodejs 服务
2. 直接使用 vue-cli 提供的配置
#### 直接使用 vue-cli... |
Java | UTF-8 | 2,947 | 2.5 | 2 | [] | no_license | package com.ozoon.ozoon.Adapters;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.ozoon.ozoon.Model.Objects.... |
Ruby | UTF-8 | 2,123 | 2.8125 | 3 | [
"MIT"
] | permissive | module PryMoves::Recursion
class Tracker
attr_reader :loops
def initialize
@history = []
@loops = 0
@missing = 0
@currently_missing = []
@missing_lines = []
end
def track file, line_num, bt_index, binding_index
line = "#{file}:#{line_num}"
if @last_index
... |
C# | GB18030 | 5,603 | 3.078125 | 3 | [] | no_license | using System;
using System.Security.Cryptography;
using System.Text;
using System.IO;
namespace YxLiCai.Tools.SafeEncrypt
{
/// <summary>
/// DESܷ
/// </summary>
public class DES
{
private const string DES_KEY = "FDSFIojslsk;fjlk;)*(+nmjdsf$#@dsf54641#&*(()";
/// <summary>
... |
Java | UTF-8 | 5,107 | 2.46875 | 2 | [] | no_license | package com.example.taskassignment;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
... |
Java | UTF-8 | 988 | 1.796875 | 2 | [] | no_license | package com.app.maskit_app;
import android.app.Application;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.net.Uri;
import java.util.ArrayList;
import java.util.List;
public class Bootstrap extends Application {
public Uri SavedUri;
public String... |
Python | UTF-8 | 657 | 4.09375 | 4 | [] | no_license | #백준 5585 거스름돈 (신지원)
def money(pay):
pay = 1000-pay #1000엔에서 거스름돈을 계산할 것이기 때문에
money = [500,100,50,10,5,1] #반복문을 통해 간결하게 하기 위해 화폐를 담아줌
total = 0 #최종 거스름돈의 개수
for i in money:
if pay//i: #몫이 존재한다면. 나누어질 수 있다면.
total += pay//i #몫을 거스름돈의 개수에 추가.
pay %= i #나머지를 다시 반복시켜 더 작은 단... |
Python | UTF-8 | 222 | 3.703125 | 4 | [] | no_license | fruits = ['apple','bannana','pear','grapes','orange']
counter = 0
for fruit in fruits:
print "%s is an awesome fruit" % fruit
counter += 1
print "The counter is %d" % counter
if counter == 2:
break
|
Java | UTF-8 | 3,302 | 2.296875 | 2 | [] | no_license | package com.graygrass.healthylife.fragment;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
... |
SQL | UTF-8 | 401 | 2.75 | 3 | [] | no_license | DROP DATABASE IF EXISTS estacionamento;
CREATE DATABASE estacionamento;
USE estacionamento;
CREATE TABLE carro(
placa CHAR(7) NOT NULL,
cor VARCHAR(15),
descricao VARCHAR(100),
PRIMARY KEY (placa)
);
CREATE TABLE tbusuario(
idUsuario INT AUTO_INCREMENT,
nomeUsu VARCHAR(15),
senhaUsu VARCHAR(15),
PRIMARY KEY (idUsuari... |
Java | UTF-8 | 549 | 2.109375 | 2 | [] | no_license | package com.atu.erp.dao;
import com.atu.erp.domain.ItemDescription;
public interface ItemDescriptionDao{
/**
* 添加商品描述信息
* @param itemDescription
* @return
*/
public Integer insert(ItemDescription itemDescription);
/**
* 依据商品ID修改商品描述信息
* @param itemDescription
*/
public void mod... |
C++ | UTF-8 | 3,111 | 3.546875 | 4 | [] | no_license | #include"MaxHeap.h"
#include<iostream>
#include<math.h>
using namespace std;
MaxHeap::MaxHeap() {// Generate an empty heap with the default array size of 30.
arraySize = 30;
H = new int[arraySize];
heapSize = 0;
};
MaxHeap::MaxHeap(int* A, int size) {// A contains a sequence of elements
arraySize = size... |
Python | UTF-8 | 699 | 3.265625 | 3 | [
"MIT"
] | permissive | """Rx Workshop: Event Processing.
Part 2 - Grouping.
Usage:
python wksp5.py
"""
from __future__ import print_function
import rx
class Program:
@staticmethod
def main():
src = rx.Observable.from_iterable(get_input(),
rx.concurrency.Scheduler.new_thread... |
Java | UTF-8 | 1,604 | 3.015625 | 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 uva10000_10599;
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.lang.*;
public clas... |
JavaScript | UTF-8 | 4,073 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import sanityClient from "../client";
export default function Project(){
const [projectData, setProjectData] = useState(null);
useEffect(() => {
sanityClient.fetch(`*[_type == "project"]{
title,
date,
place,
... |
C++ | UTF-8 | 2,296 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <iostream>
#include <fstream>
#include <string>
enum class TruelogType {
INFO,
ERROR,
WARNING,
DEBUG
};
enum class TruelogStreamType {
CONSOLE,
FILE,
ALL
};
class Truelog {
//private:
class LogHelper;
public:
static void InitFile(const std::string& path = "log.txt");
// Write logs
s... |
C# | UTF-8 | 271 | 2.9375 | 3 | [] | no_license | public class A { }
public class B
{
public A AInstance { get; set; }
public B (A a)
{
AInstance = a;
}
public void test()
{
/* do something with `AInstance` */
}
}
|
C++ | UTF-8 | 685 | 3.390625 | 3 | [] | no_license | // it's in the Python
class OrderLog:
def __init__(self, size):
self.log = list()
self.size = size
def __repr__(self):
return str(self.log)
def record(self, order_id):
self.log.append(order_id)
if len(self.log) > self.size:
self.log = self.... |
Java | UTF-8 | 1,105 | 3.46875 | 3 | [] | no_license | package dp;
public class LongestPalindromeSubString {
public static void main(String[] args) {
String str = "geekeg";
System.out.println(longestPalindromeSubString(str));
}
private static int longestPalindromeSubString(String A) {
int n = A.length();
int start = 0;
int length = 0;
int M... |
TypeScript | UTF-8 | 969 | 2.875 | 3 | [] | no_license | /**
* The widget configuration options
*/
export interface WidgetOptions {
embedMode?: EmbedMode; // Default: modal
env?: Environment; // Default: production
brandColor?: string; // Default: #262525
brandImageUrl?: string; // Default: REDSHIFT Image
containerId?: string; // The id of the container that the ... |
Python | UTF-8 | 2,920 | 3.828125 | 4 | [] | no_license | ########## Unterstützender Code ##########
class Node:
def __init__(self):
self.key = None
self.parent = None
self.left = None
self.right = None
########## Lösung ##########
# Node in parameter represents root of tree
def insert(root, insert):
current_node = root
last_node = None... |
Java | UTF-8 | 2,603 | 2.53125 | 3 | [] | no_license | package app.ui.expenseType.list;
import app.data.model.StatusResponse;
import app.data.network.Api;
import app.ui.base.BasePresenter;
import app.util.Utils;
import io.reactivex.rxjava3.schedulers.Schedulers;
import java.util.HashMap;
/**
* The presenter class responsible for the communication between the view and
*... |
C | UTF-8 | 621 | 3.796875 | 4 | [] | no_license | /*Write a fn which accepts radius of circle from main()
and calculates diameter, area and circumference. print
result achieved from main*/
#include<stdio.h>
#include<conio.h>
void calc(int,int*,float*, float*); /*fn decln*/
void main()
{
int r,d;
float ar,cc;
clrscr();
printf("Enter the radius of t... |
Python | UTF-8 | 186 | 2.9375 | 3 | [] | no_license | a = [{"width": 0},
{"width": 56},
{"width": 3},
{"width": 9}
]
def so(a):
return a["width"]
b = sorted(a, key=(lambda data: data["width"]))
print(b)
print(a)
|
Java | UTF-8 | 2,323 | 3.3125 | 3 | [] | no_license | package com.chnye.common.tuple;
//import org.apache.commons.lang3.builder.HashCodeBuilder;
public class Pair<K, V> implements Tuple, Comparable<Pair<K, V>> {
private final K first;
private final V second;
public static <T, U> Pair<T, U> of(T first, U second) {
return new Pair<T, U>(first, second);
}
... |
PHP | UTF-8 | 1,189 | 2.671875 | 3 | [] | no_license | <?php
function removeStudentFromClass($id, $classid)
{
$id = mysql_real_escape_string($id);
$classid = mysql_real_escape_string($classid);
//Remove user from class and all his/her notepads from the class
$deleteduser = mysql_query("DELETE FROM classmates WHERE userid='$id' AND classid='$classid'");
$re... |
Swift | UTF-8 | 3,688 | 3.265625 | 3 | [] | no_license | //
// FamiliEmptyView.swift
// Component
//
// Created by Owen Prasetya on 17/11/20.
//
import UIKit
/** Empty View
Create an empty view with predefined positioning.
How to use:
* Using xib
* * Drag and drop a UIView and change the class to FamiliEmptyView, put it inside a container view.
... |
Markdown | UTF-8 | 4,687 | 3.25 | 3 | [
"MIT"
] | permissive | # Quick Start
Once you run all Docker containers, visit <http://localhost:8080/#/>
Or any other URL where you install Whoops Monitor.
## Login
Now you can log in. Use the admin password you can read from the Docker Compose file, the `APP_PASSWORD` variable. You might also click on the "Are you a guest?" link, allowi... |
C++ | UTF-8 | 842 | 3.015625 | 3 | [] | no_license | #ifndef PLACE_H
#define PLACE_H
#include "enums.h"
#include "farmer.h"
class Place
{
protected:
int level_;
int upgrade_day_;
bool is_upgrading_;
public:
const uint upgrade_time;
Place(uint upgrade_time) : upgrade_time(upgrade_time){}
int level() const { return level_; }
int upgrade_day()... |
Java | UTF-8 | 640 | 2.390625 | 2 | [] | no_license | package com.util.dataConverter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.entity.Payment;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
public class JsonPaymentDataConverter implements P... |
Java | UTF-8 | 3,989 | 1.9375 | 2 | [
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Java | UTF-8 | 469 | 2.15625 | 2 | [] | no_license | package ren.shuaipeng.demo.springboot.statemachine;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.concurrent.TimeUnit;
@Transactional(rollbackFor = Exception.class)
@Service
@Log4j2
public class Iter... |
Markdown | UTF-8 | 1,619 | 2.875 | 3 | [
"MIT"
] | permissive | # Pathfinding
[](https://www.youtube.com/watch?v=egGQED1TgxE&feature=youtu.be)
[View demo on YouTube](https://www.youtube.com/watch?v=egGQED1TgxE&feature=youtu.be)
This is an opensource project that is a personal exp... |
Java | UTF-8 | 920 | 3.171875 | 3 | [] | no_license | package com.tk.algorithm.binary_tree_paths_257;
import java.util.ArrayList;
import java.util.List;
public class Solution {
public List<String> binaryTreePaths(TreeNode root) {
List<String> res = new ArrayList<>();
if (root == null)
return res;
if (root.left == null && root.r... |
Java | UTF-8 | 1,329 | 2.453125 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package gov.samhsa.c2s.c2suiapi.service;
public interface EnforceUserAuthService {
/**
* Enforces only granting access to users who are authorized
* to access a particular patient's MRN
* <p>
* If current user is not authorized to access the specified patient MRN,
* then a PatientNotBelon... |
Markdown | UTF-8 | 953 | 4 | 4 | [
"MIT"
] | permissive | # 在 C++ 中使用 ifstream 逐行读取文件
文件内容如下
>5 3
6 4
7 1
10 5
11 6
12 3
12 4
5 3 是一个坐标,我在 C++ 中怎么逐行的处理这些数据?
## 回答
首先 创建 ifstream 实例
```C++
#include <fstream>
std::ifstream infile("thefile.txt")
```
有两种标准的方法:
1. 假设每一行都由两个数字组成可以逐个 token 的读取:
```C++
int a, b;
while(infile >> a >> b)
{
//process pair (a, b)... |
Markdown | UTF-8 | 1,558 | 3.671875 | 4 | [] | no_license | # call、apply、bind
- 都用来改变函数的this指向
- 第一个参数都是this
- 都可以利用后续参数传参
- call:fn.call(this,1,2,3)
- apply:fn.apply(this,[1,2,3])
- bind:fn.bind(this)(1,2,3)
## call的实现
```javascript
Function.prototype.myCall=function(context=window,...rest){
context.fn=this
let result=context.fn(...rest)
delete context.fn
... |
C++ | UTF-8 | 1,529 | 3.234375 | 3 | [] | no_license | #include"NrRat.h"
NrRat::NrRat()
{
this->numarator = 0;
this->numitor = 0;
}
NrRat::NrRat(int a,int b)
{
this->numarator = a;
this->numitor = b;
}
std::istream &operator >> (std::istream &flux, NrRat &Nr)
{
flux >> Nr.numarator;
std::cout << '-' << std::endl;
flux >> Nr.numitor;
return flux;
}
std::ostream &ope... |
Python | UTF-8 | 1,415 | 3 | 3 | [] | no_license |
import streamlit as st
import pandas as pd
import matplotlib.pyplot as plt
import plotly.express as px
st.title('Life Expectancy vs GNI per capita')
@st.cache
def data_p():
ley = pd.read_csv("Data/life_expectancy_years.csv")
gni = pd.read_csv("Data/gnipercapita_ppp_current_international.csv")
pop =... |
Markdown | UTF-8 | 3,889 | 3.234375 | 3 | [
"CC-BY-4.0"
] | permissive | ---
id: p-model
title: Abstract Programming Model
permalink: book/en/p-model.html
---
CKB has a very different programming model, an abstract programming model. Why do we need an abstract programming model?
## Why abstract programming model?
There is a problem that blockchains are often lack of cryptography primiti... |
Markdown | UTF-8 | 1,877 | 2.71875 | 3 | [
"MIT"
] | permissive | ---
layout: default
title: Home
nav_order: 1
description: "Just the Docs is a responsive Jekyll theme with built-in search that is easily customizable and hosted on GitHub Pages."
permalink:
mathjax: true.
---
This is a fork of documentation template "Just the Docs" with MathJax support and a few changes.
## Usage
J... |
Python | UTF-8 | 2,822 | 3.796875 | 4 | [] | no_license |
"""
In this question your task is again to run the clustering algorithm from lecture, but on a MUCH bigger graph.
So big, in fact, that the distances (i.e., edge costs) are only defined implicitly, rather than being provided as an explicit list.
The data set is below.
clustering_big.txt
The format is:
[# of nodes... |
PHP | UTF-8 | 2,611 | 2.640625 | 3 | [] | no_license | <div id="page">
<div id="contenu">
<div class="box">
<?php
// si la variable $_REQUEST['Pra_Num'] est vide c'est qu'il s'agit d'un nouvel Praticien à créer
if(!empty($_REQUEST['Pra_Num']))
{ // si on demande une modification d'un Praticien
$LePraticien=Praticien::findById($_REQUEST['Pra_Num']); // trouve ... |
TypeScript | UTF-8 | 384 | 2.515625 | 3 | [] | no_license | export class LogService{
constructor(){
}
log(info:string):void{
console.log(info)
}
}
export class UseValueService{
log(info:string):void{
console.log(info)
}
}
export class UseFactroryService{
log(message:string){
console.log(message);
}
}
export class LogStringTokenService{
construct... |
SQL | UTF-8 | 442 | 3.1875 | 3 | [] | no_license | DROP TABLE IF EXISTS USER_SEARCH;
DROP TABLE IF EXISTS USER_SEARCH_BY_RESULT;
CREATE TABLE USER_SEARCH (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(250) NOT NULL,
created_date timestamp ,
search_result VARCHAR(250) NOT NULL
);
CREATE TABLE USER_SEARCH_BY_RESULT (
id INT AUTO_INCREMENT PRIMARY KE... |
Python | UTF-8 | 1,301 | 3.109375 | 3 | [
"MIT"
] | permissive | import csv
import argparse
import glob
def run(folder: str, column: str, value):
files = [i for i in glob.glob(f'{folder}/*.csv')]
if not input(f'Adding column {column} with value {value} to {len(files)} files in folder {folder}. Continue? [y/n]') == 'y':
return
for file in files:
run_fil... |
Java | UTF-8 | 4,219 | 2.421875 | 2 | [
"MIT"
] | permissive | package com.tags.jsf.form;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import javax.faces.component.FacesComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import com... |
Python | UTF-8 | 818 | 2.671875 | 3 | [] | no_license | # takes a list of protein sequences and determines their orthogroup ids
#with python/2.7.8
#takes two files, source of fasta and output
import urllib, json, time, sys
from Bio import SeqIO
urlbase = "http://www.orthodb.org/blast?"
outfile = open(sys.argv[2], "w", 0)
level = "level=7434" #Aculeata
count = 1
start = t... |
Markdown | UTF-8 | 7,159 | 2.953125 | 3 | [
"MIT"
] | permissive | ---
layout: article
title: AE 484 - Finite Element Methods
aside:
toc: true
sidebar:
nav: docs-en
categories: department_elective ae-484
permalink: /course_reviews/:categories
tags: structures theory project
---
# Autumn 2019
### Prof. PJ Guruprasad
**Author**: Sakshi Dayal
**Pre-requisite courses**: [AE 227](/co... |
Ruby | UTF-8 | 199 | 3.1875 | 3 | [] | no_license | def is_integer?
self.to_i.to_s == self
end
def isIPv4Address(inputString)
inputString.count('.') == 3 && inputString.split('.').all? { |s| s.is_integer? && s.to_i >= 0 && s.to_i < 256 }
end
|
JavaScript | UTF-8 | 1,322 | 2.546875 | 3 | [
"MIT"
] | permissive | var test = require('tape')
var FauxDOMRequest = require('./index')
var successful = require('./dummy/successful')
var erroneous = require('./dummy/erroneous')
test('default state', function (assert) {
var request = new FauxDOMRequest
assert.equal(request.readyState, 'pending', 'readyState is "pending"')
assert.... |
Java | UTF-8 | 8,853 | 2.234375 | 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 CONTROLLER.Controle;
import MODEL.ClientesBEAN;
import static java.lang.Thread.sleep;
import java.util.logging.Le... |
Markdown | UTF-8 | 4,578 | 3 | 3 | [] | no_license | +++
comments = true
date = "2015-04-03"
draft = false
image = ""
menu = ""
share = true
slug = "make-some-joy-on-phaser-stick"
tags = ["game", "development", "es6", "javaScript", "phaser", "guide", "tutorial"]
title = "A Virtual Joystick for Phaser"
excerpt = 'So I wrote my own Virtual Joystick Plugin for the HTML5 gam... |
JavaScript | UTF-8 | 1,544 | 2.890625 | 3 | [
"MIT"
] | permissive | var subDays = require('date-fns/src/sub_days');
var subMonths = require('date-fns/src/sub_months');
var isWithinRange = require('date-fns/src/is_within_range');
var parseDate = require('date-fns/src/parse');
var dateAgoToken = /ago$/;
var dateAgoDelimeterToken = /[ .]+/;
var daysUnitToken = /(days?|d)/;
var weeksUnit... |
Markdown | UTF-8 | 2,527 | 2.90625 | 3 | [] | no_license | # Article P 17
§ 1er. - Lors des conférences faites accessoirement dans les salles de réunion, les sièges doivent être reliés entre eux par rangées au moyen d'un système d'attache rigide. Chaque rangée doit, en outre, être fixée solidement à ses deux extrémités au sol ou aux parois, soit rendue solidaire d'une ou plus... |
C | UTF-8 | 4,894 | 2.609375 | 3 | [] | no_license | /*
==============================================================
Name : sensor.c
Copyright : Copyright (C) 早稲田大学マイクロマウスクラブ
Description : センサ関連の関数たちです.
更新履歴
2016/1/29 山上 コメント追加、get_wall_info関数内の始めの
pins_write関数の第3引数を6からLED_NUMに変更
2016/2/24 山上 2016年度用にピン設定を変更
===============================... |
C | UTF-8 | 6,615 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/time.h>
#define num_mem_block 1000
#define mem_block_size 1048576
#define NUM_THREADS 1
int z=0,y=0;
struct mem
{
long t;
};
struct arr
{
long f1,f2;
};
struct arr ar1[10],ar2[10];
void func(char** m) //int mem_block_size
{
//char** m = mg;
stru... |
Java | UTF-8 | 1,263 | 2.1875 | 2 | [
"Apache-2.0"
] | permissive | /*
*
* 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 agreed to in writing, software
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.