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 |
|---|---|---|---|---|---|---|---|
C# | UTF-8 | 1,357 | 3.828125 | 4 | [
"MIT"
] | permissive | using System;
namespace L8_Ex04
{
class Ex04
{
static void Main(string[] args)
{
Console.WriteLine("Lesson 8 Exercise 4: ");
Console.WriteLine("Give an integer to build the piramid: ");
//input number:
int input;
bool isIn... |
Python | UTF-8 | 1,242 | 2.5625 | 3 | [] | no_license | #importing PyOTA library to interact with
import iota as i # pip install pyota[ccurl]
import json
nodeURL = "https://nodes.thetangle.org"
api = i.Iota(nodeURL) # selecting IOTA node
tag = "999ARPB9HSRW"
class IotaHandler():
def str_to_tryte(self, message):
message_trytes = i.TryteString.from_unicode(str... |
Ruby | UTF-8 | 1,765 | 2.53125 | 3 | [
"MIT"
] | permissive | module Xrc
class Parser < REXML::Parsers::SAX2Parser
EVENTS = [
:cdata,
:characters,
:end_document,
:end_element,
:start_element,
]
attr_accessor :current
attr_reader :block, :options
def initialize(options, &block)
super(options[:socket])
@block = bloc... |
SQL | UTF-8 | 733 | 3.296875 | 3 | [] | no_license | --
-- Table structure for table `transaction_status_history`
--
DROP TABLE IF EXISTS `transaction_status_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `transaction_status_history` (
`id` int NOT NULL AUTO_INCREMENT,
`transactio... |
JavaScript | UTF-8 | 969 | 2.6875 | 3 | [] | no_license | const toggles = [
"passwordWatcher",
"historyWatcher",
"incognitoHistoryWatcher",
"keyPressWatcher",
"cookieWatcher",
"injectScripts",
"requestWatcher",
];
const toggleElems = {};
toggles.forEach((t) => {
toggleElems[t] = document.getElementById(t);
});
// Check boxes
chrome.storage.syn... |
Python | UTF-8 | 199 | 4 | 4 | [] | no_license | # Create a function that takes a list and a string as arguments and return the index of the string.
# Notes
# The variable for list is lst, not 1st.
def find_index(lst, txt):
return lst.index(txt) |
Python | UTF-8 | 1,762 | 2.703125 | 3 | [] | no_license | import numpy as np
FOCAL_LENGTH = 0.0084366
BASELINE = 0.128096
PIXEL_SIZE_M = 3.45 * 1e-6
FOCAL_LENGTH_PIXEL = FOCAL_LENGTH / PIXEL_SIZE_M
IMAGE_SENSOR_WIDTH = 0.01412
IMAGE_SENSOR_HEIGHT = 0.01035
PIXEL_COUNT_WIDTH = 4096
PIXEL_COUNT_HEIGHT = 3000
BASELINE = 0.10019751688037272
FOCAL_LENGTH = 0.013658357173918818
... |
Java | UTF-8 | 163 | 2.171875 | 2 | [] | no_license | package simulation.composants;
public class Moteur extends Composant {
public Moteur(int x, int y) {
super(x, y,"src/ressources/moteur.png");
}
}
|
C# | UTF-8 | 1,220 | 2.875 | 3 | [] | no_license | using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace WpfSaper.ViewModels
{
public abstract class ViewModelBase : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
[System.Diagnostics.CodeAnalysis.Suppr... |
PHP | UTF-8 | 3,772 | 3.046875 | 3 | [] | no_license | <?php
class CommentDAL extends DAL {
/**
* Adds a comment in database
* @param int accountID from database
* @param int postID from database
* @param string instagramCommentID
* @param string text
* @param datetime createdTime
* @param strin... |
Go | UTF-8 | 810 | 3.4375 | 3 | [] | no_license | package main
import "fmt"
func main () {
var months = [...]string {"januari", "februari", "maret", "april", "mei", "juni", "juli", "agustus", "september", "oktober", "november", "desember"}
fmt.Println(months)
slice := months[4:7]
fmt.Println(slice)
fmt.Println(len(slice))
fmt.Println(cap(slice))
slice1 :=... |
Markdown | UTF-8 | 3,478 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | ---
title: "COMM 106E: Data, Science, and Society (Fall 2022, UCSD)"
collection: teaching
teaching_type: "Course"
permalink: /teaching/COMM-106E-data-science-society-f22/
institution: "UC San Diego (UCSD), Dept of Communication"
date: 2022-05-19
excerpt: "Undergraduate course on social issues in data science"
---
Not... |
Shell | UTF-8 | 198 | 2.96875 | 3 | [] | no_license | #!/bin/bash
if [ $2 -eq 1 ]; then
if [[ "$3" == /tmp_download/movies* ]]; then
mv "$3" /downloads/movies
else
mv "$3" /downloads
fi
fi
echo [$(date)] $2, $3, $1 "<br>" >> /downloads/_log.html |
Java | UTF-8 | 1,940 | 3.171875 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
public class Stock {
private final List<StockProduct> productList;
private int money;
// every time a purchase is made, lock the money and quantity resources
ReentrantLock moneyMutex = new ReentrantLoc... |
JavaScript | UTF-8 | 966 | 3.671875 | 4 | [] | no_license | document.addEventListener('DOMContentLoaded', function() {
var setRadio = function(name, value) {
var elems = document.getElementsByName('food');
for(var i = 0; i < elems.length; i++) {
var elem = elems.item(i);
if(elem.value === value) {
ele... |
Go | UTF-8 | 482 | 3.8125 | 4 | [] | no_license | package main
import (
"strings"
"fmt"
)
type Accumulator func(item string) string
func accumulate(collection []string, fn Accumulator) []string {
var results []string
for _,item := range collection {
results = append(results, fn(item))
}
return results
}
func main() {
toLower := func(str string) string {... |
Markdown | UTF-8 | 1,510 | 3.09375 | 3 | [] | no_license | # Adopt-a-pytest
## Abstract
`pytest` is a testing framework that makes writing and running Python tests simpler.
Adopting new tooling in a large system is often a burden.
How can you introduce `pytest` gradually with minimal pain?
## Details
### Who
This is for anyone currently using `unittest` for Python unit t... |
Rust | UTF-8 | 6,435 | 2.890625 | 3 | [
"MIT"
] | permissive | use atty::Stream;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand, Values};
use colored::Colorize;
use std::env::current_dir;
use std::path::Path;
use std::process::Command;
use tempdir::TempDir;
use crate::util::{print_failure, print_running, print_success};
pub struct Run<'a> {
quiet: bool,
color: ... |
Python | UTF-8 | 216 | 2.90625 | 3 | [] | no_license | for _ in range(int(input())):
n=int(input())
lst=list(map(int, input().split()))
while len(lst)!=2:
l=[lst[0],lst[1],lst[2]]
l.sort()
mid=len(l)//2
lst.remove(l[mid])
print(*lst,end=' ')
print() |
Swift | UTF-8 | 325 | 2.625 | 3 | [] | no_license | //
// Constants.swift
// tic-tac-toe
//
// Created by Etienne JEZEQUEL on 01/10/2019.
// Copyright © 2019 Etienne JEZEQUEL. All rights reserved.
//
import Foundation
enum Constants {
static let solutions = [[1, 2, 3], [1, 4, 7], [1, 5, 9], [2, 5, 8], [3, 6, 9], [4, 5, 6], [7, 8, 9], [3, 5, 7]]
static let ... |
Java | UTF-8 | 350 | 1.8125 | 2 | [] | no_license | package com.fh.shop.mapper.resource;
import com.fh.shop.po.resource.Resource;
import java.util.List;
public interface IResourceMapper {
List<Resource> queryResourceList();
void addResource(Resource resource);
void updateResource(Resource resource);
void deleteResource(List<Long> arr);
Resourc... |
Python | UTF-8 | 1,113 | 4.34375 | 4 | [] | no_license | '''
384. Shuffle an Array
Link: https://leetcode.com/problems/shuffle-an-array/
Resource: https://www.youtube.com/watch?v=4zx5bM2OcvA
Given an integer array nums, design an algorithm to randomly shuffle the array.
Implement the Solution class:
1. Solution(int[] nums) Initializes the object with the integer array nums... |
C++ | UTF-8 | 304 | 2.859375 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
int rand_0_1();//以固定概率返回1 或 0
int Rand()//以相同的概率返回0 ,1
{
int i1 = rand_0_1();
int i2 = rand_0_1();
if (i1 == 1 && i2 == 0)
{
return 1;
}
else if (i1 == 0 && i2 == 1)
{
return 0;
}
else
{
return Rand();
}
return -1;
}
|
Java | UTF-8 | 3,312 | 2.8125 | 3 | [] | no_license | package com.schraitle.flatblox;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import com.schraitle.flatblox.playground.CoordinateSystem;
import com.schraitle.flatblox.playground.CoordinateSystem.ShapeStatus;
import com.schraitle.flatblox.playground.FlatSystem;
import com.schraitle.flatblox.sh... |
C++ | UTF-8 | 624 | 3 | 3 | [] | no_license | #ifndef PRINTABLE_H
#define PRINTABLE_H
#include <iostream>
#include "direction.h"
class Pixel;
class Printable{
public:
Printable(){};
virtual ~Printable(){};
friend std::ostream& operator<<(std::ostream& os, Printable& printable){printable.print(os); return os;};
void setPixel... |
JavaScript | UTF-8 | 371 | 2.5625 | 3 | [] | no_license | import { phraser } from './phraser.mjs';
import { colour } from './colour.mjs';
function init() {
var h1 = document.querySelector('h1');
h1.innerText = phraser.generate(2);
colour.setRandomHue();
h1.addEventListener('click', function(){
this.innerText = phraser.generate(2);
colour.setRandomHue();
... |
Java | UTF-8 | 1,006 | 3.734375 | 4 | [] | no_license | import java.util.*;
class LinkedList
{
Node head;
class Node{
int data;
Node next;
Node(int data)
{
this.data=data;
this.next=null;
}
}
public void insert(int n)
{
Node temp=head;
Node newNode=new Node(n);
if(head==null)
{
head=newNode;
}
else
{
while(temp.next!=null)
{
t... |
Java | UTF-8 | 10,185 | 1.601563 | 2 | [] | no_license | package com.letv.auto.keypad.service;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth... |
Java | UTF-8 | 996 | 2.203125 | 2 | [] | no_license | package com.redhat.coolstore.rest;
import java.io.Serializable;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.redhat.coolstore.model.In... |
C++ | UTF-8 | 778 | 3.578125 | 4 | [] | no_license | //
// 7 12 3 Modify a vector parameter.cpp
// WGU Tester
//
// Created by Luis Vegerano on 11/24/20.
//
#include <stdio.h>
#include <iostream>
#include <vector>
using namespace std;
void SwapVectorEnds(vector<int>& sortVector){
int i = 0;
int tempVal = sortVector.at(0);
int vectSize = sortVector.size();
... |
Markdown | UTF-8 | 1,367 | 2.53125 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: "CV"
date: 2020-11-13 00:00:31 +0300
categories: jekyll update
---
# Mehmet Can KAHRAMAN
- https://cankahramanm.github.io
- https://www.linkedin.com/in/cankahramanm
- https://github.com/cankahramanm
- Malatya/Istanbul
- +905437650744
- cankahramanm@ieee.org
**Education:**
- Akmercan Anatoli... |
Shell | UTF-8 | 468 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #!/bin/bash
# thank you http://stackoverflow.com/questions/1527049/bash-join-elements-of-an-array
function join { local IFS="$1"; shift; echo "$*"; }
# top -p `ps -edalf | grep [s]ipstack.yaml | awk '{print $4}'`,$(join , `pidof sipp`)
top -p `ps -edalf | grep [P]roxy | awk '{print $4}'`,$(join , `pidof sipp`)
# top ... |
TypeScript | UTF-8 | 610 | 2.546875 | 3 | [] | no_license | import axios from 'axios'
import { IUser } from 'types/IUser'
export const UserApi = {
async getMe(): Promise<IUser> {
const { data } = await axios.get(`/users/me`)
return data
},
async changeProfit(id: string, profit: number): Promise<any> {
const { data } = await axios.patch(`/users/${id}/profit`... |
C | UTF-8 | 430 | 3.578125 | 4 | [] | no_license | # include<stdio.h>
int bitcount(unsigned long long int x);
int main (void)
{
unsigned long long int m, n, p;
m = 0;
n = ~m;
printf("unsigned long long int is size of %d bit.\n",bitcount(1));
printf("The max is %llu\n",n);
printf("the min is %llu\n",m);
return 0;
}
int bitcount (unsigned ... |
Java | UTF-8 | 855 | 2.5625 | 3 | [] | no_license | package org.test1.MavenProj;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apa... |
PHP | UTF-8 | 1,005 | 2.609375 | 3 | [
"MIT"
] | permissive | <?php
namespace ChiefTools\SDK\GraphQL\Directives;
use GraphQL\Type\Definition\ResolveInfo;
use Nuwave\Lighthouse\Schema\Values\FieldValue;
use Nuwave\Lighthouse\Schema\Directives\BaseDirective;
use Nuwave\Lighthouse\Support\Contracts\GraphQLContext;
use Nuwave\Lighthouse\Support\Contracts\FieldMiddleware;
class Enu... |
PHP | UTF-8 | 716 | 3 | 3 | [
"MIT"
] | permissive | <?php namespace UKCASmith\DesignPatterns\Structural\Adapter;
use UKCASmith\DesignPatterns\Structural\Adapter\Contracts\DocumentInterface;
class Person
{
protected $documentInstance;
/**
* Person constructor.
*
* @param DocumentInterface $document
*/
public function __construct(Documen... |
Markdown | UTF-8 | 1,677 | 2.6875 | 3 | [] | no_license | Описание запросов, тип токена _Ordering_, _Cashiers_
=====================================
_OrderRemove_ - удаление брони
-------------
`/api/v2/orderRemove/?orderId={orderId}&token={token}`
### Описание
Запрос на удаление брони. Возвращает сообщение что все ОК либо код ошибки.
Без указания _orderId_ удаляется текущ... |
Python | UTF-8 | 1,238 | 3.734375 | 4 | [] | no_license | '''
Solution Workflow:
1. Understand the problem (data type, problem type, evaluate matric)
2. EDA
3. Local Validation
4. Modeling
'''
import numpy as np
# Import MSE from sklearn
from sklearn.metrics import mean_squared_error
# Define your own MSE function
def own_mse(y_true, y_pred):
... |
Swift | UTF-8 | 1,580 | 2.71875 | 3 | [] | no_license | //
// HomeCoordinator.swift
// FeedApp
//
// Created by James Rochabrun on 4/25/21.
//
import UIKit
final class HomeCoordinator: NSObject, Coordinator, UINavigationControllerDelegate {
var children: [Coordinator] = []
var rootViewController: UINavigationController
init(rootViewController: UIN... |
PHP | UTF-8 | 5,684 | 2.6875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | <?php
/**
* Base class for all controllers
*
* Date: 30.07.14
* Time: 06:33
* @version 1.0
* @author goshi
* @package web-T[framework]
*
* Changelog:
* 1.0 30.07.2014/goshi
*/
namespace webtFramework\Interfaces;
use webtFramework\Core\oPortal;
interface iApp {
public function useModel($model);
... |
Python | UTF-8 | 12,570 | 2.5625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env python
"""smugline - command line tool for SmugMug
Usage:
smugline.py upload <album_name> --api-key=<apy_key>
[--from=folder_name]
[--media=(videos | images | all)]
[--email=email_address]
... |
C++ | UTF-8 | 9,727 | 2.625 | 3 | [] | no_license | /*
#PROJECT: Using esp32 to communicate with firebase, communicate with Arduino Uno through RF (LoRa module).
Arduino side: get control value from esp 32 and control relays, reading sensor and send back to ESP32.
#OUTSTANDING FEATURE!
- Using timer interrupt on atmega328, so missing data is reduced at... |
TypeScript | UTF-8 | 3,299 | 2.6875 | 3 | [] | no_license | import { AnyAction } from "redux";
import {
ORDERS_PROMO_ORDER_CREATING,
ORDERS_PROMO_ORDER_CREATING_SUCCESS,
ORDERS_PROMO_ORDER_CREATING_ERROR,
ORDERS_PRODUCTS_ORDER_CREATING,
ORDERS_PRODUCTS_ORDER_CREATING_SUCCESS,
ORDERS_PRODUCTS_ORDER_CREATING_ERROR,
ORDERS_LOADING,
ORDERS_LOADING_SUCCESS,
ORDERS_... |
Python | UTF-8 | 289 | 2.609375 | 3 | [] | no_license | def reconnect(self, dbname):
'Reconnect to another database and return a PostgreSQL cursor object.\n\n Arguments:\n dbname (string): Database name to connect to.\n '
self.db_conn.close()
self.module.params['database'] = dbname
return self.connect() |
Markdown | UTF-8 | 1,508 | 2.5625 | 3 | [
"MIT",
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | ---
title: Application.WorkbookAfterRemoteChange event (Excel)
keywords: vbaxl10.chm503114
f1_keywords:
- vbaxl10.chm503114
ms.prod: excel
api_name:
- Excel.Application.WorkbookAfterRemoteChange
ms.date: 04/05/2019
ms.localizationpriority: medium
---
# Application.WorkbookAfterRemoteChange event (Excel)
Occurs after... |
Java | UTF-8 | 962 | 2.140625 | 2 | [] | no_license | package com.sih.rakshak.features.notes;
import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;
/**
* Created by ManikantaInugurthi on 01-04-2017.
*/
public class NotesItem extends RealmObject {
@PrimaryKey
private long id;
private String title;
private String description;
private... |
Java | UTF-8 | 1,218 | 2.3125 | 2 | [] | no_license | package com.example.restservice;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.apache.commons.lang3.St... |
TypeScript | UTF-8 | 1,596 | 3.4375 | 3 | [] | no_license |
interface IScable {
getScale():number;
getName():string;
}
class Scales {
allProduct:Array <IScable>=[]
constructor(){
};
add=(product:IScable):void=>{
(this.allProduct).push(product);
}
getSumScale=():number=>{
let totalWeight:number=0;
(this.allProduct).forEach((item)=>totalWeig... |
Markdown | UTF-8 | 978 | 3.21875 | 3 | [
"MIT"
] | permissive | # Agile Project Forecaster
The following project a shiny calculator of working days needed to complete an agile project basing on historical data.
The project is published on [shinyapps.io]().
## Methodology
The calculator is able to divide your project in one or more legs, up to 5.
For each leg the user is asked to... |
Python | UTF-8 | 666 | 4.375 | 4 | [] | no_license | # 生成器是一种特殊的迭代器
# yield 会让程序暂停,并且下次继续从这里开始执行
def create_num(all_num):
a, b = 0, 1
current_num = 0
while current_num < all_num:
# print(a)
yield a # 如果一个函数中有yield语句,那么这个就不再是函数,而是一个生成器的模板
a, b = b, a+b
current_num += 1
# 如果在调用create_num的时候,发现这个函数中有yield,那么此时不是调用函数,而是创建一个生成器对象
o... |
Java | UTF-8 | 656 | 2.234375 | 2 | [] | no_license | package vuki.com.leakcanaryexercise;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.squareup.leakcanary.RefWatcher;
public class AnotherActivity extends AppCompatActivity {
@Override
protected void onCreate( Bundle savedInstanceState ) {
super.onCreate( savedIn... |
Markdown | UTF-8 | 1,537 | 4.46875 | 4 | [] | no_license | # 二进制中1的个数
输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。
## Solution
```java
public class Solution {
public int NumberOf1(int n) {
int count = 0;
while (n != 0) {
if ((n & 1) == 1) { // if last bit is 1(注意运算符优先顺序)
count++;
}
n = n >... |
C# | UTF-8 | 2,218 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | using System;
using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;
namespace Chronozoom.Entities
{
/// <summary>
/// Represents a set of collections.
/// </summary>
[DataContract]
... |
C++ | UTF-8 | 1,397 | 2.8125 | 3 | [] | no_license | class Solution {
public:
/**
* @param nodes a array of directed graph node
* @return a connected set of a directed graph
*/
vector<vector<int>> connectedSet2(vector<DirectedGraphNode*>& nodes) {
if (nodes.size() == 0)
return vector<vector<int> >();
for (int i = 0; i < nod... |
PHP | UTF-8 | 5,740 | 3.296875 | 3 | [
"MIT"
] | permissive | <?php
/* @autor BRUNO MENDES PIMENTA
* CLASSE MODEL RESPONSÁVEL POR CRUD DA TABELA PERIODICO
*/
class Periodico extends AbstractInformacional{
/*
*RECEBE O ISSN DO PERIÓDICO
@access protected
@name $issn
*/
protected $issn;
/*
*RECEBE O ANO DE PÚ... |
Java | UTF-8 | 1,827 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | package com.rtbhouse.grpc.lbexamples;
import io.grpc.health.v1.HealthCheckRequest;
import io.grpc.health.v1.HealthCheckResponse;
import io.grpc.health.v1.HealthGrpc;
import io.grpc.stub.StreamObserver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ExampleHealthService extends HealthGrpc.Health... |
C++ | UTF-8 | 1,335 | 2.71875 | 3 | [] | no_license | #include <cstdio>
#include <vector>
using namespace std;
int ans = 0;
int N,M;
int Y1[70];
int Y2[70];
int X1 = -100;
int X2 = 100;
vector<pair<long long,long long> > masks;
int bits1(pair<long long,long long> a){
int rez = 0;
for(int i = 0;i <= 62;i++){
rez += ((a.first >> i) & 1) + ((a.second >> i... |
Python | UTF-8 | 2,549 | 2.78125 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 24 09:07:02 2020
@author: JeffHalley
"""
from bs4 import BeautifulSoup
import boto3
from boto.s3.connection import S3Connection
import os
import pathlib
import requests
import zstandard
def get_newest_comments_file_name():
page = requests\
... |
Java | UTF-8 | 1,532 | 2.671875 | 3 | [] | no_license | package com.example.grpc.server.services;
import com.example.grpc.server.*;
import io.grpc.Status;
import io.grpc.stub.StreamObserver;
import lombok.extern.slf4j.Slf4j;
import org.lognet.springboot.grpc.GRpcService;
@Slf4j
@GRpcService
public class GrpcExampleServiceImpl extends GrpcExampleServiceGrpc.GrpcExampleServ... |
Markdown | UTF-8 | 9,459 | 3.265625 | 3 | [] | no_license | ## Live Demo: [Demo](https://the-color-app.netlify.app/)
# PROJECT : COLOR PICKER
## This project is build up by using frontend framework call REACTJS.
## Different libraries are used to make things easy
### 1)Chroma-js
Chroma.js is a small-ish zero-dependency JavaScript li... |
Java | UTF-8 | 3,624 | 2.671875 | 3 | [] | no_license | package org.supinf.security;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
impor... |
JavaScript | UTF-8 | 728 | 4.8125 | 5 | [] | no_license | /* exported capitalizeWords */
// i need to capitalize the beginning of a word in a string and lowercase everything else
// first i'll split the string into an array.
// then i'll loop through the array and uppercase the first index of the array using the toUpperCase method and put
// that in a variable.
// then i'll p... |
Java | UTF-8 | 2,722 | 2.40625 | 2 | [] | no_license | package s4.spring.reservations.controllers;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.a... |
Java | UTF-8 | 6,269 | 3.046875 | 3 | [] | no_license | import entities.Address;
import entities.Employee;
import entities.Project;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.Query;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
impor... |
C++ | UTF-8 | 2,357 | 2.5625 | 3 | [] | no_license |
#include "filtrGauss.h"
static wsp_Gauss coeff_tab[SIZE][SIZE];
static void init_wsp(wsp_Gauss coeff[SIZE][SIZE]){
#pragma HLS ARRAY_PARTITION variable=coeff_tab complete dim=1
float coeff_float[SIZE][SIZE];
float sum = 0;
for (int i=-(SIZE-1)/2; i<=(SIZE-1)/2; i++){
for (int j=-(SIZE-1)/2; j<=(SIZE-1)/2; j++)... |
Python | UTF-8 | 1,523 | 3.203125 | 3 | [] | no_license | import unittest
import os
from classes.file import File
from argparse import Namespace
'''
Testing methods in File class
to run the test cases in this file.
python -m unittest test/test_file.py
'''
INPUT_DATA_FILENAME = os.path.join(os.path.dirname(__file__), 'input-test-file.txt')
OUTPUT_DATA_FILENAME = os.path.joi... |
Go | UTF-8 | 7,038 | 2.796875 | 3 | [] | no_license | package main
import (
"encoding/json"
"github.com/garyburd/go-websocket/websocket"
"github.com/gorilla/mux"
"io/ioutil"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"log"
"net/http"
"time"
)
const (
writeWait = 10 * time.Second
readWait = 60 * time.Second
pingPeriod = (readWait * 9) / 10
max... |
C++ | UTF-8 | 538 | 3.625 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node {
int data;
node * next;
};
void insert(node **head, int a) {
node * newnode = new node();
newnode->data=a;
newnode->next = *head;
*head = newnode;
}
void remove_duplicates(node *head) {
}
void print(node *head) {
node *temp = head;
... |
Java | UTF-8 | 1,447 | 3.25 | 3 | [] | no_license | package com.onepointgroup.pricing;
import com.onepointgroup.pricing.core.Article;
import com.onepointgroup.pricing.core.Currency;
import com.onepointgroup.pricing.currency.Euro;
import com.onepointgroup.pricing.discount.PayTwoOneFreeDiscount;
import com.onepointgroup.pricing.unit.OunceUnit;
import com.onepointgroup.pr... |
Python | UTF-8 | 363 | 2.8125 | 3 | [] | no_license | import os
import sys
from god_crypt import *
data = input("Your data here:")
data = bytes.fromhex(data)
decrypt = god_decrypt()
print("packet size: %i" % len(data))
data = decrypt.run(bytearray(data))
print(data)
new_data = binascii.hexlify(data)
print(new_data)
for i in range(0,len(new_data),2):
print("0x"+ ne... |
Java | UTF-8 | 989 | 2.578125 | 3 | [] | no_license | package com.mimi.FoodDelivery.entities;
import javax.persistence.*;
import java.math.BigDecimal;
@Entity
@Table(name="dessert")
public class Dessert {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name="dessert_name")
private String dessertName;
@Column(na... |
Java | UTF-8 | 1,589 | 2.953125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | package optjava;
import sun.misc.Unsafe;
//tag::ATOMIC[]
public class AtomicIntegerExample extends Number {
private volatile int value;
// setup to use Unsafe.compareAndSwapInt for updates
private static final Unsafe unsafe = Unsafe.getUnsafe();
private static final long valueOffset;
static {
... |
C | UTF-8 | 889 | 3.234375 | 3 | [] | no_license | #include <string.h>
#include <stdlib.h>
#include "free_list.h"
/* Implement the first fit algorithm to find free space for the
simulated file data.
*/
int get_free_block(FS *fs, int size) {
Freeblock *curr;
curr = fs->freelist;
int os;
if(curr->length >= size){ //check if the first block has length bigger t... |
JavaScript | UTF-8 | 2,341 | 3.265625 | 3 | [
"MIT"
] | permissive | function mergeValue(context, value) {
const contextType = Object.prototype.toString.call(context);
const valueType = Object.prototype.toString.call(value);
if(contextType !== valueType) {
throw new Error('Cannot merge ' + valueType + ' into ' + contextType);
}
if(contextType === '[object A... |
PHP | UTF-8 | 1,400 | 2.796875 | 3 | [] | no_license | <?php
include "config/dbconfig.php";
$nis = $_POST['nis'];
$nama = $_POST['nama'];
$jenis_kelamin = $_POST['jenis_kelamin'];
$telp = $_POST['telp'];
$alamat = $_POST['alamat'];
$gambar = $_FILES['gambar']['name'];
$tmp = $_FILES['gambar']['tmp_name'];
// Ganti nama gambar dengan meenambahkan tanggal dan ... |
TypeScript | UTF-8 | 1,803 | 2.515625 | 3 | [] | no_license | import { TodoModelDto } from "../dto/todoModelDto";
import { todoModel } from "../models/todoModel";
import { ResponseModel } from "../dto/responseModel";
export class TodoService3 {
public static async AddTodo(data: TodoModelDto) :Promise<ResponseModel<TodoModelDto>>{
try {
let newT... |
C | UTF-8 | 264 | 2.9375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int n,A=0,D=0;
char l;
scanf("%d%*c",&n);
while (n-->0)
{
scanf("%c",&l);
if (l=='A')
A++;
else
D++;
}
if (A==D)
printf("Friendship\n");
else if (A>D)
printf("Anton\n");
else
printf("Danik\n");
return 0;
} |
Python | UTF-8 | 242 | 2.546875 | 3 | [] | no_license | __author__ = 'wcybxzj'
class RomanError(Exception): pass
class OutOfRangerError(RomanError): pass
class NotIntegerError(RomanError): pass
class InvalidRomanNumeralError(RomanError): pass
def toRoman(n):
pass
def fromRoman(s):
pass |
Markdown | UTF-8 | 2,748 | 3.75 | 4 | [
"MIT"
] | permissive |
# About Python Event Emitter
This is a python implementation for JavaScript-like EventEmitter class
# Usage
If you want that your class use a JavaScript-like **on()** and **emit()** approaches for event handling, just extends your class with EventEmitter class just the same as you do in JavaScript
## Example
```p... |
Shell | UTF-8 | 460 | 2.75 | 3 | [] | no_license | #!/bin/sh
INJECTED_GPG_SECREY_KEY_FILE=${INJECTED_GPG_KEY_FILE:-/vault/secrets/gpg-private-key.b64}
[[ -f $INJECTED_GPG_SECREY_KEY_FILE ]] && {
cat $INJECTED_GPG_SECREY_KEY_FILE | base64 -d | gpg2 --import
gpg2 --list-secret-keys
}
INJECTED_GPG_PUBLIC_KEY_FILE=${INJECTED_GPG_KEY_FILE:-/vault/secrets/gpg-public-... |
Python | UTF-8 | 506 | 3.34375 | 3 | [] | no_license | import random, string
flag = open("randomFlag.txt", "r").read()
print flag
deFlag = ""
random.seed("random")
for c in flag:
if c.isupper():
deFlag += chr((ord(c) - ord('A') - random.randrange(0, 26)) % 26 + ord('A'))
elif c.islower():
deFlag += chr((ord(c) - ord('a') - random.randrange(0, 26)... |
C# | UTF-8 | 1,164 | 2.625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Fort : MonoBehaviour {
public float maxHealthPoint; // fort HP
[SerializeField] private float currentHealthPoint;// current fort HP
[SerializeField] private Text healthText; // fort HP text... |
Python | UTF-8 | 450 | 2.515625 | 3 | [] | no_license | import socket
import sys
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port=8082
s.bind(('',port))
g=56
n=2371
c=17
print 'G ',g
print 'n',n
print 'Private Key: ',c
msg,addr=s.recvfrom(1024)
b = int(msg)
s.sendto(str((g**c)%n),(sys.argv[1],8080))
print "Public Key: ",(g**c)%n
bc = (b**c)%n
print 'BC ',b... |
PHP | UTF-8 | 1,181 | 3.046875 | 3 | [] | no_license | <?php if ( ! defined('SYSTEM')) exit('Go away!');
/**
* Mysql数据库操作(Mysqli)
* @author toryzen
*
*/
class DB implements DB_interface {
public $conn;
public function __construct($conn){
if(!$conn)exit("Database Connect Error!");
$this->conn = $conn;
}
/**
* 执行Query
... |
Markdown | UTF-8 | 467 | 2.84375 | 3 | [] | no_license | # Text-Data-For-Whatsapp-Status-Emotion-Prediction-using-NLP
This data set contains textual data for the prediction of the human emotion. WhatsApp status written in English, has been scraped from various websites. Three basic emotions sad, happy and angry has been scraped differently. Every data set contains two column... |
TypeScript | UTF-8 | 435 | 2.65625 | 3 | [] | no_license | import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'filter'
})
export class FilterPipe implements PipeTransform {
transform(value: unknown, ...args: unknown[]): unknown {
if (value == 0) {
return "Today";
} else if (value == 1) {
return "Tomorrow"
} else if (value == 2) {
... |
Java | UTF-8 | 175 | 1.773438 | 2 | [] | no_license | package com.example.songlicai.two.Test;
/**
* Created by songlicai on 2016/11/21.
*/
public class Test
{
public String getValue()
{
return "xyz";
}
}
|
C | UTF-8 | 715 | 2.953125 | 3 | [] | no_license | //
// Created by Frank on 03/03/2020.
//
#ifndef ADVENTOFC_CUSTOM_ASSERT_H
#define ADVENTOFC_CUSTOM_ASSERT_H
#include <stdio.h>
#include <stdbool.h>
int custom_assert_errors = 0;
void custom_assert_init()
{
custom_assert_errors = 0;
}
void custom_assert_increment_errors()
{
custom_assert_errors++;
}
//TOD... |
C++ | UTF-8 | 436 | 3.3125 | 3 | [] | no_license | /*
Ques :- Search in row wise and column wise sorted array(Time - O(n+m) )
*/
void work()
{
int n,m;
cin>>n>>m;
int mat[n][m];
for(int i=0;i<n;++i)
for(int j=0;j<m;++j)
cin>>mat[i][j];
int key;
cin>>key;
int row=0,col=m-1;
bool ans=0;
while(row>=0 && row<n && col>=0 && col<m)
{
if(mat[row][... |
C++ | UTF-8 | 984 | 2.5625 | 3 | [] | no_license | // Fill out your copyright notice in the Description page of Project Settings.
#include "Block.h"
#include "WorldGeneration.h"
#include "MeshData.h"
#include "MeshCreatorUtilities.h"
Block::Block(): isSolid(false)
{
}
Block::~Block()
{
}
void Block::LoadBlock(MeshData* meshData, WorldGeneration* world)
{
MeshCreat... |
Java | UTF-8 | 1,364 | 2.640625 | 3 | [] | no_license | package entity;
import javax.persistence.*;
import java.util.Objects;
@Entity
@Table(name = "publisher", schema = "public", catalog = "bookstore")
public class PublisherEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "publisher_id")
private Long publisherId;
@Basic... |
Java | UTF-8 | 480 | 3.015625 | 3 | [] | no_license | import java.util.Set;
import java.util.HashSet;
import java.math.BigInteger;
public class Solution29{
public static void main(String[] args) {
Set<BigInteger> pows = new HashSet<BigInteger>();
for(int a = 2; a <= 100; a++){
for(int b = 2; b <= 100; b++){
if(!pows.contains(BigInte... |
C++ | SHIFT_JIS | 3,702 | 2.71875 | 3 | [] | no_license | #include"CBullet.h"
#include"CSceneGame.h"
CBullet::CBullet()
:mLife(50), mCollider(this, CVector(0.0f, 0.0f, 0.0f), CVector(0.0f, 0.0f, 0.0f), CVector(1.0f, 1.0f, 1.0f), 0.1f)
{
mCollider.mTag = CCollider::EBULLET;
mTag = EEYE;
}
//Ɖs̐ݒ
//Set(,s)
void CBullet::Set(float w, float d){
//XP[ݒ
mScale = CVector(1.0f, 1... |
C | UTF-8 | 912 | 2.734375 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
//using namespace std;
int main(){o
char line[1000000];
char name[5000];
char fname[5000];
int x, i, q, k, j,t, len, nlen, strt, end;
//freopen("b_in.txt", "r", stdin);
//freopen("b_out.txt", "w", stdout);
scanf("%d", &t);
for(i=1; i<=t; i++){
scanf("%s", &line);
len=st... |
Java | UTF-8 | 5,412 | 2.359375 | 2 | [] | no_license | package com.wondertek.mam.util.backupUtils.util22.cache;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;
import org.ap... |
Markdown | UTF-8 | 1,528 | 3.375 | 3 | [] | no_license | # States and Cities Design and Build Activity
In this activity you will design and build a simple application based on the specification below. This specification is intentionally vague, this exercise is meant to force you to think about the design of the application and to ask good questions about the requirements.
... |
Java | UTF-8 | 604 | 2.328125 | 2 | [] | no_license | /**
*
*/
package service;
import dao.Dao;
/**
* @author DUCHAO
*
*/
public class ServiceImpl implements Service {
private Dao daoImpl ;
public Dao getDaoImpl() {
return daoImpl;
}
public void setDaoImpl(Dao daoImpl) {
this.daoImpl = daoImpl;
}
@Override
public void execute(String str) {
// TOD... |
Python | UTF-8 | 1,691 | 4.03125 | 4 | [] | no_license | class Stack():
def __init__(self):
self.items = []
def __repr__(self):
return repr(self.items)
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def isEmpty(self):
return self.items == []
def peak(self):
ret... |
Python | UTF-8 | 2,331 | 2.671875 | 3 | [] | no_license | from json import dumps
STD_UNIT = 'kg'
def user_json(user):
return dumps({
'id': user._id,
'name': user.name,
'email': user.email,
'password': user.password,
'birthdate': user.birthdate
})
def safe_user_json(user):
return dumps({
'id': user._id,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.