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 | 697 | 3.953125 | 4 | [
"MIT"
] | permissive | '''
subsets and subarrays
subarrays:
a = [10,20,30]
=> [
[10], [20], [30]
[10,20], [10,20,30], [20,30],
]
subsets:
a = [10,20,30]
=> [
[], [10,20,30]
[10], [20], [30], [10, 20], [10, 30], [20, 30]
]
'''
def print_subsets(a):
limit = 2 ** len(a)
for i in ra... |
Ruby | UTF-8 | 177 | 3.796875 | 4 | [] | no_license | print "Please enter a number: "
number_1 = gets.to_i
def always_three(number)
(((((number + 5) * 2) - 4) / 2) - number)
end
puts "Always " + always_three(number_1).to_s + "." |
Shell | UTF-8 | 6,676 | 3.671875 | 4 | [] | no_license | #!/bin/bash
. /workspace/ENV
ENVIRONMENT="dev"
BASEHTML="/var/www/html"
DOCROOT="/var/www/html/web"
DRUSH="/.composer/vendor/drush/drush/drush -y"
GRPID=$(stat -c "%g" /var/lib/mysql/)
LOCAL_IP=$(hostname -I| awk '{print $1}')
HOSTIP=$(/sbin/ip route | awk '/default/ { print $3 }')
DEV_MODULES_ENABLED=("${DEV_MODULE... |
Java | UTF-8 | 990 | 3.1875 | 3 | [] | no_license | package org.hardy.alegole;
/**
* 提供两个字符串的差距
* @author songshangkun
*
*/
public class DisdenceEdite {
//有问题的程序
public static int getLevenshteinDistance(String strA, String strB) {
int lenA = (int)strA.length();
int lenB = (int)strB.length();
int[][] c = new int[lenA+1][lenB+1];
... |
Go | UTF-8 | 477 | 2.6875 | 3 | [
"MIT"
] | permissive | package gpsutil
import (
"testing"
"math"
)
func TestToRad(t *testing.T) {
expected := math.Pi/2
result := toRad(90)
if result != expected {
t.Errorf("Expected '%v' but got '%v'", expected, result)
}
expected = math.Pi/4
result = toRad(45)
if result != expected {
t.Errorf("Expected '%v' but got '%v'",... |
Python | UTF-8 | 792 | 2.71875 | 3 | [] | no_license |
# coding: utf-8
# In[64]:
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.neural_network import MLPClassifier
from sklearn.metrics import classification_report,confusion_matrix
# In[65]:
image = pd.read_csv('final.csv')
X=ima... |
Python | UTF-8 | 7,737 | 2.625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
from __future__ import division
import numpy
import os
from sklearn.cluster import DBSCAN, AgglomerativeClustering
def RMSD(traj, ref, idx):
'''
Returns RMSD between trajectory frames in mdtraj traj and reference frame in mdtraj ref object.
RMSD is computed for atom indices... |
PHP | UTF-8 | 3,701 | 2.5625 | 3 | [] | no_license | <?php
include('conection.php');
if(isset($_POST['submit'])){
try{
if(empty($_POST['username'])){
throw new Exception("User name field cannot be empty");
}
if(empty($_POST['password'])){
throw new Exception("Password field cannot be empty");
... |
Java | UTF-8 | 5,929 | 2.453125 | 2 | [] | no_license | package hacks.coachs_timer;
import android.app.Activity;
import android.content.Context;
import android.os.SystemClock;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.LinearLayout;... |
Markdown | UTF-8 | 1,748 | 2.65625 | 3 | [] | no_license | ---
ID: 235
post_title: The .uk TLD has arrived
author: Andrew Coates
post_date: 2014-06-23 11:25:43
post_excerpt: ""
layout: post
permalink: >
https://dev.mikamai.com/2014/06/23/the-uk-tld-has-arrived/
published: true
tumblr_mikamayhem_permalink:
- >
http://dev.mikamai.com/post/89647283094/the-uk-tld-has-arriv... |
TypeScript | UTF-8 | 2,109 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | import { CoreQuadOperation } from "../../tree/core/CoreQuadOperation";
import { CoreContext } from "../../tree/core/CoreContext";
import { ElementCore } from "../../tree/core/ElementCore";
import { RenderTextureInfo } from "../../tree/core/RenderTextureInfo";
import { WebGLCoreRenderExecutor } from "./WebGLCoreRenderEx... |
Java | UTF-8 | 5,214 | 2.109375 | 2 | [] | no_license | package com.binroot.gpa;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import misc.Constants;
import org.json.JSONArray;
import org.json.JSONEx... |
Java | UTF-8 | 772 | 2.140625 | 2 | [] | no_license | package be.sansoft.axondemo.accounts.view.projection.details;
import be.sansoft.axondemo.accounts.view.projection.json.JpaAccountDetailsJsonConverter;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
/**
* @author kristofennekens
*/
@Entity
@Table(name = "account_details")
public class Accou... |
Rust | UTF-8 | 766 | 3.46875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | use std::fmt;
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum DayOfWeek {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
}
impl fmt::Debug for DayOfWeek {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let s = match self {
Self::Su... |
PHP | UTF-8 | 438 | 2.90625 | 3 | [] | no_license | <?php
namespace Sepbin\System\Util\Data;
class GUID
{
public static function create() {
$charid = strtolower(md5(uniqid(mt_rand(), true)));
$hyphen = chr(45);// "-"
$uuid = substr($charid, 0, 8).$hyphen
.substr($charid, 8, 4).$hyphen
.substr($charid,12, 4).$hyp... |
Java | UTF-8 | 152 | 2.484375 | 2 | [] | no_license |
public class ToItemException extends Exception {
@Override
public String getMessage() {
return "To-Do item is illegal";
}
}
|
Markdown | UTF-8 | 1,649 | 2.921875 | 3 | [] | no_license | # Cloud Maturity Assessment Survey Tool
An Office Excel based tool that can used by
- Organizations adopting a Cloud Platform, or
- by ISV Vendors that provide Cloud based Solutions to their Customers
to assess how they are utilising the Cloud Platform today and the state that they aspire to be in, in the fut... |
C++ | UTF-8 | 1,395 | 2.8125 | 3 | [] | no_license | /** A wrapper class for dealing with ESCs.
* Comes with calibration function.
*/
#ifndef H_DRONE_ESC
#define H_DRONE_ESC
#define SERVO_OUTPUT_MAX 1000
#define SERVO_OUTPUT_MIN 2000
#define INTENSITY_MAX 1.0
#define INTENSITY_MIN 0.0
#define CALI_MAX_DURATION 2000
#define CALI_MIN_DURATION 2000
#define CALI_GRAD... |
Python | UTF-8 | 1,228 | 3.578125 | 4 | [] | no_license | class NumArray(object):
def __init__(self, nums):
"""
initialize your data structure here.
:type nums: List[int]
"""
self.nums = nums
self.len = len(nums)
if self.len >0:
self.partsum =[nums[0]]
for i in range(1,self.len):
self... |
Java | UTF-8 | 2,914 | 2.3125 | 2 | [] | no_license | package com.example.xeus_labmacbook.growup.model;
import com.google.gson.annotations.SerializedName;
public class DataItem{
@SerializedName("temp_stat")
private String tempStat;
@SerializedName("airhumid_value")
private String airhumidValue;
@SerializedName("waterlvl_value")
private String waterlvlValue;
... |
C++ | UTF-8 | 643 | 3.546875 | 4 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool isPossible(vector<int> &piles, int h, int k) {
int total = 0;
for (auto pile: piles) {
total += ceil(pile * 1.0 / k);
}
return total <= h;
}
int minEatingSpeed(vector<int> piles, int h)
{
int lo = 1, hi = *max_element(piles.begin(), piles... |
Java | UTF-8 | 285 | 2.59375 | 3 | [] | no_license | package wzorzec_dekorator.example_1.składniki;
import wzorzec_dekorator.example_1.Pizza;
public class FungiPizza implements Pizza {
@Override
public String getName() {
return "Fungi";
}
@Override
public float getCost() {
return 20.50f;
}
}
|
Java | UTF-8 | 966 | 3.140625 | 3 | [] | no_license | package ConsoleBars;
import java.util.*;
import java.io.*;
class ConsoleBar implements Observer {
static enum Opcode {
INC, DEC, BELL
}
static class Command {
Opcode op;
Command(Opcode op) {
this.op = op;
}
}
int cmax;
ValueBar model;
static final char BLOCK = 0x2588; // ASCII Character
... |
C++ | WINDOWS-1250 | 932 | 2.5625 | 3 | [] | no_license | //Este proyecto utiliza una clase llamada Img creada por Manuel Jess Zavala Nez
//Esta clase engloba a la clase de OpenCV Mat para hacer ms sencilla la implementacin de sus funciones
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include "Img.h"
#include <iostream>
#in... |
TypeScript | UTF-8 | 454 | 2.578125 | 3 | [
"MIT"
] | permissive | import { BotEvent } from "../types/types";
const event: BotEvent = {
name: 'Ready',
description: 'Evento chamado quando o Bot inicia',
caller: 'ready',
enable: true,
run: (Bot) => {
Bot.startTime = Date.now(); // Salvar timestamp do horario que o bot iniciou
console.log(`Bot iniciado com ${Bot.u... |
C# | UTF-8 | 2,872 | 2.9375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Runtime.Serialization.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WeatherGroup2.Models;
namespace WeatherGroup2.Controllers
{
public class WeatherHTTPClientController : Controller
... |
Python | UTF-8 | 1,984 | 2.65625 | 3 | [
"MIT"
] | permissive | # ***************************************************************************************
# ***************************************************************************************
#
# Name : makedictionary.py
# Author : Paul Robson (paul@robsons.org.uk)
# Date : 8th November 2018
# Purpose : Create initial dict... |
Markdown | UTF-8 | 941 | 2.84375 | 3 | [] | no_license | # Article 58
Les établissements fournissent au minimum les informations suivantes au sujet des espèces présentées :
- nom scientifique ;
- nom vernaculaire ;
- éléments permettant d'appréhender la position de l'espèce dans la classification zoologique ;
- répartition géographique ;
- éléments remarquables de la b... |
Java | UTF-8 | 1,167 | 2.3125 | 2 | [
"Apache-2.0"
] | permissive | /**
* <p>Copyright (R) 2014 我是大牛软件股份有限公司。<p>
*/
package com.woshidaniu.drdcsj.drsj.handler.impl;
import java.util.List;
import com.woshidaniu.drdcsj.drsj.comm.ImportConfig;
import com.woshidaniu.drdcsj.drsj.dao.entities.DrlpzModel;
import com.woshidaniu.drdcsj.drsj.handler.AbstractHandler;
import com.woshidaniu.drd... |
C++ | GB18030 | 4,975 | 2.859375 | 3 | [] | no_license | #include "cutPhoto.h"
cuttingPhotos* cuttingPhotos::create(const char* photo,unsigned int rows,unsigned int columns)
{
cuttingPhotos *cp=new cuttingPhotos();
if (cp && cp->initWithPhoto(photo,rows,columns)) {
cp->autorelease();
return cp;
}
CC_SAFE_DELETE(cp);
return ... |
Markdown | UTF-8 | 1,850 | 2.640625 | 3 | [] | no_license | #### 仿京东地址选择器
##### 用法
Step 1. Add the JitPack repository to your build file
Add it in your root build.gradle at the end of repositories:
```javascript
allprojects {
repositories{
maven { url 'https://jitpack.io' }
}
}
```
Step 2. Add the dependency
```
dependencies {
implementation 'com.github.pa... |
C++ | UTF-8 | 496 | 2.84375 | 3 | [] | no_license | #include"BasicData.h"
float cPOINTF::GetDistance(cPOINTF & s)
{
return sqrt((x - s.x)*(x - s.x) + (y - s.y)*(y - s.y));
}
float cPOINTF::GetAngle(cPOINTF & d)
{
if (fabs(d.x - x)<1e-6)
{
if (d.y<y)
{
return 270;
}
else
{
return 90;
}
}
float a = atan((d.y - y) / (d.x - x)) / 3.1415926 * 180;
i... |
Java | UTF-8 | 1,386 | 2.234375 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | package org.apereo.cas.support.inwebo.authentication;
import org.apereo.cas.authentication.AuthenticationBuilder;
import org.apereo.cas.authentication.AuthenticationTransaction;
import org.apereo.cas.authentication.Credential;
import org.apereo.cas.authentication.metadata.BaseAuthenticationMetaDataPopulator;
import l... |
TypeScript | UTF-8 | 829 | 3.15625 | 3 | [
"MIT"
] | permissive | // @TODO:
/**
* The Chat Bubble Class
* This application displays a temporary message sent from a particular Token in the active Scene.
* The message is displayed on the HUD layer just above the Token.
*/
declare class ChatBubbles {
/**
* Track active Chat Bubbles
*/
bubbles: object;
constructor();
/**
... |
Java | UTF-8 | 5,043 | 1.953125 | 2 | [
"Apache-2.0"
] | permissive | package org.zaproxy.zap.db.repository;
import java.util.List;
import java.util.Optional;
import javax.persistence.QueryHint;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data... |
TypeScript | UTF-8 | 1,949 | 3.453125 | 3 | [] | no_license | export class Descriptive {
static mean(data: number[]): number {
return Descriptive.sum(data) / data.length;
}
static median(data: number[]): number {
const sortedDataset = data.sort((left, right) => left - right);
const middleIndex = sortedDataset.length / 2;
if (!this.is... |
Java | UTF-8 | 3,035 | 2.40625 | 2 | [] | no_license | package me.ele.homedemo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;... |
Java | UTF-8 | 7,184 | 2.265625 | 2 | [] | no_license | package com.zenithgames.shadowrunner.utils;
import com.badlogic.gdx.Application;
import com.badlogic.gdx.Application.ApplicationType;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
/**
* Created by i... |
C++ | UTF-8 | 513 | 3.046875 | 3 | [] | no_license | #pragma once
#include <vector>
#include "Vector2.h"
class Edge;
class Node
{
public:
Vector2 position;
std::vector<Edge> edges;
void AddEdge(Edge e);
};
class Edge
{
public:
Node* connectedTo;
float weight;
Edge(Node* node, float w = 1);
};
class Graph
{
std::vector<Node> nodes;
public:
Graph();
~Graph()... |
C# | UTF-8 | 3,082 | 3.0625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace FontWorx
{
public partial class ByteGenerator : Form
{
Main MainWindow;
... |
Python | UTF-8 | 4,047 | 3.078125 | 3 | [
"MIT"
] | permissive | """DEPRECATED
Provides the struct used to store instructions within binary files.
"""
# TODO: Add automatic detection and creation of format string based on
# int.bitlength
from __future__ import print_function
import bitstruct
import sys
class Struct(object):
"""Conveniece wrapper around struct.Struct class t... |
C++ | UTF-8 | 2,856 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2018 Delft University of Technology
//
// 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 l... |
PHP | UTF-8 | 9,345 | 2.765625 | 3 | [] | no_license | <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>form_upload</title>
</head>
<body>
<div class="well">
<div class="content">
<form action="form_upload.php" method="post" enctype="multipart/form-data">
<fieldset>
<table width="350" border="0" align="center">
<legend> Data Entry
... |
Java | UTF-8 | 7,635 | 2.703125 | 3 | [
"MIT"
] | permissive | package name.valery1707.kazPersonId;
import java.sql.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.regex.Pattern;
public final class PersonIdUtils {
protected PersonIdUtils() {
throw new IllegalStateExceptio... |
C++ | UTF-8 | 1,204 | 2.796875 | 3 | [] | no_license | #ifndef STRING
#define STRING
#include<string>
#endif
#ifndef IOSTREAM
#define IOSTREAM
#include<iostream>
#endif
#ifndef USER
#define USER
#include "user.h"
#endif
#ifndef DATABASE
#define DATABASE
#include "database.h"
#endif
#ifndef MISC
#define MISC
#include "misc.h"
#endif
#ifndef AIRPORT_CONTROL... |
Java | UTF-8 | 4,665 | 2.34375 | 2 | [] | no_license | package com.senzecit.iitiimshaadi.customdialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
i... |
Shell | UTF-8 | 2,357 | 3.765625 | 4 | [] | no_license | #!/bin/bash
# chkconfig: 2345 20 80
# description: hubot start/stop script
# processname: hubot
### BEGIN INIT INFO
# Provides: hubot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: hu... |
Java | UTF-8 | 2,573 | 2.3125 | 2 | [] | no_license | package com.example.akhil.workforce.worker;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.... |
C# | UTF-8 | 3,136 | 2.765625 | 3 | [] | no_license | using Sales.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sales.Components.PriceComponent
{
class PriceImpl : IPrice
{
private SalesDBEntities context;
public void addPriceCustomer(int customerId, decimal p... |
Swift | UTF-8 | 1,902 | 2.6875 | 3 | [] | no_license | //
// ToolbarView.swift
// APITest
//
// Created by Mathew Polzin on 4/12/20.
// Copyright © 2020 Mathew Polzin. All rights reserved.
//
import Foundation
import SwiftUI
import APIModels
struct ToolbarView: View {
let buildingAndRunningTestCount: Int
let finishedTodayTestCount: Int
let settingsTrayOpe... |
PHP | UTF-8 | 676 | 2.515625 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class CreateItemPricesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('item_prices', function(Blueprint $table)
{
$table->integer('id')->unsign... |
Python | UTF-8 | 5,501 | 2.53125 | 3 | [] | no_license | import base64
import tornado.web
import tornado.template
import os.path
import json
import GameBoard
import utils
from config import STATIC_CONTENT_PATH
class MapEditorHandler(tornado.web.RequestHandler):
actions = utils.Enum(["MODULE_SELECTOR", "PAGE", "LIST_IMAGES", "MODULE", "CREATE", "MODULE_INFO"])
de... |
Python | UTF-8 | 2,756 | 3.84375 | 4 | [] | no_license | """
## 牛客网Python刷题stdin问题
牛客网上面大部分题都不是像leetcode那样将解答写在Solution类的实例方法上
而是 从stdin读取测试用例,再通过stdout输出返回值
## 牛客网的Python版本不完全支持typehint
牛客网的python3版本是3.5,刚开始支持typehint,但仅在函数入参和返回值中支持typehint
不支持Python 3.6的typehint/variable annotations
[variable annotations](https://docs.python.org/3/whatsnew/3.6.html)
```
PEP 526: Syntax ... |
Java | UTF-8 | 1,365 | 1.804688 | 2 | [
"Apache-2.0"
] | permissive | /**
* <p>IJPay 让支付触手可及,封装了微信支付、支付宝支付、银联支付常用的支付方式以及各种常用的接口。</p>
*
* <p>不依赖任何第三方 mvc 框架,仅仅作为工具使用简单快速完成支付模块的开发,可轻松嵌入到任何系统里。 </p>
*
* <p>IJPay 交流群: 723992875、864988890</p>
*
* <p>Node.js 版: <a href="https://gitee.com/javen205/TNWX">https://gitee.com/javen205/TNWX</a></p>
*
* <p>企业微信-发放企业红包</p>
*
* @author Javen
... |
JavaScript | UTF-8 | 6,319 | 3.421875 | 3 | [] | no_license | const classicGallery = document.querySelector("#section-classic");
const veganGallery = document.querySelector("#section-vegan");
const spicyGallery = document.querySelector("#section-spicy");
const courseToAdd = [
{
section: "classic",
name: "falafels",
picture: {src:"ressources/desktop/cl... |
Java | UTF-8 | 811 | 2.515625 | 3 | [] | no_license | package br.edu.up.Control.service;
import br.edu.up.Control.DAO.Dao;
import br.edu.up.Control.DAO.FactoryDao;
import br.edu.up.Control.entidade.Produto;
public class ProdutoService {
public void salvar(Produto c) throws ServiceException {
if (c.getNome() == null || c.getNome().equals("")) {
... |
C# | UTF-8 | 2,348 | 2.671875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
string path = "";
protected void Page_Load(o... |
Rust | UTF-8 | 2,587 | 3.140625 | 3 | [] | no_license | use crate::state::State;
use crate::world::World;
#[derive(Debug, Clone, Copy)]
pub struct StateIndexer {
num_taxi_states: usize,
num_passenger_states: usize,
num_destination_states: usize,
}
impl StateIndexer {
pub fn new(world: &World) -> StateIndexer {
let num_taxi_states = (world.width * w... |
Markdown | UTF-8 | 1,557 | 3.125 | 3 | [
"MIT"
] | permissive | ---
title: Karakter og fellesskap
date: 21/07/2022
---
En sang lyder: «Jeg er en stein, jeg er en øy.» Har du noen gang følt det slik – å ville stå alene? Du kan ha hørt folk si: «Vel, min vandring med Gud er en privatsak. Det er ikke noe jeg vil snakke om.»
`Les Ef 4,11–16. Hva er poenget i teksten? Hva er felless... |
Go | UTF-8 | 1,069 | 2.59375 | 3 | [] | no_license | package nana
import (
"bytes"
"testing"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/Sirupsen/logrus"
"github.com/stretchr/testify/assert"
)
func TestNullMetricsClient(t *testing.T) {
assert := assert.New(t)
log := logrus.New()
log.Level = logrus.DebugLevel
log.Formatter = &logrus.TextFormatt... |
C++ | UTF-8 | 5,285 | 3.78125 | 4 | [] | no_license | #include "BSTree.h"
// default constructor
BSTree::BSTree()
{
root = nullptr;
}
// destructor, deallocate all memory in heap
BSTree::~BSTree()
{
empty(); // empties out tree
}
/*
* inserts a movie into the BST
* in sorted order.
*/
bool BSTree::insert(Movie *movie)
{
// check if ob... |
SQL | UTF-8 | 153 | 2.890625 | 3 | [] | no_license | CREATE PROCEDURE sunnyHolidays()
BEGIN
SELECT holiday_date AS ski_date
FROM holidays
INNER JOIN weather ON holiday_date = sunny_date;
END
|
Python | UTF-8 | 2,810 | 3.25 | 3 | [] | no_license | name = ["mohan", "raj", "harsh"]
# print(name)
# number=[23,45,29,59,34]
# print(number)
# mixed=["mohan","raj","harsh",23,45,29,59,34]
# print(mixed)
# mixed_int=[23,45,29,59,34]
# mixed_int.sort()
# print(mixed_int)
# name.append("sohan")
# print(name)
# name.insert(2,"ravi")
# print(name)
# name.extend(... |
C++ | UTF-8 | 3,774 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "UI.h"
#include "Scene.h"
#include "LevelManager.h"
#include "Level.h"
#include "ShaderManager.h"
#include "PredefinedWordFactory.h"
#include "ButtonFactory.h"
#include "UIAdapter.h"
void UI::init() {
selectedButton = -1;
backgroundTexture.loadFromFile("images/UI/black_frame.png", TEXTURE_PIXEL_FORMAT_RGBA... |
C++ | UTF-8 | 2,382 | 3.375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
int bin2dec()
{
int num,cal, dec = 0, i = 0;
printf("Enter binary number: ");
flag: fflush(stdin);
scanf("%d",&num);
fflush(stdin);
if(num == 0 || num%10 == 2 ||num%10 == 3 || num%10 == 4 || num%10 == 5 ||... |
Markdown | UTF-8 | 3,119 | 2.515625 | 3 | [] | no_license | Projet de PCD 2019.
Membres du groupe :
FAZOUANE Souhail
REHIOUI Walid
HMIZA Jaber
LATA Warren
Release Day 1:
* Mise en place de la vue principale
* Recherche d'un flux RSS et sur le parsing du XML correspondant
* Tester le lancement du 1er Media
* Conception du Podcast (Ajout des classes du Modèle)
* ... |
JavaScript | UTF-8 | 3,180 | 3.546875 | 4 | [] | no_license | var Cards = require("./cards.js");
var inquirer = require("inquirer");
var dataFile = require("./data.txt");
var fs = require("fs");
var correctCounter = 0;
var wrongCounter = 0;
var x = 0;
function start() {
inquirer.prompt([{
type: "list",
name: "userChoice",
message: "Would like to go f... |
JavaScript | UTF-8 | 4,008 | 2.640625 | 3 | [] | no_license | var usrId;
var btnPress;
var addDlg;
var numberRegex = /^[+-]?\d+(\.\d+)?([eE][+-]?\d+)?$/;
$(document).ready(function() {
addDlg = $("#dialog").dialog({
autoOpen: false,
top: 40,
height: "auto",
modal: true,
buttons: {
Ok: function() {
if(btnPress == "add")
add();
else if(btnPress == "updat... |
JavaScript | UTF-8 | 1,175 | 2.640625 | 3 | [] | no_license | export default {
data() {
return {
// 所有的商品分类
catelist: [],
// 级联选择框的对应关系
cascaderProps: {
value: 'cat_id',
label: 'cat_name',
children: 'children'
},
// 选中的商品分类
selectedCate: [],
// 被选中的 tab 页签的名字
activeName: 'first'
}
},
creat... |
Python | UTF-8 | 1,228 | 3.625 | 4 | [
"MIT"
] | permissive | """
Utilities for use with pandas.DataFrame
"""
import pandas as pd
def summary(data=None, groups=None, column=None, *args):
"""
Create a table of descriptive statistics of the underlying data. Function will calculate
the percentiles in `args` in addition to the min, max, mean, std, and count. `summary` ... |
Java | UTF-8 | 2,905 | 3.296875 | 3 | [
"MIT"
] | permissive | package io.github.oliviercailloux.j_voting.preferences;
import com.google.common.graph.MutableGraph;
import io.github.oliviercailloux.j_voting.Alternative;
/**
* <p>
* A mutable preference keeps two graphs: the one representing the information
* received directly from the voter, not necessarily transitive or refle... |
C++ | UTF-8 | 1,425 | 3.734375 | 4 | [] | no_license | #include <algorithm>
#include <iostream>
#include <vector>
#include <stdexcept>
#include <cmath>
using namespace std;
template <uint32_t DIM>
class Queue {
public:
Queue() : array(), head(0), tail(0) {}
Queue(const Queue<DIM> & rhs) : head(rhs.head), tail(rhs.tail) {
for (uint32_t i = 0; i < DIM; i++)
array[... |
Java | UTF-8 | 3,661 | 2.125 | 2 | [] | no_license | package com.property.tax.controller;
import com.property.tax.TaxApplication;
import com.property.tax.model.SelfAssessmentForm;
import com.property.tax.model.ZonalReport;
import com.property.tax.service.PropertyTaxService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.sp... |
Java | UTF-8 | 329 | 2.28125 | 2 | [
"Apache-2.0"
] | permissive | package org.nutz.walnut.ext.data.fake.impl;
import org.nutz.walnut.ext.data.fake.WnFaker;
public class WnStaticFaker implements WnFaker<Object> {
private Object value;
public WnStaticFaker(Object value) {
this.value = value;
}
@Override
public Object next() {
return this.value;
... |
Java | UTF-8 | 276 | 2.171875 | 2 | [] | no_license | package org.nardogames.rattlesnake.common.keyboard;
public interface IListenToKeyEvents {
public boolean listensToKey(int key);
void notifyKeyPushed(int key);
void notifyKeyIsDown(int key, float deltaTime);
void notifyKeyReleased(int key, long timeDown);
}
|
Markdown | UTF-8 | 947 | 2.53125 | 3 | [] | no_license | ## AWS Training Manual
Brought to you by we45

## Objective
This repository contains the list of exercises intended for the "Hacking and Defending your applications in AWS" workshop presented at the Information Security Symposium at the University of California (Davis), June 2019.
These hands-... |
C++ | UTF-8 | 3,516 | 2.90625 | 3 | [] | no_license |
/**
Check if a directed Graph is a Tree or not
Insights
========
1 . A tree has only 1 root
2 . A vertex can't be visited more than once
(If it is visited more than once , then there is 2 paths from the root .
But in a tree there is always only 1 path to a vertex)
One extra condition for Undirected Graph : only a ... |
Java | UTF-8 | 516 | 1.835938 | 2 | [] | no_license | package com.bpmnengine.data;
import com.bpmnengine.model.Activity;
import com.bpmnengine.model.CatchEvent;
/**
* @author André Waloszek
*/
public interface DataContext {
void executeDataInputAssociations();
void executeDataOutputAssociations();
void setDataObject(String id, Object value);
Object... |
Python | UTF-8 | 495 | 2.859375 | 3 | [
"MIT"
] | permissive | # pylint: disable=missing-docstring
import asyncio
async def bla1():
await asyncio.sleep(1)
async def bla2():
await asyncio.sleep(2)
async def combining_coroutine1():
await bla1()
await bla2()
async def combining_coroutine2():
future1 = bla1()
future2 = bla2()
await asyncio.gather(f... |
C | UTF-8 | 543 | 2.640625 | 3 | [] | no_license | #ifndef TVM_MEMORY_H_
#define TVM_MEMORY_H_
#include <stdint.h>
#include <stddef.h>
#define MIN_MEMORY_SIZE (64 * 1024 * 1024) /* 64 MB */
typedef union
{
int32_t i32;
int32_t* i32_ptr;
union
{
int16_t h;
int16_t l;
} i16;
} tvm_register_t;
typedef struct
{
/*
Similar to x86 FLAGS register
0x1 EQUAL
... |
Swift | UTF-8 | 2,719 | 2.5625 | 3 | [
"MIT"
] | permissive | import UIKit
import Firebase
import ProgressHUD
protocol ForgotPasswordViewEvents: AnyObject {
func present(viewController: UIViewController)
func push(viewController: UIViewController)
}
class ForgotPasswordViewController: UIViewController {
@IBOutlet weak var textView: UITextView!
@IBOutlet wea... |
Shell | UTF-8 | 596 | 2.75 | 3 | [
"MIT"
] | permissive | #!/bin/bash
input=$1
output=$2
if [ -z "$input" ] || [ -z "$output" ]; then
echo "Usage: subset <input> <output>"
exit 1
fi
ncks -v state_WVatm_avk,state_WVatm,atm_altitude,state_WVatm_a,atm_nol,lat,lon,fit_quality,iter,srf_flag,Time,Date $input $output
# for file in *.nc; do
# ncks --overwrite -v lat,... |
C# | UTF-8 | 816 | 2.65625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace SimpleSurveyAPI.Controllers
{
public class SurveyController : ApiController
{
public HttpResponseMessage Get(int id)
{
HttpResponseMessage re... |
Java | UTF-8 | 1,606 | 2.0625 | 2 | [] | no_license | package com.bridgelabz.controller;
import java.io.IOException;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpSer... |
Python | UTF-8 | 955 | 2.515625 | 3 | [
"MIT"
] | permissive | import enum
class JointPath:
def __init__(self, joint_positions, cost):
self.joint_positions = joint_positions
self.cost = cost
class SolveMethod(enum.Enum):
""" Acrobotics.planning implements two types of algorithms. """
sampling_based = 0
optimization_based = 1
class CostFuntion... |
PHP | UTF-8 | 1,230 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
namespace NotificationChannels\OneSignal\Traits\Categories;
trait GroupingHelpers
{
/**
* Set the Android Grouping Parameters.
*
* @param string $group
* @param array $groupMessage
* @return $this
*/
public function setAndroidGroup(string $group, array $groupMessage)
... |
Java | UTF-8 | 1,232 | 2.5625 | 3 | [
"MIT"
] | permissive | package client;
import handlers.IWordOperations;
import java.net.URL;
import java.util.Scanner;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
import org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory;
import org.apache.xmlrpc.client.util.ClientFactory;
pub... |
C++ | UTF-8 | 643 | 3.296875 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
using namespace std;
int strStr(string haystack, string needle)
{
int index = -1;
const int n = haystack.length();
const int m = needle.length();
if (n < m)
return -1;
for (int i=0; i<=n-m; ++i)
{
int j = 0;
for (; j<m; ++j)
{
if (haystack[i+j] != needle[j])
{
break;
... |
C++ | BIG5 | 374 | 3.0625 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
int main ()
{ int a[9];
int answer=0;
printf("JAnƦr:\n");
for(int i=0;i<9;i++)
{
scanf("%d",&a[i]);
}
for(int i=0;i<9;i++)
{
printf("%d",a[i]);
}
answer=(a[0]*a[4]*a[8])+(a[3]*a[7]*a[2])+(a[6]*a[1]*a[5])
-(a[2]*a[4]*a[6])-(a[1]*a[3]*a[8])-(a[0]*a[5]*a[7]);... |
C++ | UTF-8 | 1,107 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include "Matrix.h"
#include "Object.h"
#include "Painter.h"
#include "Render.h"
void renderObject(const Object& obj,Render *r){
for(int i=0;i<obj.length()-1;++i)
{
Vec3f a[3];
for(int j=0;j<3;++j){
a[j]=r->vert(obj.vert(i,j));
}
r->Line(a[0],a[1]... |
Java | UTF-8 | 5,332 | 2.21875 | 2 | [] | no_license | package com.nisira.core.dao;
import com.nisira.core.entity.*;
import java.util.List;
import android.database.sqlite.SQLiteDatabase;
import com.nisira.core.database.DataBaseClass;
import android.content.ContentValues;
import android.database.Cursor;
import com.nisira.core.util.ClaveMovil;
import java.util.ArrayList;
im... |
Markdown | UTF-8 | 2,786 | 2.8125 | 3 | [] | no_license | # CSFX HW 1
```
Team #15
107062503 許博皓
10706XXXX 鄭家鈞
107062566 黃鈺程
```
## Introduction
我們準備了三張圖片:
[人臉](https://i.imgur.com/4S6XvLu.png)
[蘋果](https://i.imgur.com/VKd1dfg.png)
[橘子](https://i.imgur.com/vKQNUwr.jpg)
進行四個實驗:
1. 蘋果 轉換成 **橘子風格**
2. 人臉 轉換成 **橘子風格**
3. 橘子 轉換成 **蘋果風格**
5. 人臉 轉換成 **蘋果風格**
並使用四種 model 來實驗。
... |
Python | UTF-8 | 4,636 | 3.296875 | 3 | [
"MIT"
] | permissive | """Peter Rasmussen, Lab 4, run.py
This module processes a reads a file or directory of files containing integers, executes five
recursive sorting algorithms, and an output CSV for each input file.
"""
# standard library imports
import csv
from copy import deepcopy
from pathlib import Path
from time import time_ns
#... |
Python | UTF-8 | 11,694 | 3.8125 | 4 | [] | no_license | # Jonathan Williams
# Jon
# Final Project
# Clicker Madness
# Version 0.8.5
# Version Patch Notes: Add rough elapsed time, difficulty selection.
# Clicker Game that displays targets the player must click for points.
##To do list for Final Project:
##FUTURE Improvements:
##Upgrade Graphics
##New kinds of t... |
Java | UTF-8 | 229 | 2.265625 | 2 | [] | no_license | public class NormalDistribution extends ProbabilityDistribution {
public NormalDistribution(double mean, double stddev) {
super(mean, stddev);
}
public NormalDistribution() {
super(0.0, 1.0);
}
}
|
Python | UTF-8 | 4,565 | 3.65625 | 4 | [] | no_license | """
A3, Q2
Solving van der Pol oscillator using both Runge-Kutta and odeint,
taking odeint's result to be the true value
"""
import scipy.integrate as sp_int
import numpy as np
import matplotlib.pyplot as plt
from run_kut4 import *
# define constant
epsilon = 10.0
# inital conditions
x0 = 0.5
y0 = 0.0
ics = [x0,y0] ... |
Python | UTF-8 | 1,109 | 3.09375 | 3 | [] | no_license | from functools import cmp_to_key
import re
def compare(stu1, stu2):
def getGrade(stu):
if stu[1] >= c and stu[2] >= c:
return 4
elif stu[1] >= c and stu[2] < c:
return 3
elif stu[1] < c and stu[2] < c and stu[1] >= stu[2]:
return 2
else... |
Java | UTF-8 | 1,535 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package com.example.pc.custadvisroyapp;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class HomeActivity extends AppCompatActivity {
Button HeadAdvisor, Stude... |
Python | UTF-8 | 1,113 | 3.46875 | 3 | [] | no_license | import sys
def is_prime(num):
if num == 2 or num == 3: return True
if num < 2 or num % 2 == 0: return False
if num < 9: return True
if num % 3 == 0: return False
r = int(num ** 0.5)
f = 5
while f <= r:
if num % f == 0: return False
if num % (f + 2) == 0: return False
f += 6
return True
def get_p_ran... |
Python | UTF-8 | 2,550 | 2.859375 | 3 | [
"MIT"
] | permissive | from read_data import *
from interaction_labelling import *
from feature_generation import *
from model import *
from sklearn.model_selection import StratifiedKFold
def main():
#import XML Data - From link source
drug_list, smiles_dict = read_from_file('../data/sample/full_database.xml')
#preprocessing
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.