language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
C++ | UTF-8 | 1,638 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <functional>
#include <vector>
#include <windows.h>
#include <string>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
auto novedades = [] (string editorial){
return [=] (string year, string month){
if(editorial=="panini"){
string web{"http:... |
C++ | UTF-8 | 8,207 | 2.609375 | 3 | [
"MIT"
] | permissive | #include"xygrayscale.h"
void Grayscale::dilate(QImage *image, QImage *newimage, int k[3][3], int width, int height, int depth)
{
int value=0;
int newvalue=0;
if (depth==32)
{
for (int ii=150; ii<width-1; ii++)
{
for (int jj=225; jj<height-1; jj++)
{
... |
Java | UTF-8 | 318 | 1.960938 | 2 | [] | no_license | package application.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import application.model.Utilisateur;
@Repository
public interface UserRepository extends JpaRepository<Utilisateur, String>{
Utilisateur findByUsername(String str);
} |
C | UTF-8 | 12,168 | 2.515625 | 3 | [
"MIT"
] | permissive | ///--------------------------------------------------------------------------------------
// SpriteFrame.c
//
// Portions are copyright: � 1991-94 Tony Myles, All rights reserved worldwide.
//
// Description: implementation of the frame stuff
///--------------------------------------------------------------------------... |
Java | UTF-8 | 3,811 | 2.765625 | 3 | [] | no_license | package com.revaturelabs.ask.tag;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotatio... |
Java | UTF-8 | 179 | 1.632813 | 2 | [] | no_license | package ru.otus.spring.homework_04.service;
public interface ExaminationService {
void askName();
void askQuestions();
void printResult();
void startTesting();
}
|
PHP | UTF-8 | 1,787 | 2.53125 | 3 | [] | no_license | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\State;
class StateController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function index()
{
$State = State::all();
return view('states/index', ['states... |
Markdown | UTF-8 | 4,088 | 2.84375 | 3 | [
"Unlicense"
] | permissive | # C Standards
* K&R C
* ANSI C (1990)
* C89/C90 standard (ISO/IEC 9899:1990)
* C99 standard (ISO/IEC 9899:1999)
* C11 standard (ISO/IEC 9899:2011)
* C17
C Implementations:
K&R, GCC, Clang, Intel C, Microsoft Visual C++, Pelles C, Watcom C
## K&R C
In 1978, Brian Kernighan and Dennis Ritchie published the first edi... |
Markdown | UTF-8 | 698 | 2.90625 | 3 | [] | no_license | # UnityFirstTry
My first try of using unity. I've made a simple garden game
## Features
There are some interactable objects
### Grounds

### WaterBarrel

Now, water barrel don't have any interactions: only water info in interaction menu
### Gr... |
Markdown | UTF-8 | 6,408 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | [](https://api.travis-ci.org/jonschwenk/rivgraph)
[](https://coveralls.io/github/jonschwenk/RivGraph?branch=master)

{
string[] forbbidenWords = words.Split(' ').ToArray();
for (int i = 0; i < forbbidenWords.Length; i++)
{
... |
C++ | UTF-8 | 1,589 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
int beforepat(char *p);
int pat(char *p, int a);
int afterpat(char *p, int a, int b);
int main(void)
{
int re, repeat;
char s[100];
scanf("%d",&repeat);
getchar();
for(re = 1; re <= repeat; re++)
{
scanf("%s",s);
getchar();
if(beforepat(s))
printf("YES\n")... |
Python | UTF-8 | 4,089 | 2.625 | 3 | [] | no_license | from io import BytesIO
import config
from aiohttp.client import ClientSession
from PIL import Image
from utils import run_in_executor
def get_frames(spritesheet, width: int, height: int, sheet_width: int):
return [
spritesheet.crop(
(i * width, 0, (i + 1) * width, height)).convert('RGBA')
... |
PHP | UTF-8 | 4,938 | 2.515625 | 3 | [
"BSD-3-Clause",
"CC-BY-3.0"
] | permissive | <?php
/**
* This file is part of SilverWare.
*
* PHP version >=5.6.0
*
* For full copyright and license information, please view the
* LICENSE.md file that was distributed with this source code.
*
* @package SilverWare\Extensions\Style
* @author Colin Tucker <colin@praxis.net.au>
* @copyright 2017 Praxis Int... |
Python | UTF-8 | 342 | 4.1875 | 4 | [] | no_license | # factorial of N
# get input N from user
N=int(input())
# define factorial function
def factorial():
# initialize fact is equal to one
fact = 1
# for loop range from 1 to N+1
for i in range(1,N+1):
fact = fact*i
return fact
# call the factorial function and store it in output
output=factorial()
# print outpu... |
PHP | UTF-8 | 829 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* This file is part of PHP-CFG, a Control flow graph implementation for PHP
*
* @copyright 2015 Anthony Ferrara. All rights reserved
* @license MIT See LICENSE at the root of the project for more info
*/
namespace PHPCfg\Op\Expr;
use PHPCfg\Func;
use PHPCfg\Op\CallableOp;
use... |
Java | UTF-8 | 384 | 1.789063 | 2 | [] | no_license | package com.oocl;
import org.junit.Assert;
import org.junit.Test;
import static org.junit.Assert.*;
public class RandomSecretNumberGeneratorTest {
@Test
public void should_return_random_number() {
RandomSecretNumberGenerator randomSecretNumberGenerator = new RandomSecretNumberGenerator();
As... |
Go | UTF-8 | 236 | 3 | 3 | [] | no_license | package fizzbuzz
import "strconv"
func runFizzBuzz(i int) string {
switch true {
case i%3 == 0 && i%5 == 0:
return "fizzbuzz"
case i%3 == 0:
return "fizz"
case i%5 == 0:
return "buzz"
default:
return strconv.Itoa(i)
}
}
|
PHP | UTF-8 | 5,821 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
use Carbon\Carbon;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Http\Response;
use Tests\TestCase;
/**
* Todo
* Class FilterGraphsTest
*/
class FilterGraphsTest extends FiltersTest
{
use DatabaseTransactions;
/**
* @test
* @return void
*/
public function ... |
Java | UTF-8 | 488 | 2.6875 | 3 | [] | no_license | package com.example.tony.asansol;
public class Words {
int mDescrption,mHeading;
int mImage;
Words(int mHeading,int mDescrption,int mImage)
{
this.mHeading = mHeading;
this.mDescrption = mDescrption;
this.mImage = mImage;
}
public int getmHeading() {
... |
Markdown | UTF-8 | 9,457 | 2.78125 | 3 | [
"MIT"
] | permissive | # Project: Investigate a Dataset (FBI Gun Data)
The purpose of this project is to explore the trends of U.S gun purchases with census population data.<br>
- <a href="https://github.com/m-lotfi-c/Udacity_project02_Investigate_a_Dataset_-FBI_Gun_Data-">[You can find this project repository in my my github repository]</a... |
C# | UTF-8 | 346 | 2.734375 | 3 | [] | no_license | abstract class Person
{
public string Name {get; set}
public Gender Gender {get; set;}
public DateTime Birthday {get; set;}
}
public class Teacher : Person
{
public int Id {get; set;}
...
}
public class Student : Person
{
public int Id {get... |
Markdown | UTF-8 | 5,924 | 3.25 | 3 | [] | no_license | 一五三
正当他自我悔恨的当儿,忽然听得“吱”的一声,一只大山鼠,由他身边的一道石缝中跳了出来,它口中衔着一小枝山果,飞快地跑了。
瞿涛朝山鼠跑出的地方望去,果然看见有一棵红色的小果树,生长在乱石缝中。
那是一棵不过尺许高矮的小树,树上有七八个小红果子,生在仅有的一枝枝丫之上。
那小树身上,流着白色的浆液,想必是刚才山鼠采折之后,才流出来的。
他当即伸手入内,把树上仅有的小枝折了下来。
令人奇怪的是,当他折下最后的一枝后,那棵小树竟整个倒了下去,顷刻间,枝抽叶卷,成了枯萎的一团。
瞿涛却没有更多的时间,再去察看这棵树了。
他匆匆拿着这枝小红果子,翻上了岩坡。
... |
PHP | UTF-8 | 696 | 2.59375 | 3 | [] | no_license | <?php
namespace Stafleu\Classes;
class BitCoinWebserviceClient extends JSONRPCClient
{
/**
* Constructor. Basically gathers and uses the default values to insert into
* the parent's constructor
*/
public function __construct($location = null, array $options = array())
{
$options = ar... |
Java | UTF-8 | 1,335 | 2.390625 | 2 | [] | no_license | package rimp.rild.com.android.remotecontrolexample;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListene... |
Java | UTF-8 | 275 | 1.757813 | 2 | [
"MIT"
] | permissive | package warehouse.products;
import lombok.Value;
import warehouse.PaletteLabel;
import warehouse.locations.Location;
/**
* Created by michal on 13.07.2016.
*/
@Value
public class Store {
private final PaletteLabel paletteLabel;
private final Location location;
}
|
Python | UTF-8 | 1,276 | 4.21875 | 4 | [
"Apache-2.0"
] | permissive | # coding=utf-8
'''
re模块中的findall 方法
上面的 match 和 search 方法都是一次匹配,只要找到了一个匹配的结果就返回。然而,在大多数时候,我们需要搜索整个字符串,获得所有匹配的结果。
findall 方法的使用形式如下:
findall(string[, pos[, endpos]])
其中,string 是待匹配的字符串,pos 和 endpos 是可选参数,指定字符串的起始和终点位置,默认值分别是 0 和 len (字符串长度)。
findall 以列表形式返回全部能匹配的子串,如果没有匹配,则返回一个空列表。
例子1:
例子2:
'''
import re
# 例子1:
patter... |
Swift | UTF-8 | 2,174 | 2.578125 | 3 | [] | no_license | //
// ResultViewController.swift
// Rainer
//
// Created by Sivaramsingh on 09/06/18.
// Copyright © 2018 Self. All rights reserved.
//
import UIKit
class ResultViewController: UIViewController {
@IBOutlet weak var txtResultnews: UITextView!
@IBOutlet weak var imgView: UIImageView!
var strInfo : Stri... |
JavaScript | UTF-8 | 1,776 | 3.4375 | 3 | [] | no_license | var friends = require("../data/friends");
module.exports = function(app) {
// when user visits localhost:PORT/api/friendsData... they get a JSON of the friends in the database
app.get("/api/friendsData", function(req, res) {
res.json(friends);
});
app.post("/api/friendsData", function(req, res) {
var... |
Markdown | UTF-8 | 1,852 | 2.65625 | 3 | [] | no_license | # Predicting possible accidents from videos.
## Introduction.
Conceptual foundation of the model: [the prednet paper](https://arxiv.org/pdf/1605.08104v4.pdf)
The repository of prednet source code: [https://github.com/coxlab/prednet.git](https://github.com/coxlab/prednet.git).
Some packages you might need to install... |
Java | UTF-8 | 2,924 | 2.375 | 2 | [] | no_license | package com.boots.controller;
import com.boots.entity.CarServices;
import com.boots.entity.Reservation;
import com.boots.entity.User;
import com.boots.service.ReservationService;
import com.boots.service.ReservationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.s... |
C# | UTF-8 | 1,100 | 2.984375 | 3 | [
"MIT"
] | permissive | using Microsoft.VisualStudio.TestTools.UnitTesting;
using Shouldly;
namespace Stefurishin.Primitives.Text.Tests
{
[TestClass]
public sealed class InternedStringTests
{
[TestMethod]
public void Test()
{
var c = Concat("ab", "c");
var d = Concat("a", "bc");
... |
C | UTF-8 | 23,225 | 2.921875 | 3 | [] | no_license | #ifndef __P1__H__//prevent overlap header file
#define __P1__H__//prevent overlap header file
#define INPUT_LIMIT 100//Input's limit size
#define INPUT_SIZE 20//Tempotary input's size
#define BUCKET_SIZE 20//bucket's size
#define LINE_SIZE 100//assem's line size
#define ALPHABET_SIZE 26;//the counts of alphabet
typedef... |
Markdown | UTF-8 | 884 | 3.90625 | 4 | [] | no_license | **See [CS50 style guide](https://manual.cs50.net/style/#structures) for official syntax recommendations for structs.**
**If you're curious about how typedef works--**
Typedef is just a way to use a different keyword synonymous with a given type. For example, we could do the following:
```
typedef int km_per_hour;
k... |
Markdown | UTF-8 | 1,749 | 3.015625 | 3 | [] | no_license | # etherclust
This repository implements address clustering heuristics for Ethereum with Python 3.
The following is an illustration of addresses clustered in the [Bionic token](https://etherscan.io/token/0xef51c9377feb29856e61625caf9390bd0b67ea18) network:
 array 'A' of integers. (S)he has written the following C++ function to achieve this goal. Assume that when the function is called from 'main', the input parameters passed are: an array 'A' of N (> 0) integers sorted in increasing order,... |
C++ | UTF-8 | 3,561 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <vector>
#include <array>
#include <list>
#include <set>
#include <cstdint>
#include <algorithm>
using namespace std;
using hashType = vector<uint8_t>;
const auto HASH_LENGTH_G(256);
uint8_t index(uint64_t pos)
{
return pos % HASH_LENGTH_G;
}
void reverse(hashType& lis... |
TypeScript | UTF-8 | 2,001 | 2.953125 | 3 | [] | no_license | import { IPagination } from '../interfaces/pagination.interface';
export class PaginationHandler {
// #region Properties (4)
private ITEMS_PER_PAGE = 5;
private MAX_PAGES = 5;
private pConfig: IPagination;
public pages: number[] = [];
// #endregion Properties (4)
// #region Constructors... |
Markdown | UTF-8 | 2,935 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | ---
title: github api 사용방법
date: 2017-03-02 11:18:05
categories:
- tech
tags:
- github
- archives-2017
url : /2017/03/02/github-api/
featuredImage: /images/github-api/github.png
images :
- /images/github-api/github.png
---
github 에서는 레파지토리의 전반적인 상황에 대해 다양한 API를 제공해주고 있다. 이번에는 그 API를 사용하는 방법에 대해 알아보고자 한다.
## Pe... |
C# | UTF-8 | 757 | 2.9375 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using JetBrains.Annotations;
namespace System.Linq
{
partial class LinqExt
{
/// <summary>
/// (Opinionated)
/// Create a sequence from a single element. Will not throw for <see langword="null"/> values.
/// </summary>
/// <type... |
Python | UTF-8 | 3,267 | 2.75 | 3 | [] | no_license | #!/usr/bin/env python
import shutil, os, fnmatch, sys
print """
__, _ __ _
( / ( / )//
`. ,_ __, _ /< /--'// , , _,
(___)_/|_)_(_/(_/ (_/ |_/ (/_(_/_(_)_
/| /|
(/ ... |
Java | UTF-8 | 7,938 | 2.015625 | 2 | [] | no_license | package com.logiware.bc;
import java.io.File;
import java.io.IOException;
import java.util.List;
import com.gp.cong.common.CommonConstants;
import com.gp.cong.common.CommonUtils;
import com.gp.cong.logisoft.ExcelGenerator.ExportGLMappingToExcel;
import com.gp.cong.logisoft.bc.accounting.GLMappingConstant;
import com.... |
Python | UTF-8 | 1,147 | 4.53125 | 5 | [] | no_license | """
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
The replacement must be in-place, do not allocate extra memory.
Here are som... |
JavaScript | UTF-8 | 2,695 | 2.5625 | 3 | [] | no_license |
import data from "../../data"
const INITIAL_STATE = {
ListCards: [],
boardSize: 10,
loadingsize: true,
tries: 0,
score: 0,
testimage: [],
}
const gameControle = (state = INITIAL_STATE, action) => {
switch (action.type) {
case 'SET_CURRENT_CARD':
return {
... |
Markdown | UTF-8 | 3,790 | 3.296875 | 3 | [
"Artistic-2.0"
] | permissive | ---
layout: post
Title: Sometimes Nothing is a Good Default
Author: Chris Prather
Date: 2009-07-09 12:34:20
---
# Sometimes Nothing is a Good Default
So I know this has come up before but I can't see where I've mentioned it and stevan just asked me to blog about it. One of the frequently requested features in Moose ... |
Java | UTF-8 | 2,914 | 3.078125 | 3 | [] | no_license | package com.learn.a;
import org.junit.Test;
import java.util.Arrays;
import java.util.Date;
/**
* @author admin
* @create 2020/10/13
*/
public class HelloTest {
public static void main(String[] args) {
System.out.println("hello");
StringBuilder stringBuilder = new StringBuilder("egd");
... |
C++ | UTF-8 | 930 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <unordered_map>
#include <algorithm>
#include <bits/shared_ptr.h>
using namespace std;
/**
* 确定两个字符串(字母构成)的所含字母集完全相同
* 使用hash表查找, 时间复杂度O(1), 空间复杂度 O(n)
*/
class Solution {
public:
bool isAnagram(string s, string t) {
if (s.length() != t.length()) return false;
uno... |
JavaScript | UTF-8 | 1,992 | 2.734375 | 3 | [] | no_license | import React, { Component } from 'react';
import styled from 'styled-components';
import { HourHand, MinuteHand, SecondHand } from './ClockHands';
import { setTitle } from '../../services/title';
const StyledClock = styled.svg`
width: 250px;
height: 250px;
fill: #ededed;
stroke: black;
stroke-width: 1;
str... |
Markdown | UTF-8 | 1,832 | 2.90625 | 3 | [] | no_license | ---
title: Intel Compute Card
date: 2017-01-14 12:46:24
categories:
- Personal
tags:
- tech
- mobile
---
Intel announced their Compute Card at this year's CES as a better-thought-out version of their existing Compute Stick. [AnandTech](http://www.anandtech.com/show/11019/intel-compute-card-a-universal-compute-formfa... |
C++ | UTF-8 | 416 | 2.96875 | 3 | [] | no_license | #pragma once
#include <string>
#include <cstdint>
#include <memory>
using namespace std;
class Bitmap
{
private:
int width{ 0 };
int height{ 0 };
unique_ptr<uint8_t[]> pixels{ nullptr };
public:
Bitmap(int width, int height);
bool write(string fileName);
void setPixel(int x, int y, uint8_t red, uint8_t green, ... |
Java | UTF-8 | 1,395 | 2.1875 | 2 | [] | no_license | package e7;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.output.FileO... |
Python | UTF-8 | 2,474 | 2.640625 | 3 | [] | no_license | import base64
import os
import random
import set2
def test_challenge9():
assert set2.pkcs7_pad(b"YELLOW SUBMARINE", 20) == b"YELLOW SUBMARINE\x04\x04\x04\x04"
for i in range(100):
bytestring = os.urandom(i)
assert bytestring == set2.pkcs7_unpad(set2.pkcs7_pad(bytestring, 16), 16)
def test_chal... |
C | UTF-8 | 10,147 | 2.90625 | 3 | [] | no_license | #include "evaluator.h"
void printIds(ids* ids_){
int i;
for(i=0; i<ids_->size; i++){
printf("%s ", ids_->arg_[i]);
}
printf("\n");
}
void printValeurs(valeurs* valeurs_){
int i;
for(i=0; i<valeurs_->size; i++){
printf("%d ", valeurs_->v[i]);
}
printf("\n");
}
ids* args_to_ids(arg arg_){
arg p = arg_;
i... |
Java | GB18030 | 4,522 | 2.28125 | 2 | [] | no_license | package com.zephyr.studentsafe.impl;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Timer;
import java.util.TimerTask;
import org.apache.log4j.Logg... |
C# | UTF-8 | 517 | 3.625 | 4 | [] | no_license | using System;
namespace Interfaces
{
class Triangle: IShape, IShapeDisplay
{
public string Color { get; set; } = "Red";
public string Name { get; } = "Triangle";
public double Width { get; set; } = 4;
public double Height { get; set; } = 4;
public double GetArea()
... |
Java | UTF-8 | 2,106 | 1.96875 | 2 | [
"Apache-2.0"
] | permissive | package com.flexdms.flexims.urlctrl;
import java.io.IOException;
import java.util.List;
import java.util.regex.Pattern;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
impo... |
Markdown | UTF-8 | 2,407 | 3.078125 | 3 | [] | no_license | `oscscheduler` works by reading a schedule file written in json. This file specifies a start time and end time for the show which will be run each day.
The show itself is a series of osc actions that will be run in a loop until then end time.
'Usage'
```javascript
var ShowScheduler = require("oscscheduler");
//Load... |
Ruby | UTF-8 | 2,119 | 2.609375 | 3 | [] | no_license | class Point < ActiveRecord::Base
belongs_to :user
# attr_accessible :name, :latitude, :longitude, :privacy_flag
scope :ordered, -> { order(:name) }
scope :published, -> { where(:privacy_flag => true) }
def self.forecast_cache_key(point)
"Forecast:#{point.latitude}:#{point.longitude}"
end
def self.... |
Java | UTF-8 | 420 | 2.6875 | 3 | [] | no_license | package in.vamsoft.bank;
public class OuterClass {
public void show() {
System.out.println("OuterClass.show()");
}
class InnerClass{
OuterClass out = new OuterClass();
public void innerShow() {
out.show();
System.out.println("OuterClass.InnerClass.innerShow()");
}
}
p... |
Java | UTF-8 | 4,265 | 2.125 | 2 | [] | no_license | package com.booking.common.service.impl;
import com.booking.common.resp.Page;
import com.booking.common.resp.PageInterceptor;
import com.booking.common.entity.ProductSpecRelEntity;
import com.booking.common.mapper.ProductSpecRelMapper;
import com.booking.common.service.IProductSpecRelService;
import org.slf4j.Logger;
... |
Markdown | UTF-8 | 51,579 | 2.515625 | 3 | [] | no_license | <!--
.. title: Ubuntu MATE June 2017 supporters
.. slug: ubuntu-mate-june-2017-supporters
.. date: 2017-07-12 13:00:00 UTC
.. tags: Ubuntu,MATE,community,donate
.. link:
.. description: Community members who supported Ubuntu MATE this month.
.. type: text
.. author: Martin Wimpress
-->
Many thanks to everyone who inve... |
Python | UTF-8 | 216 | 2.9375 | 3 | [] | no_license | #!/usr/bin/env python3
# lesson-00.py - print hello world
#
# Learn:
# shebang line
# single-line comments
# string literal
# print statement
# function and function call
print('Hello, world.')
|
Shell | UTF-8 | 410 | 3.53125 | 4 | [
"MIT"
] | permissive | #!/bin/bash
#
# Convert image file to gif using imagemagick
#
# usage:
# to_gif image_file [gif_file]
#
# yaswant.pradhan
# -----------------------------------------------------------------------------
[[ $# -lt 1 ]] && echo "usage: ${0##*/} image_file [gif_file]" && exit
[[ $# -lt 2 ]] && giffile="${1%.*}.gif" || g... |
PHP | UTF-8 | 2,895 | 2.796875 | 3 | [] | no_license | <?php
require("Compte.class.php");
class InitPaiement
{
//Déclaration des attributs
private $message;
private $numero;
private $etatComm;
private $numCompte;
// le constructeur
public function __construct($num,$mess,$compte,$etatCom){
$this->numero=$num;
$this->message=$mess;
$this->etatComm=$etatCom;
$... |
Go | UTF-8 | 675 | 4.09375 | 4 | [] | no_license | package main
import "fmt"
func main() {
// 定义一个变量, 类型为map[int]string
var m1 map[int]string
fmt.Println("m1 = ",m1)
// 对于map只有len,没有cap
fmt.Println("len = ",len(m1))
// 可以通过make创建
m2 := make(map[int]string)
fmt.Println("m2 = ",m2)
fmt.Println("len = ",len(m2))
// 可以指定长度,只是指定容量,但是里面却是一个数据也没有
m3 := make(map... |
C# | UTF-8 | 3,987 | 2.96875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using TodoList.Models;
using System.Data.SqlClient;
namespace TodoList.Repositories
{
public class TarefaDatabaseRepository : BDContext, ITarefaRepository
{
public void Create(Tarefa model)
{
try {
SqlCommand cmd = new ... |
Markdown | UTF-8 | 15,121 | 2.8125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | ---
layout: post
title: "Seattle is Saturated"
author: "Landon"
tags:
- travel
image: "/assets/img/thumbnail/2018-06-18-seattle-trip-4_thumb_800.jpg"
gallery: true
---
After graduation, I wanted to go travel a bit, and especially visit some friends on the west coast that I haven't seen for a while, and probably won't ... |
Java | UTF-8 | 4,762 | 2.078125 | 2 | [] | no_license | package com.android.sudesi.schoolapp.Activity;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.os.Environment;
import androidx.annotation.Nullable;
import android.text.TextUtils;
import android.view.View;
import android.widg... |
C# | UTF-8 | 1,411 | 3.359375 | 3 | [] | no_license | /*
* Nathan Cover
* WeaponGenerator.cs
* Assignment_04
* Class that generates weapons of random type and then wraps it in a random rarity type before displaying it to the screen
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scripts.Assig... |
PHP | UTF-8 | 672 | 2.90625 | 3 | [
"MIT"
] | permissive | <?php
$key = "4L2UAZbK8aAuBM5UC97ChhvEAcBiw7ah";
$algo = "aes-256-ctr";
function encryptPassword($pass) {
return password_hash($pass, PASSWORD_BCRYPT);
}
function testPassword($pass, $hash) {
return password_verify($pass, $hash);
}
function encryptData($data, $iv = "") {
if (strlen($iv) == 0) $iv = bin2hex(ra... |
Python | UTF-8 | 540 | 3.09375 | 3 | [] | no_license | import pandas as pd
import numpy as np
import pickle
from sklearn.ensemble import RandomForestClassifier
dataset = pd.read_csv("diabetes.csv")
# 1 = Glucose
# 4 = Insulin
# 5 = BMI
# 7 = Age
X = dataset.iloc[:,[1,4,5,7]]
y = dataset.iloc[:,[8]]
model = RandomForestClassifier(n_estimators=100, criterion... |
Java | UTF-8 | 2,388 | 2.390625 | 2 | [] | no_license | package synchronizer;
import com.dropbox.core.v2.files.FileMetadata;
import synchronizer.components.file.FilesComponent;
import synchronizer.components.folder.FolderComponent;
import synchronizer.components.dbox.DBoxApi;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import java.io.File;
import java.ut... |
Java | UTF-8 | 2,610 | 2.078125 | 2 | [] | no_license | package com.happy.admin.sys.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.happy.admin.sys.dao.entity.Post;
import com.happy.admin.sys.dao.mapper.PostMapper;
import com.happy.admin.sys.service.IPostService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.happy.admin.sys.... |
Swift | UTF-8 | 1,569 | 3.65625 | 4 | [] | no_license | import Foundation
public class LabelAnnotations {
public var mid : String?
public var score : Double?
public var description : String?
/**
Returns an array of models based on given dictionary.
Sample usage:
let labelAnnotations_list = LabelAnnotations.modelsFromDictionaryArray(someDictionaryArrayF... |
C# | UTF-8 | 466 | 2.703125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace projettest
{
class Case
{
public enum CaseType { Desert, Grotte, Temple, Boss, Foret };
public int X;
public int Y;
public CaseType Type;... |
Java | UTF-8 | 6,019 | 1.984375 | 2 | [
"MIT"
] | permissive | package ActionConditionClasses;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import authoring.Sprite.AbstractSpriteObject;
import authoring_actionconditions.ActionConditionHBox;
import authoring_actionconditions.ActionRow;
import author... |
Markdown | UTF-8 | 3,094 | 4.09375 | 4 | [] | no_license | ## Arrays
오늘 기록할 API는 **Arrays** !!!<br>
Arrays class안에는 Array를 정렬하거나 Array안에 있는 요소를 찾는 등의 작업을 할 수 있는 여러 메소드가 있다.
이 메소드들은 모두 `NullPointerException`을 던진다.
### asList(arr)
- Array 안의 요소를 Array length만큼의 size를 가진 List에 넣어준 후, List를 return
- parameters
- arr : list로 return할 array
- returns
- array에서 return된 list
... |
Swift | UTF-8 | 448 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | import UIKit
@IBDesignable
class SoraButton: UIButton {
override func layoutSubviews() {
super.layoutSubviews()
clipsToBounds = true
layer.cornerRadius = min(frame.height, frame.width) / 2.0
}
func setActive(with color: UIColor) {
isEnabled = true
backgroundCol... |
Java | UTF-8 | 972 | 3.625 | 4 | [] | no_license | /*
* UCF COP3330 Summer 2021 Assignment 2 Solution
* Copyright 2021 Mikhail Plekunov
*/
package ex25.Base;
public class Main {
public static void main(String[] args) {
String password = readInput("Enter password that you would like to validate: ");
output(password);
}
public static ... |
Markdown | UTF-8 | 724 | 3.03125 | 3 | [] | no_license | # Advent of Code 2019
Solutions in Ada by James Tomasino.
## Overview
I have little practice with Ada other than repeating web tutorials and basic
book examples. This event gives me the opportunity to build solutions from
scratch in an unfamiliar language. My solutions, therefore, should not be
viewed as a good exam... |
Python | UTF-8 | 840 | 4.0625 | 4 | [
"MIT"
] | permissive | '''Escreva um programa em Python que dados o peso (em kg)
e a altura (em metros) de um individuo, nesta ordem,
calcule o IMC e mostre a situação do mesmo de acordo
com as definições abaixo:
IMC=pesoaltura2
IMC<20 -> ABAIXO
20<=IMC<=25 -> NORMAL
25<IMC<=30 -> SOBREPESO
30<IMC<=40 -> OBESIDADE
IMC>40 -> OBESIDADE G... |
JavaScript | UTF-8 | 234 | 3.703125 | 4 | [] | no_license | let newFormula = (a,b,c,d) =>{
let x = (a-c)**2+(b-d)**2;
return Math.sqrt(x);
}
const x = newFormula(3, 10, 0, 6);
if (x !== 5) {
console.log("Failed: the calculation is wrong");
} else {
console.log("Passed, bravo");
}
|
Python | UTF-8 | 731 | 2.828125 | 3 | [] | no_license |
#Code à ajouter dans le script "bot.py" dans la librairie pymessenger
def send_quick_replies(self, recipient_id, message, quick_replies):
'''Send text messages to the specified recipient.
https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies
Input:
... |
JavaScript | UTF-8 | 178 | 3.578125 | 4 | [] | no_license | // Shortest Word
function findShort(s) {
let lengths = [];
let sArray = s.split(" ").forEach(word => {
lengths.push(word.length);
});
return Math.min(...lengths);
}
|
C++ | UTF-8 | 13,484 | 2.65625 | 3 | [] | no_license | #ifndef UTILS_H
#define UTILS_H
#include <iostream>
#include <vector>
#include <chrono>
#include <fstream>
#include <time.h>
#include <algorithm>
#include <math.h>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
using namespace std;
struct sparse_matrix {
int row;
int col;
... |
Java | UTF-8 | 533 | 2.9375 | 3 | [] | no_license | package com.hao.greatinrxjava.pattern.productorcustomer;
/**
* Created by liuxuehao on 16/12/23.
*/
public class Productor implements Runnable {
private Info info;
public Productor(Info info) {
this.info = info;
}
@Override
public void run() {
for (int x = 0; x < 100; x++) {
... |
Python | UTF-8 | 417 | 2.765625 | 3 | [] | no_license | class Solution:
def longestWPI(self, a: List[int]) -> int:
g = {}
s = 0
z = 0
for i in range(len(a)):
if a[i] > 8:
s += 1
else:
s -= 1
if s > 0:
z = max(z, i + 1)
else:
z =... |
C# | UTF-8 | 4,039 | 2.78125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace RPCApplication
{
public class ServerCommunication
{
int dataSize;
byte[] da... |
C# | UTF-8 | 663 | 3.5625 | 4 | [
"MIT",
"CC-BY-4.0"
] | permissive | using System;
using System.Runtime.InteropServices;
public class Example
{
public static void Main()
{
// <Snippet1>
int[] arr = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20 };
unsafe {
fixed(int* parr = arr)
{
IntPtr ptr = new IntPtr(parr);
for (int ctr = 0;... |
C++ | UTF-8 | 11,771 | 2.671875 | 3 | [] | no_license | #include "Encoder.h"
#include "arduino.h"
#include "MilliTimer.h"
Encoder::Encoder(){
}
Encoder::Encoder(uint8_t pinA, uint8_t pinB)
{
_pinA = pinA;
_pinB = pinB;
buttonEnabled = false;
}
Encoder::Encoder(uint8_t pinA, uint8_t pinB, uint8_t pinC)
{
_pinA = pinA;
_pinB = pinB;
_pinC = pinC;
}... |
C++ | UTF-8 | 466 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
void main()
{
//经理:
manager m1;
m1.pay();
m1.displayStatus();
//兼职技术人员:;
technician t1;
t1.pay();
t1.displayStatus();
//兼职推销员:;
salesman s1;
s1.pay();
s1.displayStatus();
cout<<"\n 使基类指针指向子类对象"<<endl;
empl... |
Java | UTF-8 | 4,448 | 2.21875 | 2 | [
"LicenseRef-scancode-jgraph"
] | permissive | package org.openossad.ui.panels;
import org.jdesktop.swingx.JXList;
import org.openossad.ui.base.GenericListModelHibernate;
import org.openossad.ui.base.PanelPropsBase;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
... |
JavaScript | UTF-8 | 5,535 | 2.703125 | 3 | [
"MIT"
] | permissive | ;(function (window, document, undefined) {
"use strict";
var ssm = {},
states = [],
debug = false,
browserWidth = 0,
currentState = null,
resizeTimeout = 50,
resizeTimer = null;
var browserResizePre = function () {
clearTimeout(resizeTimer);
... |
JavaScript | UTF-8 | 2,220 | 4.1875 | 4 | [] | no_license | /**
* 1130. Minimum Cost Tree From Leaf Values
Medium
Given an array arr of positive integers, consider all binary trees such that:
Each node has either 0 or 2 children;
The values of arr correspond to the values of each leaf in an in-order traversal of the tree. (Recall that a node is a leaf if and only if it has... |
JavaScript | UTF-8 | 1,871 | 2.578125 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const bcrypt = require("bcrypt");
const session = require("express-session");
// Model
const userModel = require("../models/User");
const { findOne } = require("../models/User");
const isNullOrUndefined = (value) => value === null || value === undef... |
C++ | UTF-8 | 1,487 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __LIBPROCESS_SOCKET_HPP__
#define __LIBPROCESS_SOCKET_HPP__
#include <assert.h>
#include <unistd.h> // For close.
#include <iostream>
#include <stout/nothing.hpp>
#include <stout/os.hpp>
#include <stout/try.hpp>
// An abstraction around a socket (file descriptor) that provides
// reference counting such tha... |
Java | UTF-8 | 603 | 3.078125 | 3 | [] | no_license | package cn.itcast;
public class Test3 {
public static void main(String[] args) {
String[][] arr1 = {{"java", "php", "python"}, {"mysql", "oracle", "plsql", "nosql", "redis"}, {"idea", "eclipse", "pychar"}};
//遍历二维数组
for (int i = 0; i < arr1.length; i++) {//负责取出每个一维数组
String[... |
Swift | UTF-8 | 744 | 3.421875 | 3 | [] | no_license | //
// Challenge.swift
// Summit
//
// Created by Reagan Wood on 3/22/20.
// Copyright © 2020 Reagan Wood. All rights reserved.
//
import UIKit
public class Challenge: Codable {
public let id: Int
public let title: String
public let attemptsToComplete: Int
public let failureAmount: Int
public l... |
Python | UTF-8 | 3,509 | 2.65625 | 3 | [
"MIT"
] | permissive | from abc import ABC, abstractmethod
from typing import List, Optional
from pycode2seq.inference.common.utils import pre_order
from pycode2seq.inference.common.node import Node
from pycode2seq.inference.methods.model import ElementNode, MethodInfo, MethodNode, ParameterNode
from pycode2seq.inference.parsing.utils impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.