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 |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 3,716 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <functional>
#include <cassert>
#include "BigInt.h"
void test1()
{
std::cout << "TEST CONSTRUCTORS AND OUTPUT." << std::endl;
BigInt a = 1337;
BigInt b("100500100500100500100500");
std::cout << "Init a = " << a << " and " << "b = " << b << std... |
Python | UTF-8 | 325 | 2.8125 | 3 | [] | no_license | def pytha(a,b,c):
if (a*a)+(b*b)==(c*c)
return true
else if (a*a)+(c*c)==(b*b)
return true
else if (c*c)+(b*b)==(a*a)
return true
else
return false
def pytha2(a,b,c):
return (a*a)+(b*b)==(c*c)||(a*a)+(c*c)==(b*b)||(c*c)+(b*b)==(a*a)
# // rundet gegen -unendlich
# -10//3 = -4 = 10//-3
# & rundet gegen ... |
JavaScript | UTF-8 | 2,472 | 3.453125 | 3 | [
"MIT"
] | permissive | /*
* Напиши скрипт создания и очистки коллекции элементов. Пользователь вводит количество элементов в input и нажимает кнопку Создать, после чего рендерится коллекция. При нажатии на кнопку Очистить, коллекция элементов очищается.
* Создай функцию createBoxes(amount), которая принимает 1 параметр amount - число. Функ... |
C# | UTF-8 | 3,609 | 2.8125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShadowEmu.Common.GameData.D2O
{
public static class ObjectDataManager
{
public static readonly Dictionary<Type, D2oReader> readers = new Dictionary<Type, D2oRe... |
TypeScript | UTF-8 | 329 | 3.140625 | 3 | [] | no_license | const isStringHexadecimal = (string: string): boolean => {
const lowerCaseString = string.toLowerCase();
const pattern = new RegExp(/([0-9a-f])+$/, "i")
return !isNaN(parseInt(lowerCaseString, 16))
&& lowerCaseString.length % 2 === 0
&& pattern.test(lowerCaseString);
}
export { isStringHexa... |
Python | UTF-8 | 22,924 | 2.8125 | 3 | [] | no_license | import cv2
import numpy as np
import matplotlib.pyplot as plt
import math
import sys
from skimage import measure,data,color
from PIL import Image
def sliding_window(image, stepSize, windowSize):
# slide a window across the image
for y in range(0, image.shape[0], stepSize[1]):
for x in range(0, image.sh... |
C | BIG5 | 1,273 | 3.171875 | 3 | [] | no_license | # include<stdio.h>
# include<stdlib.h>
# include<time.h>
int main(void){
int cardpoint;
float cppoint;
float sum=0;
int reply;
srand(time(NULL));
printf("ӸqPK10Iba!\nundPI`MWL10IbAåBpqdPI`M\nANĹF!\nJBQBKPCi0.5I\n");
while(sum<=10.5){
printf("Do you want to add another card?\nType 1 for yes or\nT... |
PHP | UTF-8 | 5,910 | 2.625 | 3 | [] | no_license | <?php
/**
* @package GamificationPlatform
* @subpackage GamificationLibrary
* @author Todor Iliev
* @copyright Copyright (C) 2014 Todor Iliev <todor@itprism.com>. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('JPATH_PLATFORM') or die;
... |
Java | UTF-8 | 6,885 | 1.835938 | 2 | [] | no_license | package kr.co.modacom.iot.ltegwdev.sg100;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickL... |
Python | UTF-8 | 249 | 4.09375 | 4 | [] | no_license | n = int(input("How many bills you wish to process : "))
for i in range(1,n+1):
billamount = int(input("Enter the amount : "))
tax = billamount*(18/100)
print("For {} amount taxes are {}".format(billamount,tax))
print("Thank You !!") |
Python | UTF-8 | 2,433 | 2.546875 | 3 | [
"MIT"
] | permissive | import socket
import struct
import binascii
import pprint as pp
import network
import time
import uuid
import stringify
import unpack
import time
import modify
def main(write_file=False):
# Timing
run_sniffer_for = int(input('For how many second should sniffer run?: ')) * 1000
run_start ... |
Java | UTF-8 | 11,990 | 2.09375 | 2 | [] | no_license | package embedded.com.android.dx.cf.direct;
import embedded.com.android.dx.cf.code.*;
import embedded.com.android.dx.rop.cst.*;
import embedded.com.android.dx.cf.attrib.*;
import embedded.com.android.dx.cf.iface.*;
import embedded.com.android.dx.util.*;
import embedded.com.android.dx.cf.cst.*;
import embedded.com.andro... |
Java | UTF-8 | 766 | 1.867188 | 2 | [] | no_license | package com.iw.cf.core.dao;
import com.iw.cf.core.dto.Era;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class EraDao {
@Autowired
private SqlSession sqlS... |
Python | UTF-8 | 865 | 3.859375 | 4 | [] | no_license | """The program will prompt for a URL, read the XML data from that URL using urllib
and then parse and extract the comment counts from the XML data,
compute the sum of the numbers in the file.
Data:
<comment>
<name>Matthias</name>
<count>97</count>
</comment>
"""
import urllib.request, urllib.parse, urllib.error... |
Java | UTF-8 | 564 | 2.96875 | 3 | [] | no_license | package com.pzy.study.C21备忘录模式;
import java.util.HashMap;
/**
* Destription:
* Author: pengzuyao
* Time: 2019-07-14
*/
public class MementCaretaker {
private HashMap<String ,MementoIF> mementoMap;
public MementCaretaker(){
mementoMap = new HashMap<String ,MementoIF>();
}
public MementoI... |
Python | UTF-8 | 1,843 | 2.75 | 3 | [] | no_license | import requests
import time
from datetime import datetime
import json
from trading.utils.validation import isFloat, isValidDate
from trading.events.event import Tick
from trading.utils.time import to_utc_timestamp
from trading.DataSource.DataSource import DataSource
from trading.utils.logger import Logger
class OANDAT... |
Java | UTF-8 | 3,998 | 2.390625 | 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.
*/
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQL... |
Python | UTF-8 | 454 | 4.21875 | 4 | [] | no_license | print(abs(-5)) # 절대값 구하기
print(pow(4, 2)) # 4^2 = 16
print(max(5, 12)) # 12
print(min(5, 12)) # 12
print(round(3.14)) # 3
print("-" * 15)
from math import *
print(floor(4.99)) # 내림
print(ceil(3.14)) # 올림
print(sqrt(16)) # 제곱근
print("-" * 15)
from random import *
print(random()) # 0~1사이의 랜덤값 생성
print(random()... |
Java | UTF-8 | 2,944 | 2.234375 | 2 | [
"Apache-2.0"
] | permissive | package org.ripple.power.command;
import org.json.JSONObject;
import org.ripple.power.txns.CurrencyUtils;
public abstract class AMacros implements IMacros {
protected String clazz;
protected final String[] commands;
protected boolean syncing;
protected DMacros macros;
protected IScriptLog log;
protected i... |
Markdown | UTF-8 | 12,488 | 2.5625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | > *The following text is extracted and transformed from the itk.org privacy policy that was archived on 2019-12-31. Please check the [original snapshot on the Wayback Machine](https://web.archive.org/web/20191231233142id_/https%3A//www.kitware.com/privacy) for the most accurate reproduction.*
# Privacy - Kitware, Inc.... |
Java | UTF-8 | 4,370 | 2.296875 | 2 | [] | no_license | package com.fortune_user;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
public class UserDatabaseHandler extends SQLiteOpenHelper {
private static fina... |
Python | UTF-8 | 946 | 2.765625 | 3 | [] | no_license | #!/scisoft/bin/python
"""
Make a list of files for use in WIRCSOFT
Options:
-n : Name -- The name of the region
-l : Lower -- Starting index
-u : Upper -- Ending index
-h : Help -- Display this help
"""
import os,sys
import getopt
def main():
try:
opts,args = getopt.getopt(sys.argv[1:],"n:l:u:h")
... |
Java | UTF-8 | 5,529 | 3.84375 | 4 | [] | no_license | package trees;
import java.util.ArrayList;
import java.util.Stack;
import reusableobjects.TreeNode;
public class TreePaths {
/**
* Longest path between two nodes
* @param root
* @return
*/
public int longestPath(TreeNode root) {
Stack<TreeNode> s = new Stack<TreeNode>();
HeightOfTree h = new HeightOf... |
C | UTF-8 | 325 | 2.65625 | 3 | [
"MIT"
] | permissive | #include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <inttypes.h>
#include "aterm.h"
int main(void) {
// setvbuf(stdout, NULL, _IONBF, 0);
aterm* at = at_parse(stdin);
printf("Getting ready to to_string\n");
char* sterm = aterm_to_string(*at);
printf("Back from to_string\n");
printf("%s\n", sterm... |
C++ | UTF-8 | 977 | 2.953125 | 3 | [
"Apache-2.0"
] | permissive | /**
Copyright 2017 Udey Rishi
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, soft... |
C# | UTF-8 | 3,145 | 3.3125 | 3 | [] | no_license | using RepositoryPatterns;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StreamingContent_Inheritance
{
public class StreamingRepository : StreamingContentRepository
{
// using this _contentDirectory from streamingcontentr... |
C# | UTF-8 | 1,912 | 2.71875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
namespace Reader
{
public partial class ComSettings : Form
{
private SerialPort _Port;
... |
Python | UTF-8 | 1,660 | 3.0625 | 3 | [] | no_license |
#(a) Si tu aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa está en primero (valor 1) de videojuegos (valor 'videojuegos')
curso_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa==1 and g_comp_2=='Diseño y desarrollo de videojuegos'
#(b) Si tu aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa no está en primero de videojuegos. Escribe dos expresi... |
Java | UTF-8 | 35,704 | 2.09375 | 2 | [] | no_license | package edu.ku.cete.domain.professionaldevelopment;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class BatchStudentTrackerExample {
/**
* This field was generated by MyBatis Generator. This field corresponds to the database table batchstudenttracker
* @mbggenerated Mon Nov... |
C++ | UTF-8 | 3,641 | 2.9375 | 3 | [] | no_license | /*******************************************************************************
All content (c)2015, DigiPen (USA) Corporation, all rights reserved.
Primary Author: <yongmin.cho>
Coproducers:
<name> : <Sukjun Park>
File Description:
Header of math.cpp
*****************************************************************... |
Java | UTF-8 | 8,603 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | /*
* The University of Wales, Cardiff Triana Project Software License (Based
* on the Apache Software License Version 1.1)
*
* Copyright (c) 2007 University of Wales, Cardiff. All rights reserved.
*
* Redistribution and use of the software in source and binary forms, with
* or without modification, are permitted... |
Java | UTF-8 | 2,465 | 2.859375 | 3 | [] | no_license | import java.util.*;
class Waste
{
private GregorianCalendar wasteDate;
private int wastePrice;
private FoodReserve foodReserve;
private String tag;
public Waste()
{
this(new GregorianCalendar(),0,new FoodReserve(),"");
}
public Waste(FoodReserve foodReserve)
{
this.foodReserve=foodReserve;
}
public W... |
Python | UTF-8 | 118 | 3.234375 | 3 | [] | no_license | #!/usr/bin/python3
par = []
for n in range(20):
if n % 2 != 0:
continue
par.append(n)
print(par) |
JavaScript | UTF-8 | 7,211 | 2.75 | 3 | [] | no_license | // import TraceData from './traceData'
// import SingleTrace from './singleTrace'
import TraceData from './traceData'
import SingleTrace from './singleTrace'
function byte2binary (n) {
if (n < 0 || n > 255 || n % 1 !== 0) {
throw new Error(n + ' does not fit in a byte')
}
return ('000000000' + n.toString(2)... |
Rust | UTF-8 | 3,195 | 2.84375 | 3 | [
"MIT"
] | permissive | //! FS utils for creating temporary files folder and doing FS work.
use crate::error::{Error, IOError};
use async_stream::try_stream;
use futures::stream::Stream;
use grpc_api::{Script, TargetOs};
use std::io;
use std::io::Write;
use std::path::{Path, PathBuf};
use tempfile::{Builder, NamedTempFile, TempDir};
use tokio... |
Python | UTF-8 | 956 | 2.96875 | 3 | [] | no_license | from unittest import TestCase
from yahtzee import get_score_three_of_a_kind
class Test(TestCase):
def test_get_score_three_kind_no_matches(self):
players_dice = [1, 6, 3, 4, 5]
actual = get_score_three_of_a_kind(players_dice)
expected = 0
self.assertEqual(expected, actual)
de... |
SQL | UTF-8 | 7,158 | 3.765625 | 4 | [
"MIT"
] | permissive | DROP SCHEMA IF EXISTS c9;
CREATE SCHEMA IF NOT EXISTS c9;
use c9;
CREATE TABLE IF NOT EXISTS `students` (
`id_student` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`n_identification` varchar(25),
`name` varchar(25),
`hometown` varchar(50) NOT NULL,
`date_birth` date NOT NULL,
`current_cours... |
Java | UTF-8 | 604 | 1.890625 | 2 | [] | no_license | package com.trkj.tsm.dao;
import com.trkj.tsm.entity.Classroom;
import com.trkj.tsm.vo.ClassroomVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface ClassroomDao {
int deleteByPrimaryKey(Integer classroomId);
int insert(Classroom record);
int insertSelective(... |
Java | UTF-8 | 4,519 | 2.328125 | 2 | [
"Apache-2.0"
] | permissive | package so.droidman;
import java.io.InputStream;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.CookieStore;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.entity.BufferedHttpEnti... |
Markdown | UTF-8 | 3,941 | 3.03125 | 3 | [] | no_license | # slack-psn-activity
This is a [Tampermonkey](https://tampermonkey.net) [userscript](https://en.wikipedia.org/wiki/Userscript) that runs in [Chrome](https://www.google.com/chrome/) to post notifications to [Slack](https://www.slack.com) about [PSN](https://www.playstation.com) activity of friends.
If you are using Sla... |
Markdown | UTF-8 | 5,073 | 3.171875 | 3 | [
"MIT"
] | permissive | # Manual guide
This guide uses example data wrapped around double curly brackets - `{{example_data}}`. You should replace it with valid values of your own choice.
## NAS setup
1. Connect to Raspberry Pi through SSH (using `ssh`, `putty` or some other SSH client of choice).
2. Create new users - `{{admin}}` (an admi... |
Markdown | UTF-8 | 3,346 | 2.75 | 3 | [] | no_license | ## Restaurant App
A app designed for restaurant staff to manage incoming orders. Works on mobile.
---
### Screenshots
<img src="https://raw.githubusercontent.com/Yurtledaturtle/RESTaurant/master/public/images/Screenshot.png">
### ERD
<img src="https://raw.githubusercontent.com/Yurtledaturtle/RESTaurant/master/publ... |
Python | UTF-8 | 769 | 3.65625 | 4 | [] | no_license | #题目:https://leetcode.com/problems/letter-combinations-of-a-phone-number/
class Solution(object):
def letterCombinations(self, digits):
"""
:type digits: str
:rtype: List[str]
"""
d = {'2':'abc', '3':'def', '4':'ghi', '5':'jkl',
'6':'mno', '7':'pqrs', '8':'tuv', ... |
Python | UTF-8 | 3,040 | 2.6875 | 3 | [] | no_license | # coding:utf-8
import urllib2
import re
import Tool
class BDTB:
def __init__(self,baseUrl,seelz):
self.baseUrl=baseUrl
self.seeLZ='?see_lz='+str(seelz)
self.user_agnt = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36'
... |
C++ | UTF-8 | 2,716 | 3.625 | 4 | [] | no_license | // File Name: drama.h
// Programmer: Tabitha Roemish & Prathyusha Pillari
// Date: February 23, 2018
// File contains: drama class declaration [D]
// Inherits from the Movie class.
// Holds a single Drama movie type’s attributes.
#include "drama.h"
#include <iostream>
// initializes the variables
Drama::D... |
Shell | UTF-8 | 1,055 | 3.328125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env bash
# Usage:
# 1. npm install
# 1. ./update_assets.sh
# 1. review any changes manually, ignoring where where the engine adds configurations
DIST_PATH="node_modules/redoc/dist"
ASSETS_PATH="app/assets"
npm install
command -v beautify >/dev/null || npm install -g beautify
strip_trailing_whitespace() ... |
Java | UTF-8 | 15,359 | 1.890625 | 2 | [] | no_license | package com.example.psato.paulosato_sample;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.desig... |
Java | UTF-8 | 3,130 | 3.125 | 3 | [] | no_license | package com.company.jdbc;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ResourceBundle;
/**
* @author 苏东坡
* @version 1.0
* @ClassName JdbcTest3
* @company 公司
* @Description 从属性文件中读取数据库连接信息1
* 第一步: 注册驱动 (作用:告诉Java程序,即将要连接的是哪个... |
PHP | UTF-8 | 756 | 2.5625 | 3 | [] | no_license | <?php
$entryDataFound = isset($entryData);
if(isset($_POST) && !empty($_FILES['image']['name'])){
$name = $_FILES['image']['name'];
list($txt, $ext) = explode(".", $name);
$image_name = time().".".$ext;
$tmp = $_FILES['image']['tmp_name'];
if(move_uploaded_file($tmp, '../../img/cars/'.$image_name)){
echo "<i... |
TypeScript | UTF-8 | 1,233 | 2.5625 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import {ProductService} from 'src/app/services/product.service';// is global singletton
//so we need to refer this by using depency injection
//better way to call the src folder to import is to start at scr/app
import {Product} from 'src/app/models/product'
import { ... |
Shell | UTF-8 | 380 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | #!/bin/bash
# Usage: bash eradicate_setup.sh
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
source $SCRIPT_DIR/../../config.sh
download_infer $SCRIPT_DIR
# Create sandbox
mkdir $ERAD_PROJ_FILES
mkdir $ERAD_PROJ_REPORTS
# Checkout d4j files
export PATH=$PATH:$D4J_DIR/framework/bin
downlo... |
Java | UTF-8 | 1,708 | 2.703125 | 3 | [] | no_license | package com.sougat818.p3;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class Problem3Test {
private Problem3 problem3;
@Before
public void setUp() {
problem3 = new Problem3();
}
@Test
public void testSolution1() {
ListNode listNode1 = new ListNode(new int[]{2... |
C++ | UTF-8 | 1,055 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
string num;
int i,y,x,t=1024;
while(t--)
{
cin>>num;
y=0;
x = num.length();
reverse(num.begin(),num.end());
if(num... |
Java | UTF-8 | 2,675 | 1.8125 | 2 | [] | no_license | package com.dbg.model.test;
import java.io.Serializable;
import javax.persistence.*;
import java.util.List;
/**
* The persistent class for the tm_pers database table.
*
*/
@Entity
@Table(name="TM_PERS")
@NamedQuery(name="TmPer.findAll", query="SELECT t FROM TmPer t")
public class TmPer implements Serializable {
... |
Markdown | UTF-8 | 16,144 | 2.703125 | 3 | [] | no_license | ---
title: Digital Pedagogy in the Humanities
subtitle: Concepts, Models, and Experiments
chapter: Project Management
URL: keywords/projectManagement.md
author:
- family: Siemens
given: Lynne
editor:
- family: Sayers
given: Jentery
publisher: Modern Language Association
type: book
---
# PROJECT MANAGEMENT (Dra... |
Java | UTF-8 | 2,178 | 2.375 | 2 | [] | no_license | package com.example.ancacret.rssfeed.pojo;
import android.graphics.drawable.GradientDrawable;
import android.os.Parcel;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import com.example.ancacret.rssfeed.R;
import com.example.ancacret.rssfeed.adapters.DrawerCategoriesAdap... |
C++ | UTF-8 | 1,447 | 2.890625 | 3 | [] | no_license | #ifndef CAMERA_CPP
#define CAMERA_CPP
#include <glm/gtc/matrix_transform.hpp>
#include "camera.hpp"
#include <cmath>
#include <glm/gtx/rotate_vector.hpp>
void Camera::set_position(const glm::vec3 &position)
{
this->m_position[0] = position[0];
this->m_position[1] = position[1];
this->m_position[2] = posit... |
Python | UTF-8 | 4,172 | 2.859375 | 3 | [] | no_license | import numpy as np
import random
class Dataset(object):
def __init__(self, data, batch_size, num_vocab, pad_idx, shuffle=True):
self.que = data[0]
self.ans = data[1]
self.batch_size = batch_size
self.length = len(self.que)
self.batch_idx = 0
self.shuffle = True
... |
Ruby | UTF-8 | 589 | 3.90625 | 4 | [] | no_license | # @param {Integer} n
# @param {Integer[]} primes
# @return {Integer}
def nth_super_ugly_number(n, primes)
count = Array.new(primes.count, 0)
res = Array.new(n)
res[0] = 1
1.upto(n - 1) do |t|
min = 1000000000000
count.each_with_index do |c, i|
min = [primes[i]... |
Markdown | UTF-8 | 518 | 2.765625 | 3 | [
"MIT"
] | permissive | ## EXERCISE 5
At times, one would like to ssh between servers without typing a password or the need to approve new servers.
Please add the commands required to ssh password-less from server1 to sever2 and without host key checking.
Script to update configuration should be put in the following files.
* for server1 upd... |
C# | UTF-8 | 6,394 | 2.703125 | 3 | [
"MIT"
] | permissive | using System;
using UnityEngine;
using System.Collections.Generic;
[Serializable]
public class KingsCallToArms : Events {
public static int frequency = 1;
private List<Player> highestRankPlayers;
public Player currentPlayer;
public Player firstPlayer;
private BoardManagerMediator board;
public KingsCall... |
C | UTF-8 | 2,043 | 2.671875 | 3 | [] | no_license | //!
//! \file ostime.c
//! \brief <i><b>OSAL Timers Handling Functions</b></i>
//! \details This is the implementation file for the OSAL
//! (Operating System Abstraction Layer) timer Functions.
//! \author Raffaele Belardi
//! \author (original version) Luca Pesenti
//! \version 1.0
//! \date ... |
C++ | UTF-8 | 17,765 | 3.125 | 3 | [
"BSD-2-Clause"
] | permissive | /**
* @file scalar_math.h
* Expression template functors to create new math algorithms for scientific
* applications.
*/
#pragma once
#include <usml/ublas/math_traits.h>
namespace usml {
namespace ublas {
/**
* @internal
* Expression template functors to create new math algorithms for scientific
... |
PHP | UTF-8 | 922 | 2.796875 | 3 | [] | no_license | <?php
session_start();
function showForm() {
echo file_get_contents("login.html");
exit();
}
require_once "../../lib/autoload.php";
if (!isset($_SESSION['logedin'])) {
// Look if Login Process ongoing
if (!isset($_POST['username']) and !isset($_POST['password'])) {
// Send User login form
... |
Markdown | UTF-8 | 1,675 | 3.796875 | 4 | [] | no_license |
1. Write a python program to print all characters in a string 'www.google.com'.
Example: 'Hello' should be printed as:
H
e
l
l
o
2. WAPP to make the a string 'Don't Stop Me Now' to all UPPERCASE
3. WAPP to make the a string 'Don't Stop Me Now' to all low... |
C# | UTF-8 | 5,283 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Estudos.IdempotentConsumer.Enums;
using Estudos.IdempotentConsumer.Repositories.Base;
using FluentAssertions;
using Xunit;
namespace Estudos.IdempotentConsumer.Tests.Unitary.Repositories.Base;
public class EntryTest
{
private static readonly Entry DefaultEntr... |
Java | UTF-8 | 209 | 1.851563 | 2 | [
"OGL-UK-3.0"
] | permissive | package uk.gov.caz.psr.controller.exception;
public class PaymentInfoVrnValidationException extends RuntimeException {
public PaymentInfoVrnValidationException(String message) {
super(message);
}
}
|
Markdown | UTF-8 | 1,298 | 3.140625 | 3 | [] | no_license | ## mandelbrot
A simple Mandelbrot set visualization with matplotlib
### Dependencies
- python 3
- numpy
- matplotlib
- numba
NOTE: I have only used this with python 3.7, numpy 1.16.2, matplotlib 3.0.3 and numba 0.43.1.
### Documentation
#### Class constructor
```python
Mandelbrot.__init__(width=9, height=6, dpi=72... |
Python | UTF-8 | 296 | 3.4375 | 3 | [] | no_license | m=int(input())
n=int(input())
maiorMultiplo=0
cont=m
while(cont<=n):
if(cont%m == 0):
if(cont>=maiorMultiplo):
maiorMultiplo=cont
cont+=1
if(maiorMultiplo==0):
print("sem multiplos menores que",n,)
else:
print(maiorMultiplo)
|
JavaScript | UTF-8 | 2,624 | 2.59375 | 3 | [
"MIT"
] | permissive | /* eslint-disable react/prop-types */
import React from 'react';
import { mount, byId, text, simulate, runAllTimers } from 'react-test-render-fns';
import TrafficLights from './components/TrafficLights';
import TrafficLightsWithWalk from './components/TrafficLightsWithWalk';
jest.useFakeTimers();
const clickBtn = (... |
Markdown | UTF-8 | 19,259 | 3 | 3 | [] | no_license | ##CPU100%,频繁FullGC排查
jstack 和内存信息,然后重启系统,尽快保证系统的可用性。
这种情况可能的原因主要有两种:
* 代码中某个位置读取数据量较大,导致系统内存耗尽,从而导致 Full GC 次数过多,系统缓慢。
* 代码中有比较耗 CPU 的操作,导致 CPU 过高,系统运行缓慢。
相对来说,这是出现频率\*\*\*的两种线上问题,而且它们会直接导致系统不可用。
另外有几种情况也会导致某个功能运行缓慢,但是不至于导致系统不可用:
* 代码某个位置有阻塞性的操作,导致该功能调用整体比较耗时,但出现是比较随机的。
* 某个线程由于某种原因而进入 WAITING 状态,此时该功能整体不可... |
Java | UTF-8 | 2,276 | 3.21875 | 3 | [] | no_license | /**
* A Character that can be controlled by the interface.
*/
package yuuki.entity;
import java.util.ArrayList;
import yuuki.action.Action;
import yuuki.ui.Interactable;
public class PlayerCharacter extends Character {
/**
* A reference to the user interface for this PC to get its moves from.
*/
private In... |
C | UTF-8 | 13,830 | 2.71875 | 3 | [
"MIT"
] | permissive | //==============================================================================
// UTILITY
//==============================================================================
ProteoColor brightness(ProteoColor color,float bright)
{
ProteoColor col={255,
MIN(255,color.r*bright),
MIN(255,color.g*bright),
MIN(255,... |
C# | UTF-8 | 5,482 | 2.5625 | 3 | [
"MIT"
] | permissive | /****************************************************************************
* Copyright (c) 2021.4 liangxie
*
* http://qframework.io
* https://github.com/liangxiegame/QFramework
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation fi... |
TypeScript | UTF-8 | 5,283 | 2.703125 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import { Heros } from "app/heros";
import { PrenomInsee } from "app/prenominsee";
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'app works!'... |
Markdown | UTF-8 | 102,675 | 2.84375 | 3 | [] | no_license |
### Note:
This is **the third version** of the final project. Below is the list of modifications I made from the second version.
- Included graphs showing the scores of each K value for **SelectKBest**.
- In **the second version**, due to the randomness, I decided not to use the **feature importances** in **Decision... |
Java | UTF-8 | 933 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | import java.util.Random;
public class CuriousBunny extends Animal implements Teleporter
{
private Random rand = new Random();
private int x = 0;
private int y = 0;
public CuriousBunny()
{
}
public CuriousBunny(String name, String color)
{
s... |
TypeScript | UTF-8 | 2,044 | 2.78125 | 3 | [] | no_license | import {
all,
call,
fork,
put,
takeEvery,
takeLatest
} from "redux-saga/effects";
import callApi from "../../utils/callApi";
import { fetchError, fetchSuccess, selectRepo, repoSelected } from "./actions";
import { ReposActionTypes } from "./types";
const API_ENDPOINT = "https://api.github.com/repos/faceboo... |
Java | UTF-8 | 829 | 1.742188 | 2 | [] | no_license | package com.gautams.pos.view.splash;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import com.gautams.pos.R;
import com.gautams.pos.databinding.ActivitySplashBinding;
import com.gautams.pos.view.base.BaseActivity;
import com.gautams.pos.view.splash.vm.SplashActivityViewModel;
import javax.inj... |
Java | UTF-8 | 2,379 | 2.640625 | 3 | [
"Unlicense"
] | permissive | package com.webserver.Http;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class HttpContext {
public static final int CR=13;
public static ... |
Java | UTF-8 | 916 | 1.96875 | 2 | [] | no_license | package com.workout.fitness.womenfitness.activities;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.workout.fitness.womenfitness.R;
public class UpdateActivity extend... |
Java | UTF-8 | 1,071 | 3.53125 | 4 | [] | no_license | package dynamicProgramming.lisPattern;
//https://www.interviewbit.com/problems/length-of-longest-subsequence/
public class LongestBitonicSubsequence {
public static int longestSubsequenceLength(final int[] A) {
if(A.length <2){
return A.length;
}
int leftInc[] = new int[A.length];
int rightDe... |
Markdown | UTF-8 | 1,357 | 3.09375 | 3 | [] | no_license | #Talk in js代理模式
·将js的面对对象通过送花的情景讲出来
1、对象JSON Object,描述性,对象字面量,js是动态灵活的语言
{}Object;
2、将现实世界跟代码结合,属性和方法组成复杂数据结构
key:value,value值为function方法,对象有行为或动作时用方法;
3、接口,两个对象实现同样的方法,可以在执行中互换使用,这是代理模式的核心:
-代理模式proxyable:
使用代理模式可以实现更复杂有用的功能,更好的控制对象;
不同对象间实现相同的接口,用于实现相同的动作,使用代理对象可以更好地了解目标对象,数据传送... |
Java | UTF-8 | 1,063 | 2.21875 | 2 | [] | no_license | package com.controller;/********************************************************************
/**
* @Project: spring_web
* @Package com.controller
* @author wangzhenxin
* @date 2017-11-01 9:42
* @Copyright: 2017 www.zyht.com Inc. All rights reserved.
* @version V1.0
*/
import org.springframework.stereotype.Con... |
Python | UTF-8 | 6,351 | 2.609375 | 3 | [] | no_license | import os
import shutil
import sass
from jsmin import jsmin
from django.conf import settings
from django.core.management import call_command
from journal import models as journal_models
def process_scss():
"""Compiles SCSS into CSS in the Static Assets folder"""
paths = [
os.path.join(settings.BASE_... |
Java | UTF-8 | 2,562 | 2.875 | 3 | [] | no_license | package db;
import models.calander.Day;
import models.food.Food;
import models.food.Meal;
import models.person.Person;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import java.util.ArrayList;
import java.util.List;
... |
Python | UTF-8 | 107 | 3.859375 | 4 | [] | no_license | number = input("Enter a number: ")
product = 1
for i in number:
product = product * int(i)
print (product) |
Rust | UTF-8 | 1,573 | 3.78125 | 4 | [
"MIT"
] | permissive | pub trait Draw {
fn draw(&self);
}
pub struct Screen {
pub components: Vec<Box<dyn Draw>>,
}
impl Screen {
pub fn run(&self) {
for component in self.components.iter() {
component.draw();
}
}
}
#[derive(Debug)]
pub struct Button {
pub width: u32,
pub height: u32,
... |
Python | UTF-8 | 1,412 | 2.96875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""
实用函数
"""
import time
from itertools import chain, zip_longest
from flask_login import login_required as login_required_
from flask_smorest.utils import deepupdate
from operator import truth
def login_required(func):
"""包装 flask-login 的 login_required 装饰器
给该函数的 401 响应添加 api doc
... |
Java | WINDOWS-1252 | 35,263 | 1.71875 | 2 | [] | no_license | package hr.ante.test.asktable;
import hr.ante.test.asktable.comparator.ASKTableSortOnClick2;
import hr.ante.test.asktable.comparator.ASSortComparatorExample2;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Vector;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.acti... |
Java | UTF-8 | 5,788 | 2.234375 | 2 | [
"MIT"
] | permissive | package com.xqoo.email.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.Objects;
/**
* @author: zhangdong
* @date 2021/1/20
* @description TODO
*/
public class EmailTemplate... |
JavaScript | UTF-8 | 283 | 4.21875 | 4 | [] | no_license | // ejemplo de hoisting var
var miNombre = undefined;
console.log(miNombre + " Soy ese hoisting");
miNombre = "Jimmy";
// ejecuta en consola para ver el resultado
// ejemplo de hoisting function
hey();
function hey( ){
console.log("hola " + miNombre);
}
var miNombre = "Jimmy"; |
JavaScript | UTF-8 | 2,023 | 3.015625 | 3 | [] | no_license | function TodoViewModel(todo) {
var self = this;
this.todo = todo;
self.date = '';
self.newNoteText = ko.observable('');
self.notes = ko.observableArray();
// this.availableColors = ko.observableArray(["red", "slateblue", "lightseagreen", "khaki", "slategray", "deeppink", "coral"]);
// this.... |
TypeScript | UTF-8 | 128 | 2.578125 | 3 | [] | no_license | /**
* Interface for the 'User' data
*/
export interface UserEntity {
id: string;
firstName: string;
lastName: string;
}
|
Python | UTF-8 | 684 | 2.90625 | 3 | [
"MIT"
] | permissive | from .base import JiraBase
from .utils import render
class Row(JiraBase):
def __init__(self, *columns):
self.columns = list(columns)
def render(self) -> str:
inner = "|".join([render(c) for c in self.columns])
return f"|{inner}|"
class HeadRow(Row):
def render(self) -> str:
... |
Swift | UTF-8 | 3,524 | 2.65625 | 3 | [] | no_license | //
// AddPasswordViewController.swift
// PasswordKeeper
//
// Created by Herman Kwan on 6/12/18.
// Copyright © 2018 Herman Kwan. All rights reserved.
//
import UIKit
import AudioToolbox
class AddPasswordViewController: UIViewController {
@IBOutlet weak var titleTextField: UITextField!
@IBOutlet weak... |
C++ | UTF-8 | 1,319 | 3 | 3 | [] | no_license | #include "Delegate.h"
#include "Utils.h"
class B
{
public:
bool Func(int i)
{
LOG("Test Member Function (%d)\n", i);
return true;
}
void FuncMulticast(int i, int j)
{
LOG("Test Multicast Member Function (%d, %d)\n", i, j);
}
};
bool TestRawFunc()
{
LOG("Test Raw Function\n");
return true;
}
void Tes... |
Java | UTF-8 | 1,567 | 2.703125 | 3 | [
"BSD-3-Clause"
] | permissive | package edu.ksu.cs.benign;
import android.app.IntentService;
import android.content.Intent;
import android.util.Log;
import java.io.File;
/**
* An {@link IntentService} subclass for handling asynchronous task requests in
* a service on a separate handler thread.
* <p>
* TODO: Customize class - update intent act... |
Python | UTF-8 | 708 | 2.546875 | 3 | [
"MIT"
] | permissive | import sys
import json
def main(args):
vcf_filename = args[1]
gt_map = {}
with open(vcf_filename) as f:
for line in f:
line = line.strip()
if line.startswith('#'):
continue
terms = line.split('\t')
assert(len(terms) > 9)
fo... |
Go | UTF-8 | 3,459 | 2.625 | 3 | [
"MIT"
] | permissive | package generator
import (
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"testing"
"context"
strings2 "github.com/recolabs/microgen/generator/strings"
"github.com/recolabs/microgen/generator/template"
"github.com/stretchr/testify/assert"
"github.com/vetcher/go-astra"
"github.com/vetcher/go-astra/types"
)
f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.