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 | 1,001 | 2.484375 | 2 | [] | no_license | package org.droidslicer.graph.entity;
import com.ibm.wala.types.MethodReference;
public abstract class ICCReturnCalleeUnit extends ICCUnit
{
private final MethodReference mMethodRef;
public ICCReturnCalleeUnit(MethodReference methodRef)
{
if(methodRef == null)
throw new IllegalArgumentException();
mMethodRe... |
Markdown | UTF-8 | 12,525 | 3.421875 | 3 | [] | no_license | # 4. 리포지터리와 모델 구현 (JPA 중심)
## JPA를 이용한 리포지터리 구현
#### 모듈 위치
- 리포지터리 인터페이스는 애그리거트와 같이 도메인 영역
- 리포지터리를 상세 기술로 구현한 클래스는 인프라스트럭쳐 영역
- 일부 패키지 구성 시 도메인 영역 내 `impl`을 사용하는 케이스가 있는데, 이는 그리 좋은 방법은 아니다. (인프라 요소는 인프라 영역에 있도록 하여 도메인의 인프라 의존을 낮춰야함)
#### 리포지터리 기본 기능 구현
- 리포지터리의 기본 기능은 `아이디로 애그리거트 조회`, `애그리거트 저장`
- 인터페이스는 애그리거트 루트를 기... |
Python | UTF-8 | 971 | 2.859375 | 3 | [
"MIT"
] | permissive | import numpy as np
from Lab4.concept import concept_power, concept_label
def likelihood(data, concept):
return np.power(1 / concept_power(concept), len(data))
def likelihoods(data, concepts):
return [(concept_label(concept), likelihood(data, concept)) for concept in concepts]
def posterior(data, concept,... |
Java | UTF-8 | 859 | 2.046875 | 2 | [
"Apache-2.0"
] | permissive | package com.emc.ecs.management.sdk.model.iam.exception;
import com.emc.ecs.management.sdk.model.iam.IamResponseConstants;
import javax.xml.bind.annotation.*;
@XmlRootElement(name = "ErrorResponse", namespace = IamResponseConstants.RESPONSE_XML_NAMESPACE)
@XmlAccessorType(value = XmlAccessType.NONE)
public class IamE... |
Rust | UTF-8 | 2,584 | 3.4375 | 3 | [] | no_license | #[macro_use]
extern crate clap;
use common::set_log_level;
use std::collections::HashMap;
struct Fraction {
remainer: usize,
divisor: usize,
}
impl Fraction {
fn new(num: usize, denom: usize) -> Fraction {
Fraction { remainer: num, divisor: denom }
}
}
impl Iterator for Fraction {
type I... |
C | UTF-8 | 571 | 4.0625 | 4 | [] | no_license | /*
* Copyright (c) 我的有限公司
* 文件名: factorial.c
* 描述: 数的阶乘
* 作者: hyb
* 完成日期: 2018年1月4日
* 当前版本: 1.0
*/
#include <stdio.h>
long factorial1(int n);
long factorial2(int n);
int main(void)
{
int n = 8;
printf("factorial1(int n): %ld\n", factorial1(8));
printf("factorial2(int n): %ld\n", factorial2(8));
return 0;... |
PHP | UTF-8 | 1,778 | 2.84375 | 3 | [
"NTP",
"BSD-3-Clause",
"OpenSSL",
"RSA-MD",
"MIT",
"LicenseRef-scancode-rsa-md4",
"HPND-sell-variant",
"Zlib",
"LicenseRef-scancode-pcre",
"Apache-2.0",
"LicenseRef-scancode-zeusbench",
"LicenseRef-scancode-other-permissive",
"metamail",
"Beerware",
"LicenseRef-scancode-rsa-1990",
"Spe... | permissive | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cookieStore</title>
</head>
<body>
<?php
if (isset($_POST["old_name"]... |
C++ | UTF-8 | 212 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int a,b,c;
for (int i = 100; i <= 999; i++)
{
c = i / 100;
b = i / 10 % 10;
a = i % 10;
if (c*c*c + b*b*b + a*a*a == i)
{
printf("%d\n", i);
}
}
return 0;
}
|
Java | UTF-8 | 3,590 | 2.40625 | 2 | [] | no_license | package svp.playground;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.GroupLayout;
import javax.swing.JButton;
import javax.swing.JCheckBox;
impor... |
JavaScript | UTF-8 | 3,354 | 2.890625 | 3 | [] | no_license | #! /usr/bin/env node
'use strict';
var _apprecom = require('apprecom');
var _apprecom2 = _interopRequireDefault(_apprecom);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// SIMPLE CONFIGURATION
var MIN_SUPPORT = 0.02;
var MIN_CONFIDENCE = 0.4;
var TEST_RATIO = 0.9;
... |
JavaScript | UTF-8 | 848 | 2.828125 | 3 | [] | no_license | import React, { useState } from "react";
import useFetch from "./useFetch"
function Button () {
const [buttonText, setButtonText] = useState("click me!");
const users = useFetch('https://jsonplaceholder.typicode.com/users/');
const [data, setData] = useState([]);
function handleClick() {
getData();
}
... |
Markdown | UTF-8 | 1,650 | 3.53125 | 4 | [] | no_license | ###### 查看 Python 版本
```
python -V
```
###### 执行 python文件
```
python Hello.py
```
###### 语法
```
# 打印数组
list = ['a', 'b', 'c', 'd']
print (list)
```
###### 行和缩进
```
Python 与其他语言最大的区别就是,Python 的代码块不使用大括号 {} 来控制类,函数以及其他逻辑判断。
python 最具特色的就是用缩进来写模块。
缩进的空白数量是可变的,但是所有代码块语句必须包含相同的缩进空白数量,这个必须严格执行。
```
###### 安装模块
```
# 安装 o... |
Java | UTF-8 | 6,176 | 2.546875 | 3 | [] | no_license | package Presentacion.View;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io... |
C++ | UTF-8 | 1,099 | 3.28125 | 3 | [
"BSD-2-Clause"
] | permissive | #include <bits/stdc++.h>
using namespace std;
/*
Given a string of letters a, b, n how many different ways can you make
the word "banana" by crossing out various letters and then reading left-to-right?
(Use - to indicate a crossed-out letter)
Example
Input
bbananana
Output
b-anana--
b-anan--a
b-ana--na
b-an--ana
b... |
Java | UTF-8 | 2,306 | 3.28125 | 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 ICollection;
/**
* @param <E>
* @date Jul 26, 2014
* @author Chris Medina
* <p>
* The ICollection interface provides meth... |
Markdown | UTF-8 | 10,887 | 3.921875 | 4 | [] | no_license | # <span style="color:#93329e">***The Duckett HTML book:***</span>
## <span style="color:#e2703a">**Design and Build Websites**</span>
## <span style="color:#e2703a">**"TEXT"**</span>
> - Headings and paragraphs
> - Bold, italic, emphasis
> - Structural and semantic markup
- ## Structural markup:
> the ele... |
SQL | UTF-8 | 2,245 | 4.09375 | 4 | [] | no_license |
-- Filtering Records
-- Operators
-- = , <> , < , > , <= , >=
-- Between
-- Like
-- In
-- Is
-- Select the Database.
USE `DemoDB`;
-- Create
CREATE TABLE `Course` (
`CourseID` INT PRIMARY KEY AUTO_INCREMENT,
`Name` VARCHAR(50),
`Price` NUMERIC(10,2)
);
-- INSERT
INSERT INTO `C... |
Python | UTF-8 | 2,731 | 3.328125 | 3 | [] | no_license | import unittest
from tests.my_first_test import find_sum
class TestTimeConverter(unittest.TestCase):
def test_positive_hours(self):
actual_seconds = self.convert_into_seconds(hours=4)
# actual_seconds = convert_into_seconds(4, 0, 0)
self.assertEqual(14400, actual_seconds)
def test_po... |
JavaScript | UTF-8 | 997 | 3.65625 | 4 | [] | no_license | // function diaSemanaNumero(dia) {
// switch (dia) {
// case 'lunes':
// return 1
// case 'martes':
// return 2
// case 'miercoles':
// return 3
// case 'jueves':
// return 4
// case 'viernes':
// return 5
// case 'sabado':
// return 6
// case 'domingo':... |
Java | UTF-8 | 640 | 2.046875 | 2 | [] | no_license | package com.ldx.springboot_cache.repository;
import com.ldx.springboot_cache.pojo.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Tran... |
C# | UTF-8 | 2,277 | 2.5625 | 3 | [
"MIT"
] | permissive | using System;
using PivotalTrackerDotNet.Domain;
namespace PivotalTrackerDotNet
{
public class PivotalTrackerClient : IPivotalTrackerClient
{
private readonly string token;
private readonly Lazy<IAuthenticationService> authenticationService;
private readonly Lazy<IAccountService> acco... |
Markdown | UTF-8 | 2,475 | 2.875 | 3 | [] | no_license | # FigureView
react native实现的轮播图


````
FigureView.js(适配了Android与Ios)
ImageData.json
{
"data": [
{
"img" : "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3413953738,1102676238&fm=200&gp=0.jpg",
"t... |
C++ | UHC | 3,960 | 2.640625 | 3 | [
"MIT"
] | permissive | // N3BaseFileAccess.cpp: implementation of the CN3BaseFileAccess class.
//
//////////////////////////////////////////////////////////////////////
#include "StdAfxBase.h"
#include "N3BaseFileAccess.h"
#include <vector>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//... |
C++ | UTF-8 | 20,613 | 2.765625 | 3 | [
"MIT"
] | permissive | // Distributed under the MIT License.
// See LICENSE.txt for details.
#pragma once
#include <array>
#include <cstddef>
#include <iterator>
#include <memory> // std::addressof
#include <optional>
#include <pup.h>
#include <pup_stl.h>
#include <type_traits>
#include "Utilities/Algorithm.hpp"
#include "Utilities/Const... |
Python | UTF-8 | 800 | 2.609375 | 3 | [] | no_license | from Variable import *
pygame.mixer.init()
pygame.mixer.music.load("./sleepMusic.mp3")
pygame.mixer.music.set_volume(1.0)
def detect_Button(btn_status):
# btn_status = False
#아케이드 버튼이 눌리지 않았으면 기다리기
#아케이드 버튼이 눌려서 GPIO.input(5)값이 0이 되면
#파이어베이스에 alarmSwitch와 measureSwitch를 False로 바꾸고 빠져나가기
while Tr... |
Python | UTF-8 | 1,245 | 3.265625 | 3 | [] | no_license | import heapq
def dp(pq, total):
highest = -pq[0]
if highest < 4:
total += highest
return total
#Scenario 1: Split largest value in half
pq1 = pq[:]
heapq.heappop(pq1)
heapq.heappush(pq1, -highest/2)
heapq.heappush(pq1, -(highest-highest/2))
total1 = dp(pq1,... |
Java | UTF-8 | 1,301 | 2.328125 | 2 | [] | no_license | package edu.wustl.common.querysuite.queryobject.impl;
import edu.wustl.common.querysuite.queryobject.IDateOffsetLiteral;
import edu.wustl.common.querysuite.queryobject.TermType;
import edu.wustl.common.querysuite.queryobject.TimeInterval;
public class DateOffsetLiteral extends ArithmeticOperand implements IDate... |
Java | UTF-8 | 2,994 | 2.109375 | 2 | [] | no_license | package com.pj.magic.service;
import java.util.Date;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
... |
Java | UTF-8 | 967 | 2.265625 | 2 | [] | no_license | package org.debugroom.mynavi.sample.aws.lambda.s3event.app.function;
import java.util.function.Function;
import reactor.core.publisher.Flux;
import com.amazonaws.services.s3.event.S3EventNotification;
import org.springframework.beans.factory.annotation.Autowired;
import org.debugroom.mynavi.sample.aws.lambda.s3event... |
C++ | GB18030 | 807 | 2.828125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "ray.h"
#include "aabb.h"
//¼rayĸֲĽṹ
class material;
void get_sphere_uv(const vec3& p, double& u, double &v) {
double phi = atan2(p.z(), p.x());
double theta = asin(p.y());
u = 1 - (phi + M_PI) / (2 * M_PI);
v = (theta + M_PI / 2) / M_PI;
}
struct hit_record
{
//rayеIJt
double t;
//λ
vec3... |
TypeScript | UTF-8 | 1,424 | 3.484375 | 3 | [] | no_license | export function intersection(...args: any[]) {
const interList = []
var n = args.length;
if(n <= 1) return args;
//console.log(` array = ${arguments[1]}`)
for(let i = 0; i < args[0].length; i++){
//console.log(`start to check ${i}`)
if(checkIntersection(args, n-1, args[0][i])) interL... |
PHP | UTF-8 | 3,644 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php declare(strict_types=1);
/**
* Copyright (c) 2017 Holger Woltersdorf & Contributors
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation... |
C++ | UTF-8 | 261 | 2.5625 | 3 | [] | no_license | #include "circle.h"
#include <cmath>
#include <QPainter>
Circle::Circle(QObject *parent) : Shape(parent){
shapeName = "Circle";
shapeCode = Shape::Circle;
}
void Circle::paint(QPainter & painter) const {
drawCircleMidPoint(painter, start, end);
}
|
Java | UTF-8 | 670 | 2.171875 | 2 | [
"MIT"
] | permissive | package com.fonseca.breweryapi.mapper.impl;
import com.fonseca.breweryapi.client.brewerydb.domain.Brewery;
import com.fonseca.breweryapi.dto.BreweryDTO;
import com.fonseca.breweryapi.factory.BreweryFactory;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
class BreweryToBr... |
Python | UTF-8 | 1,906 | 2.765625 | 3 | [] | no_license | __author__ = 'Javier'
import unittest
from movies.RESTApi import RestCache, MongoDBMoviesCache, ApiRest
import mongomock
import httpretty
class JsonCapturer(object):
def capture(self, doc):
self.doc = doc
class TestRestApi_UsingMongoMock(unittest.TestCase):
def setUp(self):
self.mongo_clie... |
JavaScript | UTF-8 | 965 | 3.375 | 3 | [] | no_license | function Tail(pos){
this.pos = pos;
this.num = 150;
this.hist = [];
this.weight = 5;//random(0.2, 3.0);
this.init = function(){
// this.num = Math.round(random(15, 200));
this.hist = [];
for(var i=this.num-1; i>=0; i--){
var p = new Point(this.pos.x, this.pos.y);
this.hist.push(p);
}
console.log(... |
Java | UTF-8 | 174 | 1.75 | 2 | [] | no_license | package com.ooteco.mapper.ext;
import com.ooteco.model.AppCustom;
import java.util.List;
public interface AppCustomExtMapper {
List<AppCustom> selectAll();
} |
JavaScript | UTF-8 | 1,566 | 2.578125 | 3 | [] | no_license | import React,{Component} from 'react';
import './Day.scss';
export default class Day extends Component {
handaleChange = (event) => {
if (this.props.active === 'true'){
this.props.onChange(event);
} else {
event.preventDefault()
}
}
render(){
let c... |
JavaScript | UTF-8 | 585 | 2.796875 | 3 | [] | no_license | const defaultInfo = {
status: 200,
data: {},
headers: {}
};
class Response {
constructor(status, data, headers) {
this.status = status || defaultInfo.status;
this.data = data || defaultInfo.data;
this.headers = headers || defaultInfo.headers;
}
setStatus(status) {
this.status = status;
}... |
C# | UTF-8 | 1,203 | 3.875 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace Algorithms.Algorithms.PrincetonPartI.CH2
{
/// <summary>
/// find smallest entry in array, swap it to leftmost position.
/// find next smallest to the right of the sorted smallest item, etc.
/// finding that minimum item is a... |
JavaScript | UTF-8 | 4,474 | 2.53125 | 3 | [] | no_license | /**
* File này dành cho việc authentication, tạo user, đăng nhập
*/
require('dotenv').config();
const express = require('express');
const router = express.Router();
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
const jwt = require('jsonwebtoken');
const userSchema = require('./../model/user... |
Markdown | UTF-8 | 2,387 | 2.515625 | 3 | [] | no_license | # docker-apache-php Web Service (php 7.3 apache)
A Docker container to provide a web service for executing applications written in PHP.
The container runs an instance of Apache Webserver for web applications written in PHP to display and retrieve data through standard web protocols. This container also provides c... |
Markdown | UTF-8 | 1,579 | 2.984375 | 3 | [] | no_license | # Can I sync only some of my decks?
Anki stores all your decks in a single collection file, so there is no way to sync only part of a collection. However, there are several possible workarounds that may be useful:
**Use two profiles.** You can store the decks you do not want to sync in a separate profile (you can cre... |
Markdown | UTF-8 | 2,000 | 3.15625 | 3 | [] | no_license | # Flow123d-python-utils
Takes file in json profiler format created in project [Flow123d](https://github.com/flow123d/flow123d) and
converts it to different format.
## Usage
```
Usage: profiler_formatter_script.py [options]
Options:
-h, --help show this help message and exit
-i FILENAME, --input=FILENA... |
C++ | UTF-8 | 1,043 | 3 | 3 | [] | no_license | #ifndef _PLAYER__H
#define _PLAYER__H
#include<string>
#include<iostream>
#include "board.h"
#include <utility>
class player{
protected:
std::string name;
std::string pawnType;
public:
player():name("AI"),pawnType(){}
virtual void AskMyName() = 0;
virtual ~player(){}
virtual void NameSecondPlayer(){}
... |
Markdown | UTF-8 | 2,964 | 3 | 3 | [] | no_license | ###Week03-Day01
=======
#WORK IN YOUR OWN FOLDER ONLY!
#Your pull-request title must start with `hw_w03_submission`
##Morning Exercise:
##Part 1 - AmaZone Store
It's 1990-something and you are appointed as the manager of AmaZone, a low-tech, brick-and-mortar store and tasked with building a backend ``command-line``... |
Markdown | UTF-8 | 2,132 | 3.609375 | 4 | [] | no_license | ### 상속
#### 조상 클래스 parent클래스,super클래스,base클래스
#### 자손 클래스 child클래스,sub클래스,derived클래스
```
생성자와 초기화 블럭은 상속되지 않는다. 멤버만 상속된다
```
```
public class Parent {
int age;
void play() {
System.out.println("부모님");
}
}
public class Child extends Parent{ //extends를 통한 상속
void play() { //오버라이딩
System.out... |
SQL | UTF-8 | 1,367 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | DROP TABLE IF EXISTS `t_dict`;
CREATE TABLE `t_dict` (
`id` bigint(64) NOT NULL COMMENT '编号',
`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '标签名',
`value` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT NULL COMMENT '数据值',
`type` varchar(100) CHARACTER SET utf8... |
Java | UTF-8 | 9,650 | 2.609375 | 3 | [] | no_license | package web.socket;
import org.eclipse.jetty.websocket.api.Session;
import org.eclipse.jetty.websocket.api.annotations.*;
import org.json.JSONArray;
import org.json.JSONObject;
import web.WebMethods;
import web.game.Room;
import java.io.IOException;
import java.util.*;
/**
* Created by levon.gevorgyan on 10/02/16.... |
PHP | UTF-8 | 764 | 2.8125 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace Meraki\Email\Exception;
use Meraki\Email\Exception\DisplayName as DisplayNameException;
use Meraki\TestSuite\TestCase;
use InvalidArgumentException;
final class DisplayNameTest extends TestCase
{
/**
* @test
*/
public function is_an_invalid_argument_exception(): void
{... |
Java | UTF-8 | 2,144 | 1.992188 | 2 | [] | no_license | package com.pix.api.pixfacil.dto.pixfacil;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
public class VendaDTO {
private BigDecimal expiracao;
private String infoPagador;
private Long idUsuario;
private List<ItensVendaDTO> itensVendas;
... |
Python | UTF-8 | 510 | 3.890625 | 4 | [] | no_license | # program to search an element from a list of different type of values
# Developed by : rakesh kumar
# Last revised on : 20-lujy-2019
list =[10,20,'a','abc',40,50.6]
a = input("Enter any number")
try: # if we are able to type cast the value
b = eval(a)
if b in list:
pri... |
Python | UTF-8 | 964 | 2.515625 | 3 | [
"MIT"
] | permissive | import logging
from bs4 import BeautifulSoup
import requests
from .models import Page
from fig_demo.celery import FigDemoTask
LOG = logging.getLogger(__name__)
class PageFetchTask(FigDemoTask):
"""
Do stuff
"""
def run(self, page_id):
page = Page.objects.get(id=page_id)
response = ... |
C++ | UTF-8 | 539 | 2.6875 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <gmock/gmock.h>
#include <sstream>
#include "interpreter.hpp"
TEST(Interpreter, GobbleRem) {
std::string input1 = "REM Hello.";
std::string input2 = "BLAH Hello.";
std::string message = "";
Interpreter::ParseStatus s;
Interpreter i;
// Comment
s = i.gobbl... |
Java | UTF-8 | 1,373 | 3.78125 | 4 | [] | no_license | package Petcu;
import java.util.Arrays;
import java.util.Scanner;
public class AnagramChecker {
private void isAnagram() {
Scanner in = new Scanner(System.in);
System.out.println("Enter two strings and I will tell you if they are anagrams.");
System.out.println("Enter the first string:")... |
C# | UTF-8 | 867 | 3.109375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EPAM.HomeTask4
{
class Program
{
/*
- Story class: обобщающие делегаты -> generic events
partOfStoryForEachAnimal<T>...
- IAnima... |
Python | UTF-8 | 674 | 2.890625 | 3 | [] | no_license | import socket
host = socket.gethostname()
port = 5000
mySocket = socket.socket()
mySocket.connect((host,port))
def Main(mySocket):
while True:
while True:
data = input(" -> ")
if data != 'q' :
mySoc... |
Java | UTF-8 | 2,791 | 1.6875 | 2 | [
"MIT"
] | permissive | /*
* MIT License
*
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the r... |
Java | UTF-8 | 1,112 | 3.734375 | 4 | [] | no_license | package com.javadroider.interviewprep.leetcode.easy;
import java.util.Arrays;
public class _0977_SquaresOfASortedArray {
public static void main(String[] args) {
System.out.println(Arrays.toString(new _0977_SquaresOfASortedArray().sortedSquares(new int[]{-4, -1, 0, 3, 10})));
}
//-4,-1,0,3,10
... |
Python | UTF-8 | 1,039 | 2.578125 | 3 | [] | no_license | # this converts all images in given directories to grayscale.
# Must already have images in training-images1 directories generated from reader.py in keras-image-preprocessing.
# usage: $ python grayscaler.py
import cv2
import sys
import os
from os.path import isfile
from keras.preprocessing import image as im
i = ... |
Java | UTF-8 | 1,544 | 2.671875 | 3 | [] | no_license | package org.apache.ivy.core.resolve;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* This class is used to store data related to one node of the dependency graph visit. It stores
* both an {@link IvyNode} and related {@link VisitNode} objects. Indeed, during ... |
Markdown | UTF-8 | 12,228 | 2.625 | 3 | [
"MIT"
] | permissive | # **Publishing a new version for shading files**
1. Open **Maya 2017** using **Solstice Launcher**

***
2. Launch **Solstice Pipelinizer** tool
> Solstice Pipelinizer Button in Solstice Shelf
ε
*
* ο1http://zhidao.baidu.com/question/81938912.html
*
* ο2http://cslibrary.stanford.edu/110/BinaryTrees.html#java
*
* @author ocaicai@yeah.net @date: 2011-5-17
*
*/
public class Tree2 {
privat... |
Java | UTF-8 | 1,291 | 2.375 | 2 | [] | no_license | package com.training.dataproviders;
import java.util.List;
import org.testng.annotations.DataProvider;
import com.training.bean.CustomerGrpDetailsBean;
import com.training.bean.LoginBean;
import com.training.dao.CustomerGroupDAO;
public class UNF_086_DataProviders {
@DataProvider(name = "db-inputs")
public Objec... |
Python | UTF-8 | 6,009 | 2.8125 | 3 | [] | no_license | import os
import pickle
from scipy.io import wavfile
import pandas as pd
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from python_speech_features import mfcc
from Configuration_Class import config
import warnings
warnings.filterwarnings("ignore")
#An instance of the configuration class
config ... |
C# | UTF-8 | 832 | 3.203125 | 3 | [] | no_license | /*
Extension methods are static methods of static classes
* Extension methods are used to add new functionality into already existing Types without creating nre derived types
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace ExtensionMethod
{
public static cla... |
JavaScript | UTF-8 | 1,232 | 2.78125 | 3 | [] | no_license |
var colorRed = '#e52213';
function validarForm() {
var divAviso = document.getElementById("divAviso");
var fabricNome = document.getElementById("fabricNome");
var situacao = document.getElementById("situacao");
divAviso.innerHTML = "";
fabricNome.style.removeProperty('border');
situacao.sty... |
C# | UTF-8 | 1,657 | 2.78125 | 3 | [] | no_license | using System.Collections.Generic;
using NUnit.Framework;
using RecommendationSystem.Data;
namespace RecommendationSystem.BL.Test
{
[TestFixture]
public class SortGamesTest
{
[Test]
public void Sort_SortedGames()
{
//arrange
#region Define actual objects
... |
C# | UTF-8 | 2,184 | 3.875 | 4 | [] | no_license | using System;
public static class Calculator
{
// выводит на консоль результат сложения двух целых чисел
public static void Sum()
{
Console.WriteLine();
Console.Write("Введите первое число: ");
int num1 = int.Parse(Console.ReadLine());
Console.Write("Введите вто... |
C++ | UTF-8 | 334 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
//Soft Drinking CF151-D2-A
int n, k, l;
int c, d, p;
int nl, np;
cin>>n>>k>>l>>c>>d>>p>>nl>>np;
int mlAvailable = k*l;
int slicesAvailable = c*d;
int toasts = min(mlAvailable/nl,min(p/np,slicesAvailable));
cout... |
Java | UTF-8 | 1,562 | 1.78125 | 2 | [] | no_license | package com.skt.mars.usr.si;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAn... |
TypeScript | UTF-8 | 1,194 | 2.671875 | 3 | [
"MIT"
] | permissive | /*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2023 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
/**
* @module selection
*/
import type { IJodit } from 'jodit/types';
import { Dom } from 'jodi... |
Java | UTF-8 | 3,194 | 2.3125 | 2 | [] | no_license | package com.ucl.news.dao;
import android.os.Parcel;
import android.os.Parcelable;
public class RunningAppsDAO implements Parcelable {
private long userID;
private String userSession;
private String appName;
private String packageName;
private String categoryName;
private double lat;
private double lon;
priva... |
PHP | UTF-8 | 2,880 | 2.703125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: cmcnamara87
* Date: 18/01/2015
* Time: 7:25 PM
*/
namespace MoviesOwl\Service;
use Carbon\Carbon;
use MoviesOwl\Cinema21\Cinema21Api;
use MoviesOwl\EventCinemas\EventCinemasApi;
use MoviesOwl\Repos\Showing\ShowingRepository;
use MoviesOwl\Showings\Showing;
class SeatingSe... |
PHP | UTF-8 | 1,310 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php namespace Evdb\Cas\Request;
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
class GuzzleCasRequestClient implements CasRequestClient
{
/**
* @var ClientInterface
*/
protected $guzzle;
/**
* Gu... |
JavaScript | UTF-8 | 3,187 | 2.6875 | 3 | [
"MIT"
] | permissive | var endent = require('endent')
var defaultConfig = JSON.parse(require(`./configTmpl.js`))
module.exports = (site, config) => {
var config = config ? config : defaultConfig
var personInfoComment = endent`
<span class="token comment">
/**
* Nice to meet you!
*/</span>
`
var personInfo = enden... |
Rust | UTF-8 | 3,252 | 3.125 | 3 | [] | no_license | use mysql_async::{FromRowError, Row};
use mysql_async::prelude::FromRow;
use serde::{Deserialize, Serialize};
use crate::database::{DatabaseResult, get_from_row};
use crate::database::connection_pool::ConnectionPool;
use crate::database::DatabaseError::NotFound;
use crate::database::procedures::Procedure::*;
pub stru... |
C++ | UTF-8 | 897 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
/*
you have a string "ddaaiillyypprrooggrraammeerr". We want to remove all the
consecutive duplicates and put them in a separate string, which yields two
separate instances of the string "dailyprogramer".
use this list for testing:
input: "balloons"
expected output: "balons" "... |
PHP | UTF-8 | 920 | 2.671875 | 3 | [] | no_license | <?php
session_start();
$dbhost = 'localhost';
$dbname = 'projet3';
$dbuser = 'root';
$dbpswd = '';
try{
$db = new PDO('mysql:host='.$dbhost.';dbname='.$dbname,$dbuser,$dbpswd, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING));
}catch(PDOexception $e){
die("... |
JavaScript | UTF-8 | 1,242 | 3.140625 | 3 | [] | no_license | const response = require('express');
const express = require('express');
const app = express();
app.listen(3000, () => {
console.log('server: running');
});
//G
var addAmount = 0;
app.get('/api/random', (req, res) => {
res.send({ 'number': Math.floor(Math.random() * 1024) });
});
app.get('/api/custom_random/:n... |
Markdown | UTF-8 | 965 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | # SKAFFOLD
## Summary
Notes on using skaffold to make k8s development easier
## Resources
[Docs](https://skaffold.dev/)
[Github](https://github.com/GoogleContainerTools/skaffold)
[Skaffold.yml Reference](https://skaffold.dev/docs/references/yaml/)
[Easy ECR Setup](go get -u github.com/awslabs/amazon-ecr-credential-... |
Swift | UTF-8 | 783 | 3.25 | 3 | [] | no_license | //
// ContentView.swift
// LeetCode
//
// Created by Eason Qian on 2019/8/27.
// Copyright © 2019 Eason Qian. All rights reserved.
//
import SwiftUI
struct ContentView: View {
// let nums = addSum(1, 2) //twoSum(_num: [1, 8], target: 9)
var body: some View {
Text("Hello World")
// ... |
Shell | UTF-8 | 5,542 | 3.21875 | 3 | [] | no_license | #!/bin/bash
clear
USER=usertest
PASSWORD=passwordtest
IP=test_ip
HOSTNAME=test_hostname
PORT=test_port
COST=test_cost
STATE=IL
PROVIDER=1
CURRENCY=USD
STATUS=free
BILLING_CYCLE=Monthly
key=confident
function wrap() {
echo -n '\\\"'
echo -n "$1"
echo -n '\\\"'
}
function bind() {
echo -n "$(wrap $1)"
echo ... |
Java | UTF-8 | 299 | 1.945313 | 2 | [] | no_license | package screenCapture;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class capturescreen2 {
@Test
void display() {
WebDriver dr = new ChromeDriver();
dr.get("https://www.facebook.com");
}
} |
C++ | UTF-8 | 608 | 2.640625 | 3 | [] | no_license | /******************************************************************************
* Author: Nicholas Pelham
* Date : 5/30/2017
*****************************************************************************/
#ifndef PUMP_HPP
#define PUMP_HPP
#include "task.hpp"
#include "volume.hpp"
#include <wiringPi.h>
class Pump... |
Python | UTF-8 | 949 | 3.578125 | 4 | [] | no_license | # Uses python3
import sys
def optimal_sequence(n):
sequence = [(0, 'sum')]
for i in range(1, n + 1):
opt1 = (sequence[i - 1][0] + 1, 'sum')
opt2 = (float('inf'), 'none')
opt3 = (float('inf'), 'none')
if i % 2 == 0:
opt2 = (sequence[i // 2][0] + 1, 'two')
if ... |
Shell | UTF-8 | 267 | 3.28125 | 3 | [] | no_license | #!/usr/bin/env sh
DATE=$(date +'%m-%d-%Y')
PATH=notes/stream-notes/$DATE.md
/bin/cat > $PATH <<EOL
# $DATE
## The plan for the day
## What we actually worked on
## Notes and links from the stream
## Thoughts on how the stream went
EOL
echo "Enjoy your stream"
|
Java | UTF-8 | 8,813 | 1.875 | 2 | [
"MIT"
] | permissive | package com.health.anytime;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.Toast;
import android... |
Python | UTF-8 | 4,957 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | # -*- coding: utf-8 -*-
'''获取当前日期前后N天或N月的日期'''
from time import strftime, localtime, time
from datetime import timedelta, date, datetime
import calendar
year = strftime("%Y", localtime())
mon = strftime("%m", localtime())
day = strftime("%d", localtime())
hour = strftime("%H", localtime())
minute = strftime("%M", l... |
Markdown | UTF-8 | 1,171 | 3.125 | 3 | [] | no_license | # Social Proof Section - Frontend Mentor Challenges

## Welcome 👋
Thank you for checking my solution to [Social Proof Section](https://www.frontendmentor.io/challenges/social-proof-section-6e0qTv_bA) Frontend Mentor challeng... |
Markdown | UTF-8 | 1,349 | 4.1875 | 4 | [] | no_license | # 708. Insert into a Cyclic Sorted List
**Medium**
[Original Page](https://leetcode.com/problems/insert-into-a-cyclic-sorted-list/)
Given a node from a cyclic linked list which is sorted in ascending order, write a function to insert a value into the list such that it remains a cyclic sorted list. The given node can... |
C# | UTF-8 | 10,038 | 2.625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/*
Kane Testa - 910748
References
https://en.wikipedia.org/wiki/Diamond-square_algorithm#Description
https://www.youtube.com/watch?v=1HV8GbFnCik&t=699s
https://www.youtube.com/watch?v=iG0Lpp0SQ7U&t=38s
*/
public class DiamondSquare... |
JavaScript | UTF-8 | 4,953 | 3.09375 | 3 | [] | no_license | *********************** PARTE 1 *************************
// Criei a pasta projeto/ pasta scr e dentro da pasta criei um arquivo chamado servidor.js
const porta = 3003
const express = require('express')
const app = express()
app.get('/produtos', (req, res, next) =>{
res.send({ nome: 'Notebook', preco: 123.45}) ... |
C# | UTF-8 | 3,743 | 3.46875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
namespace Lab1_OOP
{
public class AstronomicalBody: ICoordinates<AstronomicalBody>, ICharacteristic<AstronomicalBody>
{
//fields
private s... |
C++ | UTF-8 | 2,888 | 2.640625 | 3 | [] | no_license | #ifndef NETWORK_H_INCLUDED
#define NETWORK_H_INCLUDED
#include <vector>
#include <list>
#include <string>
#include <map>
#include <iostream>
#include <stdio.h>
#include "com.h"
class Node
{
private:
int id;
int nbrVoiz;
int *pred; //matrice des prédécesseur
int * distmin; //ma... |
PHP | UTF-8 | 3,545 | 3.25 | 3 | [] | no_license | <?php
// Starts the user session
session_start();
// Header text for this page
$headerText = "<h1 class=\"display-1\">Product Inventory</h1>";
//Gets credentials and connects to db (also creates $results variable)
include "data-con.php";
// Binds the new data into the database if "add new" ... |
C# | UTF-8 | 1,185 | 2.671875 | 3 | [] | no_license | using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
namespace Robot.Tests
{
[TestFixture]
public class HeadTests
{
[Test]
public void SetUpHeadTest()
{
HeadServo yawServo = new HeadServo(0, 1, 90, -90);
HeadServo pitchServo = new HeadServo(90, 2, ... |
Java | UTF-8 | 855 | 2.203125 | 2 | [] | no_license | package db.mysql.provider;
import db.mysql.entity.UserFollowEntity;
import java.util.List;
public class UserFollowSyncProvider extends MysqlProviderBase {
/**
* 查询单个用户之间关系
* @param userFollowEntity 用户id
* @return 关系状况实体
*/
public UserFollowEntity queryState(UserFollowEntity userFollowEn... |
Java | UTF-8 | 1,640 | 2.921875 | 3 | [] | no_license | package apps.liamm.shiftlypersonal.helpers;
import android.util.Patterns;
import androidx.annotation.NonNull;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* Checks specific inputs from forms to check for the validity.
*
* Currently contains checks for both emails and passwords.
*/
public ... |
Ruby | UTF-8 | 222 | 2.71875 | 3 | [] | no_license | class Person
def name=(that_bois_name)
@name = that_bois_name
end
def name
@name
end
def job=(that_bois_job)
@job = that_bois_job
end
def job
@job
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.