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 |
|---|---|---|---|---|---|---|---|
SQL | UTF-8 | 1,215 | 3.015625 | 3 | [] | no_license | -- 用意されているコマンドに関しては大文字を使う
INSERT INTO gs_bm_table(company,brandname,items,comment,datetime)VALUES('サツドラ','wellnessnavi',ビタアルト,'低価格で高品質',sysdate())
INSERT INTO gs_bm_table(company,brandname,items,comment,datetime)VALUES('イオン','TOPVALUE',ヨーグルト,'安いけどおいしくない',sysdate())
INSERT INTO gs_bm_table(company,brandname,items,com... |
JavaScript | UTF-8 | 3,879 | 2.90625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-other-permissive"
] | permissive | const geometry = require('../geometry');
describe('geometry', () => {
describe('extendPointOnLine', () => {
it('returns a point distance away from the end point', () => {
const p1 = {x: 0, y: 0};
const p2 = {x: 8, y: 6};
expect(geometry.extendPointOnLine(p1, p2, 5)).toEqual({x: 12, y: 9});
... |
C++ | UTF-8 | 1,816 | 3.375 | 3 | [] | no_license | /*
* File: CrazyRandomSword.cpp
* Author: Vivian Nguyen <vsn17@my.fsu.edu>
*
* Created on January 29, 2019, 10:15 PM
*/
#include "CrazyRandomSword.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
using namespace std;
CrazyRandomSword::CrazyRandomSword() : Weapon("Crazy Random Sword", 0.0)
{
srand( t... |
Ruby | UTF-8 | 188 | 3.03125 | 3 | [] | no_license | N = gets.to_i
count = 0
(1..N).each do |num|
if num.odd?
ds = []
(1..num).each do |i|
ds << i if num % i == 0
end
count += 1 if ds.length == 8
end
end
puts count
|
JavaScript | UTF-8 | 1,164 | 2.640625 | 3 | [] | no_license |
const express = require("express");
const https = require("https");
const bodyParser = require("body-parser");
const ejs = require("ejs");
const app = express();
app.use( bodyParser.urlencoded({extended : true}));
app.set('view engine','ejs');
app.use(express.static("public"));
app.get("/",function(req,res){
res.... |
Java | IBM852 | 535 | 3.859375 | 4 | [] | no_license | import java.util.Scanner;
public class P04_LaMultiplication {
public static void main(String[] args) {
// ferme le lecteur
Scanner in = new Scanner(System.in);
// lit les nombres.
System.out.printf("Enter first number: ");
int num1 = in.nextInt();
System.out.printf("Enter second number: ... |
Java | UTF-8 | 825 | 2.03125 | 2 | [] | no_license | package taskmodels;
import com.example.nicol.joynus.RegisterActivity;
import dtomodels.userDTO.RegisterFormDTO;
public class RegisterUserPackage
{
private RegisterFormDTO formToSend;
private int responseCode;
private RegisterActivity sender;
public RegisterUserPackage()
{
}
public Reg... |
C++ | UTF-8 | 1,357 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <vector>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
int index = 0, begin = 0, end = nums.size();
index = (begin + end) / 2;
while (end > begin+1)
{
if (target > nums[end-1])
{
return end;
}
else ... |
PHP | UTF-8 | 21,956 | 2.640625 | 3 | [] | no_license | <?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Allow to access/update/delete job's informations from database
*
* @author Hermannovich <donfack.hermann@gmail.com>
*/
class Jobs_model extends CI_Model {
public function __construct()
{
parent::__construct();
}
... |
Java | UTF-8 | 4,435 | 2.53125 | 3 | [] | no_license | package it.polimi.deib.provaFinale2014.francesco1.corsini_gabriele.carassale.controller;
import it.polimi.deib.provaFinale2014.francesco1.corsini_gabriele.carassale.connection.ConnectionManager;
import it.polimi.deib.provaFinale2014.francesco1.corsini_gabriele.carassale.connection.FinishGame;
import it.polimi.deib.pro... |
JavaScript | UTF-8 | 4,056 | 3.765625 | 4 | [] | no_license |
/**
* Bài 1
* Khối 1: Input
* wage: lương theo ngày
* days: số ngày làm việc
*
* Khối 2: Các bước xử lý
* B1: tạo và gán giá trị cho lương theo ngày
* B2: tạo biến số ngày làm việc cho người dùng nhập vào
* B3: xây dựng công thức
* salary = wage*days
* b4: xuất giá trị salary
* Khối 3: Output
* salary: t... |
Ruby | UTF-8 | 446 | 2.78125 | 3 | [] | no_license | require 'active_support/all'
require_relative 'formatted_value'
class FormattedNumeric < FormattedValue
def initialize(value, format)
val = Float(value || 0)
format.color = format.positive_color if val > 0 && format.positive_color
format.color = format.negative_color if val < 0 && format.negative_color... |
JavaScript | UTF-8 | 849 | 2.546875 | 3 | [] | no_license | class DDl extends React.Component {
desert = [
{
value:1,
text :"Gulab Jamun"
},
{
value:2,
text :"Basundi"
},
{
value:3,
text :"Jalebi"
},
{
value:4,
text :"Ras M... |
C | UTF-8 | 4,963 | 3.203125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-mit-nagy",
"LicenseRef-scancode-other-permissive",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"MIT",
"GPL-1.0-or-later",
"OpenSSL",
"Apache-2.0"
] | permissive | #include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "test.h"
static char buffer[100];
static void checkStrftime(const char* format, const struct tm* tm,
const char* expected) {
size_t resultLength = strftime(buffer, sizeof(buffer), format, tm);
if (resultLength != 0 && strcmp(b... |
Java | UTF-8 | 2,357 | 2.65625 | 3 | [] | no_license | package interpretator.component.impl.expressionresolver;
import interpretator.component.ExpressionResolver;
import interpretator.exception.SyntaxInterpretatorException;
import interpretator.model.Expression;
import interpretator.model.expression.ArrayWithValuesDeclarationExpression;
import java.util.ArrayList;
import... |
Python | UTF-8 | 992 | 3.375 | 3 | [] | no_license | from sys import stdin
def solution(N):
counter = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
S, E = 1, N
unit = 1
def count_chiper(num, unit):
while num:
counter[num%10] += unit
num //= 10
while True:
# move start and end
while S%10 != 0 and S <= E:
... |
Python | UTF-8 | 786 | 2.84375 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python3
import base64
from Crypto.Cipher import AES
def find_iv():
begin = data.find(b'\xFF\xC0')
iv_len = 16
# skip marker and length
end = begin + 4 + iv_len
SOF0 = data[begin+4:end]
return SOF0
def find_key():
begin = data.find(b'\xFF\xDA')
key_len = 32
# skip mar... |
PHP | UTF-8 | 2,256 | 2.578125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
class ConfigAppRepository
{
/**
* ConfigApp string representation.
*
* @var string
*/
protected $configApp;
/**
* ConfigApp path.
*
* @var string
*/
protected $configAppPath;
/**
* Items.
*
* @var array
... |
TypeScript | UTF-8 | 603 | 2.796875 | 3 | [] | no_license |
class jQuery {
constructor(selector: string) {
const nodes = document.querySelectorAll(selector);
const result: any = {};
for (let i in nodes) {
if (nodes.hasOwnProperty(i)) {
this[i] = nodes[i];
}
}
this['length'] = nodes.len... |
Markdown | UTF-8 | 2,168 | 2.90625 | 3 | [] | no_license | # Algorithms And Data Structures
## Help
#### C++
To compile code use
```g++ -pipe -O2 -std=c++11 ./path/to/source.cpp -o ./path/to/dest.out```
#### Racket
Run with REPL
```racket <filename.rkt>```
## Contents
| Issue | Solution examples | Description |
| ----------- | ----------- | ----------- |
| Stress testing ... |
Java | UTF-8 | 3,595 | 2.875 | 3 | [] | no_license | package view;
import javafx.collections.FXCollections;
import javafx.collections.ObservableMap;
import javafx.fxml.FXMLLoader;
import javafx.scene.Node;
import javafx.scene.layout.Pane;
import java.io.IOException;
import controller.Main;
/**
* An utility class to load and store the .fxml nodes of the view.
*
* T... |
TypeScript | UTF-8 | 2,565 | 3.375 | 3 | [] | no_license |
export interface NaturalPerson {
name: string;
firstLastName: string;
secondLastName: string;
day: number;
month: number;
year: number;
}
export function calculate(person: NaturalPerson): string {
return new NameCode(person).toString() + new BirthdayCode(person).toString();
}
// matches any ocurrence o... |
C# | UTF-8 | 758 | 2.546875 | 3 | [] | no_license | using System.ComponentModel.DataAnnotations;
namespace TestingService.Models.AccountModels
{
public class RegisterModel
{
[RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Некорректный адрес")]
[Required]
public string Email { get; set; }
[... |
Ruby | UTF-8 | 808 | 3.1875 | 3 | [] | no_license | describe '#convert_between_temperature_units' do
it 'is defined and functions for simple values' do
expect(convert_between_temperature_units(0, 'C', 'K')).to be_within(0.0001).of(273.15)
expect(convert_between_temperature_units(1, 'C', 'F')).to be_within(0.0001).of(33.8)
end
end
describe '#melting_point_of... |
C++ | UTF-8 | 117 | 2.671875 | 3 | [] | no_license | #include <stdio.h>
int main() {
int c;
float f;
scanf("%d", &c);
f = 9.0 / 5.0 * c + 32;
printf("%.1f",f);
} |
C | UTF-8 | 274 | 2.671875 | 3 | [] | no_license | #include "client.h"
static int usage(void)
{
printf("usage: ./client [port]\n");
return (1);
}
int main(int argc, char **argv)
{
t_uint16 port;
if (argc < 2)
return (usage());
port = ft_atoi(argv[1]);
if (connect_server(port) == -1)
return (1);
return (0);
} |
Java | UTF-8 | 873 | 2.3125 | 2 | [] | permissive | package com.apptentive.android.sdk.partners.apptimize;
/**
* Data container class that mimics `ApptimizeTestInfo`.
* https://sdk.apptimize.com/ios/appledocs/appledoc-3.0.1/Protocols/ApptimizeTestInfo.html
*/
public class ApptentiveApptimizeTestInfo {
private final String testName;
private final String enrol... |
Markdown | UTF-8 | 5,054 | 2.671875 | 3 | [] | no_license | ---
description: "Recipe of Any-night-of-the-week Steak Salad"
title: "Recipe of Any-night-of-the-week Steak Salad"
slug: 457-recipe-of-any-night-of-the-week-steak-salad
date: 2020-11-11T22:20:35.338Z
image: https://img-global.cpcdn.com/recipes/3518ae412f60526d/751x532cq70/steak-salad-recipe-main-photo.jpg
thumbnail: h... |
Python | UTF-8 | 216 | 3 | 3 | [] | no_license | def classifica_idade(idade):
if idade<12:
print("crianca")
else:
if idade>=12 and x<18:
print('adolescente')
else:
if idade>=18:
print("adulto") |
SQL | UTF-8 | 415 | 2.84375 | 3 | [] | no_license | DROP TABLE IF EXISTS ACCOUNT;
CREATE TABLE ACCOUNT
(
ACCOUNT_NUMBER VARCHAR(100) PRIMARY KEY NOT NULL,
PIN INT NOT NULL,
OPEN_BALANCE INT NOT NULL,
OVERDRAFT INT NOT NULL
);
INSERT INTO ACCOUNT (ACCOUNT_NUMBER, PIN, OPEN_... |
Swift | UTF-8 | 838 | 3.28125 | 3 | [] | no_license | //
// MovieModel.swift
// MovieRentalApp
//
// Created by Akaash Dev on 25/03/20.
// Copyright © 2020 Sarath Chenthamarai. All rights reserved.
//
import Foundation
struct MovieModel: Equatable {
let id: Int
let name: String
let posterUrlString: String
let ratings: Double
let pricing: PricingM... |
Java | UTF-8 | 1,701 | 3.359375 | 3 | [] | no_license | package com.day5;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
public class Main {
public static void main(String[] args) {
BufferedReader reader;
int maxID=0;
ArrayList<Integer> seats = new ... |
C++ | UTF-8 | 1,426 | 2.75 | 3 | [] | no_license |
#include<opencv2/core/core.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc.hpp>
#include<opencv2/opencv.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
Mat image1;
image1 = imread("C:/Lena_color.png", IMREAD_GRAYSCALE);
if (image1.empty()) {
... |
SQL | UTF-8 | 2,088 | 3.609375 | 4 | [] | no_license | use lastmile_chwdb;
drop view if exists view_chwPerformanceIndicatorQA;
create view view_chwPerformanceIndicatorQA as
select
s1.chwID,
s1.yearReported,
s1.monthReported,
if( s1.iCCMNutritionNumberInitialSickChildVisitsTotal is null, 0, s1.iCCMNutritionNumberInitialSickCh... |
JavaScript | UTF-8 | 840 | 2.6875 | 3 | [] | no_license | Components.Background = (function() {
return React.createClass({
getDefaultProps: function() {
return {}
},
getInitialState: function() {
return {}
},
render: function () {
var classes = "background";
if(this.props.type) {
classes += " background--" + this.props.... |
PHP | UTF-8 | 2,375 | 4.0625 | 4 | [] | no_license | <?php
/*_ EXERCICE 5 (1 PT)
**_____
**Hand in: pool_php_d07/ex_05/Character.php
**pool_php_d07/ex_05/Warrior.php
**pool_php_d07/ex_05/Mage.php
**pool_php_d07/ex_05/IMovable.php
**Now our characters can talk, walk and attack in a customized way. Yet, they still cannot unsheathe their
**weapon! Being able to attack is n... |
PHP | UTF-8 | 4,591 | 2.515625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
defined('BASEPATH') or exit('No direct script access allowed');
class Auth extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->load->model('MainModel', 'main');
$this->load->model('AuthModel', 'auth');
$this->form_validation->set_error_de... |
PHP | UTF-8 | 7,210 | 2.671875 | 3 | [
"MIT"
] | permissive | <?php
namespace Fenos\Notifynder\Builder;
use Closure;
use ArrayAccess;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Fenos\Notifynder\Helpers\TypeChecker;
use Fenos\Notifynder\Models\NotificationCategory;
use Fenos\Notifynder\Exceptions\UnvalidNotificationException;
/**
* Class Builder.
*/
class ... |
Markdown | UTF-8 | 749 | 2.96875 | 3 | [
"Apache-2.0"
] | permissive | # Weatherworks
Weatherworks is an online platform that aims at weather detection by classifying sky images.
The multiclass application distinguishes the weather into rainy, cloudy, shiny and sunrise giving an opportunity of suitable precautions that could be undertaken by the user.
From the perspective of agriculture... |
Python | UTF-8 | 5,572 | 3.140625 | 3 | [] | no_license | import pygame
from const import TILE_SIZE
from Item import Item
class Block:
"""
Class qui initialise un block
"""
def __init__(self, world, chunk, name, x, y, image, hardness, have_hitbox):
"""
Constructor d'un block
:param world: World.World --> monde auquel appartient le bl... |
JavaScript | UTF-8 | 4,154 | 3.0625 | 3 | [] | no_license | $(function(){
// 封好请求1分页数据的接口
function getpostbypagination(currentPage,pageSize,category_id,status){
$.ajax({
type: "post",
url: "/getPostsByPagination",
data: {
currentPage,pageSize,category_id,status
},// 这里需要传递两个参数,一个是当前是第几页,每页显示多少条,
... |
Java | UTF-8 | 6,003 | 2.671875 | 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 Teamjava.Library;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import... |
Java | UTF-8 | 1,189 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | package openfoodfacts.github.scrachx.openfood.models;
import android.util.Log;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.ArrayList;
import java.util.List;
import openfoodfacts.github.scrachx.openfood.network.deserializers.IngredientsWrapperDeserializer;
/**
* JSON from URL... |
TypeScript | UTF-8 | 324 | 2.515625 | 3 | [] | no_license | import { hash } from 'bcrypt';
import { randomBytes } from 'crypto';
export const hashPassword = (password: string): Promise<string> =>
hash(password, 10);
export const generateRandomToken = (): Promise<string> =>
new Promise((resolve) =>
randomBytes(64, (err, buffer) => resolve(buffer.toString('base64'))),
... |
Java | UTF-8 | 1,156 | 2.390625 | 2 | [
"MIT"
] | permissive | package com.github.hisener.timetracker.model;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.time.Instant;
@Document
public class TimeLog {
@Id
pr... |
Java | WINDOWS-1252 | 1,046 | 3.171875 | 3 | [] | no_license | package ǰ;
import java.util.*;
public class Solution3 {
public List<Integer> preorderTraversal(TreeNode root) {
LinkedList<Integer> output = new LinkedList<>();
TreeNode node = root;
while(node!=null)
{
if(node.left == null)
{
output.add(node.... |
Python | UTF-8 | 2,491 | 2.765625 | 3 | [] | no_license | import imutils
import cv2
from keras.models import load_model
import numpy as np
from imutils.video import VideoStream
import time
def get_labels(dataset_name):
if dataset_name == 'fer2013':
return {0: 'angry', 1: 'disgust', 2: 'fear', 3: 'happy',
4: 'sad', 5: 'surprise', 6: 'neutral'}
... |
Markdown | UTF-8 | 14,666 | 2.609375 | 3 | [] | no_license | <link href="../../css/style.css" rel="stylesheet" type="text/css" />
# 《张中丞传后叙》
<span class="r">唐 · 韩愈
<div class="p">
元和二年四月十三日夜,愈与吴郡张籍阅家中旧书,得李翰所为《张巡传》。翰以文章自名,为此传颇详密。然尚恨有阙(quē)者:不为许远立传,又不载雷万春事首尾。
<span class="comment">
张中丞:即张巡(—年),中丞,张巡驻守睢阳时朝廷所加的官衔。
元和二年:公元八〇七年元和,唐宪宗李纯的年号(—年)。
张籍(约—约年):字文昌,吴郡(治所在今江苏省苏州市)人,唐代著名诗人,韩... |
C++ | UTF-8 | 441 | 2.8125 | 3 | [] | no_license | #ifndef Student_H
#define Student_H
#include <iostream>
#include <string>
#include "Course.h"
using namespace std;
const int MAXNUM = 20;
class Student
{
public:
Student(string nm, string no);
string GetStuName();
string GetStuNumber();
void AssignGrade(string co, int gr);
int GetGrade(string co);
float ... |
Java | UTF-8 | 6,911 | 2.1875 | 2 | [] | no_license | package at.wiencampus.se.apigateway.service;
import at.wiencampus.se.common.dto.*;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.common.header.internals.RecordHeader;
import org.springframework.beans.factory.annotation.Autowire... |
Java | UTF-8 | 751 | 2.84375 | 3 | [] | no_license | package NC;
public class NC24 {
public class ListNode {
int val;
ListNode next = null;
public ListNode(int i) {
this.val =i;
}
}
public ListNode deleteDuplicates (ListNode head) {
// write code here
ListNode dummy=new ListNode(0);
dummy.next=head... |
C++ | UTF-8 | 645 | 3.3125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | #pragma once
namespace Blah
{
enum class Endian
{
Little,
Big
};
template<class T>
inline void swap_endian(T* value)
{
for (int i = 0; i < sizeof(T) / 2; i++)
{
char* _ptr = (char*)&value;
char _temp = *(_ptr + i);
*(_ptr + i) = *(_ptr + sizeof(T) - i - 1);
*(_ptr + sizeof(T) - i - 1) = _tem... |
C# | UTF-8 | 1,605 | 3 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SyncShark.Engine.FileSystem.InMemory
{
public class DirectoryInfoInMemoryFactory
{
public DirectoryInfoInMemory GetInstance(string fullName)
{
... |
Python | UTF-8 | 3,141 | 2.546875 | 3 | [
"Python-2.0",
"CC-BY-4.0",
"MIT"
] | permissive | """test script for a few new invalid token catches"""
import sys
from test import support
from test.support import os_helper
from test.support import script_helper
import unittest
# TODO: RUSTPYTHON
@unittest.expectedFailure
class EOFTestCase(unittest.TestCase):
def test_EOF_single_quote(self):
expect = "... |
C# | UTF-8 | 514 | 2.734375 | 3 | [] | no_license | using System.ComponentModel;
namespace Converter_1_.VIewModel
{
public abstract class ViewModelBase:INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler ... |
Markdown | UTF-8 | 931 | 3.71875 | 4 | [
"MIT"
] | permissive | 938\. Range Sum of BST
Easy
Given the `root` node of a binary search tree and two integers `low` and `high`, return _the sum of values of all nodes with a value in the **inclusive** range_ `[low, high]`.
**Example 1:**

**Input:** root = [10,5,15,3,7,null... |
C# | UTF-8 | 2,618 | 2.8125 | 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.Threading.Tasks;
using System.Windows.Forms;
using BusinessAccessLayer;
namespace PresentationLayer
{
public partial class StudentRegistration : ... |
C++ | UTF-8 | 893 | 3.359375 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* mergeKLists(vector<ListNode*>& lists) {
vector<int> merge_vector;
for(int i = 0;i<lists.size();i++) {
... |
Python | UTF-8 | 1,193 | 3.078125 | 3 | [] | no_license | #!/usr/bin/env python
import sys
import requests
import os
import json
calais_url = 'https://api.thomsonreuters.com/permid/calais'
access_token = '<Access token>'
def get_tags_util(input_string, headers):
response = requests.post(calais_url, data=input_string, headers=headers, timeout=80)
# print ('status cod... |
TypeScript | UTF-8 | 478 | 2.6875 | 3 | [] | no_license | export class Produto {
id: string;
codigo: string;
nome: string;
precoUnitario: number;
imagemUrl: string;
quantidade: number;
constructor(id: string, codigo: string, nome: string, precoUnitario: number, imagemUrl: string, quantidade: number) {
this.id = id;
this.codigo = c... |
Ruby | UTF-8 | 458 | 2.546875 | 3 | [] | no_license | Three parts of testing
1. Arrange
can include:
-instantiating objects
vb: calc = Calculator.new('1,2')
-setting mocks and stubs
-populate databases with records to test against integration- tests
2. Act
where we launch the behavior we want to test, usually a method call
vb: result ... |
C | UTF-8 | 476 | 3.296875 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int obrnut(int x){
int suma=0,broj=x;
int digit,brojac=0,i;
//x=abs(x);
digit = x%10;
//suma=digit;
while(!(x<=0))
{
brojac++;
x = x/10;
}
for(i=brojac;i>0;i--){
suma+=(broj%10)*pow(10,i-1);
broj=broj/10;
}
return suma;
}
... |
JavaScript | UTF-8 | 4,370 | 2.890625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
var goal = 0;
var wins = 0;
var losses = 0;
var gems = [];
var score = 0;
var colors = ["green", "red", "blue", "yellow"];
var gemsContainer = $("#gems");
var goalContainer = $("#goal");
var scoreContainer = $("#total-score");
var statsContainer = $... |
C++ | UTF-8 | 593 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <vector>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using namespace std;
string garagem, *pgaragem;
int main() {
garagem = "palio";
*pgaragem = "0";
cout << "\nDigite o que esta em garagem: \n";
cout << garagem;
cout << "\nDigite o que est... |
Markdown | UTF-8 | 2,691 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | # Sample Trellis Application
[](https://travis-ci.org/trellis-ldp/trellis-sample-app)
This project provides a skeleton for a custom Trellis application. For a full, working
example, please examine the trellis-rosid-app directory in... |
C# | UTF-8 | 508 | 2.515625 | 3 | [] | no_license | using Calculator.Core;
using Microsoft.AspNetCore.Mvc;
namespace Api.Controllers
{
[ApiController]
[Route("[controller]")]
public class CalculatorController : ControllerBase
{
private readonly ICalculatorService _service;
public CalculatorController(ICalculatorService service)
... |
PHP | UTF-8 | 752 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
require __DIR__ . "/../../vendor/autoload.php";
/** @file
* Empty unit testing template/database version
* @cond
* Unit tests for the class
*/
class EmptyDBTest extends \PHPUnit_Extensions_Database_TestCase
{
/**
* @return PHPUnit_Extensions_Database_DB_IDatabaseConnection
*/
p... |
Java | UTF-8 | 2,994 | 2.453125 | 2 | [] | no_license | package com.hq.uitest;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import java.util.List;
/**
* Created by heqiang on 17/6/6.
*/
public class StringAdapt... |
Java | UTF-8 | 671 | 2.03125 | 2 | [] | no_license | package com.library.service;
import java.util.List;
import com.library.entity.*;
public interface LibraryService {
public List<Book> getResults(String keyword);
public void createBookLoan(String isbn, int card_id);
public int getLoans(int card_id);
public void addBorrower(Borrower br);
... |
Python | UTF-8 | 335 | 2.9375 | 3 | [] | no_license | def chazhao(a,b):
if len(a)!=len(b):
print('false')
else:
A=[ord(x) for x in a]
B=[ord(x) for x in b]
s1=set(A)
s2=set(B)
if len(s1|s2)!=len(s1):
print('false')
else:
print('true')
import re
a=input()
m=re.split(r'\"',a)
a=m[1]
b=m[... |
JavaScript | UTF-8 | 644 | 2.734375 | 3 | [] | no_license | $(function() {
function createColorArray(length) {
let colors = ["#54ca76", "#f5c452", "#f2637f", "#9261f3","#31a4e6","55cbcb"]
if (length <= colors.length) {
return colors.slice(0, length);
}
}
function createChart(chart_params) {
ret = new Chart(canvas.getContext("2d"), {
type: "dou... |
Go | UTF-8 | 3,505 | 2.96875 | 3 | [] | no_license | package cylon
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"log"
"net/http"
"net/url"
"github.com/gorilla/mux"
)
type Server struct {
ai AI
remoteRoot string
localRoot string
done chan bool
}
func NewServer(ai AI, remoteRoot string, localRoot string, done chan bool) *Server {
s := &Se... |
PHP | UTF-8 | 1,528 | 2.921875 | 3 | [] | no_license | <?php
/**
* Class file for AmazonEc2TypeDescribeRouteTablesResponseType
* @date 10/07/2012
*/
/**
* Class AmazonEc2TypeDescribeRouteTablesResponseType
* @date 10/07/2012
*/
class AmazonEc2TypeDescribeRouteTablesResponseType extends AmazonEc2WsdlClass
{
/**
* The requestId
* @var string
*/
public $requestI... |
Java | UTF-8 | 852 | 2.75 | 3 | [] | no_license | package tests.bo;
import bo.Agence;
import bo.ComptePayant;
import bo.Operation;
import java.io.IOException;
import java.sql.SQLException;
public class TestOperation {
public static void main(String[] args) throws SQLException, IOException, ClassNotFoundException {
Operation operation;
System.o... |
Java | UTF-8 | 890 | 3.125 | 3 | [
"MIT"
] | permissive | package md.tekwill.exercises.inputoutput;
public class Lanterns {
public static void main(String[] args) {
roofSpace();
roof();
light1();
roofSpace();
roof();
light2();
}
public static void roof(){
System.out.println (" ***** ");
System... |
C# | UTF-8 | 1,480 | 2.890625 | 3 | [] | no_license | using ISynergy.Framework.Automations.States.Base;
namespace ISynergy.Framework.Automations.States
{
/// <summary>
/// Numeric trigger based on an integer.
/// </summary>
public class IntegerState : BaseState<int>
{
/// <summary>
/// Default constructor.
/// </summary>
... |
Python | UTF-8 | 848 | 4.25 | 4 | [] | no_license | #직사각형 별찍기
#https://programmers.co.kr/learn/courses/30/lessons/12969?language=python3
#이 문제에는 표준 입력으로 두 개의 정수 n과 m이 주어집니다.
#별(*) 문자를 이용해 가로의 길이가 n, 세로의 길이가 m인 직사각형 형태를 출력해보세요.
#파이썬은 문자를 숫자로 곱하면 반복합니다.
#map(): 입력값 받는다. 반복 가능한 자료형에 대해서 함수를 각각 적용한 결과 (여기선 int 함수를 쓴 것)
#int함수? 그냥 input 값을 int로 받는 것
#strip(): 양쪽 공백 없애기(왼쪽 ... |
Markdown | UTF-8 | 4,534 | 3.015625 | 3 | [] | no_license | # Education Benefits Application Research with VCEs
## Goal and Research Questions
- Goal
- Get a more nuanced understanding of the current application experience process from "expert users"
- Learn what the relevance of data entered is and how it's used by VCEs
- Key research questions
- What are the most conf... |
Markdown | UTF-8 | 506 | 3.125 | 3 | [
"MIT"
] | permissive | # ohm-grammar-ecmascript
This directory contains Ohm grammars for various versions of the ECMAScript
spec. Currently, only the ES5 grammar is reasonably complete, but we are
working on ES6.
## Usage (NPM)
You can install these grammars as an NPM package:
```
npm install ohm-grammar-ecmascript
```
After installing,... |
Java | UTF-8 | 2,025 | 2.75 | 3 | [] | no_license | /*******************************************************************************
* Copyright 2018 Mountain Fog, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.... |
C++ | UTF-8 | 795 | 3.046875 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
struct Student{
char name[11];
char id[11];
int grade;
int flag;
}stu[100010];
bool cmp(Student a, Student b){
if(a.flag != b.flag) return a.flag > b.flag;
else return a.grade > b.grade;
}
int main(){
int n, g1, g2;
scanf("%d... |
Markdown | UTF-8 | 5,014 | 2.640625 | 3 | [] | no_license | # Oauth 2.0 Authorization Server 簡單範例說明
## Authorization Code Grant
+----------+ +----------+
| Resource | | User |
| Owner | | Server |
| | ... |
C++ | UTF-8 | 907 | 3.125 | 3 | [] | no_license | /**
* \file Employe.h
* \brief Classe de base abstraite Employe
* \author etudiant
* \version 0.1
* \date 2015-03-19
*/
#ifndef EMPLOYE_H_
#define EMPLOYE_H_
#include "Date.h"
#include "ContratException.h"
namespace labo10 {
/**
* \class Employe
* \brief Classe de base
*/
class Employe {
public:
Employe(co... |
C# | UTF-8 | 11,525 | 2.640625 | 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.Threading.Tasks;
using System.Windows.Forms;
using OpenTK;
using OpenTK.Graphics.OpenGL;
namespace Lab3Boytsov
{
public partial class Form1... |
Python | UTF-8 | 1,104 | 3.046875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
from solver import *
# import solver
table = [(0,1,6,8,1),
(4,0,3,4,2),
(2,5,0,2,9),
(5,7,4,0,7),
(2,1,6,3,0)]
state = [0,2,1]
# genePool = [0,1,2]
genePool=range(5)
def printTable():
for row in table:
print(row)
def getMSTDist(state):... |
C# | UTF-8 | 5,039 | 3.15625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Delegates2
{
class MessageEventArgs : EventArgs
{
public string Message { get; set; }
}
class Messenger
{
public Action<string> MessageAvailable; //this is ... |
C# | UTF-8 | 1,251 | 2.59375 | 3 | [
"MIT"
] | permissive | using Rail.Mvvm;
using Rail.Tracks;
using System;
using System.Diagnostics;
namespace Rail.TrackEditor.ViewModel
{
[DebuggerDisplay("{Id} {Name} {Value}")]
public class TrackNamedValueViewModel : BaseViewModel
{
private readonly TrackNamedValue namedValue;
public TrackNamedValueViewModel(... |
C++ | UTF-8 | 1,557 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Heap {
public:
void push(int number) {
m_data.insert(m_data.begin(), number);
heapify(0);
}
int pop() {
if (empty())
return -1;
int number = m_data[0];
m_data[0] = m_data[m_data.size()... |
Java | UTF-8 | 7,048 | 2.21875 | 2 | [] | no_license | package HealthTracker;
import com.jfoenix.controls.JFXToggleButton;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scen... |
Python | UTF-8 | 4,397 | 2.859375 | 3 | [] | no_license | print("-- Vigenère Cipher Decoder --")
ciphertext = input("Input the message to decode: ")
original = ciphertext
caps = [0] * len(ciphertext)
for i in range(len(ciphertext)):
if ord(ciphertext[i]) >= 65 and ord(ciphertext[i]) <= 90:
caps[i] = 1
# print(caps)
keylen = int(input("Input the length of the ke... |
Java | UTF-8 | 5,968 | 2.40625 | 2 | [] | no_license | package me.emersondantas.coursescounter.activity;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.V... |
Java | UTF-8 | 1,099 | 3.3125 | 3 | [] | no_license |
package org.mine.thread;
import java.io.IOException;
import java.io.PipedReader;
import java.io.PipedWriter;
/**
* PipedReader、PipedWriter、PipedInputStream、PipedOutputStream
* 主要用于线程间传输数据,传输介质为内存
*
*/
public class Piped {
public static void main(String[] args) throws IOException {
PipedWriter pipedWriter = ... |
Python | UTF-8 | 4,067 | 3.109375 | 3 | [] | no_license | import os
from scipy import signal
from scipy.io import wavfile
from scipy.fftpack import fft # fourier transform
import matplotlib.pyplot as plot
import numpy as np
def calc_ITD(sound):
samplerate, data = wavfile.read("./sounds/" + sound)
left_channel = data[:, 0] # get all rows in column 0 (left channel)
... |
Java | UTF-8 | 1,352 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package by.bsu.command.impl;
import by.bsu.command.Command;
import by.bsu.controller.JspPageName;
import by.bsu.exception.service.CarServiceException;
import by.bsu.exception.service.OrderServiceException;
import by.bsu.service.impl.CarServiceImpl;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.ht... |
Python | UTF-8 | 3,710 | 4.03125 | 4 | [
"MIT"
] | permissive | import numpy as np
class NeuralNetwork():
def __init__(self):
# Seed the random number generator, so it generates the same numbers
# every time the program runs.
np.random.seed(1)
# We model a 3 layer network, with 3 input connections and 1 output connection.
# We assign r... |
JavaScript | UTF-8 | 642 | 2.78125 | 3 | [] | no_license | var fs = require('fs');
var stream = fs.createWriteStream("render.ppm");
var image = []
var width = 255
var height = 255
for (var y = 0; y < height; y++) {
var row = []
for (var x = 0; x < width; x++) {
var pixel = []
pixel[0] = Math.round(y%255)
pixel[1] = Math.round(x%255)
pixel[2] = Math.round(255)
row... |
Java | UTF-8 | 18,127 | 2.265625 | 2 | [] | no_license | /*
Created by Petar Shomov <petar@sprettur.is> and contributors
Copyright (c) 2009 Síminn hf (http://www.siminn.is). 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://ww... |
Java | UTF-8 | 11,416 | 2.375 | 2 | [] | no_license |
package view;
import controller.CadastroViewController;
import javax.swing.JTextField;
public class CadastroView extends javax.swing.JFrame {
private final CadastroViewController controller;
public CadastroView() {
initComponents();
controller = new CadastroViewController(this);
}... |
Java | UTF-8 | 325 | 2.265625 | 2 | [] | no_license | package com.valtech.azubi.bankanwendung.model.core;
import com.valtech.azubi.bankanwendung.model.entity.Konto;
public class KontoGesperrtException extends Exception{
public KontoGesperrtException(Konto k) {
super("Konto mit der Kontonummer: "+k.getKontoNr()+" gesperrt! Keine Transaktionen möglich!");
... |
Java | UTF-8 | 4,726 | 2.125 | 2 | [] | no_license | package ent.ast;
import ent.types.*;
import polyglot.ast.*;
import polyglot.translate.*;
import polyglot.types.*;
import polyglot.util.*;
import polyglot.visit.*;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
public class ModeParamTypeNode_c extends TypeNode_c implements ModeParam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.