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 |
|---|---|---|---|---|---|---|---|
TypeScript | UTF-8 | 3,536 | 3.546875 | 4 | [] | no_license | 'use strict';
let microChipNumber = 0;
class AnimalShelter {
animals: Animal [] = [];
budget: number = 50;
adopters: string [] = [];
rescue(newAnimal: Animal) {
this.animals.push(newAnimal);
return this.animals.length;
}
heal() {
let healedAnimals: number = 0;
for (let i: number = 0; i < t... |
C++ | UTF-8 | 2,455 | 2.625 | 3 | [] | no_license | #include "bltpch.h"
#include "Font.h"
#include "BoltLib/Profiling/Profiling.h"
namespace Bolt
{
Font::Font(const FilePath& fontFile, float fontSize, int textureWidth, int textureHeight) : Texture2D(textureWidth, textureHeight, PixelFormat::R, { PixelWrap::Clamp, PixelFilter::Linear, PixelFilter::Linear, false }),
... |
Java | UTF-8 | 5,933 | 2.03125 | 2 | [] | no_license | package com.appsimples.mutti.interusp_android.Atualizar;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.v... |
Java | UTF-8 | 875 | 3.921875 | 4 | [] | no_license | package Lec20;
public class Max_Sub_Array_Sum {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] arr = { -2, -3, -1, -8, -13, -9 };
System.out.println(max_sum(arr));
System.out.println(max_sum1(arr));
}
// O(N^3)
public static int max_sum(int[] arr) {
int ans = Integer.... |
C | WINDOWS-1250 | 504 | 2.96875 | 3 | [] | no_license | #include<stdio.h>
int main(void){
int a,b;
int ans;
scanf("%d",&a);
scanf("%d",&b);
ans=(a-1)*(b-1);
printf("%d\n",ans);
return 0;
} ./Main.c: In function main:
./Main.c:6:5: warning: ignoring return value of scanf, declared with attribute warn_unused_result [-Wunused-result]
sc... |
Java | UTF-8 | 1,299 | 2.25 | 2 | [] | no_license | package com.stackroute.findmeclinic.bookingappointment.model;
import java.util.Date;
public class Notification {
private String notification_id;
private String doctorId;
private String patientId;
private String content;
private Date notifgenDate;
public String getDoctorId() {
return doctorId;
}
... |
Java | UTF-8 | 348 | 1.609375 | 2 | [] | no_license | package com.wipro.SpringBootDemoJul8;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBootDemoJul8Application {
public static void main(String[] args) {
SpringApplication.run(SpringBootDemoJul8Applica... |
Java | UTF-8 | 2,599 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | /**
* Copyright (C) 2018 Jeebiz (http://jeebiz.net).
* All Rights Reserved.
*/
package io.hiwepy.admin.authz.rbac0.utils;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.springframework.biz.utils.StringUtils;
import org.springframework.uti... |
Java | UTF-8 | 6,579 | 2.21875 | 2 | [
"MIT"
] | permissive | package domain;
public class CompanyBuilder {
private String buildertemplate;
private String buildershort_description;
private String builderindustry_category;
private String buildercik;
private String builderstock_exchange;
private String builderbusiness_address;
private int buildersic;
... |
JavaScript | UTF-8 | 1,776 | 2.875 | 3 | [
"MIT"
] | permissive | 'use strict';
const EventEmitter = require('events');
class CmdError extends Error {
constructor(msg) {
super();
this.errorMsg = msg;
}
}
// Mutex class to control read/write access to discord-distances/imgcache/
class Lock extends EventEmitter {
constructor(socket) {
... |
Java | UTF-8 | 2,294 | 3.515625 | 4 | [] | no_license | package model;
/**
* Created by danielchu on 12/30/16.
*/
import model.pieces.IPiece;
import model.pieces.PieceInfo;
import model.players.Team;
/**
* Interface for the model for a game of chess.
*/
public interface IChessGameModel {
/**
* Makes the piece move from its original location to the target locati... |
C | UTF-8 | 3,198 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
struct FT
{
char nonT,set[20];
};
int i,j;
typedef struct FT FIRST_FOLLOW_SET;
FIRST_FOLLOW_SET first[10],follow[10];
char Parser_Table[2][3][10];
char *strrev(char *str)
{
int i=strlen(str)-1,j=0;
char ch;
while(i>j)
{
ch=str[i];
str[i]=str[j];
str... |
Go | UTF-8 | 2,351 | 3.03125 | 3 | [
"MIT"
] | permissive | package gocfcrypt
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"io"
"io/ioutil"
"log"
"strings"
)
func Base64Decode(key []byte) []byte {
decoded, _ := base64.StdEncoding.DecodeString(strings.TrimSpace(string(key)))
return decoded
}
func ReadFile(filePath st... |
Java | UTF-8 | 1,319 | 2.15625 | 2 | [] | no_license | package vn.luvina.startup.security.services;
import java.util.Optional;
import org.springframework.http.HttpStatus;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNo... |
C# | UTF-8 | 463 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Text;
namespace TimecardRepository.Interfaces
{
/// <summary>
/// Enforces CRUD methods.
/// </summary>
/// <typeparam name="T"></typeparam>
public interface IDataRepository<T>
{
T Add(T inputObject);
List<T> Ge... |
Java | UTF-8 | 440 | 2.671875 | 3 | [] | no_license | import java.util.regex.Pattern;
public enum Lexeme {
VAR(Pattern.compile("^[a-z]+$")),
ASSIGN_OP(Pattern.compile("^=$")),
DIGIT(Pattern.compile("^0|[1-9][0-9]*")),
OP(Pattern.compile("^\\+|\\-|\\*|\\/$")),
WS(Pattern.compile("^\\s+"));
private Pattern pattern;
Lexeme(Pattern pa... |
Shell | UTF-8 | 1,132 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
BASEDIR="$(dirname $0)"
# paths are valid for mml7
# select images
#ls /data/inpainting/work/data/train | shuf | head -2000 | xargs -n1 -I{} cp {} /data/inpainting/mask_analysis/src
# generate masks
#"$BASEDIR/../gen_debug_mask_dataset.py" \
# "$BASEDIR/../../configs/debug_mask_gen.yaml" \
# "/dat... |
Java | UTF-8 | 375 | 1.6875 | 2 | [] | no_license | package edu.brown.cs.atari_vision.ale.burlap;
import burlap.mdp.core.oo.state.generic.GenericOOState;
import org.bytedeco.javacpp.opencv_core.*;
/**
* Created by MelRod on 3/18/16.
*/
public class BlankALEState extends GenericOOState {
public Mat screen;
public BlankALEState() {}
public BlankALESta... |
Java | UTF-8 | 40,699 | 1.578125 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2009 The Android Open Source Project
*
* 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 app... |
Java | UTF-8 | 1,774 | 2.484375 | 2 | [
"BSD-2-Clause",
"Apache-2.0"
] | permissive | package org.oddjob.schedules;
import org.junit.Test;
import java.text.ParseException;
import java.util.Calendar;
import java.util.TimeZone;
import org.oddjob.OjTestCase;
import org.oddjob.arooa.utils.DateHelper;
/**
*
*/
public class DateUtilsTest extends OjTestCase {
/*
* Test for Date star... |
Markdown | UTF-8 | 4,882 | 2.953125 | 3 | [] | no_license | ---
title: 获取键值对
weight: 4
---
## grib_get
> 获取键值对
使用`grib_get`从一个或多个文件中获取一个或多个key值,与`grib_ls`类似。
默认情况下,如果有错误发生(例如没有找到key),`grib_get`则会运行失败,返回非0退出值。
- 适合在脚本中获取 GRIB 消息的键值。
- 可以强制`grib_get`在出错时不会运行失败。
支持获取所有的 MARS key 和特定名称空间中的所有 key。可以添加其他 key 到默认集合。
浮点类型数据的输出支持 C 风格的格式化描述。
可以用于寻找某个经纬度坐标点的最近邻点,与`grib_ls`工作方式相同。... |
JavaScript | UTF-8 | 3,280 | 2.75 | 3 | [] | no_license | import Routes from '../routes';
import Ajax from '../ajax';
/**
* Class used to make all api's request
*/
class ApiRequest {
/**
* Get all items asynchronously. If something went wrong with the request, it returns null, else it returns array of items
*
* @returns {Array|null}
*/
GetAllIt... |
Python | UTF-8 | 136 | 3.90625 | 4 | [] | no_license | for i in range(1,10,1):
for j in range(2,10,1):
print("%d * %d = %3d"%(j,i,(i*j)), end= ' | ')
print("\n")
|
Python | UTF-8 | 586 | 3.15625 | 3 | [] | no_license | T=int(input())
res=[]
def check(s,t):
i,j=0,0
len1=len(s)
len2=len(t)
for i in range(0,len2):
if t[i]!=t[0]:
break
i=i if i>0 else 1
if i>len1:
return "No"
for j in range(i):
if s[j]!=t[0]:
return "No"
while j<len1:
while i<len2:
... |
Rust | UTF-8 | 7,981 | 2.765625 | 3 | [] | no_license | use crate::jsonrpc::Client;
use crate::{Coalition, Error};
use serde_json::Value;
pub struct MenuEntry {
client: Client,
path: Value,
}
pub struct GroupMenuEntry {
client: Client,
group_id: usize,
path: Value,
}
pub struct CoalitionMenuEntry {
client: Client,
coalition: Coalition,
pat... |
C | UTF-8 | 1,446 | 3.546875 | 4 | [
"GPL-1.0-or-later",
"GPL-2.0-only",
"MIT"
] | permissive | /*
* Copyright (c) 2002, Intel Corporation. All rights reserved.
* Created by: rolla.n.selbak REMOVE-THIS AT intel DOT com
* This file is licensed under the GPL license. For the full content
* of this license, see the COPYING file at the top level of this
* source tree.
* Test that pthread_create() creates... |
Java | UTF-8 | 534 | 2.625 | 3 | [] | no_license | package com.ledgerCo.dao;
import com.ledgerCo.models.Borrower;
import java.util.HashMap;
public class BorrowerDao implements Dao<Borrower> {
public HashMap<String, Borrower> borrowers = new HashMap<>();
@Override
public Borrower get(String name) {
return borrowers.getOrDefault(name, null);
}... |
JavaScript | UTF-8 | 1,786 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import io from 'socket.io-client';
import axios from 'axios';
import './Messages.css';
const socket = io.connect('http://localhost:4000')
export default class Messages extends Component {
constructor(props) {
super(props);
this.state= {
userI... |
Ruby | UTF-8 | 679 | 3.078125 | 3 | [] | no_license |
def pi
places = 1000
digitCt = 0
q_, r_, t_, k_, n_, l_ = 1, 0, 1, 1, 3, 3
dot = nil
loop do
if 4 * q_ + r_ - t_ < n_ * t_ then
digitCt += 1
if places > 0 && digitCt - 1 > places then
break
end
yield n_
if dot.nil? then
yield '.'
dot = '.'
end
... |
PHP | UTF-8 | 3,308 | 2.515625 | 3 | [] | no_license | <?php
namespace App\Controller;
use Cake\ORM\TableRegistry;
use App\Controller\AppController;
use App\Form\AddFighterForm;
use Cake\Event\Event;
use Cake\Auth\DefaultPasswordHasher;
/**
* Controller utilisateur
* Toutes les fonctions relatives aux joueurs
*/
class PlayersController extends AppController {
/**... |
Java | UTF-8 | 1,385 | 3.21875 | 3 | [] | no_license | package isu;
import java.awt.Image;
import java.util.*;
import javax.swing.ImageIcon;
public class DestWall {
private Image inputWall;
private ImageIcon wall;
private int x;
private int y;
private int wallSize = 40;
//Description: The constructor for the Destructible Wall class, it creates a new object with... |
Java | UTF-8 | 88 | 1.789063 | 2 | [] | no_license | package com.janani.lambda;
public interface Interface1 {
void method1(String s);
}
|
C++ | UTF-8 | 3,183 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /**
* This program tests serial Slightly Compressible solver with an
* acoustic wave in 2D duct case.
* A Gaussian pulse is used as the time dependent BC with max velocity
* equal to 6cm/s.
* This test takes about 770s.
*/
#include "mpi_scnsim.h"
#include "parameters.h"
#include "utilities.h"
extern template cla... |
Java | UTF-8 | 1,708 | 2.25 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright (c) 2020.
* Created by YoloSanta
* Created On 10/22/20, 1:23 AM
*/
package net.hcriots.hcfactions.bosses.eggs;
import cc.fyre.stark.util.ItemBuilder;
import net.hcriots.hcfactions.Hulu;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import java.u... |
C++ | UTF-8 | 1,390 | 3.109375 | 3 | [] | no_license | #include "geometry/Sphere.h"
bool Sphere::hit(const Ray& ray, double minDistance, double maxDistance, HitRecord& hitRecord) const
{
Vector3 sphereCenterToRayOrigin = ray.getOrigin() - this->center;
double a = ray.getDirection().lengthSquared();
double simplifiedB = ray.getDirection().dotProduct(sphereCenterToRayOri... |
Markdown | UTF-8 | 456 | 2.59375 | 3 | [
"MIT"
] | permissive | # 💻 Sobre o desafio
Neste desafio, coloquei em pratica o conceito de passagem de propriedades para componentes filhos, criação de interfaces separadas, etc.
Principais conceitos
- Passar propriedades e funções para componentes
- Componentização
- Compartilhamento de interfaces no typescript
Screenshot
;
}
|
SQL | UTF-8 | 2,987 | 4.40625 | 4 | [] | no_license | --Find all accounts and sales reps in the Midwest region.
SELECT r.name AS region,
s.name AS rep,
a.name AS account
FROM region AS r
JOIN sales_reps AS s ON s.region_id = r.id
JOIN accounts AS a ON a.sales_rep_id = s.id
WHERE r.name = 'Midwest'
ORDER BY a.name;
--Find all accounts and sales reps in the ... |
C++ | UTF-8 | 10,955 | 2.6875 | 3 | [] | no_license | //2020/08/27 TomokiHirayama
//Aug 28, 2020 Masahiro Furukawa modified
//
//this program is calcurating Inverse Kinematics(IK)
//and save angle data into .csv file
//
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <string>
#include "QueryPerformanceTimer.h"
#include "mbed_Serial_... |
Java | UTF-8 | 1,942 | 3.046875 | 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 programa.primeira.fase;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
im... |
Java | UTF-8 | 1,404 | 1.742188 | 2 | [] | no_license | package CurrentUser.Model;
public class CurrentUserBean {
public String areaname;
public String departmentname;
public String officename;
public String assetdaesang;
public String assetreceive;
public String noassetdaesang;
public String noassetreceive;
public String getOfficename() {
r... |
Markdown | UTF-8 | 1,112 | 2.9375 | 3 | [] | no_license | Ramayana
=============
**Introduction:**
Book about Ramayana ( One of the two great epics of Hinduism ) ascribed by Valmiki
The Ramayana consists of 24,000 verses in seven books (kāṇḍas) and 500 cantos (sargas)
Ramayana tells the story of Rama (an avatar of the Hindu supreme-god Vishnu), whose wife Sita is abduct... |
TypeScript | UTF-8 | 6,426 | 3.25 | 3 | [
"MIT"
] | permissive | import diff_match_patch, {
DIFF_DELETE,
DIFF_INSERT,
DIFF_EQUAL,
Diff,
} from 'diff-match-patch'
const clc = require('cli-color')
const SkippedLinesMarker = `\n---`
/**
* Compares code using Google's diff_match_patch and displays the results in the console.
* @param codeA
* @param codeB
* @param l... |
Java | UTF-8 | 1,941 | 2.296875 | 2 | [] | no_license | package com.brand.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.I... |
Java | UTF-8 | 1,446 | 3.40625 | 3 | [] | no_license | package com.company.lab10;
import java.util.concurrent.ThreadLocalRandom;
public class RaceCarRunnable extends Car implements Runnable{
private int passed;
private int distance;
private boolean isFinish;
public int getPassed(){
return passed;
}
public int getDistance(){
retur... |
Python | UTF-8 | 7,157 | 2.828125 | 3 | [] | no_license | from dronekit import connect, VehicleMode, LocationGlobal, LocationGlobalRelative
from pymavlink import mavutil # Needed for command message definitions
import time
import math
# Connect to the Vehicle
connection_string = '/dev/ttyAMA0'
print 'Connecting to vehicle on: %s' % connection_string
vehicle = connect(connect... |
C# | UTF-8 | 4,618 | 3.375 | 3 | [] | no_license | using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CustomListClassProject;
namespace CustomUnitTestProject1
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void Add_AddItemToEmptyList_ItemGoesToIndexZero()
{
//Arange
CustomLi... |
JavaScript | UTF-8 | 786 | 2.59375 | 3 | [] | no_license | function reducer(state = {
sales: [],
currentChart:
{ chart: 'retailSales', description: 'RETAIL SALES', color: 'blue' }
},action) {
switch (action.type) {
case "SET_SUMMARY":
return ({
...state,
summary: {
...action.payload
}
})
case "SET_TAGS":
ret... |
Shell | UTF-8 | 653 | 3.09375 | 3 | [] | no_license | #-------------------------------------------------------------
# bash aliases
#-------------------------------------------------------------
alias df='df -kTh'
alias lr='ll -R' # Recursive ls.
alias tree='tree -Csuh' # Nice alternative to 'recursive ls' ...
alias ..='cd ..'
# Pretty-print of some PATH... |
C# | UTF-8 | 6,986 | 2.6875 | 3 | [] | no_license | using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MonoTetris2;
namespace Game1
{
// TODO: Make this intantiate once and just change wha... |
Shell | UTF-8 | 870 | 2.515625 | 3 | [] | no_license | # $Id: PKGBUILD 35938 2009-04-18 11:42:35Z andrea $
# Maintainer: Jason Chu <jason@archlinux.org>
pkgname=pacbuild
pkgver=0.4
pkgrel=2
pkgdesc="A distributed build management system"
arch=(i586 i686 x86_64)
url="http://groups.google.com/group/pacbuild"
license=("GPL")
depends=('snarf' 'python-sqlobject' 'python-pysqli... |
JavaScript | UTF-8 | 1,443 | 3.1875 | 3 | [] | no_license | // We use testing features to run quick tests across our applications to make sure everything is working fine
// The framework we are using for this course is called Jest, and is designed by Facebook to work with React very well
// We are going to install Jest, but it is not the kind of thing that we need to import int... |
Python | UTF-8 | 422 | 2.546875 | 3 | [
"MIT"
] | permissive | import unittest
import api.photo2song as p2s
class TestPhoto2Song(unittest.TestCase):
def test_photo_to_song(self):
image_urls = [
"https://oxfordportal.blob.core.windows.net/vision/Thumbnail/1.jpg",
"https://oxfordportal.blob.core.windows.net/vision/Thumbnail/4.jpg"
]
... |
JavaScript | UTF-8 | 1,657 | 2.71875 | 3 | [] | no_license | import {QUESTION_ADD,QUESTION_DELETE,QUESTION_GETALL,QUESTION_GETALL_SUCCESS,QUESTION_GETALL_FAILURE,QUESTION_UPDATE} from '../actions/actionTypes'
const initialState = {
Questions : [ ],
loading : false
}
const reducer = (state = initialState, action) => {
switch(action.type){
case QUESTION_ADD:... |
Markdown | UTF-8 | 3,214 | 2.984375 | 3 | [] | no_license | # 93: Viết code như thể bạn phải hỗ trợ nó đến hết đời
Bạn có thể hỏi 97 người liệu lập trình viên nên biết gì và làm gì, và bạn sẽ nhận được 97 câu trả lời khác nhau. Điều này có thể vừa áp đảo vừa đáng sợ. Mọi lời khuyên đều tốt, mọi nguyên tắc đều hợp lý, và mọi câu chuyện đều hấp dẫn, nhưng bạn nên bắt đầu từ đâu?... |
Java | UTF-8 | 293 | 2.671875 | 3 | [] | no_license | package fanorona.Logic;
public class Player
{
// white or black
public long state;
public Player(long state)
{
this.state = state;
}
/**
* Copy constructor.
*/
public Player(Player p)
{
this.state = p.state;
}
} |
PHP | UTF-8 | 923 | 2.671875 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | <?php
namespace Illuminate\Mail\Transport;
use Swift_Mime_SimpleMessage;
use GuzzleHttp\ClientInterface;
class MailgunTransport extends Transport
{
/**
* Guzzle client instance.
*
* @var \GuzzleHttp\ClientInterface
*/
protected $client;
/**
* The Mailgun API key.
*
* @... |
Java | UTF-8 | 3,956 | 2.40625 | 2 | [] | no_license | package com.newlec.web;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet... |
C++ | UTF-8 | 843 | 3.203125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <memory>
#include "electronic_device.h"
int main() {
std::vector<std::unique_ptr<ElectronicDevice>> electronic_devices(4);
electronic_devices[0] = std::make_unique<TV>();
electronic_devices[1] = std::make_unique<Laptop>();
electronic_devices[2] = std::make... |
PHP | UTF-8 | 1,512 | 2.671875 | 3 | [] | no_license | <?php
/**
* Class file for XiFinancialsTypeGetIncomeStatementRangeResponse
* @date 08/07/2012
*/
/**
* Class XiFinancialsTypeGetIncomeStatementRangeResponse
* @date 08/07/2012
*/
class XiFinancialsTypeGetIncomeStatementRangeResponse extends XiFinancialsWsdlClass
{
/**
* The GetIncomeStatementRangeResult
* Me... |
Python | UTF-8 | 1,010 | 3.640625 | 4 | [] | no_license | import csv
def extraire(fichier):
"""Extrait d’un fichier texte annuaire avec du type prenom, tel la liste des prenoms et celle des numéros de telephone"""
f = open(fichier,'r')
prenom,tel = [],[] #initialisation des listes de prenoms et de numeros for ligne in f
for ligne in f:
p,n ... |
Java | UTF-8 | 1,861 | 2.546875 | 3 | [] | no_license | package cn.zjnktion.middleware.zson.serializer;
import cn.zjnktion.middleware.zson.Context;
import cn.zjnktion.middleware.zson.writer.ZsonWriter;
import java.io.IOException;
import java.util.Iterator;
import java.util.Map;
/**
* @author zjnktion
*/
public class MapSerializer implements ZsonSerializer {
public... |
C++ | UTF-8 | 491 | 2.546875 | 3 | [] | no_license | #ifndef TRLANGUAGE_H
#define TRLANGUAGE_H
#include <string>
#include <ostream>
#include "tnode.h"
#include "wordstructure.h"
class WordTree : public WordStructure {
private:
TNode m_Tree;
void add_word(TNode & node, const std::string & word, uint32_t pos);
public:
WordTree() : WordStructure() {}
... |
PHP | UTF-8 | 112 | 3.59375 | 4 | [] | no_license | <?php
function cube($num) {
return $num * $num * $num;
}
$cubeResult = cube(4);
echo $cubeResult; |
Markdown | UTF-8 | 2,400 | 2.9375 | 3 | [] | no_license | # 2월21일
### #2.8 express의 router
> index.js 파일을 app.js
>
> init.js 파일생성
>
> app.js 파일에서 post부분 삭제
- init.js에 어플리케이션 호출 시작
> app있는것을 init에 호출
>
> - export default app;
>
> > 누군가가 내파일을 불러올때(import) app object를 주겠다라는 의미.
- router에대한것. roots 감싸기
- ##### Module(모듈)
> 코드를 공유할 수 있다. 다른파일에서 코드를 가져다가 사용할... |
Java | UTF-8 | 1,090 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | package com.contaazul.challenge.mars.model;
import com.contaazul.challenge.mars.model.enums.OrientationEnum;
/**
*
* @author Wesklei Migliorini
*/
public class Robot {
private static final long serialVersionUID = -340875071855645838L;
private int xCoord;
private int yCoord;
private OrientationEnu... |
JavaScript | UTF-8 | 1,802 | 2.671875 | 3 | [
"MIT"
] | permissive | const express = require('express')
const router = express.Router()
const User = require('../models/user')
/** Route to get all users. */
// GET localhost:3000/users/
router.get('/', (req, res) => {
User.find().then((users) => {
return res.json({users})
})
.catch((err) => {
throw ... |
Java | UTF-8 | 1,132 | 2.09375 | 2 | [] | no_license | package io.starskyoio.dbstore.common.constants;
/**
* 定义数据存储服务URL地址
*/
public interface Paths {
/**
* 插入URL
*/
String INSERT_PATH = "/api/dbstore/add/v1";
/**
* 修改URL
*/
String UPDATE_PATH = "/api/dbstore/mod/v1";
/**
* 删除URL
*/
String DELETE_PATH = "/api/dbsto... |
Java | UTF-8 | 793 | 2.453125 | 2 | [] | no_license | package RoombaTest;
import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Scalar;
import org.opencv.imgproc.Imgproc;
public class ColorDetector {
public ColorDetector(){
}
public Mat detect_blue(Mat img){
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat im = img;// 入力画像の取得
Mat i... |
Python | UTF-8 | 4,094 | 2.890625 | 3 | [] | no_license | # cancer.npy를 가지고 tensorflow 코딩을 하시오
# test와 train 분리할 것
# dropout, get_variable, multi layer 등 배운 것을 모두 사용할 것
import tensorflow as tf
import numpy as np
import random
tf.set_random_seed(777)
x_data = np.load("./data/cancer_x.npy", allow_pickle = True)
y_data = np.load("./data/cancer_y.npy", allow_pickle = True)
# pr... |
TypeScript | UTF-8 | 1,380 | 3.171875 | 3 | [] | no_license |
class GameUtil{
/**基于矩形的碰撞检测*/
public static hitTest(obj1:egret.DisplayObject,obj2:egret.DisplayObject):boolean
{
var rect1:egret.Rectangle = obj1.getBounds();
var rect2:egret.Rectangle = obj2.getBounds();
rect1.x = obj1.x - obj1.width/2;
... |
Java | UTF-8 | 610 | 1.976563 | 2 | [] | no_license | package com.zconly.pianocourse.event;
import com.zconly.pianocourse.bean.CouponBean;
/**
* @Description: 选择优惠券
* @Author: dengbin
* @CreateDate: 2020/3/24 20:55
* @UpdateUser: dengbin
* @UpdateDate: 2020/3/24 20:55
* @UpdateRemark: 更新说明
*/
public class SelectCouponEvent {
private CouponBean couponBean;
... |
Python | UTF-8 | 3,231 | 2.546875 | 3 | [
"MIT"
] | permissive | # -*- coding: utf-8 -*-
# Copyright (c) 2016 Jeremy Low
# License: MIT
try:
from urlparse import *
except ImportError:
from cgi import parse_qsl, parse_qs
pass
try:
import oauth2 as Oauth
from twitter import Twitter
import twitter
import json
import sys
import os
from time impo... |
JavaScript | UTF-8 | 390 | 3 | 3 | [
"MIT"
] | permissive | function Scoreboard() {
this.initialize();
}
Scoreboard.prototype = new Text();
Scoreboard.prototype.initialize = function() {
this.color = "#fff";
this.font = "bold 24px Arial";
this.text = 'SCORE: 0';
this.x = 10;
this.y = 25;
this.name = 'scoreboard';
game.stage.addChild(this);
};
Scoreboard.prot... |
C# | UTF-8 | 1,224 | 3.15625 | 3 | [] | no_license | using Module_6_Task_6.Entities;
using System;
using System.Collections.Generic;
using System.Text;
namespace Module_6_Task_6.Attacks
{
public class SpearAttack : Entities.Attack
{
public SpearAttack(Log log) : base(log)
{
}
public override void Do(Unit target)
{
... |
TypeScript | UTF-8 | 969 | 2.953125 | 3 | [] | no_license | import moment from 'moment-timezone';
interface SEARCHKEYVALUE {
'$gte': string;
'$lte': string;
}
export interface UPDATEKEYVALUE {
update: SEARCHKEYVALUE;
}
export class VODateTime {
private timestamp: string;
public static of(timestamp: string): VODateTime {
return new VODateTime(timestamp);
}
p... |
Python | UTF-8 | 208 | 2.921875 | 3 | [] | no_license | def fun(a):
return(len(a))
x=map(fun,('apple','grapes','orange'))
print(x)
print(list(x))
def fun(a,b):
return a,-,+b
x=map(fun,('apple','grapes','banana'),('red','green','yellow'))
print(x)
print(list(x))
|
PHP | UTF-8 | 1,645 | 2.671875 | 3 | [] | no_license | <?php
require_once('./db.inc.php');
$con = mysqli_connect("$db_hostname","$db_username","$db_password", "$db_database");
//check connection
if (mysqli_connect_errno())
{
echo "Failed to connect MySQL: " . mysqli_connect_errno();
exit();
... |
Java | UTF-8 | 7,894 | 3.015625 | 3 | [] | no_license | package UI;
import line.Line;
import line.Timetable;
import line.comparator.LineNameComparator;
import line.comparator.VehicleDepartureComparator;
import line.vehicle.Vehicle;
import station.Station;
import ticket.Ticket;
import java.util.*;
/** Listázással kapcsolatos inteface metódusok */
public abstract class lis... |
C++ | UTF-8 | 192 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <thread>
int main() {
for (auto i=0; i<20; ++i)
{
if (i%3 == 0)
{
std::cout << i << std::endl;
}
}
} |
Swift | UTF-8 | 3,737 | 2.640625 | 3 | [
"MIT"
] | permissive | //
// PresentPhotoFromInternetViewController.swift
// Tinkoff Chat
//
// Created by Даниил on 11.05.17.
// Copyright © 2017 Даниил. All rights reserved.
//
import UIKit
protocol IPresentaionPhotoFormInternetDelegate {
func setNewImage(imageToShow: UIImage)
}
class PresentPhotoFromInternetViewController: UIVi... |
C++ | UTF-8 | 5,698 | 2.6875 | 3 | [
"MIT"
] | permissive | // ======================================================================
/*!
* \file NFmiPreProcessor.h
* \brief Interface of class NFmiPreProcessor
*/
// ======================================================================
#pragma once
#include "NFmiCommentStripper.h"
#include <map>
#include <string>
//! Undo... |
TypeScript | UTF-8 | 3,476 | 2.71875 | 3 | [] | no_license | import { createSlice } from "@reduxjs/toolkit";
import { CellRow, gameSelectors } from ".";
import { CellState } from "@/components/Cell";
import { GameSettings } from "@/components/SettingsPanel";
export const getRandomField = (settings: GameSettings) => {
const { columnCount, rowCount, fillingPercent } = settings;
... |
Java | UTF-8 | 1,480 | 2.296875 | 2 | [] | no_license | package com.tmt.kontroll.ui.page.configuration.impl.event;
import java.lang.annotation.Annotation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.tmt.kontroll.ui.page.configuration.PageSegmentConfigurator;
import com.tmt.kontroll.ui.page.con... |
Java | UTF-8 | 535 | 1.921875 | 2 | [] | no_license | package com.s.homepage.impl;
import com.s.entity.Positions;
import com.s.homepage.mapper.PositionsMapper;
import com.s.interfac.PositionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class PositionsServiceImpl implements Position... |
Java | UTF-8 | 10,084 | 2.109375 | 2 | [
"MIT"
] | permissive | /*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.creation;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import java.util.LinkedList;
import... |
Java | UTF-8 | 3,901 | 3.28125 | 3 | [] | no_license | package com.example.bms.Test;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.*;
import java.net.Socket;
import java.util.Scanner;
/**
* 用户聊天界面及数据处理器
* @create 2021-01-... |
Markdown | UTF-8 | 1,033 | 3.28125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "[Basic] K largest elements"
date: 2018-01-17 11:30:00 +0900
categories: Algorithm
---
Given an array, print k largest elements from the array. The output elements should be printed in decreasing order.
Input:
The first line of input contains an integer T denoting the number of test cases... |
Python | UTF-8 | 15,820 | 2.75 | 3 | [] | no_license | # computes trajectories on a Dedalus Chebyshev (z) / Fourier (x,y) grid
from mpi4py import MPI
import numpy as np
import math as ma
import matplotlib.pyplot as plt
import scipy
from scipy.fftpack import fft, dct
from decimal import Decimal
from scipy.stats import chi2
from scipy import signal
import matplotlib.patches... |
C++ | UTF-8 | 772 | 3.84375 | 4 | [
"MIT"
] | permissive | // Program demonstrating binary search in a sorted array (ascending order)
#include<iostream>
using namespace std;
int binarySearch(int A[],int i,int start,int end){
if(start > end)
return -1;
int mid = (start+end)/2;
int ans;
if(A[mid] == i){
ans = mid;
return ans;
}
if(A[mid] > i){
end = mid-1;
binary... |
Python | UTF-8 | 1,173 | 3.21875 | 3 | [] | no_license | a="101"
def countOnes(A):
empty = []
a = list(A)
if a.count("1") == len(a):
return empty
b = []
max_nums = a.count("1")
location = [1, 1]
for i in range(len(a)):
for j in range(i, len(a)):
b = a.copy()
if i == j:
b[i] = str(1 - int(... |
Markdown | UTF-8 | 5,810 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | # El pulpo de raza loba
## Índice
1. [Desarrollo en Entorno Cliente](#cliente)
- [Arquitectura de la aplicación y tecnologías utilizadas](#arquitectura)
- [Diagrama de componentes](#diagrama)
- [Clockify](#clockify)
2. [Despliegue de la Aplicación Web](#despliegue)
3. [Diseño de Interfaces](#interfaces)
... |
C++ | UTF-8 | 360 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class Sample
{
private:
static int x, y, z;
Sample()
{
cout<<"Constructor Called"<<endl;
}
public:
static void show()
{
Sample o1;
cout<<"X="<<x<<endl;
cout<<"Y="<<y<<endl;
cout<<"Z="<<z<<endl;
}
};
int Sample::x= 10;
int Sample::y= 20;
int Sample::... |
Go | UTF-8 | 665 | 3 | 3 | [] | no_license | package templates
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestFunctionCall(t *testing.T) {
template := `0x{{ printf "%02x" . }}`
assert.Equal(t, "0x41", renderTemplate(template, 65))
}
func TestPipeline(t *testing.T) {
template := `0x{{ . | printf "%02x" }}`
assert.Equal(t, "0x41", rend... |
Python | UTF-8 | 253 | 3.03125 | 3 | [] | no_license | # coding=utf-8
def comp(array1, array2):
if (not isinstance(array1, list)
or not isinstance(array2, list)):
return False
array1 = [x ** 2 for x in array1]
array1.sort()
array2.sort()
return array1 == array2
|
Python | UTF-8 | 708 | 3.265625 | 3 | [] | no_license | 1)
N = int(input())
data = list(input().split())
x,y = 1, 1
#L,R,U,D 순서
dx = [0, 0, -1, 1]
dy = [-1, 1, 0, 0]
a = ['L', 'R', 'U', 'D']
for plan in data:
for i in range(len(a)):
if plan == a[i]:
x += dx[i]
y += dy[i]
if x < 1:
x = 1
elif x > N:
x = N
elif y < 1:
y = 1... |
Python | UTF-8 | 1,620 | 2.515625 | 3 | [] | no_license | from flask import Flask, jsonify, request
from flask_cors import CORS, cross_origin
import pandas as pd
from sklearn.preprocessing import OneHotEncoder, StandardScaler
from sklearn.compose import make_column_transformer
import joblib
dataset_path = './50_Startups.csv'
model_path = './model.sav'
app = Flask(__name__)
... |
C++ | UTF-8 | 1,091 | 2.515625 | 3 | [] | no_license | #ifndef NETCONNECTDIALOG_H
#define NETCONNECTDIALOG_H
#include <QLabel>
#include <QDialog>
#include <QLineEdit>
#include <QEventLoop>
#include <QPushButton>
class inputDialog : public QDialog
{
Q_OBJECT
public:
inputDialog(QWidget *parent = nullptr);
~inputDialog();
static inputDialog* ... |
C | UTF-8 | 3,177 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | /*
* This file is part of udisks-glue.
*
* © 2011 Fernando Tarlá Cardoso Lemos
*
* Refer to the LICENSE file for licensing information.
*
*/
#include <assert.h>
#include <glib.h>
#include "property_cache.h"
#include "props.h"
typedef struct {
enum {
CACHE_VALUE_TYPE_BOOL,
CACHE_VALUE_TYPE_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.