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 |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 2,413 | 3.328125 | 3 | [] | no_license | '''
@Author : NONO SAHA Cyrille
Generate a random number between [0,1] using the evolution function
'''
from ROOT import *
import array
import matplotlib.pyplot as plt
import numpy as np
def vonNeumann(x) :
return (2/np.pi)*np.arcsin(np.sqrt(x))
def evolution(lamda, x) :
... |
Python | UTF-8 | 156 | 3.53125 | 4 | [] | no_license | #paste code here
choice = input("what number would you like to make a times table for?")
x=0
while x <15:
x = x+1
ans = x*choice
print (ans)
|
Markdown | UTF-8 | 12,117 | 2.75 | 3 | [] | no_license | > 现在十年过去了,这儿终于长成了一个绿树成荫的地方。有一天下很大的雨,经过池塘的时候,看到一只狸猫趴在池塘中间的荷叶上。
###成荫
####作者/周嘉宁
几个月前的晚上,我和F一起在外面吃饭,忘记是为了庆祝什么事情,喝得都有些醉醺醺的。我们打车回家,一起从车里走出来,在小区里走了一段路。冬天还没有来,但是天已经很冷。这是一个巨型小区,有朋友第一次来做客的话,我都会约他们在轻轨站见面,然后陪他们走回来,否则很容易便会在这儿迷路。走在路上,常常有出租车司机从车里探出脑袋来问出口往哪里走,还有新上任的外卖小弟气急败坏在楼宇之间穿行。小区分成好几期,一期最旧,住着大多是本地人,F的父母也住在那里。而到了我们租住的四期,则... |
Markdown | UTF-8 | 1,285 | 2.671875 | 3 | [
"MIT"
] | permissive | # 单元测试使用检查说明
- [@vue/cli-plugin-unit-mocha](https://cli.vuejs.org/core-plugins/unit-mocha.html#injected-commands)
- [chai](http://chaijs.com/)
## 测试用例常用方法
> should 和 expect 是 TDD(Test-Driven Development)——测试驱动开发,assert BDD(Behavior-Driven Development)——行为驱动开发
### 连接器
- to
- be
- been
- is
- that
- ... |
C++ | UTF-8 | 4,240 | 3.046875 | 3 | [] | no_license | #include "card.h"
Card::Card()
{
}
int Card::getId()
{
return this->id;
}
QString Card::getCardName()
{
return this->card_name;
}
void Card::setCardName(QString& card_name)
{
this->card_name = card_name;
}
QVector<ColorCard> Card::getColors()
{
return this->colors;
}
void Card::setColors(QVector<... |
Markdown | UTF-8 | 3,462 | 2.71875 | 3 | [
"MIT"
] | permissive | # PoliCSS
PoliCSS (pronounced Po-lis) will Enforce a CSS methodology, Suppress individual coding styles, Control specificity and Oppress team members.
## What is it?
PoliCSS is a CSS methodology and a PostCSS based linter designed to enforce it.
## Benefits
* Easier maintenance
* Reduce Bugs
* Portable between proje... |
C# | UTF-8 | 1,442 | 2.984375 | 3 | [] | no_license | using Gamayun.Infrastucture.Entities;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
namespace Gamayun.Infrastucture.Command.Admin
{
public class CreateSemesterCommandHandler : ICommandHandler<CreateSemesterCommandHandler.Command>
{
private readonly GamayunDbCont... |
Java | UTF-8 | 942 | 2.296875 | 2 | [] | no_license | package code.maths.litteraladv;
import code.maths.litteralcom.StrTypes;
import code.util.StringMap;
import code.util.core.IndexConstants;
public final class VariableMaOperation extends LeafMaOperation {
private final String varName;
private final int varOffset;
public VariableMaOperation(int _indexInEl, i... |
Python | UTF-8 | 155 | 3.640625 | 4 | [] | no_license | import itertools
#itertools can create infinite loops so use a for loop
for guess in itertools.product("ABCD","xy"):
guess=''.join(guess)
print(guess)
|
TypeScript | UTF-8 | 1,579 | 2.671875 | 3 | [
"MIT"
] | permissive | import { matches } from '../src/matches'
import { expect } from 'chai'
import { simpleExpressions } from './simpleExpressions'
import { compoundExpressions } from './compoundExpression'
describe('evaluate', () => {
it('should handle primitives', () => {
expect(matches(2, 2), 'Two numbers should be the same').to.... |
PHP | UTF-8 | 5,941 | 2.9375 | 3 | [] | no_license | <?php
//Filedata é a variável que o flex envia com o arquivo para upload
$doc = $_FILES['doc'];
// Pasta onde o arquivo vai ser salvo
$_UP['pasta'] = 'upload';
// Tamanho máximo do arquivo (em Bytes)
$_UP['tamanho'] = 1024 * 1024 * 2; // 2Mbyte
// Array com os tipos de erros de upload... |
Java | UTF-8 | 866 | 2 | 2 | [] | no_license | package com.apirest.efi.models.services;
import java.util.List;
import com.apirest.efi.models.dao.IndicadorGrupoDao;
import com.apirest.efi.models.entity.IndicadorGrupo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class IndicadorGrupo... |
C++ | UTF-8 | 1,041 | 2.515625 | 3 | [] | no_license | #include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdio.h>
#include <stdlib.h>
#include "Semaforo.h"
union uni
{
int val = 0; //Valor para el comando SETVAL
struct semid_ds *buf; //Para los comandos IPC_SET
unsigned short *array; //Para los comandos GETALL y SETALL
struct sem... |
Python | UTF-8 | 979 | 3.984375 | 4 | [] | no_license | print('%d'%(12345)) #顯示數值「12345」,未設寬度時直接顯示整數資料
print('%8d'%(12345)) #顯示數值「ΔΔΔ12345」,設寬度為8,寬度有剩時補空格(靠右對齊)
print('%-8d'%(-12345)) #顯示數值「-12345ΔΔ」,靠左對齊,寬度有剩時補空格
print('%08d'%(12345)) #顯示數值「00012345」,設寬度為8,寬度有剩時補0
print('%3d'%(-12345)) #顯示數值「-12345」,設寬度為3,寬度不足時全部顯示
print('%c'%('A')) #顯示字元「A」
print('%4c'%('A'))... |
Java | UTF-8 | 8,408 | 2.5 | 2 | [] | no_license | package com.example.erika_000.devmanager;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem... |
Markdown | UTF-8 | 15,789 | 2.734375 | 3 | [
"MIT"
] | permissive | # mesa
[](https://www.npmjs.org/package/mesa)
[](https://travis-ci.org/snd/mesa/branches)
[](http://codecov.io/gith... |
Java | UTF-8 | 1,717 | 3.875 | 4 | [] | no_license | import javax.swing.*;
import java.awt.*;
import java.util.Scanner;
import static javax.swing.JFrame.EXIT_ON_CLOSE;
public class GoToCenter {
public static void mainDraw(Graphics graphics) {
// Create a line drawing function that takes 2 parameters:
// The x and y coordinates of the line's starting point
... |
Python | UTF-8 | 2,035 | 3.171875 | 3 | [
"MIT"
] | permissive | from Rotor import Rotor
from Plugboard import Plugboard
from StaticRotor import StaticRotor
from Reflector import Reflector
class EnigmaController:
def __init__(self, rotors, keys, reflector):
self.plug = Plugboard()
self.static = StaticRotor()
self.left = Rotor(rotors[0], keys[0])
... |
Python | UTF-8 | 625 | 3.65625 | 4 | [] | no_license | from collections import Counter
def firstRepeated(str):
words = str.split(" ")
print(words)
dictt = Counter(words)
print(dictt)
for key in words:
if(dictt[key]>1):
print(key)
break
if __name__ == "__main__":
str = "Ravi had been saying that he had been there"
firstRepeated(str)
... |
Java | UTF-8 | 1,507 | 2.625 | 3 | [] | no_license | import org.junit.Test;
import static org.junit.Assert.*;
import org.testfx.framework.junit.ApplicationTest;
import resources.*;
public class RahulM4 extends ApplicationTest {
@Test
public void easyMonsterCheck() {
Player easyPlayer = new Player("easyCheck", Weapon.SPEAR, 750, "Easy");
Monster ... |
C++ | UTF-8 | 5,547 | 3.5 | 4 | [] | no_license | //Suhan Ma Skip List and Rectangle
#include <iostream>
#include <string>
#include <cstring>
#include <ctime>
#include "rectangle.h"
#include "skip_list.h"
using namespace std;
int skip_list::random_level()
{
int level = 0;
while (rand()%2 == 0) level++;//flip a coin, decide weather to "go deeper"
if (level... |
JavaScript | UTF-8 | 1,169 | 3.125 | 3 | [] | no_license | function translate(){
var title = document.getElementById("form-signin-heading");
var email = document.getElementById("inputEmail");
var password = document.getElementById("inputPassword");
// se usa document.getElementById para especificar cual nodo sera modificado
var remember = document.getElemen... |
Python | UTF-8 | 1,461 | 2.59375 | 3 | [] | no_license | """ Mail Sparkpost Driver """
from masonite.contracts.MailContract import MailContract
from masonite.drivers.BaseMailDriver import BaseMailDriver
from masonite.exceptions import DriverLibraryNotFound
class MailSparkpostDriver(BaseMailDriver, MailContract):
"""Sparkpost driver
"""
def _sandbox_mode(self)... |
Python | UTF-8 | 61 | 2.640625 | 3 | [
"MIT"
] | permissive | def get_bit(byteval,idx):
return ((byteval&(1<<idx))!=0); |
Java | UTF-8 | 1,428 | 3.75 | 4 | [] | no_license | package com.nsc.datastructures.list.circularlinkedlist;
import java.util.StringJoiner;
public class CircularLinkedList<T> {
private Node head;
private Node tail;
private int size;
public CircularLinkedList() {
head = tail = null;
size = 0;
}
public void add(T element) {
... |
Python | UTF-8 | 1,929 | 2.8125 | 3 | [] | no_license | import numpy as np
from scipy.optimize import leastsq
import matplotlib.pyplot as pl
import copy
import numpy
def fun(x, p):
a, b = p
return a*x + b
def fun_2(x, p):
a, b ,c = p
return a*x*x+b*x + c
def residuals(p, x, y):
return fun(x, p) - y
def residuals_2(p, x, y):
a = p[0]
if a<0:... |
Python | UTF-8 | 634 | 4.1875 | 4 | [] | no_license | '''
Input: a List of integers
Returns: a List of integers
'''
def moving_zeroes(arr):
end = len(arr)-1
# find the last non-zero value
while arr[end] == 0 and end > 0:
end -= 1
cur = 0
# iterate through the array
while cur < end:
# if arr[cur] is 0, swap it with the end
i... |
Java | UTF-8 | 95 | 1.5625 | 2 | [] | no_license | package dao;
import entidade.Task;
public interface TaskDao extends BaseDAO<Task, Long> {
}
|
Java | UTF-8 | 3,735 | 2.078125 | 2 | [] | no_license | package io.mns.mpfm.ui.fragments;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import ... |
C | ISO-8859-1 | 308 | 3.875 | 4 | [
"MIT"
] | permissive | #include <stdio.h>
#include <stdlib.h>
/*
Apresentar os nmeros entre 0 e 4, com intervalo de 0.25 entre eles, ou seja, 0, 0.25, 0.5, 0.75 ... 4.
*/
int main (void)
{
float Cont;
for(Cont=0;Cont<=4;Cont=Cont+0.25)
{
printf("%.2f\t",Cont);
}
printf("\n");
system("pause");
}
|
C++ | UTF-8 | 3,347 | 3.09375 | 3 | [] | no_license | //Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0 ? Find all unique triplets in the array which gives the sum of zero.
//
//Note : The solution set must not contain duplicate triplets.
//
// For example, given array S = [-1, 0, 1, 2, -1, -4],
//
// A solution set is :
//[
/... |
Python | UTF-8 | 627 | 2.890625 | 3 | [] | no_license |
def process():
result = ""
with open("./srt.txt","r") as f :
for line in f.readlines():
if len(line.strip()) == 0:
line = "&" + line.replace("\n","")
result += line
result = result.split("&")
fianl_result = []
for single in result:
single... |
Java | UTF-8 | 376 | 2.015625 | 2 | [] | no_license | package com.switchvov.nio.gateway.filter;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpHeaders;
public class HeaderHttpResponseFilter implements HttpResponseFilter {
@Override
public void filter(FullHttpResponse response) {
HttpHeaders headers = response.... |
C++ | UTF-8 | 1,488 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include "Product.h"
using namespace std;
Product::Product()
{
this->name="potato";
this->price=25;
this->weight=500;
}
bool Product::operator> (const Product &qq) const
{
if (name>qq.name)
{return 1;}
return 0;
}
bool Product::operator< (const Product &qq) const
{
if (name<... |
C# | UTF-8 | 353 | 2.515625 | 3 | [] | no_license | using System;
// 此处引用基类所属的命名空间
using AssemblyBase;
namespace AssemblyDerived
{
class DerivedClass : BaseClass { }
class Program
{
static void Main(string[] args)
{
DerivedClass dc = new DerivedClass();
dc.PrintMyself();
Console.ReadKey();
}
... |
Swift | UTF-8 | 1,637 | 3.953125 | 4 | [
"MIT"
] | permissive | //: [Assunto Anterior](@previous)
/*:
Esse conceito é muito usado em outras linguagens, principalmente linguages scriptadas, mas na minha visão, se você precisa usar algo como isso, você provavelmente não achou a melhor solução para o seu problema. Por isso, vou cobrir de forma bem breve essa nova funcionalidade.
... |
Python | UTF-8 | 1,201 | 3.078125 | 3 | [] | no_license | def ha(s):
return ' ' + '-' * s + ' '
def hz(s):
return ' '*(s+2)
def vb(s):
return '|'+ ' '*s + '|'
def vl(s):
return '|'+ ' '*s + ' '
def vr(s):
return ' '+ ' '*s + '|'
def paint(h,s,i):#h:높이,s:간격표준,i:그리는숫자
if h == 0: #첫째줄
if i == 1 or i == 4:
return hz(s)
else:
... |
Python | UTF-8 | 1,204 | 2.921875 | 3 | [] | no_license | from collections import defaultdict, Counter
with open('input') as f:
lines = [x.strip() for x in f]
foods = {}
for i in range(len(lines)): # line in lines:
line = lines[i]
ingr, allerg = line.split(' (contains ')
ingr = ingr.split()
allerg = allerg[:-1].split(',')
allerg = [x.strip() for x in... |
Python | UTF-8 | 4,667 | 3.03125 | 3 | [] | no_license | import pickle
import pandas as pd
from flask import Flask, jsonify, request
# User defined modules
import ML_Model.Test_Dataframes_pickles.dataframe_shape_functions as dfsf
import ML_Model.Test_Transformations_pickles.transformation_functions as tff
app = Flask(__name__)
model_path = "ML_Model/prediction_p... |
C# | UTF-8 | 4,217 | 3.5 | 4 | [] | no_license | //namespace EX_6._Jagged_Array_Manipulator
using System;
using System.Linq;
namespace EX_6._Jagged_Array_Manipulator
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
double[][] jaggedArray = new double[n][];
//Първо... |
Python | UTF-8 | 285 | 3.296875 | 3 | [] | no_license | # Teste seu codigo aos poucos.
# Nao teste tudo no final, pois fica mais dificil de identificar erros.
# Nao se intimide com as mensagens de erro. Elas ajudam a corrigir seu codigo.x=int(imput("dividendo:"))
x=int(input("divisor:"))
y=int(input("dividor:"))
z=x//y
a=x%y
print(x,y,z,a) |
Java | UTF-8 | 2,336 | 2.9375 | 3 | [] | no_license | public class item {
protected String username;
protected int itemID;
protected String itemTitle;
protected String itemDescription;
protected String date;
protected double itemPrice;
protected String itemCategory;
public item() {
}
public item(int itemID) {
this.itemID = itemID;
}
//need itemID since... |
C++ | UTF-8 | 263 | 2.625 | 3 | [] | no_license | // move.h -- class definition
#ifndef MOVE_H_
#define MOVE_H_
class Move
{
private:
double x;
double y;
public:
Move(double a = 0, double b = 0);
void showmove() const;
Move & add(const Move & m) const;
void reset(double a = 0, double b = 0);
};
#endif
|
SQL | UTF-8 | 4,246 | 3.3125 | 3 | [] | no_license | create table if not exists `user`(
`id` int unsigned primary key auto_increment comment '主键ID',
`promoter_id` int not null default 0 comment '推广人id',
`note` varchar(128) not null default '' comment '推广备注',
`type` enum('0','2','4') not null default '0' comment '0:普通用户;2:商家;4:区域合伙人',
`user_name` varc... |
Markdown | UTF-8 | 5,616 | 2.625 | 3 | [] | no_license | # Exercise 08
I'm so sorry that there are always some errors when i download and install the vpython modual, and i have no idea to solve the problem.
## Abstract
Use python to study the oscillatory motion and chaos further.
## Background
* Simple pendulum<br>

{
MyCommandHandler.Commands = new Li... |
PHP | UTF-8 | 289 | 2.546875 | 3 | [] | no_license | <?php
namespace Topxia\Service\Common;
class FieldChecker
{
public static function checkFieldName($name)
{
if (!ctype_alnum(str_replace('_', '', $name))) {
throw new \InvalidArgumentException('Field name is invalid.');
}
return true;
}
}
|
TypeScript | UTF-8 | 4,624 | 2.5625 | 3 | [
"MIT"
] | permissive | import { join } from "path";
import { readJsonSync } from "fs-extra";
type CmdDecl = {
command: string;
when?: string;
title?: string;
};
type DebuggerDecl = {
variables?: Record<string, string>;
};
describe("commands declared in package.json", () => {
const manifest = readJsonSync(join(__dirname, "../../p... |
Markdown | UTF-8 | 1,794 | 2.859375 | 3 | [
"GPL-3.0-only",
"MIT"
] | permissive | # packman
## Getting Started
#### Prerequisites
- Neovim(>= 4.0)
- Git
#### Installing
The whole plugin is just a lua file.
Run this command to install or update packman.
```sh
$ curl https://raw.githubusercontent.com/theJian/packman.lua/master/packman.lua -o $HOME/.config/nvim/lua/packman.lua
```
Configure pack... |
Python | UTF-8 | 176 | 3.625 | 4 | [] | no_license | a = input()
count_a = 0
count_b = 0
for i in range(0, len(a)) :
if a[i] == "(" :
count_a += 1
if a[i] == ")" :
count_b += 1
print(count_a, count_b)
|
Markdown | UTF-8 | 1,571 | 3.46875 | 3 | [] | no_license | # 伪目标
## 1. 伪目标的语法:
在书写伪目标时,首先需要声明伪目标,然后再定义伪目标规则.
### 1.1 声明伪目标:
```makefile
.PHONY clean (这里声明clean是伪目标)
```
### 1.2 定义伪目标规则:
```makefile
clean: (这里定义伪目标clean的规则,即伪目标的执行动作)
rm *.c
```
## 2. 伪目标的作用:
### 2.1 避免目标名与文件名冲突
也即,如果指定了伪目标,那么伪目标一定会被执行。
### 2.2 提高执行效率
当一个目标被声明为 伪目标后,makefile在执行规则时不会去试图查找隐... |
Python | UTF-8 | 2,452 | 3.328125 | 3 | [] | no_license | import unittest
from app.calculator import Calculator
from unittest.mock import patch, Mock
class TddInPythonAttempt(unittest.TestCase):
def setUp(self):
self.calc = Calculator()
#Test validate_input function
def test_calculator_validate_input_both_ints_is_1(self):
result = self.calc.validate_input(1,2)
sel... |
Java | UTF-8 | 1,619 | 2.203125 | 2 | [] | no_license | package com.supra.service;
import java.util.List;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.supra.common.util.CommonUtil;
i... |
Java | UTF-8 | 1,353 | 3.1875 | 3 | [] | no_license | package com.revature.vehicles;
import java.io.FileNotFoundException;
import java.io.IOException;
public class Driver {
public static void main(String[] args) throws FileNotFoundException, IOException {
Car ferari = new Car("Ferari", "Red", 95);
Car delorean = new Car("Delorean", "Silver", 88);
Car chevy = ... |
Java | UTF-8 | 367 | 2.640625 | 3 | [] | no_license | package com.sharknado.gestfish_hfc2018.model;
public enum TipoProducao {
SEMI_INTENSIVO("Semi-Intensivo"), INTENSIVO("Intensivo");
private String label;
TipoProducao(String label) {
this.label = label;
}
public String getLabel() {
return label;
}
@Override
public Str... |
SQL | UTF-8 | 2,485 | 3.234375 | 3 | [] | no_license | REM
REM Quick tuning prober
REM
@_BEGIN
DEFINE p = SUM(pins)
DEFINE r = SUM(reloads)
DEFINE m = &r/&p*100
SELECT
&p pins,
&r reloads,
&m "MISS RATE",
DECODE(SIGN(&m - 1), 1, 'Increase SHARED_POOL_SIZE', 'OK') comments
FROM
v$librarycache
/
UNDEFINE p r m
DEFINE g = SUM(gets)
DEFINE m ... |
Java | UTF-8 | 2,243 | 2.390625 | 2 | [] | no_license | package com.hebidu.example.test1.entity;
import javax.persistence.*;
@Entity
@Table(name = "bs_book_source_type", schema = "bookstore", catalog = "")
public class BsBookSourceTypeEntity {
private long id;
private String name;
private String homeUrl;
private long createTime;
private long updateTime... |
Python | UTF-8 | 724 | 3.953125 | 4 | [] | no_license | from datetime import datetime
#def 函式名稱(參數):
# def sumCal(numberC,numberD):
# result = numberC**numberD
# return result
# print(sumCal(10,2))
def GetDatetime(formatDate):
#formatDate 是 要轉換前的日期
#分割字串取得年分
tmpYear = formatDate.split("年")[0]
#民國年轉換成西洋年
nowYear = str(int(tmpYear)+1911)
#分割字... |
Markdown | UTF-8 | 2,447 | 2.578125 | 3 | [] | no_license | # dhis2-dummydatatracker
Tool box to generate and manage dummy data in Tracker
## Tools for dummy data generation in Tracker
Python 3.6+ is required.
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install required packages.
```bash
pip install -r requirements.txt
```
Create auth... |
Shell | UTF-8 | 1,279 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
GREEN='\033[0;32m'
LB='\033[1;34m' # light blue
NC='\033[0m' # No Color
./utils/dependency-chec-helm.sh
echo "############################################################################"
echo "Now deploying Rancher latest in namespace cattle-system"
echo "#################################################... |
Python | UTF-8 | 10,161 | 2.875 | 3 | [] | no_license | import pandas as pd
from astrodbkit import astrodb
def matches_sortCSV(gaia_catalogue, search_radius = 0.000048481, db_path = '../BDNYCdb_practice/bdnycdev_copy.db', save_all = False, save_needsreview = False):
"""Sort Gaia data into separate dataframes row by row, one for 'matches', one for 'new objects', and one... |
C# | UTF-8 | 8,489 | 2.890625 | 3 | [] | no_license | // UBMModel
// Model for UnblockMe Solver
// 2014-07-22 PV
#pragma warning disable IDE0052 // Remove unread private members
#pragma warning disable IDE0051 // Remove unused private members
using System;
using System.Collections.Generic;
namespace CS523B_UnblockMe_Solver_Visual
{
public class UBMModel
{
... |
C++ | UTF-8 | 948 | 3.109375 | 3 | [] | no_license | class Solution {
public:
int lengthOfLongestSubstring(string s) {
if (s.length() <= 1) { return s.length(); }
int res = -1, right = 0;
unordered_set<char> store;
for (int left = 0; left < s.length(); ++left) {
while (right < s.length() && !store.count(s[right])) {
store.insert(s[right]);
++right;
... |
Java | UTF-8 | 1,197 | 2.21875 | 2 | [
"MIT"
] | permissive | package kaptainwutax.featureutils.decorator.ore.nether;
import kaptainwutax.biomeutils.biome.Biomes;
import kaptainwutax.featureutils.decorator.ore.HeightProvider;
import kaptainwutax.featureutils.decorator.ore.ScatterOreDecorator;
import kaptainwutax.mcutils.block.Blocks;
import kaptainwutax.mcutils.version.MCVersion... |
Markdown | UTF-8 | 1,343 | 2.84375 | 3 | [] | no_license | # Notes on Git
## Setup
### Set identity
~~~~
git config [--global] user.email "user@email.com"
git config [--global] user.name "Name"
~~~~
### Download repository
`git clone https://repository.git`
### View remote repositories
`git remote -v`
### Add upstream repository
`git remote add upstream https://repositor... |
C# | UTF-8 | 796 | 2.640625 | 3 | [] | no_license | using NUnit.Framework;
using Lab_17_NorthwindTests;
using LAB_014_LINQ;
namespace Lab_17_NwindTests
{
public class Tests
{
[SetUp]
public void Setup()
{
}
[Test]
public void Test1()
{
Assert.Pass();
}
[TestCase(null, -1)] // ... |
Java | UTF-8 | 1,897 | 2.265625 | 2 | [] | no_license | package uk.co.wehavecookies56.kk.common.container.inventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentStri... |
C++ | UTF-8 | 1,091 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<omp.h>
#include<math.h>
using namespace std;
int main()
{
int start = omp_get_wtime();
int N = 100000;
float arr[N];
for(int i =0;i<N;i++){
arr[i] = 5;
}
long int sum =0;
omp_set_num_threads(1);
#pragma omp parallel for reduction(+:sum)
for(int i =0;i<N;i++){
sum+= arr[i];
}
cout<<sum<<endl... |
PHP | UTF-8 | 5,750 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories;
use App\Models\BankModel;
use App\Models\ParcelModel;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
class HomeActionsRepo
{
public static function splitInputs(array $arr)
{
$bankSchema = Schema::getColumnListing("bank... |
Java | UTF-8 | 452 | 2.15625 | 2 | [] | no_license | package com.test01.anno;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import com.test01.anno.MyNickName;
public class MTest {
public static void main(String[] args) {
ApplicationContext factory = new ClassPathXmlApplicationCont... |
Markdown | UTF-8 | 813 | 2.84375 | 3 | [] | no_license | # Topics
* Command Line
* Git
* For loops
* If/else/elif statements
* Lists
* Functions
* Dictionaries
* Syntax
* Debugging
* Flowcharts
# Examples of question types you may find
* I might ask you what to type into the command line to navigate from one folder to another
* Core git concepts, for instance matching a t... |
Java | UTF-8 | 2,620 | 2.484375 | 2 | [] | no_license | package Control;
import Model.Categoria;
import Model.Gerenciadores.GerenciaCategoria;
import Model.Gerenciadores.GerenciaProduto;
import Model.PDFProduto;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx... |
C++ | SHIFT_JIS | 1,518 | 2.671875 | 3 | [] | no_license | #pragma once
#include "Common.h"
class Title : public MyApp::Scene
{
private:
public:
const Font font = Font(40);
Title(const InitData& init) : IScene(init)
{
// V[ǂݍݎɈxs
}
// t[ updateAndDraw() ŌĂ
void update() override
{
if (KeySpace.up())
... |
Java | UTF-8 | 2,660 | 1.859375 | 2 | [
"MIT"
] | permissive | package io.fundrequest.core.config;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.auth.BasicAuthRequestInterceptor;
import feign.codec.Decoder;
import feign.codec.Encoder;
import feign.httpclient.ApacheHttpClient;
import io.fundrequest.core.identity.IdentityAPIClient;
import io.fundreque... |
Java | UTF-8 | 466 | 1.859375 | 2 | [
"Apache-2.0"
] | permissive | package com.palmelf.eoffice.service.arch.impl;
import com.palmelf.core.service.impl.BaseServiceImpl;
import com.palmelf.eoffice.dao.arch.ArchFondDao;
import com.palmelf.eoffice.model.arch.ArchFond;
import com.palmelf.eoffice.service.arch.ArchFondService;
public class ArchFondServiceImpl extends BaseServiceImpl<ArchFo... |
JavaScript | UTF-8 | 1,427 | 3.109375 | 3 | [] | no_license | const enviar = document.getElementById("btnEnviar");
const nombre = document.getElementById("txtNombre");
const mensaje = document.getElementById("txtComentario");
enviar.addEventListener('click', function() {
//utilizando el PI Fetch
fetch('http://localhost/app_web/servidor_V4/php/script_form_mensajes.php', {... |
Java | UTF-8 | 4,340 | 2.203125 | 2 | [] | no_license | package edu.gatech.cs2340.nonprofitdonationtracker.controllers;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spi... |
Python | UTF-8 | 531 | 3.125 | 3 | [] | no_license | def minSetSize(arr):
from collections import Counter
number_counter = Counter(arr)
num_set = set(arr)
num_set = sorted(num_set, key=lambda x: number_counter[x], reverse=True)
print(num_set)
total_count = len(arr)
count = 0
set_count = 0
for n in num_set:
set_count +... |
Python | UTF-8 | 938 | 3.40625 | 3 | [] | no_license | '''
def move(ac):
global p
if ac == "LEFT":
p -= 1
acs.append(ac)
elif ac == "RIGHT":
p += 1
acs.append(ac)
p = 0
acs = []
res = []
n = int(raw_input())
for i in range(n):
n = int(raw_input())
for i in range(n):
acao = raw_input()
if acao[0] ... |
C++ | UTF-8 | 2,892 | 2.859375 | 3 | [
"MIT"
] | permissive | // Author: btjanaka (Bryon Tjanaka)
// Problem: (UVa) 380
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define FORe(i, a, b) for (int i = a; i <= b; ++i)
#define PAI(arr, len) /*Print array of integers*/ \
{ \
for (int _i = 0; _i < len; ++... |
Python | UTF-8 | 476 | 3.3125 | 3 | [] | no_license | class Room:
def __init__(self, id, num_features, size):
self.id = id
self.size = size
self.features = [0] * num_features
def __eq__(self, value):
return self.id == value.id
def __str__(self):
return "{} (size={}) : {}".format(self.id, self.size, self.features)
... |
Markdown | UTF-8 | 422 | 4.03125 | 4 | [] | no_license | # superDigit
This code is written in JavaScript. It repeats a number n times and sums all resulting digits, until only one reminds. This is the super digit that will be printed.
For example:
For n=3 and the number numero=148, the concatenated number will be P=148148148.
Then, the function will sum all the digits as f... |
Python | UTF-8 | 749 | 2.609375 | 3 | [] | no_license | def run(m, data, ut):
class tests(ut.TestCase):
def test_1_test_lin_data(self):
shader = m().setLimits(0, 10, 10, scale_type='lin').initialize()
shader.apply([1])
shader.apply([2])
shader.apply([3])
shader.apply([4])
shader.apply(5)
shader.apply(6)
self.assertEqu... |
Java | UTF-8 | 399 | 2.3125 | 2 | [] | no_license | package figures;
import com.jogamp.opengl.GLEventListener;
import java.awt.*;
public interface Figure extends GLEventListener {
Figure withRotate(int rotateSpeed, boolean axisX, boolean axisY, boolean axisZ);
Figure withSize(float sizeX, float sizeY, float sizeZ);
Figure withColor(Color color);
... |
Python | UTF-8 | 392 | 3.484375 | 3 | [] | no_license | # Program to check the first index of number if any using recursion in a better way
from sys import setrecursionlimit
setrecursionlimit(20000)
def checkIndex(arr, x, si):
#base case
l = len(arr)
if si == l:
return -1
if arr[si] == x:
return si
#IH
smallerList = checkIndex(arr, x... |
Python | UTF-8 | 2,580 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python3
# cooperated with
# 3619d41d-b80b-11e7-a937-00505601122b
import argparse
import sys
import numpy as np
import sklearn.datasets
import sklearn.linear_model
import sklearn.metrics
import sklearn.model_selection
import sklearn.pipeline
import sklearn.preprocessing
if __name__ == "__main__":
p... |
C++ | UTF-8 | 1,001 | 3.65625 | 4 | [] | no_license | /*
Given a string S, find and return all the possible permutations of the input string.
Note 1 : The order of permutations is not important.
Note 2 : If original string contains duplicate characters, permutations will also be duplicates.
Input Format :
String S
Output Format :
All permutations (in different lines)... |
Markdown | UTF-8 | 7,447 | 3.078125 | 3 | [
"BSD-3-Clause"
] | permissive | # Semidefinite Programming {#SemidefiniteProgramming}
If you want a living version of this chapter just run the notebook
`NC/DEMOS/4_SemidefiniteProgramming.nb`.
There are two different packages for solving semidefinite programs:
* [`SDP`](#PackageSDP) provides a template algorithm that can be
customized to solve ... |
PHP | UTF-8 | 328 | 2.828125 | 3 | [
"MIT"
] | permissive | <?php
namespace Fabic\Nql\Exceptions;
class ParserException extends NqlException
{
/**
* Creates a new ParserException describing a Syntax error.
*
* @param string $message Exception message
*
* @return self
*/
public static function syntaxError($message)
{
return new self('[Syntax Error] ' . $messag... |
C++ | MacCentralEurope | 1,082 | 4.15625 | 4 | [] | no_license | /*
7. Write a program that reads input a word at a time until a lone q is entered.The
program should then report the number of words that began with vowels, the number
that began with consonants, and the number that fit neither of those categories.
One approach is to use isalpha() to discriminate between words beginnin... |
Python | UTF-8 | 4,144 | 2.59375 | 3 | [] | no_license | #!/usr/bin/env python3
import sys
from collections import namedtuple
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import DBSCAN, AgglomerativeClustering
import ROOT as r
Pixel = namedtuple('Pixel', ['x', 'y', 'raw', 'cal'])
def cluster(pixels, algorithm):
data = np.array([[x, y, ... |
PHP | UTF-8 | 518 | 2.5625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | <?php
/*
* This file is part of the Indigo Ruler package.
*
* (c) Indigo Development Team
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Indigo\Ruler;
/**
* Defines a single rule
*
* @author Márk Sági-Kazár <mark.s... |
Python | UTF-8 | 6,630 | 2.515625 | 3 | [
"MIT"
] | permissive | """Section Service."""
import datetime
import os
import sys
import time
from collections import defaultdict
from multiprocessing.pool import ThreadPool
from django.core.cache import cache
from berkeleytime.utils import AtomicInteger, BColors
from catalog.mapper import section_mapper
from catalog.models import Course,... |
Python | UTF-8 | 15,164 | 2.71875 | 3 | [
"MIT"
] | permissive | import sys
import getopt
import os.path
import itertools
from scipy.stats import chisquare
from typing import Tuple
from Bio import Phylo
from Bio.Phylo.BaseTree import TreeMixin
from .base import Tree
from ...helpers.files import read_single_column_file_to_list
class PolytomyTest(Tree):
def __init__(self, args... |
C++ | UTF-8 | 327 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <string.h>
using namespace std;
class A
{
public:
static void setA( int i );
static int getA();
private:
static int a;
};
int A::a = 0;
void A::setA( int i )
{
a = i;
}
int A::getA()
{
return a;
}
int main()
{
A::setA( 1 );
cout << "A::a = " << A::getA() << e... |
C# | UTF-8 | 859 | 2.859375 | 3 | [] | no_license | using System;
namespace Cubo.Core.Domain
{
public class Item : Entity
{
public Guid BucketId { get; protected set; }
public string Key { get; protected set; }
public string Value { get; protected set; }
protected Item()
{
}
public Item(Guid bucketId, st... |
JavaScript | UTF-8 | 298 | 2.71875 | 3 | [] | no_license | export default function getSortStep(originalArr, operation, elementsInOperation) {
const arr = JSON.parse(JSON.stringify(originalArr));
elementsInOperation.forEach(id => {
if (operation === "compare") arr[id].isInComparison = true;
else arr[id].isInSwap = true;
});
return arr;
}
|
Markdown | UTF-8 | 3,577 | 2.875 | 3 | [] | no_license | Justin Nguyen - JNguyen96
Alexander Kang - alexk2060
CS56 W16
a) This is a chance based game where the user faces off against the computer or another player, rolling dice in order to build an insect or person.
b) As a player, I can click "Roll" so that the "dice" will roll
As a player, I can see which parts I still n... |
C# | UTF-8 | 1,642 | 3.109375 | 3 | [] | no_license | using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
namespace CSharp_Shell
{
public class CDAction : CommonAction
{
override public bool TryDo(out int responseCode)
{
responseCode = 0;
string arg;
if(Args != null && Args.Count > 0)
{
... |
C# | UTF-8 | 1,310 | 2.703125 | 3 | [
"MIT"
] | permissive | using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
namespace AspNetCore.Extensions
{
public static class HttpExtensions
{
private static readonly JsonSerializer Serializer... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.