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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 2,462 | 4.3125 | 4 | [] | no_license | **Planning**
-Goal is to create a program that checks if an integer is a prime number
-A prime number is only dibisible by itself and 1
-1 is not a prime number
**V1**
-Given n is the input integer
-If function to exclude 1 from being a prime number
`` if n == 1:
return False #1 is not a prime
``
-For lo... |
Rust | UTF-8 | 2,228 | 2.578125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | use std::time::Instant;
use structopt::StructOpt;
use crate::graph::undirected::simple_graph::graph::SimpleGraph;
use crate::procedure::configuration::Configuration;
use crate::procedure::procedure::GraphProperties;
use crate::procedure::procedure_chain::ProcedureChain;
use crate::procedure::procedure_registry::Proce... |
C# | UTF-8 | 4,014 | 2.984375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace MemCachedLib.Cached
{
/// <summary>
/// 一致性哈希
/// </summary>
/// <typeparam name="T">节点类型</typeparam>
public class ConsistentHash<T>
{
/// <summary>
... |
PHP | UTF-8 | 1,495 | 3.03125 | 3 | [] | no_license | <?php
require_once "ajax.php";
$ajax = ajax();
//see controllers/messages.php to view the code that handles this request.
//call method controller_messages::messages() in controllers/messages.php
$ajax->call("ajax.php?controller=messages&function=show_messages&a=HELLO WORLD");
?>
<html>
<head>
<meta http-equiv="C... |
C# | UTF-8 | 740 | 2.9375 | 3 | [
"MIT"
] | permissive | namespace T1.ParserKit.Core.Utilities
{
public static class AssertionExtensions
{
#region AssertNotNull
public static void AssertNotNull<T>(this T instance, string message = "Expected a non-null object reference.")
where T : class
{
if (instance == null)
... |
C++ | UTF-8 | 2,990 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
using namespace std;
struct Item {
Item(int v, Item* n) { val = v; next = n; }
int val;
Item* next;
};
void readIntFile(char* filename, Item*& head1, Item*& head2);
void readLine(ifstream& ifile, Item*& head);
Item* concatenate(Item*... |
Java | UTF-8 | 909 | 2.46875 | 2 | [] | no_license | package com.williansiedschlag.course.services;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.williansiedschlag.course.entities.Order;
import com.williansiedschlag.course.respositories.OrderRep... |
Java | UTF-8 | 166 | 2.25 | 2 | [] | no_license | package com.smoothstack.training.wk1day2;
/*
* An interface for Shape objects
*/
public interface Shape {
public void calculateArea();
public void display();
}
|
C | UTF-8 | 6,934 | 2.546875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "SDL/SDL_image.h"
#include "SDL/SDL_mixer.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL.h"
#include "fonctions.h"
//utiliser des define pour W1,W2,H1 ET H2
const int W1=170;
const int H1=309;
const int W2=347;
const int H2=169;
int collision_trigo(SDL... |
C++ | UTF-8 | 3,389 | 3.875 | 4 | [] | no_license | /////////////////////////
// Ian Fisher
// CS 172
// 11/7/16
/////////////////////////
#include <iostream>
#include "Circle.h"
using namespace std;
// I interpretted the end of this problem to mean to write a test of some of the operator overload functions in class Circle:
// Testing
int main() {
Circle circle1; // ... |
Python | UTF-8 | 1,268 | 3.4375 | 3 | [
"MIT"
] | permissive | # GPIOを制御するライブラリ
import wiringpi
# タイマーのライブラリ
import time
# 引数取得
import sys
# GPIO端子の設定
motor1_pin = 23
motor2_pin = 24
# 引数
param = sys.argv
# 第1引数
# go : 回転
# back : 逆回転
# break : ブレーキ
order = param[1]
# 第2引数 秒数
second = int(param[2])
# GPIO出力モードを1に設定する
wiringpi.wiringPiSetupGpio()
wiringpi.pinMode( motor1_pin, ... |
Java | UTF-8 | 1,166 | 2.421875 | 2 | [] | no_license | package com.klay.SecondExample_b_s;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.*;
import io.netty.handler.codec.LengthFieldBasedFrameDecoder;
import io.netty.handler.codec.LengthFieldPrepender;
import io.netty.handler.codec.string.StringDecoder;... |
C# | UTF-8 | 4,441 | 2.84375 | 3 | [
"MIT"
] | permissive | using System;
namespace BoletoNetCore
{
[CarteiraCodigo("1/A")]
internal class BancoSicrediCarteira1 : ICarteira<BancoSicredi>
{
internal static Lazy<ICarteira<BancoSicredi>> Instance { get; } = new Lazy<ICarteira<BancoSicredi>>(() => new BancoSicrediCarteira1());
private BancoSicrediCart... |
Java | UTF-8 | 3,456 | 2.171875 | 2 | [] | no_license | /*
* Copyright (c) 2007 Thomas Weise for sigoa
* Simple Interface for Global Optimization Algorithms
* http://www.sigoa.org/
*
* E-Mail : info@sigoa.org
* Creation Date : 2007-11-29
* Creator : Thomas Weise
* Original Filename: test.org.sigoa.refimpl.utils.testseries.successFilter... |
Java | UTF-8 | 1,085 | 2.59375 | 3 | [] | no_license | import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.ActiveMQXAConnectionFactory;
import javax.jms.*;
public class TopicProducer {
public static final String ACTIVEMQ_URL="tcp://192.168.169.129:61616";
public static final String TOPIC_NAME="TOPIC01";
public static void main(... |
Java | UTF-8 | 1,477 | 2.34375 | 2 | [] | no_license | package Subapps.Logger.MainScreenLogger.Menu;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import java.io.IOException;
public class MenuController {
@FXML... |
Java | UTF-8 | 3,559 | 2.390625 | 2 | [
"Apache-2.0"
] | permissive | package com.qixing.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.qixing.R;
import com.qixing.bean.RechargeRecordBean;
import com.qixing.utlis.DateUtils;... |
Python | UTF-8 | 5,697 | 3.28125 | 3 | [] | no_license | # This took 2 hours to create
# This script runs a sequence of functions to create the final training, validation, and test
# sets that we will use for modeling
import datetime
import numpy as np
import pandas as pd
def read_in_games():
'''
Creates dataframe for all of the tables we're going to use
and joi... |
Java | UTF-8 | 2,056 | 2.453125 | 2 | [] | no_license | package com.cyntex.TourismApp.Logic;
import com.cyntex.TourismApp.Beans.BaseResponse;
import com.cyntex.TourismApp.Beans.RegistrationRequestBean;
import com.cyntex.TourismApp.Beans.RegistrationResponseBean;
import com.cyntex.TourismApp.Persistance.RegistrationDAO;
import com.cyntex.TourismApp.Util.FSManager;
import co... |
JavaScript | UTF-8 | 704 | 4.90625 | 5 | [] | no_license | // Write a function `stringSize` that accepts a string as an argument. The function should return the
// string 'small' if the argument is shorter than 5 characters, 'medium' if it is exactly 5 characters, and
// 'large' if it is longer than 5 characters.
let stringSize = function (str) {
if (str.length < 5) {
r... |
Python | UTF-8 | 1,052 | 2.671875 | 3 | [] | no_license | __author__ = 'Mojca'
from google.appengine.ext import ndb
import uuid
import hmac
import hashlib
class User(ndb.Model):
ime = ndb.StringProperty()
mail = ndb.StringProperty()
coded_password = ndb.StringProperty()
@classmethod
def create (cls, ime, mail, password):
user = cls... |
C# | UTF-8 | 3,012 | 3.03125 | 3 | [
"MIT"
] | permissive | // Copyright (c) Leonardo Brugnara
// Full copyright and license information in LICENSE file
using CmdOpt.Environment;
namespace CmdOpt.Options
{
public delegate void OptionHandler<TEnvironment>(TEnvironment env, params string[] arguments) where TEnvironment : Environment<TEnvironment>;
public abstract class... |
Python | UTF-8 | 2,835 | 3.953125 | 4 | [] | no_license | class Node:
def __init__(self, value=None, next_node=None, prev_node=None):
self.next_node = next_node
self.prev_node = prev_node
self.value = value
def __str__(self):
return str(self.value)
class List:
"""
Двунаправленный связный список.
"""
def __init__(self... |
C++ | UTF-8 | 1,974 | 2.734375 | 3 | [] | no_license | #include "light.h"
#include "phong_shader.h"
#include "ray.h"
#include "render_world.h"
#include "object.h"
vec3 Phong_Shader::
Shade_Surface(const Ray& ray,const vec3& intersection_point,
const vec3& same_side_normal,int recursion_depth,bool is_exiting) const
{
vec3 color;
//Calculate Ambient Color
... |
Markdown | UTF-8 | 1,153 | 3.28125 | 3 | [] | no_license | # pass_crypt
## Introduction
pass\_crypt is a simple Ruby application that allows the secure storage and retrieval of usernames and passwords. Usernames and passwords are stored in an SQLite database, encrypted using AES 256-bit encryption with a personal passphrase. Passwords can be inserted and retrieved using the... |
Ruby | UTF-8 | 2,024 | 3.359375 | 3 | [] | no_license | puts "###########################################"
puts "### Welcome to Awesome Address Book 2.0 ###"
puts "###########################################"
puts # blank line for spacing
### Oops: You were missing the quotes around 'pry'.
### I went ahead and fixed it so that I could
### run the rest of the co... |
TypeScript | UTF-8 | 5,246 | 2.8125 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | import type {
ContractRequest,
RunningTestsState,
StartContractInterceptOptions,
} from './types';
import { checkAndGetTestInfo } from './helpers/checkAndGetTestInfo';
import { generateEmptyTestState } from './helpers/generateEmptyTestState';
const runningTestState: RunningTestsState = {};
/**
* A wrapper aro... |
PHP | UTF-8 | 2,960 | 2.65625 | 3 | [] | no_license | <!DOCTYPE html>
<!--
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.
-->
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
... |
Python | UTF-8 | 1,289 | 3.578125 | 4 | [] | no_license | import numpy as np
# sigmoid function
def sigmoid(x,deriv = False):
if (deriv == True):
return x * (1 - x)
return 1 / (1 + np.exp(-x))
def dsigmoid(x,deriv = False):
if (deriv == True):
return 1.0 - x**2
return x * (1 - x)
# input dataset (输入数据集,形式为矩阵,每一行代表一个训练样本)
X = np... |
PHP | UTF-8 | 1,111 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
function sig_handler($signo) {
switch ($signo) {
case SIGTERM:
case SIGINT:
exit;
}
}
function isDaemonActive($pid_file) {
if( is_file($pid_file) ) {
$pid = file_get_contents($pid_file);
//проверяем на наличие процесса
if(posix_kill($pid,0)) {
... |
C++ | UTF-8 | 1,210 | 3.34375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int preced(char ch) {
if(ch == '+' || ch == '-') return 1;
else if(ch == '*' || ch == '/') return 2;
else if(ch == '^') return 3;
else return 0;
}
string inToPost(string st ) {
stack<char> stk;
stk.push('#');
string postfix = "";
for(int i=0; i<st.... |
C# | UTF-8 | 1,606 | 2.625 | 3 | [] | no_license | using UnityEngine;
using System;
using UnityEngine.Audio;
public class audioManager : MonoBehaviour
{
public Sound[] sound;
// Start is called before the first frame update
void Awake()
{
foreach (Sound item in sound)
{
item.source = gameObject.AddComponent<AudioSource>();
... |
TypeScript | UTF-8 | 2,282 | 2.546875 | 3 | [
"Apache-2.0"
] | permissive | /* tslint:disable */
/* eslint-disable */
/*
* Cloud Governance Api
*
* Contact: support@avepoint.com
*/
import { exists, mapValues } from '../runtime';
import {
MessageCode,
MessageCodeFromJSON,
MessageCodeFromJSONTyped,
MessageCodeToJSON,
} from './';
/**
*
* @export
* @interface ClonePermis... |
PHP | UTF-8 | 4,822 | 2.796875 | 3 | [] | no_license | <?php
class BookModel extends Model
{
public function getBooks()
{
$sql = "SELECT * from books";
$query = $this->db->prepare( $sql );
$query->execute();
return $query->fetchAll();
}
public function getBooksByAuthor( $authorId )
{
$sql ... |
Python | UTF-8 | 6,584 | 2.859375 | 3 | [
"MIT"
] | permissive | import argparse
from collections import defaultdict
import random
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
def str2bool(v):
if isinstance(v, bool):
return v
elif v.lower() in ("yes", "true", "y", "1"):
... |
C | UTF-8 | 6,012 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #include <gsl/gsl_math.h>
#include <gsl/gsl_vector.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_multifit.h>
/* Fit
*
* y = X c
*
* where X is an n x p matrix of n observations for p variables.
*
* The solution includes a possibl... |
Java | UTF-8 | 4,394 | 2.40625 | 2 | [
"MIT"
] | permissive | package com.qiyei.android.http.dialog;
import android.util.Log;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.qiyei.android.http.common.HttpLog;
/**
* @author Created by qiyei2015 on 2017/10/25.
* @version: 1.0
*... |
PHP | UTF-8 | 1,550 | 2.84375 | 3 | [] | no_license | <?php
require_once 'src/bootstrap.php';
/**
* Classes to use in this example.
*/
use \tripsort\assets\CardFactory;
use \tripsort\assets\CardAbstract;
use \tripsort\assets\transportable\Person;
use \tripsort\assets\TransportableAbstract;
use \tripsort\modules\travel\Travel;
#creating tickets
$tickets = array(
Car... |
Shell | UTF-8 | 1,150 | 3.796875 | 4 | [] | no_license | # Cleaning up
echo "Cleaning up working files"
rm replacements.sed
rm pages.index
rm pages.paths
rm pages.categorieswithextension
# Pull markdown from Github
echo "Pulling content from Github"
cd content
git pull origin
# Render HTML
echo "Rendering HTML from Markdown"
cd ..
markdoc build
# Build index
echo "Indexi... |
SQL | UTF-8 | 173 | 3.515625 | 4 | [
"MIT"
] | permissive | # Write your MySQL query statement below
select a.id,IFNULL(b.student,a.student) as student from seat as a left join seat as b on a.id = (b.id-1+(b.id&1)*2) order by id asc; |
Python | UTF-8 | 509 | 3.640625 | 4 | [] | no_license | def ExcelColumn(n):
s = ''
i = 0
while n > 0:
rem = n % 26
if rem == 0:
s += 'Z'
i += 1
n = (n // 26) - 1
else:
s += chr((rem - 1) + ord('A'))
i += 1
n = n // 26
return s[::-1]
if __name__ == '__main__':
... |
C# | UTF-8 | 1,897 | 3.25 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace BasicFileIO
{
public partial class Form1 : Form
{
public Form... |
Java | UTF-8 | 2,609 | 3.484375 | 3 | [] | no_license | package protoType;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
public class ProtoTyp... |
Python | UTF-8 | 697 | 3.078125 | 3 | [] | no_license | #!/usr/bin/python
import sys, os, re, shutil
pivot = int(sys.argv[1])
direction = sys.argv[2] if len(sys.argv) > 2 else '+'
dir_path = os.getcwd()
paths = os.listdir(dir_path)
paths_with_numbered_filenames = sorted([path for path in paths if re.match('^[0-9]+', path)])
def increment_path(path, value):
match = re.... |
Java | UTF-8 | 1,106 | 2.25 | 2 | [] | no_license | /*
* Cribbed from http://vafer.org/blog/20061010091658/
*/
package org.jruby.ext.jmxwrapper;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.UnknownHostException;
import java.rmi.server.RMIServerSocketFactory;
import javax.net.ServerSocketFactory;
... |
Shell | UTF-8 | 2,345 | 3.125 | 3 | [] | no_license | #!/bin/bash
[% c("var/set_default_env") -%]
output_dir=[% dest_dir %]/[% c('filename') %]
gradle_repo=$rootdir/[% c('input_files_by_name/gradle-dependencies') %]
# The download script assumes artifact package name is the complete URL path.
# In some cases this is incorrect, so copy those artifacts to correct location
... |
Markdown | UTF-8 | 2,648 | 3.140625 | 3 | [
"MIT"
] | permissive | date: February 2 2014
# Pastebin for photos
A dozen of entrepreneurs already talked to me about their idea for solving the photo mess. Which means that there are at least 20,000 entrepreneurs out there trying all possible angles to attack this problem. Yet, no one has nailed it yet. Someone will, someday. Here is my ... |
Java | UTF-8 | 8,514 | 2.25 | 2 | [] | no_license | package com.renke.rdbao.util;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jcraft.js... |
JavaScript | UTF-8 | 27,680 | 2.59375 | 3 | [] | no_license | !function(){
window.lcg = window.lcg || {};
//组件表
var modules = {};
//调试模式
lcg.debug = true;
//整体提示
lcg.log = function(str){
if(lcg.debug == true)
console.log("LCG.JS:"+str);
}
//绑定组件
lcg.bind = function(key,init){
if(modules[key] != null)
lcg.log("覆盖了原有的'"+key+"'组件!");
modules[key] = init;
}... |
Markdown | UTF-8 | 1,965 | 2.96875 | 3 | [
"Unlicense"
] | permissive | # Background
The file `munge.pl` processes a CSV file from Lending Club's secondary market. It generates a new CSV file that can be used for factor analysis in R.
# Amalog Features
This section expounds on Amalog features seen in the example.
## handle
Makes a predicate (`err` in this case) the active condition h... |
Python | UTF-8 | 1,646 | 3.078125 | 3 | [] | no_license | """
When passing data to the built-in training loops of a model, you should either use Numpy arrays
(if your data is small and fits in memory) or tf.data Dataset objects.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import tensorflow as tf
from tensorflow imp... |
Java | UTF-8 | 4,610 | 1.820313 | 2 | [
"EPL-1.0",
"Classpath-exception-2.0",
"ISC",
"GPL-2.0-only",
"BSD-3-Clause",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-generic-cla",
"0BSD",
"LicenseRef-scancode-sun-no-high-risk-activities",
"LicenseRef-scancode-free-unknown",
"JSON",
"LicenseRef-scancode-unico... | permissive | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
Markdown | UTF-8 | 1,469 | 2.53125 | 3 | [] | no_license | # hw6
1) 
2) 
3) 
На третьем скриншоте видно, что предположение, основанное на данных Оксфордского словаря (heavy cream более характерно для амери... |
Markdown | UTF-8 | 5,221 | 2.734375 | 3 | [] | no_license | ---
doc_date: '1983-02-28'
doc_num: 264
doc_order: 264
naa_refs: []
title: Telegram from Francis to Ministry of Foreign Affairs
vol_full_title: 'Volume 23: The Negotiation of the Australia New Zealand Closer Economic
Relations Trade Agreement, 1983'
vol_id: 23
vol_title: 'Volume 23: The Negotiation of the Australia N... |
Python | UTF-8 | 1,112 | 3.5625 | 4 | [] | no_license | """
CP1404/CP5632 Practical
Extension - Check for missing files
"""
# import shutil
import os
def main():
"""Demo file renaming with the os module."""
print("Current directory is", os.getcwd())
for dir_name, subdir_list, file_list in os.walk('.'):
if dir_name == '.':
continue
... |
C# | UTF-8 | 5,340 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using Sy... |
Java | UTF-8 | 2,004 | 3 | 3 | [] | no_license | import javax.sound.midi.Soundbank;
import java.awt.print.Book;
import java.io.IOException;
import java.net.*;
import java.util.Arrays;
public class UDPThread implements Runnable {
int port;
BookServer bookServer;
DatagramSocket datagramSocket;
public UDPThread(int port, BookServer bookServer){
... |
Python | UTF-8 | 827 | 2.71875 | 3 | [] | no_license | import hashlib
import time
import random
from httprunner import __version__
from httprunner.response import ResponseObject
def get_httprunner_version():
return __version__
def sum_two(m, n):
return m + n
def sleep(n_secs):
time.sleep(n_secs)
def get_documents_num(response:ResponseObject):
resp_jso... |
C# | UTF-8 | 2,561 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | using System;
namespace DBFlute.JavaLike.Lang
{
/**
* This exception may be thrown by methods that have detected concurrent
* modification of an object when such modification is not permissible.
* <p>
* For example, it is not generally permissible for one thread to modify a Collection
* w... |
Markdown | UTF-8 | 875 | 2.640625 | 3 | [] | no_license | # Marketing Analytics
***
### Market-Basket-Analysis-and-Recommendation-System
`Market basket analysis` is the process of discovering frequent item sets in large transactional database.
<br>`Recomendation System` is algorithm that seeks to predict the '*rating*' or '*preference*' a user would give to an item
### List o... |
Java | UTF-8 | 2,194 | 3.640625 | 4 | [] | no_license | /**
*
*/
package collections.set;
import java.util.Iterator;
/**
* @author naveen.kumar
*
*/
public class TreeSetDemo {
/**
* @param args
*/
public static void main(String[] args) {
TreeSet.addValue("one");
TreeSet.addValue("two");
TreeSet.addValue(... |
Java | UTF-8 | 1,574 | 1.578125 | 2 | [] | no_license | package org.apel.show.attach.test.web;
import java.util.List;
import org.apel.gaia.commons.jqgrid.QueryParams;
import org.apel.gaia.commons.pager.PageBean;
import org.apel.gaia.util.jqgrid.JqGridUtil;
import org.apel.show.attach.service.domain.FileInfo;
import org.apel.show.attach.service.service.FileInfoProv... |
Java | UTF-8 | 5,527 | 3.03125 | 3 | [] | no_license | package s0c13ty_MAsK.controladores;
import s0c13ty_MAsK.enumerates.Horas;
import s0c13ty_MAsK.enumerates.MemBros;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Scanner;
public class Sistema {
private static ArrayList<MemBros> listaMe... |
JavaScript | UTF-8 | 1,216 | 2.546875 | 3 | [] | no_license | var app = app || {};
/**
* @description Collection of foods that have been added, synced to firebase
* @description In hindsight, would have organized data differently and
* @description Rather than make calls to new collection, would have written filter methods
* @description and used queries
* @constructor
*/
var Fo... |
Python | UTF-8 | 482 | 2.875 | 3 | [
"Apache-2.0"
] | permissive | from tkinter import *
class StatusBar():
def __init__(self, master):
frame = Frame(master, bd=0)
frame.pack(side=BOTTOM, anchor=W, fill=X, padx=2)
self.label = Label(frame, bd=1, relief=SUNKEN, anchor=W)
self.label.pack(fill=X)
def set(self, format, *args):
self.labe... |
Markdown | UTF-8 | 2,607 | 3.328125 | 3 | [] | no_license | <h1>What is UML Parser</h1>
<p> UML Parser is a parsing tool used for generating UML diagrams as the output after taking source code as the input</p>
<p> UML Parser helps visualize the structure of the code and the inter-relation between the classes and hierarchical structure</p>
<p> In this project, we dev... |
PHP | UTF-8 | 8,547 | 2.5625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Store;
use App\Models\Product;
use App\Models\ProductStore;
use App\Models\User;
use App\Models\Url;
use Illuminate\Support\Facades\Validator;
use Redirect;
class ProductController extends Controller
{
public function product()
... |
Ruby | UTF-8 | 1,048 | 3.515625 | 4 | [] | no_license | require_relative "list"
require_relative "task"
# Create list
list = List.new
# Create tasks and add them to the list
list.add_task(Task.new("Feed the cat",7))
list.add_task(Task.new("Take out trash",2))
list.add_task(Task.new("Mow the lawn",5))
# Print out the second task in the list
puts "Second task:"
puts list.t... |
Java | UTF-8 | 1,566 | 2.8125 | 3 | [] | no_license | package domein;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.value.ChangeListener;
public class TellerThread i... |
C# | UTF-8 | 2,512 | 2.90625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
namespace sudoku
{
class Program
{
static void Main(string[] args)
{
string s =
// "xxx|4x5|xx1\n" +
// "6x5|198|xxx\n" +
// "xx9|xx7|x5x\n" +
/... |
Java | UTF-8 | 755 | 2.0625 | 2 | [] | no_license | package crud.sample.app.config;
import org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
@Configuration
public class WebConfig extends WebMvcAutoConfi... |
Markdown | UTF-8 | 2,634 | 3.109375 | 3 | [] | no_license | # Sequential-Forward-Floating-Selection
The aim of this project was to implement a feature selector algorithm - Sequential Forward Floating Selector (SFFS) from scratch in python. SFS is also implemented
The code also supports to choose from either a wrapper method or filter method to calculate the significance of f... |
Python | UTF-8 | 5,827 | 2.90625 | 3 | [] | no_license | # -*- coding: UTF-8 -*-
import wx
import os
import json
import yaml
class APP(wx.Frame):
def __init__(self):
super().__init__(None, title="Convert Data Format", pos=(200, 200), size=(1000, 600))
self.Center()
self.setup_menu_bar()
self.split_window = wx.SplitterWindow(self)
... |
PHP | UTF-8 | 889 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateUsersTable extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('full_name', 32);
... |
JavaScript | UTF-8 | 4,560 | 2.5625 | 3 | [] | no_license | /**
* Created by 93701 on 2016/9/13.
*/
/**
* Created by 93701 on 2016/9/12.
*/
var treatList = {
init: function () {
var that = this;
that.initDatePicker(); //初始化时间选择控件
that.initTable(); //初始化列表
that.bindEvent(); //绑定时间
},
initDatePicker: function () {
jQuery('.... |
TypeScript | UTF-8 | 1,936 | 2.765625 | 3 | [] | no_license | import { Injectable } from '@angular/core';
import {Router} from '@angular/router';
@Injectable()
export class PageService {
private nowPage = 1; // 当前页码
private max: number; // 最大页码
private min = 1; // 最小页码
private countNumber: number; // 计数总数
private Row = 20; // 每页行数
private url: string;
constructor(... |
Java | UTF-8 | 759 | 3.71875 | 4 | [] | no_license | package javaStudy.ch08_예외처리;
public class ExceptionEx7 {
/*
* 예외처리의 정의 -> 프로그램 실행 시 발생할 수 있는 예외에 대비한 코드를 작성
* 예외처리의 목적 -> 프로그램의 비정상 종료를 막고, 정상적인 실행상태를 유지
*
* */
public static void main(String[] args) {
System.out.println(1);
System.out.println(2);
try {
System.out.println(3);
System.out.print... |
C# | UTF-8 | 1,571 | 2.640625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Schedule.CSP.CSP;
namespace Schedule.CSP.Inference
{
public class DomainLog<Var, Val> : IInferenceLog<Var, Val> where Var : Variable
{
private readonly List<KeyValuePair<Var, Domain<Val>>> _savedDomain;
privat... |
Java | UTF-8 | 3,002 | 4 | 4 | [] | no_license | package ee.taltech.iti0200.introduction;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
public class Introduction {
/**
* Method gets a string that contains x words.
* The first character of the string starts a new word, next words always start with a capital letter.
*... |
Go | UTF-8 | 2,235 | 3.453125 | 3 | [
"Apache-2.0"
] | permissive | package easy_http
import (
"io/ioutil"
"net/http"
)
type BuildResponse func(resp *http.Response, err error) IResponse
//使用client发去请求后,返回一个实现了这个接口的对象
//只要实现这个接口,就能作为返回值
//在 `BuildResponse` 函数中构造出返回的对象
//默认提供了 `HttpResponse` 实现了这个接口
//可以根据自己的需求自己重新实现这个接口
type IResponse interface {
//返回这个请求的错误
Error() error
//返回这... |
C++ | UTF-8 | 1,985 | 2.65625 | 3 | [] | no_license | #ifndef _GORM_THREAD_POOL_H__
#define _GORM_THREAD_POOL_H__
#include "gorm_sys_inc.h"
#include "gorm_type.h"
#include "gorm_mempool.h"
namespace gorm{
class GORM_Log;
class GORM_ThreadPool;
class GORM_Thread
{
public:
GORM_Thread(GORM_Log *logHandle, shared_ptr<GORM_ThreadPool>& pPool);
virtual ~GORM_Thread(... |
C++ | SHIFT_JIS | 2,714 | 2.546875 | 3 | [] | no_license | #include "pch.h"
#include "GraphicsDeviceDX11.h"
#include "Context/Win/DirectX11/ContextDX11.h"
namespace Phoenix
{
namespace Graphics
{
//
std::shared_ptr<IGraphicsDevice> IGraphicsDevice::Create()
{
return std::make_shared<GraphicsDeviceDX11>();
}
//
bool GraphicsDeviceDX11::Initialize(OS::IDisp... |
Java | UTF-8 | 1,104 | 2.359375 | 2 | [] | no_license | package com.blazedemo.steps;
import com.blazedemo.pages.LoginPage;
import com.blazedemo.pages.ResultPage;
import com.blazedemo.pages.SearchPage;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import org.junit.Assert;
public class SearchScenarioSteps {
LoginP... |
Java | UTF-8 | 8,795 | 2.703125 | 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 academico;
import api.Pregunta;
import api.Respuesta;
import java.util.ArrayList;
import org.junit.Test;
import static org.jun... |
Python | UTF-8 | 889 | 3.578125 | 4 | [] | no_license | #start
#vakna upp
vaken = "n"
while vaken == "n":
print("Du sover som en stock. Zzz")
vaken = input("Vaknar du? [y/n]").lower()
#duscha
print("Du masar dig upp och släpar in dig i duschen")
print("Någon har lömnat en brödrost i din dusch")
duscha = input("Flyttar du på brödrosten? [y/n]").lower()
if duscha ... |
Python | UTF-8 | 2,209 | 2.59375 | 3 | [] | no_license | import logging
import inspect
from os import path
class SokLog(object):
def __init__(self, module, log_name):
self.setUpModule(module, log_name)
def _get_args_as_string(self, args):
args = list(args)
args = [str(arg) for arg in args]
return ' '.join(args)
def info(self, ... |
Python | UTF-8 | 663 | 3.25 | 3 | [
"BSD-3-Clause"
] | permissive | """
Normalized Stacked Bar Chart
-----------------------
This example shows how to make a normalized stacked bar chart.
"""
import altair as alt
from vega_datasets import data
source = data.population()
chart = alt.Chart(source).mark_bar().encode(
x = alt.X('age:O', scale = alt.Scale(rangeStep = 17)),
y = a... |
Ruby | UTF-8 | 1,733 | 3.125 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | class Song
attr_accessor :name, :artist_name
@@all = []
def self.all
@@all
end
def self.create
song = Song.new
@@all << song
song
end
def self.new_by_name(name)
song = Song.new
song.name = name
song
end
def self.create_by_name(name)
song = self.new
song.name = n... |
Java | UTF-8 | 136 | 1.632813 | 2 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive |
package org.apache.ibatis.submitted.parent_childs;
import java.util.List;
public interface Mapper {
List<Parent> getParents();
}
|
Java | UTF-8 | 1,817 | 2.625 | 3 | [] | no_license | package com.example.kvstore.repository;
import com.example.kvstore.service.KeyValueData;
import org.apache.commons.lang3.tuple.Pair;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;
public class DataDao {
private final String expiryFilePath;
private final Long dataTimeOutMs;
pr... |
C++ | UTF-8 | 2,762 | 3.390625 | 3 | [] | no_license | //
// Train.hpp
// DB Trains
//
// Created by Marina Polishchuk on 3/9/19.
// Copyright © 2019 Marina Polishchuk. All rights reserved.
//
#ifndef Train_hpp
#define Train_hpp
#include <string>
#include <iostream>
struct Date {
int day;
int month;
int year;
bool operator<(const Date& rhs){
... |
Java | UTF-8 | 313 | 1.71875 | 2 | [
"Apache-2.0"
] | permissive | package org.iglooproject.basicapp.core.business.upgrade.service;
import org.iglooproject.jpa.exception.SecurityServiceException;
import org.iglooproject.jpa.exception.ServiceException;
public interface IDataUpgradeManager {
void autoPerformDataUpgrades() throws ServiceException, SecurityServiceException;
}
|
Java | UTF-8 | 242 | 1.703125 | 2 | [
"MIT"
] | permissive | package com.sq.io.aio;
import java.io.IOException;
/**
* @author Leon
* @date 2021/1/1
*/
public class Bootstrap {
public static void main(String[] args) throws IOException {
new Thread(new AioServer(8080)).start();
}
}
|
Python | UTF-8 | 1,013 | 2.828125 | 3 | [] | no_license | #!/usr/bin/env python3
from os import listdir
from os.path import isdir, isfile, join
def is_problem_dir(path):
if isdir(path) is False:
return False
if isfile(path + 'README.md') is False:
return False # Need problem info file.
if isdir(path + 'testdata/') is False:
return Fals... |
C | UTF-8 | 3,446 | 2.9375 | 3 | [] | no_license | #include "message_parser.h"
char *get_json_string_username_password(const char *username,
const char *password) {
JSON_Value *root_value = json_value_init_object();
JSON_Object *root_object = json_value_get_object(root_value);
// adauga detaliile nec... |
Swift | UTF-8 | 2,419 | 2.78125 | 3 | [] | no_license | //
// AVTableDataSource.swift
// AVLighterTableViewController
//
// Created by Angel Vasa on 31/12/15.
// Copyright © 2015 Angel Vasa. All rights reserved.
//
import UIKit
import Foundation
protocol AVCellProtocol {
func data(items: AnyObject)
}
class AVTableDataSource: NSObject, UITableViewDelegate, UITable... |
Python | UTF-8 | 478 | 4.5625 | 5 | [] | no_license | # 8 kyu / Reversed Strings
# Details
# Complete the solution so that it reverses the string value passed into it.
# solution('world') # returns 'dlrow'
def solution(strng):
result = ''
if len(strng) == 0:
return result
else:
for i in range(1, len(strng)):
result += strng[-i... |
Python | UTF-8 | 4,158 | 3.9375 | 4 | [] | no_license | import pickle
from typing import List
class Trie(object):
# Based on: https://towardsdatascience.com/implementing-a-trie-data-structure-in-python-in-less-than-100-lines-of
# -code-a877ea23c1a1
"""
Our trie node implementation. Very basic. but does the job
"""
def __init__(self, char: str):
... |
Java | UTF-8 | 4,125 | 1.945313 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, softw... |
Ruby | UTF-8 | 246 | 2.59375 | 3 | [] | no_license |
module ApplicationHelper
def timestring_to_int(timestring)
if timestring.length<1
return 0
end
start = Time.parse "00:00:00"
duration = Time.parse timestring
return (duration - start).to_i
end
end |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.