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 |
|---|---|---|---|---|---|---|---|
Ruby | UTF-8 | 1,059 | 3.65625 | 4 | [] | no_license | =begin
Makers. 04/11/20. Here I had to amend the Diary class in order to make it testable in isolation - using a double - from its
dependency class Entry. Here is how I did it.
1) I deleted Entry.new(title, body) from the add method.
2) I placed a parameter in the initialize method, entry_class, which is by default the... |
Java | UTF-8 | 4,289 | 2.4375 | 2 | [
"Apache-2.0"
] | permissive | package com.cybernostics.lib.gui.windowcore;
import com.cybernostics.lib.gui.ButtonFactory;
import com.cybernostics.lib.gui.IconFactory;
import com.cybernostics.lib.gui.IconFactory.StdButtonType;
import com.cybernostics.lib.gui.declarative.events.WhenMadeVisible;
import com.cybernostics.lib.gui.shapeeffects.ShapedPane... |
Python | UTF-8 | 2,230 | 3.75 | 4 | [] | no_license | __author__ = 'Kalyan'
import string
notes = '''
Write your own implementation of converting a number to a given base. It is important to have a good logical
and code understanding of this.
Till now, we were glossing over error checking, for this function do proper error checking and raise exceptions
as appropri... |
Python | UTF-8 | 331 | 3.15625 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
def f(x):
return x**4 - 8*x**3 - 35*x**2 + 450*x - 1001
x = np.linspace(0.0, 10.0, 1000)
plt.clf()
plt.plot(x, f(x))
plt.grid(True)
plt.savefig("IMG_exe_5_10.pdf")
x = np.linspace(4.0, 6.0, 1000)
plt.clf()
plt.plot(x, f(x))
plt.grid(True)
plt.savefig("IMG_exe_5_... |
Swift | UTF-8 | 1,934 | 2.859375 | 3 | [] | no_license | //
// LineGraphViewController.swift
// ChartsDemo-Swift
//
// Created by Rupam Mitra on 01/08/16.
// Copyright © 2016 Rupam Mitra. All rights reserved.
//
import UIKit
class LineGraphViewController: BaseGraphViewController {
override func viewDidLoad() {
chartIdentifier = String(LineChartView)
... |
C | UTF-8 | 3,186 | 2.71875 | 3 | [] | no_license | #include "monopoly.h"
#include "game.h"
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
float results[40] = {0};
void *play_monopoly(void *results_lock) {
srand((unsigned) ((pthread_self() << 16) + time(NULL)));
float tile_landings[40] = {0};
int game;
... |
Java | UTF-8 | 10,700 | 1.9375 | 2 | [] | no_license | package swipe.android.nearlings;
import java.text.DateFormatSymbols;
import java.text.NumberFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import swipe.android.nearlings.googleplaces.GoogleParser;
import swipe.android.nearlings.googleplaces.GoogleParser.PlacesTask;
import android.... |
C# | UTF-8 | 3,352 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using log4net;
using log4net.Config;
using System.Configuration;
using System.Collections.Specialized;
namespace dk.gov.oiosi.logging
{
/// <summary>
/// Log4Net creator
/// </summary>
... |
Java | UTF-8 | 1,545 | 2.078125 | 2 | [] | no_license | //package OTP_RECIEVER;
//
///**
// * Created by Mr singh on 2/3/2017.
// */
//
//import android.content.BroadcastReceiver;
//import android.content.Context;
//import android.content.Intent;
//import android.os.Bundle;
//import android.telephony.SmsManager;
//import android.telephony.SmsMessage;
//import android.util.L... |
Java | UTF-8 | 4,287 | 2.265625 | 2 | [] | no_license | package com.orangeteam.auc.models;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;
@Entity
@Table(name = "PRODUCT")
public class Product {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "ID", nullable = false)
private Long id;
@Column(name = "NAME",... |
Swift | UTF-8 | 867 | 2.71875 | 3 | [] | no_license | //
// CommonView.swift
// Therapist
//
// Created by Astghik Hakopian on 5/2/20.
// Copyright © 2020 Astghik Hakopian. All rights reserved.
//
import UIKit
class CommonView: UIView {
// MARK: - @IBInspectable
@IBInspectable var cornerRadius: CGFloat = 0 {
didSet {
updateCorn... |
Python | UTF-8 | 4,791 | 2.71875 | 3 | [
"MIT"
] | permissive | """
GUI of image-resizer.
"""
import os
import itertools
import tkinter as tk
import tkinter.filedialog as fd
import image_resizer
import async_util
POS_X = 10
INPUT_FILE_TYPES = [
('image file', '*.bmp;*.jpeg;*.jpg;*.png;*.ppm;*.gif;*.tiff')
]
def on_select_files_button_click():
in_files = infile_text.get(... |
TypeScript | UTF-8 | 570 | 2.640625 | 3 | [] | no_license | import { justTodoListSelector } from '../selectors/index';
// @ts-ignore
export const observeTodoList = (store, cb) => {
let prevState = justTodoListSelector(store.getState());
// Check against the initial store values
if (prevState) {
cb(prevState);
}
// This will trigger an update when the store data... |
JavaScript | UTF-8 | 364 | 3.21875 | 3 | [] | no_license | var readline = require("readline");
var leitor = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let a = 0;
let b = 0;
leitor.question("", primeirovalor => {
a = parseInt(primeirovalor);
leitor.question("", segundovalor => {
b = parseInt(segundovalor);
console.log(`SOMA =... |
Java | UTF-8 | 398 | 1.921875 | 2 | [] | no_license | package cn.lanca.plentyoffish.article.service;
import cn.lanca.plentyoffish.article.model.Comment;
/**
* Description: 文章评论业务接口层
* <p>
* Author: Hongliang.mei
* Date: 2019/11/7 15:38
*/
public interface ICommentService {
/**
* 新增/添加评论
*
* @param comment 评论对象
* @return Long
*/
Lo... |
C | UTF-8 | 229 | 3.46875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int x, polynomial;
printf("enter value of x:");
scanf("%d", &x);
polynomial = ((((3 * x + 2) * x - 5) * x - 1) * x + 7) * x - 6;
printf("polynomial value:%d\n",polynomial);
} |
Python | UTF-8 | 533 | 3.125 | 3 | [
"MIT"
] | permissive | from tqdm import tqdm
import zipfile
import sys
wordlist = sys.argv[2]
zip_file = sys.argv[1]
zip_file = zipfile.ZipFile(zip_file)
n_words = len(list(open(wordlist, "rb")))
print("Senhas:", n_words)
with open(wordlist, "rb") as wordlist:
for word in tqdm(wordlist, total=n_words, unit="word"):
try:
... |
Java | UTF-8 | 852 | 3.078125 | 3 | [] | no_license | package feuchtwanger.scrabble;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
public class ScrabbleDictionary {
private static ScrabbleDictionary singleton;
private final HashSet<String> dictionary;
public ScrabbleDictionary() throws IOException {
... |
Python | UTF-8 | 567 | 3.125 | 3 | [] | no_license | import numpy
from matplotlib import pyplot as plot
from sklearn.metrics import r2_score
# training & testing
numpy.random.seed(2)
x = numpy.random.normal(3, 1, 100)
y = numpy.random.normal(150, 40, 100) / x
# plot.scatter(x, y)
# plot.show()
train_x, train_y = x[:80], y[:80]
test_x, test_y = x[80:], y[80:]
mymod... |
Python | UTF-8 | 418 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python -u
import sys, pickle
def main():
if len(sys.argv) != 2:
sys.stderr.write('Usage: %s input_file\n' % (sys.argv[0]))
exit(1)
with open(sys.argv[1], 'rb') as f:
single_dict = pickle.load(f)
sys.stderr.write('#single = ' + str(len(single_dict)) + '\n')
print 'AuthorId,DuplicateAuthorIds'
f... |
C++ | UTF-8 | 650 | 3.234375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
bool estimate(TreeNode* root, long long lower, long long upper) {
if (root == nullptr) ... |
Python | UTF-8 | 1,356 | 2.609375 | 3 | [] | no_license | # coding: utf8
# from __future__ import unicode_literals
import core as cdc
class Node_localvector(cdc.Dagnode):
def getcomment(self):
return 'this node extract current world translation of an object'
def getdisplaytype(self):
return 'math'
def getinputplugs(self):
return [
... |
JavaScript | UTF-8 | 947 | 2.78125 | 3 | [] | no_license | 'use strict';
const xhr = new XMLHttpRequest();
const submit = document.querySelector('#submit-button');
let title = document.querySelector('textarea');
let url = document.querySelector('input');
let form = document.querySelector('form');
const icon = document.querySelector('#icon');
icon.addEventListener('click', ()... |
Markdown | UTF-8 | 7,587 | 3.515625 | 4 | [] | no_license | ## 记账页面
### Money.tsx 的UI 完成
1. 根据设计稿,将TagsSection的结构先搞清楚,然后就开始写HTML,然后写css
```
<TagsSection>
<ol>
<li>衣</li>
<li>食</li>
<li>住</li>
<li>行</li>
</ol>
<button>新增标签</button>
</TagsSection>
const TagsSection = styled.section`
background: #FFFFFF... |
C# | UTF-8 | 3,809 | 3.203125 | 3 | [] | no_license | using NUnit.Framework;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System;
using SFDCInjector.Utils;
namespace SFDCInjector.Tests.Utils
{
/// <summary>
/// Tests for SFDC Injector's SerializerDeserializer class.
/// </summary>
[TestFixture]
public class SerializerDe... |
C++ | UTF-8 | 617 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "opencvtypeconverter.h"
OpencvTypeConverter::OpencvTypeConverter()
{
}
cv::Rect OpencvTypeConverter::qrect2CvRect(QRectF rect)
{
return cv::Rect(rect.topLeft().x(),rect.topLeft().y(),rect.width(),rect.height());
}
QRectF OpencvTypeConverter::qpoint2CvPoint(cv::Rect rect)
{
QPoint tl(rect.tl().x, re... |
TypeScript | UTF-8 | 1,298 | 3.0625 | 3 | [] | no_license | // interfaces/types
import type { StoryPhrases } from "../../../types/storyTypes";
// e.g. As a user, I can edit a text input in the middle, without the cursor going to the end
export const STORY_REGEX = RegExp(/as (an?) (.*), I ([a-z]*) ([^,]*)(, .*)?/i);
export const getStoryPhrases = (text: string): StoryPhrases =... |
Java | UTF-8 | 209 | 2.171875 | 2 | [] | no_license | package subsequence;
/**
* Created by thiemann on 21.05.17.
*/
public class Main {
public static PartialOrdering subsequenceCompare(String s1, String s2) {
return PartialOrdering.LESS;
}
}
|
PHP | UTF-8 | 1,068 | 3.09375 | 3 | [] | no_license | <?php
namespace App\Classes;
use App\Classes\Password;
use App\Interfaces\InterfaceLogin;
/**
*
*/
class Login
{
private $email;
private $password;
/* Gerando os Setters. */
function setEmail($email)
{
$this->email = $email;
}
function setPassword($password)
{
$this->password = $password;
}
pub... |
Java | UTF-8 | 278 | 2.859375 | 3 | [] | no_license | package HomeworkArray;
public class Task3 {
public static void main(String[] args) {
//print to the console "foo bar" using two positions from this array:
String[] s_r = new String[] {"foo ","hello","bar","world"};
System.out.println(s_r[0] + s_r[2]);
}
}
|
Ruby | UTF-8 | 876 | 4.28125 | 4 | [] | no_license | =begin
Write your code for the 'Series' exercise in this file. Make the tests in
`series_test.rb` pass.
To get started with TDD, see the `README.md` file in your
`ruby/series` directory.
=end
# contiguous = sharing a border; adjacent
class Series
# start with a string of numbers
def initialize(num_string)
@num_str... |
C++ | UTF-8 | 625 | 2.84375 | 3 | [] | no_license | #ifndef REGISTRO_H
#define REGISTRO_H
#include <iostream>
class Registro {
private:
std::string estado;
std::string data;
int codigo;
std::string cidade;
int casos;
int mortes;
public:
Registro(std::string data, std::string estado, std::string cidade, int ... |
Python | UTF-8 | 955 | 2.640625 | 3 | [] | no_license | #much of the code is gotten from these websites:
#www.voidspace.org.uk/python/articles/cookielib.shtml
#stackoverflow.com/questions/189555/how-to-use-python-to-login-to-a-webpage-and-retrieve-cookies-for-later-usage
import urllib
import urllib2
import cookielib
# handles passwords and cookies
class URL:
def __ini... |
C# | UTF-8 | 598 | 2.734375 | 3 | [] | no_license | using SOLIDPresentation.Open_Closed;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SOLIDPresentation.LiskovSubstitution
{
class Mammal : Animal
{
public override void Fly()
{
throw new Exception("Mammal... |
Markdown | UTF-8 | 491 | 2.5625 | 3 | [
"MIT"
] | permissive | # notebooks
Our community notebooks used in our workshops and talks. Docker container with Anaconda and some scientific Python stuff.
## Usage
You can download and run this image using the following commands:
```sh
docker build -t joinvilleml/notebooks:latest .
```
And start the Jupyter Notebook server:
```sh
doc... |
Java | UTF-8 | 775 | 1.796875 | 2 | [] | no_license | package com.example.selim.h2h.utils;
import android.app.Application;
import com.parse.Parse;
import com.parse.ParseACL;
import com.parse.ParseInstallation;
import com.parse.ParseObject;
import com.parse.ParseUser;
/**
* Created by selim on 26/01/2016.
*/
public class MyApp extends Application {
public ParseUser ... |
C# | UTF-8 | 1,179 | 3.4375 | 3 | [
"MIT"
] | permissive | using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections.Generic;
namespace Regex_Exercise_3_Camera_View
{
class Program
{
static void Main(string[] args)
{
int[] numbers = Console.ReadLine().Split(" ").Select(int.Parse).To... |
Python | UTF-8 | 7,150 | 3.421875 | 3 | [] | no_license | # Import python 3.0 behaviour so division does not truncate reminder when dividing integers.
from __future__ import division
import matplotlib.pyplot as plt
import csv
import pickle
from pylab import polyfit, poly1d
def loadLabMT(path):
""" Load labMT file into a dictionary.
"""
happiness = {}
with op... |
Ruby | UTF-8 | 844 | 3 | 3 | [] | no_license | require 'bundler'
Bundler.require
require_relative 'lib/player'
require_relative 'lib/game'
#require_relative 'lib/XXX'
player1 = Player.new("Lulu la terreur")
player2 = Player.new("Carlos le crado")
puts " A ma droite nous avons #{player1.name}\n Et à ma gauche nous avons #{player2.name}"
puts "\nvoici l'état de nos... |
Java | UTF-8 | 590 | 1.664063 | 2 | [] | no_license | package com.daking.sports.activity.personalset;
import android.os.Bundle;
import android.support.annotation.Nullable;
import com.daking.sports.R;
import com.daking.sports.base.NewBaseActivity;
import butterknife.ButterKnife;
/**
* Description:
* Data:2018/4/11-14:18
* steven
*/
public class PersonActivity extends... |
Java | UTF-8 | 1,385 | 2.4375 | 2 | [] | no_license | package fr.tangv.jeux2diso.objets;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.simpleyaml.configuration.serialization.ConfigurationSerializable;
import fr.tangv.jeux2diso.entity.EntityLocation;
public class Location implements ConfigurationSerializable {
protected... |
Java | UTF-8 | 4,678 | 2.546875 | 3 | [] | no_license | package com.hjx.android.customviewset.widget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.s... |
Swift | UTF-8 | 709 | 2.5625 | 3 | [] | no_license | //
// TouchDownGestureRecognizer.swift
// Treader
//
// Created by Derik Flanary on 3/7/16.
// Copyright © 2016 Derik Flanary. All rights reserved.
//
import Foundation
import UIKit
import UIKit.UIGestureRecognizerSubclass
class TouchDownGestureRecognizer: UIGestureRecognizer
{
override func touchesBegan(touc... |
PHP | UTF-8 | 802 | 2.9375 | 3 | [] | no_license | <?php
//$createEntry = true;
$servername = "localhost";
$dbuser = 'root';
$dbpass = '';
$dbname = "nearbuy";
$connection = mysqli_connect($servername, $dbuser, $dbpass,$dbname);
if (!$connection) {
die("Connection failed: " . mysqli_connect_error());
}
$createEntry = $_POST['prepareTable'];
if($create... |
Rust | UTF-8 | 90 | 2.6875 | 3 | [] | no_license | extern crate add_two;
#[test]
fn it_adds_two() {
assert_eq!(4, add_two::add_two(2));
}
|
Shell | UTF-8 | 256 | 2.609375 | 3 | [] | no_license | #!/bin/bash
#siitalgabskript
echo -n "Mitu rida soovid: "; read rida
for (( j = 1; j <= $rida; j++ ))
do
echo -n "$j."
for (( a = ((rida-1)); a >= $j; a--))
do
echo -n "O"
done
for (( i = 1; i <= $j; i++ ))
do
echo -n "*"
done
echo ""
done
|
Java | UTF-8 | 7,728 | 2.953125 | 3 | [] | no_license | package org.jyoshiriro.pocs.marsexplorer.model;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.jyoshiriro.pocs.marsexplorer.exception.BoundaryReachedException;
import org.jyoshiriro.pocs.marsexplorer.exception.PlaneNotDefinedException;
import static org.junit.jupiter.api.Asser... |
Java | UTF-8 | 712 | 2.03125 | 2 | [] | no_license | package com.mmj.active.homeManagement.model;
import java.util.List;
public class WebMaketingEx {
private List<WebMaketing> list;
private Integer showId;
private Integer maketingShow;
public List<WebMaketing> getList() {
return list;
}
public void setList(List<WebMake... |
Ruby | UTF-8 | 1,138 | 2.578125 | 3 | [
"MIT"
] | permissive | require 'metriks'
require 'rubypython'
require 'pygments.rb'
class Content
module Code
include Pygments
# Heroku's cedar stack raises an "invalid ELF header" exception using the
# latest version of python (2.7) on the system. python2.6 seems to work fine.
RubyPython.configure :python_exe => 'python2... |
Java | UTF-8 | 1,019 | 2.515625 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package citbyui.cit260.mountKabru.view;
import byui.MountKabru.Control.GameControl;
/**
*
* @author Moose
*/
public c... |
Java | UTF-8 | 3,795 | 3.09375 | 3 | [] | no_license | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
public class P1 {
public static int check(ArrayList<Character> word){
... |
C# | UTF-8 | 3,945 | 2.875 | 3 | [
"MS-PL",
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SimpleRX
{
public class LookupSubject<T, TKey> : BaseSubject<ILookup<TKey, T>>
{
private IObservable<T> source;
private Func<T, TKey> keySelector;
private IDisp... |
Java | UTF-8 | 302 | 1.9375 | 2 | [] | no_license | package com.blazers.jandan.model.event;
import com.blazers.jandan.util.log.Log;
/**
* Created by blazers on 2016/12/8.
*/
public class FastScrollUpEvent {
public int index;
public FastScrollUpEvent(int index) {
this.index = index;
Log.i("ScrollUpEvent" + index);
}
}
|
Java | UTF-8 | 3,052 | 1.976563 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2015 Bubblegum Developers
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
Python | UTF-8 | 1,774 | 2.84375 | 3 | [] | no_license | import numpy as np
import pandas as pd
from collections import Counter
from random import shuffle
train_data = np.load('training_data.npy')
df = pd.DataFrame(train_data)
print(df.head())
print(Counter(df[1].apply(str)))
forwards = []
lefts = []
rights = []
backs = []
forwardAndLefts = []
forwardAndRigh... |
Python | UTF-8 | 14,983 | 3.15625 | 3 | [
"MIT"
] | permissive | import pandas as pd
from datetime import datetime
import math
nan = float('nan')
#Definindo primeira Linha iterável da planilha
def get_begin_row(data,rows,begin_string):
for row in rows:
if(data.iloc[row][0] == begin_string):
new_begin = int(row)
#Primeiro indice não None pós matricula
... |
Java | UTF-8 | 5,935 | 2.71875 | 3 | [] | no_license | package org.ubimix.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.ubimix.commons.parser.json.utils.JavaObjectBuilder;
import org.ubimix.commons.parser.json.utils.JavaObjectVisitor;
/**
* @author kotelnikov
*/
public class TreePresenter {
@SuppressWarnings("unchecked... |
C# | UTF-8 | 461 | 3.046875 | 3 | [] | no_license | using System.Linq;
namespace Dji.UI.Extensions
{
public static class StringExtensions
{
public static bool IsValidHexString(this string value)
{
string[] hexValues = value.Trim().Split(' ');
return !(hexValues.Any(h => h.Length != 4) || hexValues.Any(h => h[1] != 'X' &... |
Java | UTF-8 | 684 | 3.25 | 3 | [] | no_license | package src.Arrayprograms;
public class Arraysort11 {
public static void main(String[] args) {
int temp;
// int length;
int []array= { 3,5,6,2 };
int length=array.length;
for(int i=0;i<=length;i++)
{
for(int j=i+1;j<=length-1;j++) {
if(array[i]>array[j])
{
temp=array[i];
array[i]=arr... |
C# | UTF-8 | 2,616 | 2.890625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace MauiDoctor
{
public class Util
{
public Util()
{
}
public const string DoctorEnvironmentVariableNamePrefix = "MAUI_DOCTOR_";
public static void SetDoctorEnvironmentVariable(string na... |
Java | UTF-8 | 2,038 | 2.21875 | 2 | [] | no_license | /*
* RemoveFuncSigFileAction.java
*
* Created on December 18, 2005, 3:17 PM
*
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
... |
Python | UTF-8 | 452 | 3.6875 | 4 | [] | no_license | import math
def shellSort(alist):
length = len(alist)
gap = int(math.floor(length/2))
while gap > 0:
for i in range(gap, length, 1):
for j in range(i, -1, -gap):
if j-gap >= 0 and alist[j-gap] > alist[j]:
alist[j-gap], alist[j] = alist[j], alist[j-gap]
els... |
Java | UTF-8 | 2,495 | 2.328125 | 2 | [] | no_license | package cz.muni.fi.pv243.musiclib.dao.impl;
import cz.muni.fi.pv243.musiclib.dao.SongDao;
import cz.muni.fi.pv243.musiclib.dao.UserDao;
import cz.muni.fi.pv243.musiclib.entity.Album;
import cz.muni.fi.pv243.musiclib.entity.Artist;
import cz.muni.fi.pv243.musiclib.entity.Genre;
import cz.muni.fi.pv243.musiclib.entity.S... |
C# | UTF-8 | 1,717 | 3.46875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MatrixProblems
{
public class ValidTicTacToe
{
int[,] matrix;
int size = 0;
public ValidTicTacToe(int n)
{
matrix = new int[n,n];
... |
PHP | UTF-8 | 760 | 2.890625 | 3 | [] | no_license | <?php
$arr=array(
'student1'=>array("name"=>"Vishal",
"age"=>"10",
"fname"=>"Satish",
"mobile"=>"3456",
"city"=>"Delhi"),
'student2'=>array("name"=>"Amit",
"age"=>"13",
"fname"=>"ABC",
"mobile"=>"444",
"city"=>"Patna"),
'student3'=>array("name"=>"Submit",
"age"=>"45",
"fname"=>"FFGG... |
C# | UTF-8 | 712 | 3.390625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
namespace Adf.Test
{
public static class EnumerableExtensions
{
public static T PickOne<T>(this IEnumerable<T> e)
{
var one = e.Skip(new Random().Next(e.Count()) - 1).First();
Console.WriteLine("Picked ... |
Markdown | UTF-8 | 2,421 | 2.65625 | 3 | [
"MIT"
] | permissive | Customizable PHP Error Handler (custom-php-error-handler)
========================
<strong>Copyright (c) 2014-2023 Rich Morgan, rich@richmorgan.me</strong>
Description
------------
This is a custom, flexible and configurable error handler useful for debugging. It writes the specified level of error messages to a log... |
Java | UTF-8 | 1,005 | 2.21875 | 2 | [] | no_license | package com.hospital.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hospital.Dao.*;
import com.hospital.Interface.*;
import com.hospital.Entity.*;
@Service
public class GioiThieuChiTietService implements GioiThi... |
Java | UTF-8 | 782 | 3.171875 | 3 | [] | no_license | /**
* Creates an object with the player's history
* @author Mehdi Himmiche
* @date Apr 25, 2016
*/
public class OperationHistory {
private String operation;
private String correctAnswer;
private String selectAnswer;
public OperationHistory(String operation, String correct, String selected) {
this.operation ... |
Java | UTF-8 | 908 | 2.078125 | 2 | [] | no_license | package zhuazhu.readhub.mvp.launcher;
import android.Manifest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.tbruyelle.rxpermissions2.RxPermissions;
import java.util.concurrent.TimeUnit;
import zhuazhu.readhub.R;
import zhuazhu.readhub.mvp.main.MainActivity;
public class Lau... |
Java | UTF-8 | 7,095 | 2.21875 | 2 | [] | no_license | package com.catbattle.bean;
public class CatInfo {
private String catId;
private String catName;
private String category;
private String defaultLevel;
private String maxLevel;
private String hp;
private String kb;
private String attack;
private String attackRate;
privat... |
Markdown | UTF-8 | 583 | 2.609375 | 3 | [] | no_license | ---
permalink: /projects.html
layout: default
title: CLARIPHY Projects
---
# Projects involving CLARIPHY collaborators
We list here a number of small projects which are underway and which involve CLARIPHY collaborators. These are often larger projects with additional participants, which can be found on the linked pro... |
Python | UTF-8 | 1,172 | 3.078125 | 3 | [] | no_license | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
def graficar_3d(n):
matriz=np.array(n, dtype='float').reshape(3,4)
b=matriz[:,3]
A=np.delete(matriz, 3, axis=1)
print(A)
print(b)
solu=np.linalg.solve(A,b)
print (solu)
... |
Python | UTF-8 | 825 | 4.3125 | 4 | [] | no_license | """
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.
"""
## maybe find a multiple of 3,4,5 such that they add ... |
Markdown | UTF-8 | 965 | 2.859375 | 3 | [
"MIT"
] | permissive | # BubFusion
The game consists of levels. The level is a grid field which can consists moving and stationary objects. There can initially be two types of balls on the level: full and empty. With the help of swipes, the player is able to move the balls. When touch begin, the same balls combine into one, which changes th... |
Java | UTF-8 | 958 | 3.8125 | 4 | [] | no_license | /**
* Title: Temperature Converter
* Description:
* Company: Heritage College
* @author Philip
* @version 1.0
*/
import java.util.Scanner;
public class TemperatureConverter
{
public static void main(String args[])
{
Scanner keyboard = new Scanner (System.in);
int celsiusTe... |
Markdown | UTF-8 | 3,216 | 2.875 | 3 | [] | no_license | ---
title: Charlie Chawke ‘very’ interested in buying Newcastle United
author: Kevin Doocey
type: post
date: 2009-07-12T11:33:38+00:00
url: /2009/07/12/charlie-chawke-very-interested-in-buying-newcastle-united/
dsq_thread_id:
- "92802650"
categories:
- Charlie Chawke
- Newcastle United News
tags:
- Charlie Chaw... |
Java | UTF-8 | 1,586 | 2.609375 | 3 | [
"MIT"
] | permissive | package pizzatech;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import ... |
Java | UTF-8 | 8,060 | 1.84375 | 2 | [] | no_license | package api.keyword.controller;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.naming.directory.InvalidAttributesException;
import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.openqa.selenium.By;
import a... |
C | UTF-8 | 335 | 3.25 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
int zhishu(int a)
{int i=2,s=0,n,m;
while(i<a)
{n=a%i;
i=i+1;
if(n==0)
s=s+1;//不是质数
else
s=s;//是质数
}
if(s==0)
m=0;
//是质数
else
m=1;
//不是质数
return m;
}
int main()
{
int n,p=1;
scanf("%d",&n);
n=n+1;
while(p!=0)
{p=zhishu(n);
n=n+1;
}
n=n-1;
printf("%d",n);
return 0;
} |
JavaScript | UTF-8 | 1,419 | 2.90625 | 3 | [] | no_license | import { createTable } from "./table.js";
{
const columns = [
{ name: "date", valueFunc: (d) => d.slice(0, 10) },
{ name: "name" },
{ name: "points" },
{ name: "bootcamp" },
{ name: "energiser" },
{ name: "category" },
].map((o, i) => {
o.headerFunc = (h) => h[0].toUpperCase(... |
Java | UTF-8 | 661 | 3.375 | 3 | [] | no_license | /**
*
* O(n^2) for all best, average and worst case, stable when using extra space
* @author Tarun Gulati, tarun.gulati1988@gmail.com
*
*/
package com.tarun.sort.selection;
import java.util.Arrays;
public class SelectionSort {
private int numbers[];
private int size;
public void sort( int[] arrayToSort ){... |
C | UTF-8 | 2,020 | 3 | 3 | [] | no_license | #include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
void cancelCatchException(void);
void throwException(int);
int catchException(void);
#define INSUFFICIENT_MEMORY "malloc returned NULL in catchException\n"
#define INVALID_EXCEPTION_NUMBER "throwException: Invalid exception number %d\n"
#... |
C++ | UTF-8 | 223 | 3.484375 | 3 | [] | no_license | // 參閱4-30頁
long fact(int n)
{
if (n == 0)
return 1;
else
return n * fact(n - 1);
}
void setup()
{
Serial.begin(115200);
long ans = fact(4); // 計算4的階層
Serial.print(ans);
}
void loop() {}
|
SQL | UTF-8 | 267 | 3.15625 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='Thermometer' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['2019','6213','1407','2221','6044','6019','4211','4202','4208','2232'])
|
Ruby | UTF-8 | 2,990 | 2.65625 | 3 | [] | no_license | class Sighting < ActiveRecord::Base
belongs_to :user
# ALERT_MESSAGE = "Meter Maid is handing out TICKETS near by".freeze
# def notify
# @interest_locations = InterestLocation.all
# @interest_locations.each do |interest_location|
# dist = find_distance([self.latitude, self.longitude], [interest_location.lat... |
C# | UTF-8 | 10,235 | 2.59375 | 3 | [] | no_license | using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using ShowShop.IDAL.Product;
using System.Collections.Generic;
namespace ShowShop.SQLServerDAL.Product
{
public class Express:IExpress
{
#region "DataBase Operation"
/// <summary>
/// 增加一条数据
/// <... |
Java | UTF-8 | 1,092 | 1.914063 | 2 | [
"LicenseRef-scancode-warranty-disclaimer",
"ANTLR-PD",
"CDDL-1.0",
"bzip2-1.0.6",
"Zlib",
"BSD-3-Clause",
"MIT",
"EPL-1.0",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-jdbm-1.00",
"Apache-2.0"
] | permissive | package com.sequenceiq.cloudbreak.converter.v4.stacks.cluster.filesystem;
import org.springframework.stereotype.Component;
import com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.storage.AdlsCloudStorageV4Parameters;
import com.sequenceiq.cloudbreak.converter.AbstractConversionServiceAwareConverter;
im... |
Markdown | UTF-8 | 674 | 2.640625 | 3 | [] | no_license | # Article L624-18
Peut être revendiqué le prix ou la partie du prix des biens visés à l'article L. 624-16 qui n'a été ni payé, ni réglé en
valeur, ni compensé entre le débiteur et l'acheteur à la date du jugement ouvrant la procédure. Peut être revendiquée dans
les mêmes conditions l'indemnité d'assurance subrogée au ... |
PHP | UTF-8 | 13,544 | 2.59375 | 3 | [] | no_license | <?php
class Users extends Model
{
public function __construct($app)
{
parent::__construct($app);
}
public function getHome()
{
$us = $this->app->db->prepare("SELECT u.*, u.id AS id_users, ul.city, img.url
FROM users u
LEFT JOIN usersLocation ... |
Java | UTF-8 | 488 | 2.3125 | 2 | [] | no_license | package test;
import main.Application;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
/**
* This test case verify the result when the sublist size is bigger then the origin list size
*
* @author Mouad Tahiri
*/
public class TestSizeParameter {
@Test
public void should_return_th... |
Markdown | UTF-8 | 1,443 | 2.59375 | 3 | [] | no_license | ### BeeGFS Tips
The BeeGFS storage is spread across 3 nodes with SSD disks. The aggregate storage is 100TB. We don't enforce quotas here as some projects have large storage needs. However, you do need to be a good HPC citizen and respect the rights of others. Don't needlessly fill up this storage.
We regularly **... |
Java | UTF-8 | 1,291 | 2.765625 | 3 | [] | no_license | package com.rhwayfun.sso.common;
import java.net.URLEncoder;
import java.util.UUID;
/**
* Created by rhwayfun on 16-3-23.
*/
public class StringUtil {
private StringUtil(){}
/**
* 根据参数拼接url
* @param originUrl
* @param parameterName
* @param parameterValue
* @return
* @throws E... |
JavaScript | UTF-8 | 2,189 | 4 | 4 | [] | no_license | //a
// const addTheWordCool = ["nice", "awesome", "geweldig"];
// //addTheWordCool.push("cool");
// console.log(addTheWordCool.push("cool"))
const addTheWordCool = function (array) {
array.push("cool");
return array;
};
console.log("Add cool: " + addTheWordCool(["nice", "awesome", "geweldig"]));
//b
// cons... |
Markdown | UTF-8 | 16,972 | 2.921875 | 3 | [
"MIT"
] | permissive | # チーム開発の準備
チーム開発に向けたGitの機能を練習します。
## ブランチ
Gitはオープンソースプロジェクトの開発を想定したツールです。リポジトリーを公開して、常に誰からアクセスされても構わないようにしておくのが基本です。
開発途中で作業時間が終わった場合に、そのままコミットとプッシュをすると、エラーがでるような状態のプロジェクトになってしまいます。これだとそのプロジェクトを使ってみたい人にとっては不便です。かといって、エラーがでない状態になるまでプッシュができないというのも不便です。
そこで、バージョン管理システムには**ブランチ**というものが用意されています。日本語で **枝** のことで、リポジトリーを枝分... |
Markdown | UTF-8 | 1,273 | 2.875 | 3 | [
"BSD-3-Clause"
] | permissive | # Components dev server
This server serves up examples of the web components built within DevTools and provides a useful way to document various states of components.
For more background, see the [initial proposal and design doc](https://docs.google.com/document/d/1P6qtACf4aryfT9OSHxNFI3okMKt9oUrtzOKCws5bOec/edit?pli... |
Java | UTF-8 | 754 | 2.34375 | 2 | [] | no_license | package com.ssh.entity;
public class Score {
private String id;
private Integer score;
private String courseId;
private String stuId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getScore() {
return score;
}
public void setScore(Integ... |
PHP | UTF-8 | 2,007 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Repositories\Impl;
use App\Models\Brand;
use App\Repositories\BrandRepository as BradRepositoryInterface;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
final class BrandRepository implements BradRepositoryInterface
{
/**
* @var Brand
*/... |
C++ | UTF-8 | 3,755 | 2.796875 | 3 | [] | no_license | #include "ClassPacmen.h"
ClassPacmen::ClassPacmen(Side SideFlag):MySide(SideFlag)
{
//ctor
}
ClassPacmen::ClassPacmen( int x , int y, Side SideFlag):MySide(SideFlag), PacmenMode(x, y), GhostMode(x, y)
{
//ctor
}
ClassPacmen::~ClassPacmen()
{
//dtor
}
void ClassPacmen::SetRegion()
{
PacmenMode.Ass... |
Java | UTF-8 | 2,351 | 2.046875 | 2 | [] | no_license | package com.tianjin.beichentiyu.bean;
import java.util.List;
public class FieldAppointListBean extends BaseRespBean{
/**
* code : 99999
* list : [{"serialVersionUID":1,"logId":"157352589343886","timeSlot":"9:00-9:30","state":"0","gradeNum":1,"genTime":"2019-11-12 10:31:33","fId":1},{"serialVersionUID":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.