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 |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 277 | 2.765625 | 3 | [] | no_license | <?php
class Pages extends IndirectObject
{
protected $pages = [];
public function addPage(Page $page)
{
$this->pages[] = $page;
}
public function getMap()
{
return [
'Type' => '/Pages',
'Kids' => $this->pages,
'Count' => count($this->pages),
];
}
}
|
Markdown | UTF-8 | 3,662 | 3.15625 | 3 | [
"MIT"
] | permissive | # `tslib` direct dependency migration
# `tslib` 直接依赖项迁移
## What does this migration do?
## 这种迁移是做什么的?
If you have any libraries within your workspace, this migration will convert `tslib` peer dependencies to direct dependencies for the libraries.
TypeScript uses the `tslib` package to provide common helper function... |
Python | UTF-8 | 295 | 2.84375 | 3 | [
"MIT"
] | permissive | from pynput.keyboard import Key, Controller
import time
time.sleep(5)
Keyboard = Controller()
while True:
for letter in "Use it to Surprise NOT HARM":
Keyboard.press(letter)
Keyboard.release(letter)
Keyboard.press(Key.enter)
Keyboard.release(Key.enter)
|
C++ | UTF-8 | 549 | 3.203125 | 3 | [] | no_license | //Problem 7
#include <conio.h>
#include <iostream>
using namespace std;
int main()
{
int x, y, sum;
cout << "Input first number" << endl;
cin >> x;
cout << "Input last number" << endl;
cin >> y;
for ( int number = x; number... |
Python | UTF-8 | 6,852 | 3.015625 | 3 | [] | no_license | from ArbolAVL.NodoEstudiante import Node
import os
class AVLTree:
def __init__(self):
self.root = None
#add
def add(self, carnet, dpi, nombre, carrera, correo, password, creditos, edad):
self.root = self._add(carnet, dpi, nombre, carrera, correo, password, creditos, edad, self.roo... |
TypeScript | UTF-8 | 1,434 | 2.8125 | 3 | [
"BSD-3-Clause"
] | permissive | import { MimeType_, URL_ } from "./datasets";
import { Converter, Convert } from "./converters";
import { DataTypeNoArgs, DataTypeStringArg, TypedConverter } from "./datatypes";
import { identity } from "rxjs";
/**
* Datasets without a known mimetype start as just a resolve mimetype and no data.
*/
export const reso... |
Java | UTF-8 | 735 | 3.28125 | 3 | [] | no_license | import java.util.Arrays;
import java.util.Scanner;
public class Task4 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = scanner.nextInt();
int [] array = new int[x];
for (int i = 0; i < array.length; i++) {
array[i] = scanner.ne... |
PHP | UTF-8 | 1,867 | 2.625 | 3 | [
"MIT"
] | permissive | <?php
namespace TDN\NanaBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\RoleInterface;
/**
* TDN\NanaBundle\Entity\NanaRoles
*/
class NanaRoles implements RoleInterface {
/**
* @var string $name
*/
private $name;
/**
* @var string $role
*/
... |
Markdown | UTF-8 | 525 | 3.328125 | 3 | [] | no_license | # 3 Types of Relationships in Database Design
#### One-to-One
A row in table "1" can can match with row in table "2" and vice versa. This is not commonly use , however this is used for security purposes !
#### One-to-Many
A row in table '1' can have many match with row in table '2' , but a row in table '2' can ha... |
C# | UTF-8 | 468 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
namespace TrieTests.TrieFolder
{
public class Node
{
public char Symbol { get; set; }
public bool isWord { get; set; } = false;
public List<Node> Descendants { get; set; } = new List<Node>();
public Node(char symbol)
{
... |
Java | UTF-8 | 891 | 2.015625 | 2 | [] | no_license | package com.maoding.yongyoucloud.module.enterprise.dto;
import java.util.List;
public class EnterpriseDetailDTO {
private String result;
private String state;
private Integer total;
private List<EnterpriseDataDTO> details;
public String getResult() {
return result;
... |
TypeScript | UTF-8 | 247 | 2.9375 | 3 | [] | no_license | class Programadores {
private _programadores: Programador[] = [];
adiciona(programador: Programador) {
this._programadores.push(programador);
}
paraArray(){
return [].concat(this._programadores);
}
} |
Java | UTF-8 | 3,436 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | package com.theah64.ets.api.servlets;
import com.theah64.ets.api.database.tables.BaseTable;
import com.theah64.ets.api.database.tables.Companies;
import com.theah64.ets.api.database.tables.Employees;
import com.theah64.ets.api.models.Company;
import com.theah64.ets.api.models.Employee;
import com.theah64.ets.api.utils... |
Java | UTF-8 | 8,832 | 1.882813 | 2 | [] | no_license | package com.sinosoft.lis.bq;
import org.apache.log4j.Logger;
import com.sinosoft.lis.bl.LPContBL;
import com.sinosoft.lis.db.LCAppntDB;
import com.sinosoft.lis.db.LPAccountDB;
import com.sinosoft.lis.db.LPEdorItemDB;
import com.sinosoft.lis.db.LPEdorMainDB;
import com.sinosoft.lis.pubfun.BqCalBase;
import com.sinosoft... |
TypeScript | UTF-8 | 499 | 2.859375 | 3 | [] | no_license | export class UUID {
public static newUUID(): string {
return this.generateUUID();
}
private static generateUUID(): string {
return this.generatePart() + this.generatePart() + '-' + this.generatePart() + '-' + this.generatePart() + '-' +
this.generatePart() + '-' + this.generatePart() + this.genera... |
Java | UTF-8 | 818 | 3.34375 | 3 | [] | no_license | /*
* This Java source file was generated by the Gradle 'init' task.
*/
package SortUsingStream;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import junit.framework.Assert;
public class SortServiceTest {
/* This project will contain test k... |
C++ | MacCentralEurope | 397 | 2.984375 | 3 | [] | no_license | #pragma once
#include "VisiteurVerbe.h"
/**
conjugue les verbes au participe pass
Ex : pour le verbe "danser", on obtient "dans"
pour le verbe "grandir", on obtient "grandi"
*/
class ParticipePasse : public VisiteurVerbe
{
public:
const static char eAccentAigu; //
const string visite(const Verbe1erGroupe * verbe... |
Markdown | UTF-8 | 10,510 | 2.6875 | 3 | [] | no_license | # Lawn Care Simulator (Web, 200pts)
## Problem
Lawn Care Simulator is a simple web application to show how the grass is growing. Yeah, ok. It has premium content, but it requires registration. Registration not working and there's no way to log in as we can't register any account.
![Lawn Care Simulator]
(https://gith... |
Java | UTF-8 | 3,494 | 2.0625 | 2 | [] | no_license | package com.okar.chatservice;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.IBinder;
import andro... |
C++ | UTF-8 | 438 | 3.421875 | 3 | [] | no_license | /*
*
* アルゴリズム 再帰関数
* 参考:https://qiita.com/drken/items/23a4f604fa3f505dd5ad
*
*/
#include <iostream>
using namespace std;
int func(int i){
if(i == 0) return 0;
return i + func(i-1);
}
int main(){
int n;
cout << endl;
cout << "nまでの値の和を表示します:nの値を入力してください" << endl;
cin >> n;
cout << n << "... |
C++ | UTF-8 | 519 | 2.90625 | 3 | [] | no_license | /*
* Exception.cpp
*
* Created on: 05.01.2013
* Author: yoshi252
*/
#include "Exception.h"
namespace blobby {
/**
* Constructor
*
* \param [in] message The message of the exception. Will be returned by what().
*/
Exception::Exception(const std::string& message) :
m_message(message)
{
}
/**
* Des... |
SQL | UTF-8 | 5,767 | 3.0625 | 3 | [
"MIT"
] | permissive | /*
SQL setup script for AWS Services Snapshot utility
v0.0.8
This script sets up the PostgreSQL database 'aws_snapshot' for use by the
AWS Services Snapshot utility
>> Note: this script must be executed using the 'ec2-user' role <<
-------------------------------------------------------------------------------... |
Python | UTF-8 | 2,222 | 2.84375 | 3 | [] | no_license | # Design: boot_script.py
# Description:
# Author: German Cano Quiveu <germancq@dte.us.es>
# Copyright Universidad de Sevilla, Spain
import sys
import binascii
import collections
elf_signature = binascii.unhexlify(b'7F454C46')
PH_info = collections.namedtuple('PH_info','offset sz vaddr')
def from_bytes (data, big_e... |
C# | UTF-8 | 2,620 | 3.015625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data.SqlClient;
namespace _30Aralik08
{
public class Product
{
public Product()
{
}
int productID;
public int ProductID
{
... |
Python | UTF-8 | 193 | 3.15625 | 3 | [] | no_license | temp_viagem = int(input('temp_viagem: '))
velocidade_media = float(input('velocidade_media: '))
distancia = velocidade_media * temp_viagem
cosumo = distancia / 12
print('%.3f' % cosumo) |
Shell | UTF-8 | 1,430 | 3.734375 | 4 | [] | no_license | #!/bin/bash
# Setup vars
source .env
DID=$(docker ps -aqf "name=cuckoo-docker_cuckoo")
DPID=$(docker inspect -f '{{.State.Pid}}' $DID)
VNET=vboxnet0
echo "Container ID is $DID"
echo "DPID is $DPID"
function test_root() {
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
}
test_roo... |
Markdown | UTF-8 | 25 | 2.640625 | 3 | [] | no_license | # JS
Simple JS exercises |
C# | UTF-8 | 2,515 | 2.546875 | 3 | [] | no_license | namespace AForge.Imaging.ColorReduction
{
public class ColorErrorDiffusionToAdjacentNeighbors : ErrorDiffusionColorDithering
{
private int[][] coefficients;
private int coefficientsSum;
public int[][] Coefficients
{
get
{
return coefficients;
}
set
{
coefficients = value;
Calculat... |
Markdown | UTF-8 | 10,910 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | # Bee RFCs
[](https://iotaledger.github.io/bee-rfcs/)
> This process is modelled after the approach taken by the Rust programming language, see [Rust RFC repository] for more
information. Also see [maidsafe's RFC process] for ... |
Java | UTF-8 | 1,661 | 3.53125 | 4 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package hrickascislempi;
import java.awt.geom.Point2D;
import java.util.Scanner;
/**
*
* @author já
* metoda Monte Carlo
* API Aplication Program interface je na netu
* doukumentace, java.awt.geom, Point2D.Double
... |
Shell | UTF-8 | 204 | 3.21875 | 3 | [] | no_license | #!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
cd $(dirname $(readlink -f $0))
escapeEol() {
sed '
: again
/\\$/ {
N
s/\\\s*\n\s*\\//
t again
}' | sed -e 's/\\n/\n/g'
}
escapeEol
|
Markdown | UTF-8 | 2,434 | 2.90625 | 3 | [] | no_license | ---
bibliography:
- '../references.bib'
---
Project Name
============
Making a “Résumé for Gig Workers”
Description
===========
Gig workers are increasingly piecing together earnings from various work
platforms to make ends meet. But insight into their work performance and
history are virtually nonexistent. Request... |
Java | UTF-8 | 1,024 | 2.25 | 2 | [] | no_license | package com.bjike.goddess.customer.vo;
/**
* 时效性因素层权重表现层对象
*
* @Author: [ lijuntao ]
* @Date: [ 2017-11-01 01:52 ]
* @Description: [ 时效性因素层权重表现层对象 ]
* @Version: [ v1.0.0 ]
* @Copy: [ com.bjike ]
*/
public class TimelinessFactorWeightVO {
/**
* id
*/
private String id;
/**
* 时效性类型名称
... |
Java | UTF-8 | 1,957 | 2.84375 | 3 | [] | no_license | package com.neeson.java8.annotation;
import javax.annotation.processing.Messager;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.*;
import javax.lang.model.util.ElementScanner8;
import javax.tools.Diagnostic;
public class NameChecker {
private final Messager messager;
... |
C# | UTF-8 | 1,197 | 2.75 | 3 | [] | no_license | using Ostis.Sctp.Arguments;
namespace Ostis.Sctp.Commands
{
/// <summary>
/// Команда: Поиск SC-элемента по его системному идентификатору.
/// </summary>
/// <example>
/// Следующий пример демонстрирует использование класса <see cref="FindElementCommand"/>
/// <code source="..\Ostis.Tests\Comm... |
Python | UTF-8 | 3,570 | 3.3125 | 3 | [] | no_license | #
# s = 'Это просто строка текста. А это ещё одна строка текстаю'
#
# pattern = 'строка'
#
# print(s.find(pattern))
# print(pattern in s)
#-----------------------------------------------------
# import re
# s = 'Это просто строка текста. А это ещё одна строка текстаю'
#
# pattern = 'строка'
#
# if re.search(pattern, ... |
JavaScript | UTF-8 | 487 | 2.9375 | 3 | [] | no_license | /**
* Created by Administrator on 2015/10/19.
*/
var utils = require('util');
/**
* 这是一个基于对象间原型继承的函数、主要是工具
* */
console.log(utils.inspect({name:'qiansimin'})); //把对象转化成字符串
console.log(utils.isArray([])); //一些列的检测 返回的是布尔值
console.log(utils.isRegExp(/\d+/));
console.log(utils.isDate(new Date()))... |
C# | UTF-8 | 973 | 3.578125 | 4 | [
"MIT"
] | permissive | public class Solution {
public bool SearchMatrix(int[,] matrix, int target) {
return SearchMatrixInt(matrix, 0, matrix.GetLength(0) - 1, 0, matrix.GetLength(1) - 1, target);
}
private bool SearchMatrixInt(int[,] matrix, int top, int bottom, int left, int right, int target) {
if (top >... |
C# | UTF-8 | 544 | 2.9375 | 3 | [] | no_license | namespace Calculator
{
public class MultipleOperation : BinaryOperator
{
public MultipleOperation() : base()
{
Priority = 2;
Literal = "*";
}
public override decimal Calculate(decimal[] x) => x[0]*x[1];
public override Operator Clone(... |
Python | UTF-8 | 2,448 | 2.921875 | 3 | [] | no_license | import numpy as np
import torch.optim
from torch.autograd import Variable
from models import linmodel
import utils
import numpy.linalg as linalg
import sys
def init_data(nsamples, dx, dy):
Xold = np.linspace(0, 1000, nsamples * dx).reshape([nsamples, dx])
X = utils.standardize(Xold)
invertible = False
... |
C++ | UTF-8 | 707 | 3.875 | 4 | [
"MIT"
] | permissive | /*
Problem-Task: Create a function that takes a string and returns the middle character(s). If the word's length is odd, return the middle character.
If the word's length is even, return the middle two characters.
Problem Link: https://edabit.com/challenge/p3SCSXaWQLWpvqCYZ
*/
#include "bits/stdc++.h"
us... |
Markdown | UTF-8 | 2,473 | 3.40625 | 3 | [] | no_license | # simpleChatBot
Developed the simple chat bot using Python and AIML(Artificial Intilegence Markup Language).
#What is AIML?
AIML was developed by Richard Wallace. He made a bot called A.L.I.C.E. (Artificial Linguistics Internet Computer Entity) which won several artificial intelligence awards. Interestingly, one of ... |
JavaScript | UTF-8 | 3,810 | 3.109375 | 3 | [] | no_license |
$(function(){
var cart = {};
render(com.dawgpizza.menu.pizzas, com.dawgpizza.menu.drinks, com.dawgpizza.menu.dessert);
renderTotal();
$('.add-to-cart').click(addToCart());
});
function render(pizzas, drinks, desserts){
var idx;
var pizza;
pizzas=com.dawgpizza... |
JavaScript | UTF-8 | 4,726 | 2.6875 | 3 | [] | no_license | /** @module room/router */
'use strict';
/* Imports */
const express = require('express');
const middleware = require('../middleware');
const mongoose = require('mongoose');
const Room = mongoose.model('Room');
const Post = mongoose.model('Post');
const ObjectId = mongoose.Types.ObjectId;
/* Create router */
const ro... |
C# | UTF-8 | 3,069 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* SplitCmd.java
*
* Copyright (c) 1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and
* redistribution of this file, and for a DISCLAIMER OF ALL
* WARRANTIES.
*
* Included in SQLite3 port to C# for use in testharness only; 2008 Noah B Hart
*
* RCS @(#) $Id: SplitCmd.java,v 1.1... |
Markdown | UTF-8 | 944 | 3.359375 | 3 | [
"MIT"
] | permissive | 在张量中排列轴。
**别名** : [ `tf.compat.v1.keras.backend.permute_dimensions` ](/api_docs/python/tf/keras/backend/permute_dimensions), [ `tf.compat.v2.keras.backend.permute_dimensions` ](/api_docs/python/tf/keras/backend/permute_dimensions)
```
tf.keras.backend.permute_dimensions(
x,
pattern
)
```
#### 参数:
- **`x`*... |
Java | UTF-8 | 1,106 | 3.1875 | 3 | [] | no_license | /*
Martin Alegría
A01022216
*/
public class Persona {
private String nombre;
private String apellido;
private int nacimiento;
private String telefono;
Persona(String nombre, String apellido, int nacimiento){
this.nombre = nombre;
this.apellido = apellido;
thi... |
Java | UTF-8 | 1,867 | 2.21875 | 2 | [] | no_license | package com.game.core.room;
import com.game.core.room.interfaces.ItemConsume;
import com.game.manager.DBServiceManager;
import com.game.manager.OnlineManager;
import com.game.socket.module.UserVistor;
import com.logger.type.LogType;
import java.util.HashSet;
import java.util.Set;
/**
* Created by Administrator on 2... |
Python | UTF-8 | 12,767 | 2.609375 | 3 | [] | no_license | from numpy import *
from pylab import *
numshots = 30
shot = zeros(numshots)
speed = zeros(numshots)
current = zeros(numshots)
saturatedfrequency = zeros(numshots)
saturatedfrequencyerr = zeros(numshots)
saturatedpower = zeros(numshots)
saturatedintervalstart = zeros(numshots)
saturatedintervalstop = zeros(numshots)
t... |
Python | UTF-8 | 3,179 | 2.71875 | 3 | [] | no_license | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from repositories.groups_repository import groups_repo
from repositories.subjects_repository import subjects_repo
from repositories.students_repository import students_repo
from repositories.marks_repository import marks_repo
graphics_folder_path =... |
Java | UTF-8 | 343 | 1.648438 | 2 | [] | no_license | package icons;
import com.intellij.openapi.util.IconLoader;
import javax.swing.*;
/**
* Icon interface used to get the correct icons for the plugin.
*/
public interface DemarkIcons {
// icon by <div>Icons made by Gregor Cresnar from Flaticon
// licensed by Creative Commons BY 3.0
Icon TOGGLE = IconLoad... |
C | UTF-8 | 22,847 | 2.90625 | 3 | [
"Unlicense"
] | permissive | #include "options.h"
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <ctype.h>
struct sn_parse_context {
/* Initial state */
struct sn_commandline *def;
struct sn_option *options;
void *target;
int argc;
char **argv;
unsigned long... |
TypeScript | UTF-8 | 456 | 2.734375 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import { APP_CONSTANTS } from '../constants/app.constants';
/**
* Service which lets you choose storage of your choice
*/
@Injectable()
export class WebStorageService {
/**
* Returns storage to be used to store data based on type
* @param type local or session
*... |
Java | UTF-8 | 3,115 | 3.125 | 3 | [] | no_license | package com.car.admin;
import com.car.admin.util.DateUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DateTest {
public static void main(String[] args) throws ParseException {
Date beginDate = new Date();
String end = "2019-5-31";
... |
JavaScript | UTF-8 | 1,679 | 2.578125 | 3 | [
"MIT"
] | permissive | import React, { Component } from "react";
export default class NewGame extends Component {
constructor(props) {
super(props);
this.state = {
name: "",
error: ""
};
this.handleSubmit = this.handleSubmit.bind(this);
this.handleNameChange = this.handleNameChange.bind(this);
this.ha... |
Python | UTF-8 | 485 | 2.71875 | 3 | [] | no_license | import os
import subprocess
f = open("Log_2019_12_12_13_24.txt", "r")
#print(os.getcwd())
if f.mode == "r":
contents = f.readlines()
f.close()
dict = {}
for line in contents:
if(line.startswith("Section")):
split = line.split('_')
if split[0] not in dict.keys():
dict[split[0]] = ... |
Go | UTF-8 | 1,788 | 2.546875 | 3 | [
"MIT"
] | permissive | package models
import (
"encoding/json"
"strconv"
"strings"
)
var (
PresenceexpandMarshalled = false
)
// This struct is here to use the useless readonly properties so that their required imports don't throw an unused error (time, etc.)
type PresenceexpandDud struct {
Id string `json:"id"`
... |
Markdown | UTF-8 | 328 | 2.59375 | 3 | [] | no_license | # Typewriter-Animation-Effects
<h4>Typewriter Animation Effects Using Pure CSS</h4>
Just download the respository and unzip the file. </br>
Open index.html file and here you go. </br>
Enjoy the typewriter animation effects.</br>
<h3>Follow Me in Github for more intresting projects.</h3></br>
:
def enviar_correo(self,destinatario,remitente,password,mensaje,titulo):
## "Instanciando" el mensaje:
msg = MIMEMultipart()
msg['From'] = remitente
... |
TypeScript | UTF-8 | 4,638 | 2.921875 | 3 | [] | no_license | class SegmentedMedia {
private frameWidth: number
private img: p5.Image
private urlRoot: string
private imgTags: string
private pieceHeight: number
private xPos: number
private noOfSegments: number
private segmentPosition: number[]
private selectedSegment: number
constructor(... |
Java | UTF-8 | 4,508 | 2.359375 | 2 | [] | no_license | package com.example.sliderapp;
import androidx.appcompat.app.AppCompatActivity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import... |
Python | UTF-8 | 2,770 | 2.71875 | 3 | [] | no_license | import tkinter
from tkinter import *
import os
import re
import glob
from gui import window, bottom_frame
from sixth import listofdirs, x
global sevenbutton
global sevenlabel
global sevenlabel1
global sevenlabel2
global sevenlabel3
global sevenlabel5
global sevenlabel6
global file_src
global secondte... |
Markdown | UTF-8 | 3,624 | 3.1875 | 3 | [
"MIT"
] | permissive | # 03/08/2019
## More MVC stuff
- ways to get data from the controller to the view
1. strongly typed view the model
- often will be a view model
- view can only take one model, so if you need several, either that's a collection type of some kind or make a new view model that contains the several you... |
Java | UTF-8 | 9,480 | 1.898438 | 2 | [
"Apache-2.0"
] | permissive | package com.guosen.zebra;
/**
* @Title: ZebraRun.java
* @Package com.guosen.zebra.core.boot.runner
* @Description: TODO(用一句话描述该文件做什么)
* @author 邓启翔
* @date 2017年11月13日 下午4:21:35
* @version V1.0
*/
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOExcep... |
C# | UTF-8 | 4,346 | 2.84375 | 3 | [] | no_license | using System;
using System.IO;
using System.Threading;
namespace SDK.Prospero.Hardware
{
public static class TouchSensor
{
private static int mY;
private static int mX;
private static bool mPress;
private static readonly Thread ProcessingThread = new Thread(Pro... |
C | UTF-8 | 248 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
int RPM( int a, int b )
{
int sum = 0;
while( b )
{
if( b & 1 )
sum += a;
a <<= 1;
b >>= 1;
}
return sum;
}
int main()
{
return printf( "%d\n", RPM( 86, 57 ) );
}
|
Ruby | UTF-8 | 822 | 2.796875 | 3 | [] | no_license | require 'nokogiri'
require_relative 'character'
class CharacterUploader
def self.create(character_sheet, user)
begin
new(character_sheet, user).message
rescue
"Please upload a valid .xml or .dnd4e file"
end
end
attr_accessor :character, :user
def initialize(character_sheet, user)
... |
Java | UTF-8 | 1,540 | 2.28125 | 2 | [] | no_license | package com.zl.test;
import com.zl.entity.Employee;
import com.zl.mapper.EmployeeMapper;
import com.zl.util.RedisUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springfr... |
PHP | UTF-8 | 222 | 2.640625 | 3 | [] | no_license | <?php
/**
* Created by PhpStorm.
* User: cippo
* Date: 2/16/2016
* Time: 12:17 AM
*/
$quote = "To be or not to be, that is the question.";
$quote = strtoupper( $quote );
$quote = strtolower( $quote );
echo $quote;
|
Go | UTF-8 | 925 | 2.65625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"os"
"runtime/pprof"
"github.com/wzshiming/gs/exec"
)
var profile = flag.String("profile", "", "profile file path")
var tree = flag.Bool("tree", false, "show ast tree")
func init() {
flag.Parse()
}
func main() {
if *profile != "" {
f, _ := os.Creat... |
Ruby | UTF-8 | 417 | 3.328125 | 3 | [] | no_license | require_relative 'hand'
class Member
INITIAL_BANK = 100
attr_accessor :bank
attr_reader :name, :hand, :color
def initialize
@bank = INITIAL_BANK
@hand = Hand.new
end
def add_card(card)
@hand.cards << card
@hand.scoring(card)
end
def bet(value)
@bank -= value
end
def reset
... |
C# | UTF-8 | 2,926 | 2.65625 | 3 | [
"MIT"
] | permissive | using SourceCodeSerializer.Converters;
using System;
using System.Collections.Immutable;
using Xunit;
using Xunit.Abstractions;
namespace SourceCodeSerializer
{
public class EnumTests
{
private readonly ITestOutputHelper _helper;
public EnumTests(ITestOutputHelper helper)
{
... |
Python | UTF-8 | 6,586 | 2.75 | 3 | [] | no_license | #!/usr/bin/python
# -*- coding: utf-8 -*-
# The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt
#
# This example shows how to use dlib's face recognition tool. This tool maps
# an image of a human face to a 128 dimensional vector space where images of
# the same person are ne... |
Swift | UTF-8 | 733 | 3 | 3 | [] | no_license | //
// Extensions.swift
// TabBarDemo
//
// Created by Admin on 9/26/18.
// Copyright © 2018 DemoApp. All rights reserved.
//
import Foundation
import UIKit
extension UIColor{
static func rgb(red: CGFloat, green: CGFloat, blue: CGFloat) -> UIColor{
return UIColor(red: red/255, green: green/255, blue: b... |
JavaScript | UTF-8 | 827 | 2.9375 | 3 | [] | no_license | let bookmarks = document.getElementsByClassName('bookmark');
[...bookmarks].forEach(bookmark => {
bookmark.style.cursor = 'pointer'
bookmark.addEventListener('click', e => {
let target = e.target.parentElement
let header = new Headers()
header.append('Accept', 'Application/JSON')
... |
JavaScript | UTF-8 | 1,020 | 2.515625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import renderer from 'react-test-renderer';
import ShallowRenderer from 'react-test-renderer/shallow'
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unm... |
Java | UTF-8 | 1,254 | 4.03125 | 4 | [] | no_license | package org.launchcode.java.studios.countoccurrences;
import java.util.HashMap;
import java.util.Map;
public class CountOccurrences {
public static HashMap<String, Integer> countOccurrences(String[] array) {
HashMap<String, Integer> characterCount = new HashMap<>();
for (String i : array) {
... |
Java | UTF-8 | 3,105 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | package dev.game.spacechaos.engine.hud;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import dev.game.spacechaos.engine.game.BaseGame;
import dev.game.spacechaos.engine.t... |
TypeScript | UTF-8 | 1,653 | 2.6875 | 3 | [] | no_license | import { Component } from '@angular/core';
import { trigger, state, style, transition, animate, keyframes } from '@angular/animations';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
animations: [
trigger('flyInOut', [
state('in', style({tra... |
JavaScript | UTF-8 | 385 | 2.96875 | 3 | [] | no_license | // Load parser using Remarkable library
let md = new Remarkable();
// Function to call when saving an html file
function saveHTML(htmlVal){
// Log the parsed MD and set it to a variable
let $html = md.render(htmlVal);
console.log($html);
// Create HTML file
let blob = new Blob([`${$html}`],{type:'text/html;charset... |
Rust | UTF-8 | 3,778 | 3.15625 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT",
"Apache-2.0",
"BSD-3-Clause",
"GPL-1.0-or-later",
"LGPL-2.0-or-later"
] | permissive | use proc_macro2::{Ident, Span};
use std::cmp::Ordering;
use std::fmt::{self, Display};
use std::hash::{Hash, Hasher};
#[cfg(feature = "parsing")]
use crate::lookahead;
/// A Rust lifetime: `'a`.
///
/// Lifetime names must conform to the following rules:
///
/// - Must start with an apostrophe.
/// - Must not consist... |
Ruby | UTF-8 | 795 | 2.71875 | 3 | [
"MIT"
] | permissive | module Flows
class Result
# Error for unwrapping non-successful result object
class UnwrapError < Flows::Error
def initialize(status, data, meta)
@status = status
@data = data
@meta = meta
end
def message
"You're trying to unwrap non-successful result with st... |
PHP | UTF-8 | 6,290 | 2.734375 | 3 | [
"MIT"
] | permissive | <?php include 'config.php'?>
<?php
session_start();
if(isset($_POST["add_to_cart"]))
{
if(isset($_SESSION["shopping_cart"]))
{
$item_array_id = array_column($_SESSION["shopping_cart"], "item_sno");
if(!in_array($_GET["sno"], $item_array_id))
{
... |
C | UTF-8 | 1,666 | 3.515625 | 4 | [] | no_license | /* COMP3301 2011 - A0 Sample Solution
* Sam Kingston, May 2011.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* prototypes from other .c files */
void do_ls(char *arg);
void do_lsr(char *arg);
void do_cp(char *src, char *dest);
void do_rm(char *arg);
static void dispatch_command(char *str)
{
c... |
Java | UTF-8 | 6,324 | 3 | 3 | [] | no_license |
package loyal.Battle.Actions;
import java.util.ArrayList;
import loyal.Battle.Characters.CharacterState.Stat;
import loyal.Battle.Characters.CharacterType;
import loyal.Battle.Characters.PlayingCharacter;
import loyal.entities.CharacterStore;
import loyal.entities.GeneratorOfParties;
import loyal.entities.SimpleChar... |
Java | UTF-8 | 245 | 2.109375 | 2 | [] | no_license | package practice.car.entity;
public class Gasoline95 {
public String getName() {
return name;
}
public Integer getPrice() {
return price;
}
private String name="95号汽油";
private Integer price=7;
}
|
JavaScript | UTF-8 | 9,687 | 2.703125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | /**
* Route Manager manages route create/edit operations
*
*/
define(function (require) {
"use strict";
var $ = require('jquery');
var L = require('leaflet');
var RouteManager = function (args) {
this.initialize(args);
};
RouteManager.prototype.initialize = function (args) {};
... |
PHP | UTF-8 | 5,165 | 2.875 | 3 | [] | no_license | <?php
declare(strict_types=1);
namespace Kev\TicTacToe\Module\Game\Domain;
use Kev\TicTacToe\Module\Move\Domain\Move;
use Kev\TicTacToe\Module\Move\Domain\Position;
use Kev\Types\Aggregate\AggregateRoot;
use function sprintf;
final class Game extends AggregateRoot
{
const MAX_MOVES = 8;
const POSSIBLE_COMBI... |
Java | UTF-8 | 3,971 | 4.125 | 4 | [] | no_license | package com.implement.pepcoding.dp;
public class PalindromicSubstring {
/*
* Time complexity : O(n^2). This gives us a runtime complexity of O(n^2).
* Space complexity : O(n^2). It uses O(n^2) space to store the table.
*/
public static int countSubstringDP(String s) {
int strLength = s.length();
if (strL... |
Python | UTF-8 | 914 | 3.375 | 3 | [] | no_license | # https://leetcode.com/problems/hamming-distance/?tab=Description
def hammingDistance( x, y):
"""
:type x: int
:type y: int
:rtype: int
"""
x2=bin(x)[2:].zfill(32)
y2=bin(y)[2:].zfill(32)
hamming = 0
# print x2,y2
for i in range (32) :
... |
Java | UTF-8 | 12,902 | 2.34375 | 2 | [] | no_license | /*
* (c) Copyright 2010-2011 AgileBirds
*
* This file is part of OpenFlexo.
*
* OpenFlexo is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any late... |
Python | UTF-8 | 577 | 3.859375 | 4 | [] | no_license | destructor:
===========
Inverse of constructor.
automatically destroy the object.
in python we have automatic carbage collection mechanism.
so we dont need to write code neccessary.
but if you think write it is posiible.
__del__()
call destructor: del obj_name
"""
class Human:
def __init__(self):... |
C | UTF-8 | 1,388 | 2.8125 | 3 | [
"MIT"
] | permissive | /*
* cli.h
*
* Created on: Mar 13, 2018
* Author: nickyang
*/
#ifndef CLI_H_
#define CLI_H_
#define CLI_ARG_COUNT_MAX 16 //Number of Args supported.
#define CLI_ARGS_SIZE_MAX 16 //Maximum Length of a single args
typedef enum CLI_RET
{
CLI_SUCCESS = 0, CLI_FAILURE = -1,
} CLI_RET;... |
Java | UTF-8 | 5,296 | 2.296875 | 2 | [] | no_license | package operations;
import java.sql.*;
import java.util.ArrayList;
import model.Transaction;
import javax.swing.JOptionPane;
//import com.sun.org.apache.bcel.internal.classfile.PMGClass;
import oracle.jdbc.pool.OracleDataSource;
public class POSOperations
{
private Statement stmt;
private ResultSet rset;
p... |
Markdown | UTF-8 | 4,618 | 2.609375 | 3 | [
"CC-BY-NC-ND-4.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | # SS14 | 从年轻到懂事的文科生
- 这是一个 90 后上山吃苦的故事.
- 说的是, 三步并作一步的年轻人, 在成熟担当的大师兄帮助下, 搞定日期转换的故事...
### 0. 见色起意
- 开源潮流下, 年轻人也被洗脑, 以为程序改变世界.
- 以为参加蟒营, 1 个半月即可习得'穿山遁甲'之技.
- 于是乎, 伪装需要 gitlab api 的陪伴, 无理要求查看自己个儿操弄 issue 的个数.
- 满嘴谎话得宣称, 按自然周查看个人 gitlab 发布 issue 个数,即可获得自我学习行为的理性评价.
- 当然, 这是扯淡... 好在蟒营开放的氛围, 一向崇尚'犯错是最好的学习路径',给了年轻人检验自己荒唐想... |
C | UTF-8 | 255 | 2.859375 | 3 | [] | no_license | #include<stdio.h>
//authors : Arsal fadilah V.01
int main(){
int angka;
//input
scanf("%d", &angka);
//proses dan ouput
if(angka%2!=0){
printf("ganjil\n");
} else{
printf("genap\n");
}
return 0;
}
|
Java | UTF-8 | 1,872 | 2.796875 | 3 | [] | no_license | import java.awt.event.*;
import javax.swing.*;
import javax.swing.filechooser.*;
/** controleur du sous menu d'édition de niveaux (getion des interaction avec l'interface). */
public class ControleSubBuildMenu1 implements ActionListener{
private Fenetre mainFenetre = null;
private Fenetre fenetre = null;
ControleSu... |
Python | UTF-8 | 1,047 | 3.59375 | 4 | [] | no_license | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 01 15:47:41 2017
@author: Elani
"""
#118. Pascal's Triangle
class Solution(object):
def generate(self, numRows):
#:type numRows: int
#:rtype: List[List[int]]
if numRows == 0:
return []
elif numRows == 1:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.