language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
PHP | UTF-8 | 4,349 | 2.703125 | 3 | [] | no_license | <?php
//header("Content-Type: application/vnd.ms-excel");
//header("Content-disposition: attachment; filename=spreadsheet.xls");
$api_key = "b5e3b32b4d29d45c16dc09274e099f731237e35f"; //Lora key
$job_id = "146522";
$unit_id = "227816726";
function objectToArray($obj) {
if (is_object($obj)) {
$obj = get_object_var... |
Shell | UTF-8 | 1,816 | 3.109375 | 3 | [] | no_license | #!/bin/bash
function rollback-analytics-db
{
echo "================rollback analytics db start $(date +%T)=========="
if [ ! -e /var/log/deploy/${ENVIRONMENT} ]
then
mkdir -p /var/log/deploy/${ENVIRONMENT}
fi
psql postgres -c "\q" &>/dev/null
if [ $? -ne 0 ];then
su - post... |
Markdown | UTF-8 | 1,549 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | Import Kibana dashboard for centralized logging and configure it.
**Table of Contents:**
- [Create a Basic & CloudTrail Logging Dashboard](#create-a-basic--cloudtrail-logging-dashboard)
- [Expected Outcome](expected-outcome)
## Create a Basic & CloudTrail Logging Dashboard
1. Login to Centralized Logging Kibana... |
JavaScript | UTF-8 | 1,563 | 2.625 | 3 | [] | no_license | var express = require('express');
var Item = require('../models/Item');
var Location = require('../models/Location');
const router = express.Router();
router.route('/')
.post(function(req, res){
console.log("POST: /items");
var item = new Item();
item.name = req.body.name;
item.price = req.body.pri... |
C# | UTF-8 | 1,960 | 2.609375 | 3 | [] | no_license | using MySql.Data.MySqlClient;
using System;
namespace GVRP.Module.Teams.AmmoArmory
{
public class AmmoArmorieItem : Loadable<uint>
{
public UInt32 Id { get; set; }
public UInt32 AmmoArmorieId { get; set; }
public UInt32 ItemId { get; set; }
public int RequiredPackets { get; set... |
PHP | UTF-8 | 474 | 3.046875 | 3 | [] | no_license | <?php
echo convertSeconds(3407) . " This was called before the functions was created <br />";
function convertSeconds($seconds) {
$minutes = floor($seconds / 60);
$seconds = $seconds % 60;
$seconds = ($seconds < 10) ? '0' . $seconds : $seconds;
return "$minutes:$seconds";
}
echo convertSeconds(5... |
C | UTF-8 | 3,114 | 2.796875 | 3 | [] | no_license | #pragma once
#include <stm32f103xb.h>
#include <sys/_stdint.h>
/**
* \brief Режим работы DMA
*/
typedef enum
{
DmaModePeriphToMem = 0 << 4,
DmaModeMemToPeriph = 1 << 4,
DmaModeMemToMem = 1 << 14
}DmaMode;
/**
* \brief Приоритет канала DMA
*/
typedef enum
{
DmaPriorityLow = 0 << 12,
DmaPriorityMedium ... |
Python | UTF-8 | 2,565 | 3.125 | 3 | [] | no_license | class Stmt(object):
pass
class PrintStmt(Stmt):
def __init__(self, exp):
self.exp = exp
class InputStmt(Stmt):
def __init__(self, nome):
self.id = nome
class LetStmt(Stmt):
def __init__(self, nome, e):
self.id = nome
self.exp = e
class IfStmt(Stmt):
def __init__(s... |
Java | UTF-8 | 790 | 2.921875 | 3 | [] | no_license | package tcp;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.Socket;
public class TcpSender {
public static void main(String[] args) throws Exception {
String sentence;
String repl;
for (int i = 0; i < 10000; i++) {
... |
Python | UTF-8 | 418 | 3.1875 | 3 | [] | no_license | import numpy as np
"""point, origo line distance
Inputs:
- oline: ndarray, line through origo, essentially just one 3d point as a vector
- points: ndarray, array of 3d points in homogeneous form
ref: https://mathworld.wolfram.com/Point-LineDistance3-Dimensional.html
"""
def p_ol_dist(oline, points):
... |
C | UTF-8 | 465 | 3.59375 | 4 | [] | no_license | #include "float_bits.h"
typedef unsigned float_bits;
/* If f is denorm, return 0. Otherwise, return f */
float_bits float_denorm_zero(float_bits f) {
/* Decompose bit representation into parts */
unsigned sign = f>>31;
unsigned exp = f>>23 & 0xFF;
unsigned frac = f & 0x7FFFFF;
if (exp == 0) {... |
JavaScript | UTF-8 | 1,330 | 3.1875 | 3 | [] | no_license | const canvas = document.querySelector("#draw");
const ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
ctx.strokeStyle = "#BADA55";
ctx.lineJoin = "round";
ctx.lineCap = "round";
ctx.lineWidth = 50;
ctx.globalCompositeOperation = "multiply"; // this is like photoshop... |
Python | UTF-8 | 4,317 | 3.90625 | 4 | [] | no_license | import random
def madlib(dictionaries):
'''
creates and prints out three madlibs (unicorn, shakespeare, princess) on 'r'
uses preferably known words from the English dictionary
the module can be exited by entering 'm' during any input request
Parameters
----------
dictionarie... |
Go | UTF-8 | 2,715 | 3.046875 | 3 | [] | no_license | package main
import (
"bytes"
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"math"
"os"
"strconv"
"time"
"github.com/tormoder/fit"
)
// print the contents of the obj
func PrettyPrint(data interface{}) {
var p []byte
p, err := json.MarshalIndent(data, "", "\t")
if err != nil {
fmt.Pri... |
C | SHIFT_JIS | 26,667 | 2.640625 | 3 | [] | no_license | /* ATmega644PpvO */
/* AVR PlayStationController */
/* Dualshock2Ή */
/*
SwitchRecv[]̃JbRɂ03܂œB
SwitchRecv[]ɂ̓vXẽ{^16i
AĂ悤ɂȂĂB
ႦΎg{^ƂB
if(SwitchRecv[1] == 0x01);
Ƃ邱ƂŁ{^Ƃ̖߂Ƃ\B
̃{^͉L̕\Q
SwitchRecv[0] ==
0x01 SELECT 0x10 L[
0x02 L3 0x20 L[
0x04 R3 0x40 L[
0x08 START... |
JavaScript | UTF-8 | 3,380 | 3.703125 | 4 | [] | no_license | function generateWinningNumber (){
return Math.ceil(Math.random()*100);
};
function shuffle(array) {
var m = array.length, t, i;
// While there remain elements to shuffle…
while (m) {
// Pick a remaining element…
i = Math.floor(Math.random() * m--);
// And swap it with the current element.
t ... |
JavaScript | UTF-8 | 530 | 3.0625 | 3 | [] | no_license | /**
* 1. Singleton (Based on Classes and class uses with extends for inheritance)
* 2. Observers (Event Emitter)
* 3. Factories (IIFE Immidiate Invoked function Expression, Instance of function)
* 4. Dependency Injections
* 5. Middleware -- App level, Route level
* 6. Streams
* 7. async/await
*/
/**
* How to ... |
C# | UTF-8 | 1,516 | 3.5625 | 4 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Altcoins
{
class Program
{
static void Main(string[] args)
{
var bitcoins = double.Parse(Console.ReadLine());
var bitcoinStartPrice = double.Par... |
Java | UTF-8 | 15,459 | 1.796875 | 2 | [
"Apache-2.0",
"LicenseRef-scancode-indiana-extreme"
] | permissive | /*
* JBoss, Home of Professional Open Source.
* Copyright 2014 Red Hat, Inc., and individual contributors
* as indicated by the @author tags.
*
* 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 Licen... |
PHP | UTF-8 | 6,780 | 2.921875 | 3 | [] | no_license | <?php
// require_once('config/home-laptop.config.php');
require_once('config/ubuntu-server.config.php');
class DB {
public $db;
private $db_user;
private $db_pass;
private $db_database;
public $conn;
public function __construct() {
$this->db_user = DB_USER;
$this->db_pass =... |
C++ | UTF-8 | 2,451 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #ifndef _HOMOMORPHINE_UTIL_H_
#define _HOMOMORPHINE_UTIL_H_
#include <limits>
#include <ctime>
#include <iostream>
#include <utility>
#include <sstream>
#include <string>
#include <boost/log/trivial.hpp>
#include <boost/log/utility/setup.hpp>
#include <boost/archive/iterators/base64_from_binary.hpp>
#include <boost/a... |
C++ | UTF-8 | 417 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
long sumTwoSmallestNumbers(std::vector<int> numbers)
{
std::sort(numbers.begin(), numbers.end());
return (long)numbers[0] + (long)numbers[1];
}
int main()
{
std::vector<int> nums;
nums.push_back(8);
nums.push_back(22);
nums.push_back(1... |
C++ | UTF-8 | 707 | 2.671875 | 3 | [
"MIT"
] | permissive | //This is the sol if we will be given any set of numbers instead od a series of 1-10
#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
#include<set>
#include<cmath>
#include<numeric>
#define LL long long
using namespace std;
int main()
{
int tc;
cin>>tc;
while(tc--)
{
... |
Python | UTF-8 | 1,114 | 2.71875 | 3 | [] | no_license | import numpy as np
from simulationtools import room
from utils import processing
from utils import plotting
#==================================================#
mic_location1 = np.c_[
[1.00, 4.02, 1.5], # mic1
[1.00, 3.98, 1.5], # mic2
[1.04, 4.02, 1.5], # mic3
[1.04, 3.98, 1.5], ... |
Python | UTF-8 | 2,100 | 3.3125 | 3 | [] | no_license | import unittest
import os
from github import Github
class GithubTest(unittest.TestCase):
def test_deve_retornar_todos_repos_do_usuario(self):
usuario = 'gpsilva'
github = Github()
repositorios = github.obter_repositorios_do(usuario)
self.assertEqual(10, len(repositorios))
def... |
Markdown | UTF-8 | 2,748 | 2.6875 | 3 | [] | no_license | # Pytorch Implementation of A2C
This repo implements the A2C algorithm for reinforcement learning with
emphasis on speed and modularity. A2C is the synchronized version of
[Asynchronous advantage actor-critic(A3C)](https://arxiv.org/pdf/1602.01783.pdf).
A2C has been implemented and studied by many AI researchers and n... |
JavaScript | UTF-8 | 10,661 | 2.671875 | 3 | [] | no_license |
$(document).ready(function() {
function updateScroll() {
var scrollDiv = document.getElementById("main");
scrollDiv.scrollTop = scrollDiv.scrollHeight;
}
/*
* Enables ability to search through existing chats for desired recipients username
*/
... |
C# | UTF-8 | 396 | 3.21875 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SumOfTwoIntegers
{
// Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.
internal class Program
{
private static void Main(stri... |
Markdown | UTF-8 | 2,481 | 2.546875 | 3 | [
"MIT"
] | permissive | ## Installation in stand-alone Tomcat
We assume Tomcat 7 in unzipped in `$TOMCAT_HOME` and that the `tomcat` user (group `tomcat`) is used
to run Tomcat. Change accordingly to your own settings.
### Tomcat configuration
In `$TOMCAT_HOME/lib`, put the following libraries:
* H2 database driver - downloaded from http:... |
C++ | UTF-8 | 1,370 | 3.328125 | 3 | [] | no_license | #pragma once
#include "ncurses.h"
/*!
* \brief Adapter klasy bibliotecznej ncurses
* \details Jest to klasa konwertujaca proceduralny interfejs (obslugujacy kolory) biblioteki ncurses na interfejs obiektowy, o wiele wygodniejszy w uzyciu
* \author Mateusz Winiarski
* \version v1.0
* \date 2015
*... |
JavaScript | UTF-8 | 1,479 | 2.90625 | 3 | [] | no_license | function solve() {
class Post {
constructor(postTitle, postContent) {
this.title = postTitle;
this.content = postContent;
}
toString() {
return `Post: ${this.title}\nContent: ${this.content}`
}
}
class SocialMediaPost extends Post {
... |
Java | UTF-8 | 249 | 1.695313 | 2 | [] | no_license | package ru.vsu.noidle_server.model.dto;
import lombok.*;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = "email")
@ToString
public class UserDtoForNotification {
private String email;
private String name;
}
|
C++ | UTF-8 | 248 | 3.65625 | 4 | [] | no_license | // WAP to calculate area of square using pass by refrence
#include<iostream>
using namespace std;
void area(int &a){
a=a*a;
}
int main(){
int l;
cout<< "Enter side of square\t";
cin>> l;
area(l);
cout<< "Area of square is"<<l;
return 0;
}
|
Markdown | UTF-8 | 3,702 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | # The PDOStatement class
I don't know why PDOStatement don't return "execution time" and "found rows" so here I created an extended class of PDOStatement with these attributes.<br><br>Just have to "setAttribute" of PDO's object to $PDO->setAttribute(\PDO::ATTR_STATEMENT_CLASS , ['\customs\PDOS... |
Java | UTF-8 | 3,402 | 4.125 | 4 | [] | no_license | package Interviews.Nextdoor;
import java.util.HashMap;
public class Longest_Equal_SubArray {
/**
* Given an array containing only 0s and 1s, find the largest subarray which contain
* equal no of 0s and 1s. Expected time complexity is O(n).
* Examples:
*
* Input: arr[] = {1, 0, 1, 1, 1, 0,... |
Markdown | UTF-8 | 1,449 | 2.625 | 3 | [] | no_license | <h1 align="center">
Enviar E-mails com C# via SMTP | <strong><a href="https://www.youtube.com/channel/UCHeVeHuy4m3HorYWirak2dg">Artigo Tech</a></strong>
</h1>
<div align="center">
## Sobre o Projeto
<p>
Este projeto foi desenvolvido no 5º Episódio do quadro C# Na Prática no Canal do YouTube - <strong><a href... |
SQL | UTF-8 | 1,085 | 3.34375 | 3 | [] | no_license |
DROP TABLE IF EXISTS users CASCADE;
CREATE TABLE users(
user_id VARCHAR(50) PRIMARY KEY,
password VARCHAR(32) NOT NULL,
email_address VARCHAR(256) NOT NULL,
user_type VARCHAR(2) NOT NULL,
enrol_date DATE NOT NULL,
last_access DATE NOT NULL
);
ALTER TABLE users OWNER TO group17_admin;
INSERT INTO users VALUES(
... |
Python | UTF-8 | 1,291 | 3.53125 | 4 | [] | no_license | # -*- coding: utf-8 -*-
__author__ = 'Olav Espenes'
__email__ = 'olaves@nmbu.no'
class LCGRand:
def __init__(self, seed):
self.seed = seed
self.a = 7**5
self.m = 2 ** 31 - 1
def rand(self):
while True:
self.seed = (self.a * self.seed) % self.m
return s... |
Markdown | UTF-8 | 7,710 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | # Contributing to Otoroshi
These guidelines apply to all Otoroshi projects living in the the `MAIF/otoroshi` repository.
These guidelines are meant to be a living document that should be changed and adapted as needed.
We encourage changes that make it easier to achieve our goals in an efficient way.
## Codebase
* [... |
Ruby | UTF-8 | 355 | 2.84375 | 3 | [] | no_license | # Modules
class Math
def add(a, b)
a + b
end
def subtract(a, b)
a - b
end
end
math = Math.new
sum = math.add(2, 2)
module Math
def add(a, b)
a + b
end
def subtract(a, b)
a - b
end
end
class CashRegister
include Math
def calculate_change(total_cost, amount_paid)
subtract(... |
Python | UTF-8 | 1,812 | 3 | 3 | [] | no_license | """
Tests the custom user model
"""
from django.test import TestCase
from django.contrib.auth import get_user_model
class UserModelTest(TestCase):
"""
Tests the default user model
"""
def test_create_user_with_email_successful(self):
"""
Test creating user model with email is successf... |
Markdown | UTF-8 | 3,274 | 2.859375 | 3 | [] | no_license | JS获取body及屏幕的高宽:
参考文档:
http://www.cnblogs.com/dolphinX/archive/2012/11/19/2777756.html
http://www.ruanyifeng.com/blog/2009/09/find_element_s_position_using_javascript.html
http://www.cnblogs.com/rubylouvre/archive/2009/08/24/1552862.html
http://itindex.net/detail/51490-js-%E9%BC%A0%E6%A0%87-%E4%BD%8D%E7%BD%AE
... |
PHP | UTF-8 | 1,287 | 3 | 3 | [
"MIT"
] | permissive | <?php
namespace Calculator\Dao;
/**
* Class CalculatorLog
*
* @package Calculator\Dao
*/
class Memory {
/**
* @var \PDO
*/
protected $dbm;
/**
* @param \PDO $dbm
*/
public function setDbm(\PDO $dbm) {
$this->dbm = $dbm;
}
/**
* @param int $calculator_id... |
Markdown | UTF-8 | 394 | 2.515625 | 3 | [] | no_license | # Olymbic-Data-Analysis ETG Intern
## About the repo?
I have analysed the summer olymbics dataset and performed some operations.
You'll learn how to handle the data.
## Features
Required operations are made and vizualised.
## Implementation
I have used colab for this project.
"Summer_Olympics.ipynb" contains the cod... |
Python | UTF-8 | 4,317 | 2.8125 | 3 | [] | no_license | # Copyright (C) 2014 SensorLab, Jozef Stefan Institute
# http://sensorlab.ijs.si
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... |
TypeScript | UTF-8 | 2,626 | 3.5 | 4 | [
"MIT"
] | permissive | /**
* Created by syjmac on 2017/8/23.
*
*开关器 可以设置任意位数的开关位 并且灵活控制每位的开关状态
*
* 参数不与许空字符串和 0 之类本身为false的值
*
*
let a=new Switcher("over","xx","v","a")
a.on("over").on("v").on("a").off("v").off()
console.log(a.isOn("a"));
console.log(a.isOn("over"));
console.log(a.isOn());
console output
_readable 1
_readabl... |
JavaScript | UTF-8 | 2,274 | 4.65625 | 5 | [] | no_license | // scope : 변수 혹은 함수를 선언하게 될 때 해당 변수 또는 함수가 유효한 범위
//1. Global (전역) Scope : 코드의 모든 범위에서 사용이 가능
//2. Function (함수) Scope : 함수 안에서만 사용이 가능
//3. Block (블록) Scope : if, for, switch 등 특정 블록 내부에서만 사용이 가능
//2,3 지역변수라고도함
//예시1
const value = "hello!"; //Global Scope
function myFunction() {
console.l... |
JavaScript | UTF-8 | 3,079 | 2.578125 | 3 | [] | no_license | // Aetna Custom Widget to create an email custom condition for forms
Aetna.EmailCondition = CQ.Ext.extend(CQ.form.CompositeField, {
/**
* @private
* @type CQ.Ext.form.Hidden
*/
hiddenField : null,
/**
* @private
* @type CQ.Ext.form.TextField
*/
inputValue : null,
/*... |
TypeScript | UTF-8 | 17,857 | 2.96875 | 3 | [
"MIT"
] | permissive | /**
* Tests for ParameterValidation.
*/
import * as Chai from "chai";
import * as Sinon from "sinon";
import { ParameterValidation } from "../../../../src/helpers/parameterValidation";
import { ILogger } from "../../../../src/interfaces/ILogger";
describe("ParameterValidation", () => {
let sandbox: Sinon.SinonSa... |
PHP | UTF-8 | 1,074 | 2.59375 | 3 | [
"Zlib"
] | permissive | <?php
/**
* Created by PhpStorm.
* User: morontt
* Date: 16.09.17
* Time: 10:42
*/
namespace Mtt\BlogBundle\Command\Telegram;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class WebhookCommand extends ... |
Python | UTF-8 | 3,022 | 2.6875 | 3 | [] | no_license | import numpy as np
import pandas as pd
import glob
import matplotlib.pyplot as plt
def ReadInputCSVFiles(filename):
print(filename)
df = pd.read_csv(filename)
return df
def ReadInputTXTFiles(filename):
print(filename)
info = pd.read_csv(filename, nrows=0)
sta = info.columns... |
Java | UTF-8 | 2,074 | 2.59375 | 3 | [] | no_license | package mechanics.system.jar;
import com.beust.jcommander.Parameter;
import mechanics.system.readers.Variables;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Alex Storm on 16.05.2017.
*/
public class Args {
@Parameter
private List<String> parameters = new ArrayLis... |
Java | UTF-8 | 2,275 | 2.328125 | 2 | [] | no_license | package com.example.manoel.maratoneia1.ResultsMovie;
import android.os.AsyncTask;
import android.view.View;
import com.airbnb.lottie.LottieAnimationView;
import com.example.manoel.maratoneia1.Movies.MovieAdapterCategory;
import com.example.manoel.maratoneia1.Movies.MovieFragment;
import com.google.gson.Gson;
import ... |
C | UTF-8 | 4,915 | 2.515625 | 3 | [] | no_license | #include "httpd.h"
//void* accept_request(void *arg)
//{
// int connfd = (int)arg;
// pthread_detach(pthread_self());
// return accept_handler(connfd);
//}
int turn = 1;
int send_data = 1;
const char *log_path = "log/httpd.log";
int logfd = 0;
int set_non_blocking(int fd)
{
int oldoption, newoption;
oldoption = fcn... |
Java | UTF-8 | 705 | 3.625 | 4 | [] | no_license | package advanced.lambdademo.anonymous;
/*
* If an anonymous class implements an interface which has only one abstract method then we can use lambda
* Anonymous class can extend interface which has more than one abstract method.
* Anonymous class can extend from normal class and an abstract class.
*/
public class ... |
JavaScript | UTF-8 | 1,454 | 2.6875 | 3 | [] | no_license | (function () {
"use strict";
angular.module('common')
.service('UserService', UserService);
UserService.$inject = ['$q'];
function UserService($q) {
var service = this;
var cookie_name = "coursera-test5";
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.g... |
Python | UTF-8 | 1,301 | 2.765625 | 3 | [] | no_license | import cv2
import numpy as np;
# Read image
im = cv2.imread("data/milestone.jpg", cv2.IMREAD_GRAYSCALE)
# Set up the detector with default parameters.
params = cv2.SimpleBlobDetector_Params()
#increasing minThreshold gets rid of tiny blobs
params.minThreshold = 150;
params.maxThreshold = 175;
#use blobColor = 255 t... |
Python | UTF-8 | 504 | 3.328125 | 3 | [] | no_license | #Pandigital 생성
import itertools
p=list()
permutations=list(itertools.permutations(list(range(0,10)),10))
for t in permutations:
s="".join(str(n) for n in t)
p.append(s)
sum_of_result = 0
rule = {1:2, 2:3, 3:5, 4:7, 5:11, 6:13, 7:17}
for pandigital in p:
isRight = True
for k in rule.keys():
i... |
Rust | UTF-8 | 1,308 | 2.625 | 3 | [] | no_license | use std::{
env,
path::{Path, PathBuf},
};
use actix_files::NamedFile;
use actix_web::{guard, web, App, Error, HttpRequest, HttpResponse, HttpServer};
use actix_web_actors::ws;
mod demo_ws;
async fn handle_ws(req: HttpRequest, stream: web::Payload) -> Result<HttpResponse, Error> {
ws::start(demo_ws::WebSo... |
Python | UTF-8 | 6,372 | 2.875 | 3 | [] | no_license | """Google Earth Engine methods to extract data."""
import json
from pathlib import Path
from typing import List, Tuple
import ee
from tqdm import tqdm
from time import sleep
from src.radix_co2_reduction.earth_engine.datasets import (
CroplandCollection,
Landsat7Collection,
Landsat8Collection,
Sentinel1... |
Markdown | UTF-8 | 676 | 2.96875 | 3 | [
"MIT"
] | permissive | ---
layout: about
title: About
permalink: /about/
---
I am a graduate student at Johns Hopkins. I am interested in the computational challenges associated with Bayesian statistics, which I focus on in this blog. While I enjoy working with many types of data, my passion is working with genomic, clinical, and healthcare... |
C | UTF-8 | 777 | 4.03125 | 4 | [] | no_license | #include "lists.h"
/**
* delete_nodeint_at_index - Entry Point
*
* @head: a pointer to a pointer to the first node in the linked list
* @index: the index at which a node is deleted
*
* Description: Deletes a node at an index in a linked list
*
* Return: 1, or -1 if it fails
*/
int delete_nodeint_at_index(listint_t **he... |
Markdown | UTF-8 | 2,175 | 3.28125 | 3 | [
"MIT"
] | permissive | ---
title: Menu
---
## Demo
```jsx_demo
{/* Lower left */}
<div style={{position: 'relative'}}>
<IconButton name="more_vert" id="demo-menu-lower-left" />
<Menu target="demo-menu-lower-left">
<MenuItem>Some Action</MenuItem>
<MenuItem>Another Action</MenuItem>
<MenuItem disabled>Disable... |
JavaScript | UTF-8 | 3,121 | 3.109375 | 3 | [] | no_license | //Creare un calendario del 2018, inserire poi le festività
$(document).ready(function(){
var numeroMese = 1;
function mese(numeroMese){
var scrittaMese = moment(numeroMese, "M").format("MMMM");
$("#month").text(scrittaMese);
var giorniMese = moment("2018-" + numeroMese + "", "Y... |
Java | UTF-8 | 1,456 | 2.359375 | 2 | [] | 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 uy.edu.cure.servidor.central.webapp.soap.server;
import java.util.List;
import javax.jws.WebService;
import javax.jws... |
Markdown | UTF-8 | 6,912 | 3.203125 | 3 | [] | no_license | # Charity data Analysis with Neural Network
Neural networks are computing systems with interconnected nodes that work much like neurons in the human brain. Using algorithms, they can recognize hidden patterns and correlations in raw data, cluster and classify it, and – over time – continuously learn and improve. Deep ... |
Python | UTF-8 | 4,430 | 2.71875 | 3 | [] | no_license | import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from urllib.parse import urlparse, parse_qs
import redis
import config
from .model import RedisModel
from utils.exceptions import ResponseTimeOut
class RedisConn(object):
def __init__(self, **kwargs):
conf = config.Config()
... |
Java | UTF-8 | 1,192 | 3.53125 | 4 | [] | no_license | package org.effectivejava.reimplement.chapter06.item30;
/**
* Created by Administrator on 2016/6/12.
*/
public enum PayrollDay {
MONDAY(PayType.WEEKDAY),
TUESDAY(PayType.WEEKDAY),
WEDNESDAY(PayType.WEEKDAY),
SUNDAY(PayType.WEEKEND);
PayrollDay( PayType payType ) {
this.payType = payType... |
C++ | UTF-8 | 1,741 | 2.546875 | 3 | [] | no_license | #include "departureinfo.h"
#include <QStringRef>
#include <QXmlStreamReader>
#include <QXmlStreamAttribute>
#include <QXmlStreamAttributes>
DepartureInfo::DepartureInfo(QXmlStreamReader &xml)
{
Q_ASSERT(xml.isStartElement() && xml.name() == "Departure");
QXmlStreamAttributes attributes = xml.attributes();
... |
Java | UTF-8 | 2,168 | 3.015625 | 3 | [
"MIT"
] | permissive | package ooga.view.engine.utils;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
/**
* This Class is responsible for splitting up sprite sheets into multiple images.
* @author Kenneth
*
*/
public class SpriteSheet {
private String GLOBAL = "res... |
Markdown | UTF-8 | 664 | 3.140625 | 3 | [] | no_license | # Titanic Survival Probability
## Quick Summary
In this project, we focus primarily on predicting the probability of survival of passengers who were onboard the Titanic. Here, explore a wide range of predictive models, namely simple decision trees, logistic regression, random forest regression, and gradient boosting te... |
Java | UTF-8 | 1,371 | 2.140625 | 2 | [] | no_license | package db;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import ... |
Java | UTF-8 | 1,252 | 3.90625 | 4 | [] | no_license | package lcof_offer;
/**
* 剑指 Offer 10- II. 青蛙跳台阶问题
* 一只青蛙一次可以跳上1级台阶,也可以跳上2级台阶。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。
*
* 答案需要取模 1e9+7(1000000007),如计算初始结果为:1000000008,请返回 1。
*
* 示例 1:
* 输入:n = 2
* 输出:2
*
* 示例 2:
* 输入:n = 7
* 输出:21
*
* 示例 3:
* 输入:n = 0
* 输出:1
*
* 提示:
* 0 <= n <= 100
* 注意:本题与主站 70 题相同:https://leetc... |
C++ | UTF-8 | 364 | 2.765625 | 3 | [] | no_license | #include "Directeur.h"
Directeur::Directeur() : nbPersonnes(0) {
}
Directeur::Directeur(const unsigned nbPersonnes, const char* service): nbPersonnes(nbPersonnes), service(service) {
}
void Directeur::Afficher(std::ostream& stream) {
Salarie::Afficher(stream);
stream << "Service : " << service << "\n"
<< "Nombre... |
Java | WINDOWS-1250 | 15,177 | 2.6875 | 3 | [] | no_license | package old;
import java.util.Random;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;
/** Klasa AlonePlayer - wykonuje algorytm w trybie "sam ze sob... |
Python | UTF-8 | 110 | 3.4375 | 3 | [] | no_license | num=[1,2,3,4,5]
sum=0;
for val in range(len(num)):
print( "NUM =" , val );
sum=sum + val;
print(sum) |
Java | UTF-8 | 3,301 | 3.03125 | 3 | [
"MIT"
] | permissive | package org.jabref.logic.util;
import java.util.Scanner;
import java.util.regex.Pattern;
/**
* Provides simple checks to ensure the correct version for JabRef is available. Currently, we need to make sure that we
* have Java 1.8 but not Java 9. The functions here are not intended for direct use. Instead, they are c... |
TypeScript | UTF-8 | 2,786 | 2.640625 | 3 | [] | no_license | /*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS205: Consider reworking code to avoid use of IIFEs
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
import assert from "assert";
import friendsStore from "../src/frien... |
C# | UTF-8 | 3,506 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | /* This class has been written by
* Corinna John (Hannover, Germany)
* cj@binary-universe.net
*
* You may do with this code whatever you like,
* except selling it or claiming any rights/ownership.
*
* Please send me a little feedback about what you're
* using this code for and what changes you'd like to
* s... |
Ruby | UTF-8 | 6,095 | 2.875 | 3 | [
"MIT"
] | permissive | require 'selkie/fourth/attacker'
module Selkie
module Monster
include Selkie::Attacker
attr_accessor :level, :role, :threat
def self.included(base)
base.extend ClassMethods
end
def initialize
self.class.maker.generate(self)
end
def abilities
@abilities ||= {}
... |
C# | UTF-8 | 1,085 | 2.625 | 3 | [] | no_license | using Almotkaml.ArtificialLimbs.Core.Domain;
using Almotkaml.ArtificialLimbs.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Almotkaml.ArtificialLimbs.Core.Extensions
{
public static class PatientExtensions
{
public static IEnumerable<PatientGridR... |
C++ | UTF-8 | 787 | 3.078125 | 3 | [] | no_license | #include "Level.h"
Level::Level(sf::RenderWindow* hwnd, Input* in)
{
window = hwnd;
input = in;
// initialise game objects
circle.setRadius(15);
circle.setPosition(300, 300);
circle.setFillColor(sf::Color::Green);
circle.setOutlineColor(sf::Color::Magenta);
circle.setOutlineThickness(2.f);
speed = 10.f;
}
... |
C++ | UTF-8 | 683 | 2.515625 | 3 | [] | no_license | /** \file BeamLogicProcessor.hpp
*
* Class to handle beam logic signals
* To be used with TreeCorrelator
* originally develeped for Dubna SHE 2014
*/
#ifndef __BEAMLOGICPROCESSOR_HPP_
#define __BEAMLOGICPROCESSOR_HPP_
#include "EventProcessor.hpp"
class BeamLogicProcessor : public EventProcessor {
public:
B... |
SQL | UTF-8 | 913 | 4 | 4 | [] | no_license | drop table channels;
create table channels (
id int auto_increment,
name varchar(64),
primary key(id)
);
drop table messages;
create table messages (
id int auto_increment,
text varchar(512),
created timestamp,
primary key (id)
);
drop table aggregations;
create table aggregations(
id int au... |
PHP | UTF-8 | 1,429 | 3.203125 | 3 | [] | no_license | <?php
class CRegistry Implements ArrayAccess
{
private $m_aVars;
static private $instance = NULL;
static public function GetInstance()
{
if(self::$instance == NULL)
self::$instance = new CRegistry();
return self::$instance;
}
/**
*
*/
private function __construct()
{
$this->... |
PHP | UTF-8 | 2,927 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
namespace PavelMaca\OpenBanking\Standard\PISP\Parts;
use PavelMaca\OpenBanking\Hydratation\HydratationException;
trait DomesticPaymentHelper
{
/**
* @var RemittanceInformation|null
*/
protected $remittanceInformation;
public function getVariableSymbol(): ?strin... |
Python | UTF-8 | 3,430 | 3.296875 | 3 | [] | no_license | import agents.agent
import pygame.event
import numpy as np
import random
class QLearningAgent(agents.agent.agent):
"""
Q-learning agent
"""
def __init__(self,pos,size,dim):
super().__init__(pos,size)
self.name = "Q-learning agent"
self.q_table = np.zeros((dim*dim, 4)) #20x20... |
C++ | UTF-8 | 5,602 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <string>
#include <cstring>
#include <utility>
#include <queue>
#include <map>
#include <algorithm>
#include <memory>
#include "HuffmanCode.h"
//*************************************************************************
//Class NodeCmp
//*************************************... |
Java | UTF-8 | 1,914 | 3.046875 | 3 | [] | no_license | package Dados;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;
/**
*
* @author n226324633
*
*classe:Produto
*/
public class Produto implements Serializable{
public static int codigogerador = 0;
private int codigo;
private double preco_unit;
private Greg... |
Markdown | UTF-8 | 1,730 | 2.546875 | 3 | [
"MIT"
] | permissive | ---
layout: page-fullwidth
title: "An anonymous face to face dating app"
subheadline: "Hi There"
meta_teaser: "Make your first move when you see someone attractive, realtime"
teaser: "<em>Make your first move when you see someone attractive, realtime</em>"
header:
image_fullwidth: galaxy.jpg
categories:
---
<!--more... |
C# | UTF-8 | 4,579 | 2.75 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
namespace WebAppCrudsPrj.DAL
{
public class DALClassFornecedores
{
string connectionString = "";
public DALClassFornecedor... |
Python | UTF-8 | 10,683 | 2.765625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
import re
from struct import unpack
from os.path import basename
# Handle parsing files into sets of addresses, each describing the start of a basic block
# Can be invoked as a standalone script for debugging purposes
def detect_format(filename):
"""Return the name of the format based on t... |
Python | UTF-8 | 895 | 4.625 | 5 | [] | no_license | ''' **2.26 (Turtle: draw a circle) Write a program that prompts the user to enter the
center and radius of a circle, and then displays the circle and its area.
/**
* @author BASSAM FARAMAWI
* @email tiodaronzi3@yahoo.com
* @since 2018
*/
'''
import turtle # Import turtle module
import math # Import... |
Python | UTF-8 | 247 | 3.609375 | 4 | [] | no_license | def is_palindrome(n):
return str(n) == str(n)[::-1]
largest = 0
for n in range(100,1000):
for m in range(100,1000):
number = n * m
if is_palindrome(number) and number > largest:
largest = number
print largest
|
Markdown | UTF-8 | 2,754 | 2.90625 | 3 | [
"MIT"
] | permissive | # @node-ts/bus-core
[](https://greenkeeper.io/)
[](https://circleci.com/gh/node-ts/bus/tree/master)[](https://o... |
Java | UTF-8 | 2,100 | 2.0625 | 2 | [] | no_license | package com.gogoyang.rpgapi.meta.job.service;
import com.gogoyang.rpgapi.framework.constant.JobStatus;
import com.gogoyang.rpgapi.meta.job.entity.Job;
import java.util.ArrayList;
import java.util.Map;
public interface IJobService {
void insertJob(Job job) throws Exception;
/**
* 读取Job的详细信息,包括jobDetail
... |
Shell | UTF-8 | 558 | 3.5625 | 4 | [
"BSD-3-Clause"
] | permissive | #!/usr/bin/env bash
set -e
SOURCE_PATH=/src/
BUILD_PATH=$HOME/build
echo "Transferring the source: $SOURCE_PATH -> $BUILD_PATH. Please wait..."
cd $BUILD_PATH && cp -rp $SOURCE_PATH . && cd src
echo
echo "Compiling PhantomJS..." && sleep 1
python build.py --confirm --release --qt-config="-no-pkg-config" --git-clean... |
JavaScript | UTF-8 | 1,877 | 3.296875 | 3 | [] | no_license | // rwd_page.js
(function($){
var winW = $(window).width();
var size = $('.size');
// step1 =================================
/* var ViewSize = function(e){
e.preventDefault();
var nowW = $(window).width();
if(winW !== nowW){
location.reload();
}
size.text(nowW);
};
$(window).on('resi... |
Shell | UTF-8 | 369 | 3.0625 | 3 | [] | no_license | #!/bin/bash
set -e
npm i && bower i && npm run build -- -e production
if [ "$TRAVIS_BRANCH" == "master" ]; then
pushd dist &> /dev/null
git init
git config user.name "AutoBot"
git config user.email "dylan947@gmail.com"
git add -A
git commit -m "Deploy to GitHub pages"
git push --force "https... |
C++ | UTF-8 | 962 | 3.59375 | 4 | [] | no_license | #pragma once
template<typename vTy>
struct ptr_ref
{
public:
typedef vTy value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
ptr_ref() = default;
ptr_ref(pointer vptr) :
ptr(vptr)
{
}
ptr_ref& operator =(const ptr_ref& o)
{
ptr = o.ptr;
return *this;
}
ptr_ref& operato... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.