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 |
|---|---|---|---|---|---|---|---|
Java | UTF-8 | 1,957 | 2.640625 | 3 | [] | no_license | package com.tercen.model.base;
import com.tercen.base.*;
import com.tercen.model.impl.*;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.Collection;
public class PropertyBase extends BaseObject {
public String name;
public String description;
public PropertyBase() {
super();
this... |
Python | UTF-8 | 4,714 | 3.484375 | 3 | [] | no_license | import numpy as np
from random import *
import pandas as pd
import pygame
from pygame.locals import *
class Labyrinth:
"""Géneration aléatoire de ligne pour construire chaque ligne d'un tableau'."""
##lign = [0]
##for i in range(14):
##i = lign.append(randint(0,1))
"""0 définit un sol et 1 ... |
Go | UTF-8 | 997 | 2.703125 | 3 | [] | no_license | package main
import (
"github.com/elisescu/dryred"
"os"
"os/signal"
"flag"
"log"
"sync"
"time"
)
func install_signal(fn func ()) {
signal_channel := make (chan os.Signal, 1)
signal.Notify(signal_channel, os.Interrupt)
signal.Notify(signal_channel, os.Kill)
go func() {
<- signal_channel
fn()
}()
}
fu... |
Python | UTF-8 | 299 | 3.1875 | 3 | [] | no_license | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
class ListMetaclass(type):
def __new__(cls,name,bases,attrs):
attrs['add'] = lambda self,value:self.append(value)
return type.__new__(cls,name,bases,attrs)
class MyList(list, metaclass=ListMetaclass):
pass
c=MyList()
print(c(1)) |
TypeScript | UTF-8 | 2,037 | 2.84375 | 3 | [
"MIT"
] | permissive | /// <reference path="../../../Scripts/endgate.d.ts" />
// Wrap in module to keep code out of global scope
module Camera {
export class World {
constructor(scene: eg.Rendering.Scene2d) {
var camSize: eg.Size2d = scene.Camera.Size;
// Add shapes and text to the Scene to represent th... |
Java | UTF-8 | 507 | 2.4375 | 2 | [] | no_license | package etc.etc.demonstrate.examples.super_sibling;
import etc.java.lang.Object.*;
import etc.demonstrate.examples.*;
abstract class _SuperSiblingDelegate extends ObjectDelegate {
private SuperSibling superSibling_;
public _SuperSiblingDelegate(SuperSibling superSibling_) {
super(superSibling_);
this.superSibl... |
Java | UTF-8 | 3,421 | 2.265625 | 2 | [] | no_license | package TesteVendas.Vendas.controller;
import java.util.List;
import java.util.Optional;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annota... |
Python | UTF-8 | 2,580 | 2.515625 | 3 | [] | no_license | from rest_framework import serializers
from .models import Location, Subscriber
class LocationSerializer(serializers.Serializer):
city = serializers.CharField(required=True, max_length=256)
state = serializers.CharField(required=True, max_length=64)
class Meta:
fields = ['city', 'state']
class S... |
C# | UTF-8 | 979 | 2.828125 | 3 | [] | no_license | using Facebook;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Net;
using System.Web;
namespace Trabalho.Utility
{
public class FacebookConnection
{
/// <summary>
/// Retorna os dados do usuario no Facebook
/// </summary>
/... |
Java | UTF-8 | 1,388 | 2.453125 | 2 | [] | no_license | package com.csye6225.fall2019.courseservice.resources;
import com.csye6225.fall2019.courseservice.datamodel.Course;
import com.csye6225.fall2019.courseservice.datamodel.Lecture;
import com.csye6225.fall2019.courseservice.service.CoursesService;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util... |
Python | UTF-8 | 11,046 | 3.046875 | 3 | [] | no_license | import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
class Attention(nn.Module):
""" Applies attention mechanism on the `context` using the `query`.
**Thank you** to IBM for their initial implementation of :class:`Attention`. Here is
their `License
... |
Python | UTF-8 | 19,016 | 2.9375 | 3 | [] | no_license | from types import SimpleNamespace
import augmentation.datasets.utils
from augmentation.datasets.custom.mnist import MNIST_CORRUPTED_VARIANTS
import tensorflow as tf
# TODO multihead should be specified as an option to the dataset instead of a separate one
def load_mnist_correlation_yz_multihead(dataset_name, dataset... |
Python | UTF-8 | 3,007 | 3 | 3 | [] | no_license | import numpy as np
from sklearn.cluster import KMeans
from math import log
import random
class FTL_online:
def __init__(self, k, d):
self.current = FTL(np.array([[0] * d for i in range(k)]), k, d)
self.next = self.current
self.X = []
self.k = d
self.d = d
def choose(... |
Python | UTF-8 | 87,989 | 2.78125 | 3 | [] | no_license | """
.. module:: merlin
This is the main module containing the core objects in
the system as well as some bootstrap and helper functions.
.. moduleauthor:: Sam Win-Mason <sam@lemonadelabs.io>
"""
import itertools
import logging
import warnings
import uuid
import json
import importlib
from datetime import datetime
from... |
Java | UTF-8 | 4,633 | 2.40625 | 2 | [] | no_license | package com.example.congressapi;
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Filter;
import android.wi... |
PHP | UTF-8 | 23,949 | 2.8125 | 3 | [
"GPL-2.0-or-later",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | <?php
if ( ! defined( 'ABSPATH' ) ) {
die( 'You are not allowed to call this page directly.' );
}
class FrmProStatisticsController {
/**
* Returns stats requested through the [frm-stats] shortcode
*
* @param array $atts
* @return string
*/
public static function stats_shortcode( $atts ) {
self::conver... |
C | UTF-8 | 1,142 | 3.71875 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
void printstruct(int **store_winner, int size){
for(int r = 0; r < size; r++){
printf("%d\n", **store_winner);
printf("(%d,%d)", *(*(store_winner + r) + 0),store_winner[r][1]);
// printf("(%d,%d)", store_winner[r][0],store_winner[r][1]);
}
printf("\... |
Shell | UTF-8 | 203 | 2.53125 | 3 | [
"MIT"
] | permissive | #!/bin/bash
# The logic to stop your application should be put in this script.
set -e
cat $OPENSHIFT_LOG_DIR/$OPENSHIFT_APP_NAME.log || :
xargs -r kill <$OPENSHIFT_RUN_DIR/$OPENSHIFT_APP_NAME.pid || :
|
Java | UTF-8 | 19,615 | 1.765625 | 2 | [
"MIT"
] | permissive | package libs.trustconnector.scdp.smartcard.application.edep;
import libs.trustconnector.scdp.*;
import org.jdom2.filter.*;
import org.jdom2.*;
import org.jdom2.xpath.*;
import java.util.*;
import libs.trustconnector.scdp.smartcard.application.*;
import libs.trustconnector.scdp.util.*;
import libs.trustconnector.scdp.s... |
Python | UTF-8 | 785 | 3.671875 | 4 | [] | no_license | from collections import deque
class TreeNode:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def insert(root, data):
q = deque()
q.append(root)
while q:
temp = q.popleft()
if temp.left:
q.append(temp.left)
else... |
Java | UTF-8 | 4,076 | 2.21875 | 2 | [] | no_license | package softgroup.backend.controller;
import org.springframework.web.bind.annotation.*;
import softgroup.backend.entity.*;
import softgroup.backend.service.CourseService;
import softgroup.backend.service.Course_studentService;
import softgroup.backend.service.VideoService;
import softgroup.backend.service.Video_studen... |
C++ | UTF-8 | 868 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int arr[10];
int _max = -999;
void r_rotate(int _arr[], int s, int t) {
int temp = _arr[t];
for (int i = t; i > s; i--) {
_arr[i] = _arr[i - 1];
}
_arr[s] = temp;
}
void l_rotate(int _arr[], int s, int t) {
int tem... |
Java | UTF-8 | 1,593 | 2.984375 | 3 | [] | no_license | package com.botijasoftware.utils.collision;
import com.botijasoftware.utils.Vector3;
public class CollisionHollowSphere extends CollisionVolume {
private Sphere outsphere;
private Sphere insphere;
private float holeangle;
private float halfholeangle;
private float angle;
public CollisionHollowSphere(Vector3... |
Python | UTF-8 | 447 | 3.5625 | 4 | [] | no_license | #Name: ...Lowai Dobie...
#Email: ...lowai.dobie76@myhunter.cuny.edu...
#Date: October 21, 2020
#This program prints: Daily Attendence
import matplotlib.pyplot as plt
import pandas as pd
fil=input("Enter name of input file: ")
out=input("Enter name of output file: ")
df=pd.read_csv(fil)
df["Date"] = pd.to_da... |
Java | UTF-8 | 1,988 | 3.515625 | 4 | [] | no_license | package theory;
public interface Scale {
public default String name() { return "<anonymous scale> " + intervals(); }
/**
* Should not include the root note. For example, the major scale would be:
* <p>
* [2, 2, 1, 2, 2, 2, 1]
* <p>
* to indicate the following scale degrees:
* <p>
* (do) [re, mi, fa,... |
Shell | UTF-8 | 298 | 3.125 | 3 | [] | no_license | #!/bin/bash
sudo echo
# install yarn
if !(command -v yarn >/dev/null 2>&1); then
sudo npm install yarn -g
fi
root=$(pwd)
modules=(api home blog)
# init modules.
yarn
for m in ${modules[@]}
do
echo "===== init" ${m} "======"
cd $root/$m && yarn
done
cd $root/types && sudo npm link |
Markdown | UTF-8 | 7,328 | 3.046875 | 3 | [
"MIT"
] | permissive | # ethereum-blocks
[](http://travis-ci.org/hiddentao/ethereum-blocks) [](https://badge.fury.io/js/ethereum-blocks) [;
static {
commandMap.put("/create", new CreateCommand());
commandMap.put("/show", new ShowComm... |
C++ | UTF-8 | 13,343 | 2.8125 | 3 | [] | no_license | #include "Descriptors.h"
#include "Image.h"
#include "Utilities.h"
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
#include <stdexcept>
void Descriptors::createBuffer(VkDeviceSize size, VkBufferUsageFlags usage, VkMemoryPropertyFlags properties, VkBuffer& buffer, VkDeviceMemory& bufferMemory, VkDevice& logic... |
Python | UTF-8 | 104 | 3.34375 | 3 | [] | no_license | def saberiDo(x):
if (x == 1):
return 1
return x + saberiDo(x - 1)
print(saberiDo(10))
|
PHP | UTF-8 | 1,223 | 3.078125 | 3 | [] | no_license | <?php
/**
* Een groep invoervelden die achter elkaar ge-renderd worden.
* Zet geen html voor, tussen of na de velden.
*
* @package Forms
*/
namespace SledgeHammer;
class Fields extends Object implements View, Import, \ArrayAccess {
protected
$fields;
function __construct($fields = array()) {
$this->fields ... |
Java | UTF-8 | 1,115 | 2.671875 | 3 | [] | no_license | package cn.donald.expr;
import org.junit.Assert;
import org.junit.Test;
import java.util.List;
public class InfixToPostfixTest {
@Test
public void test() {
{
List<Token> tokens = InfixToPostfix.convert("2+3");
Assert.assertEquals("[2, 3, +]", tokens.toString());
}
{
List<Token> tokens = InfixToP... |
Markdown | UTF-8 | 5,442 | 3.453125 | 3 | [
"MIT"
] | permissive | # Benchmark: Faster way to count unique objects
Counting unique elements is a common task in many programs.
Until recently the most straightforward way to do so was something along
these lines:
``` js
function getUniqueElements(array) {
var counter = {};
for (var i = 0; i < array.length; ++i) {
var key = arr... |
Python | UTF-8 | 5,106 | 2.578125 | 3 | [] | no_license | #!/usr/bin/env python
# coding: utf-8
# # Project World Bank
#
# By Mostafa Jubayer Khan
#
#
# In[1]:
#Importing the Pandas & NumPy Libraries
import pandas as pd
import numpy as np
import pandas_gbq as gbq
# ### Reading the all the CSV Files
# In[2]:
df_1 = pd.read_csv('/Users/mostafajubayerkhan/Desktop/Ed... |
TypeScript | UTF-8 | 732 | 2.65625 | 3 | [
"MIT"
] | permissive | import * as vscode from 'vscode'
import * as paths from './paths'
export function isMarkdown(doc: vscode.TextDocument): boolean {
return doc.fileName.split('.').pop() === 'md'
}
export function getTitle(doc: vscode.TextDocument): string | undefined {
if (!isMarkdown(doc)) {
return
}
const line = doc.line... |
Markdown | UTF-8 | 1,590 | 2.65625 | 3 | [] | no_license | # Introduction
This project started with some self reflection and a simple observation. I often unwind with an episode of the british panel comedy show [Would I Lie To You?](https://en.wikipedia.org/wiki/List_of_Would_I_Lie_to_You%3F_episodes) In one particualr episode, it seemed like the female guests had their sugge... |
Python | UTF-8 | 1,507 | 4.09375 | 4 | [] | no_license | """
Given an array of positive integers target and an array initial of same size with all zeros.
Return the minimum number of operations to form a target array from initial if you are allowed to
do the following operation:
Choose any subarray from initial and increment each value by one.
Input: target = [1,2,3,2,1]
... |
C# | UTF-8 | 1,826 | 2.796875 | 3 | [] | no_license | using Microsoft.Extensions.Logging;
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using systeminfo.Core.Entities;
namespace systeminfo.Core.Services.Unix
{
public class UnixDiskMetricsProvider : IDiskMetricsProvider
{
private readonly ILogger<UnixDiskMetricsProvider> _logger;
... |
Java | UTF-8 | 888 | 3.40625 | 3 | [] | no_license | package co.edu.uptc.logica.modelo;
/**
* clase que define a la entidad Producto
* @author Marcos Esteban Vargas Avella
*
*/
public class Producto {
private String name;
private double price;
/**
* Constructor de clase vacio
*/
public Producto() {
}
/**
* Constructor de la clase para instanciar
* @p... |
Python | UTF-8 | 381 | 2.796875 | 3 | [] | no_license | import time
from twisted.internet import reactor, threads, defer
# To be executed in thread, not coroutine.
def do_long_calculation():
time.sleep(3)
return 3
@defer.inlineCallbacks
def print_result():
# Await thread temination
x = yield threads.deferToThread(do_long_calculation)
print(x)
print_re... |
Markdown | UTF-8 | 3,668 | 3 | 3 | [] | no_license | _model:blog-post
---
title1:雜學校 創新教育博覽會
---
title2:——你的選擇,你的有敢擇學
---
date:2017/11/04
---
info:今天的行程是考試,上課,讀書;明天的行程是考試,上課,讀書。後天也是、大後天也是,到了明年依然是。有一說法是,我們的現行教育體制......(繼續閱讀)
---
content:
<p>
今天的行程是考試,上課,讀書;明天的行程是考試,上課,讀書。<br>後天也是、大後天也是,到了明年依然是。
</p>
<p>
有一說法是,我們的現行教育體制是源自工業革... |
PHP | UTF-8 | 17,009 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
/*
* This file is part of PHP CS Fixer.
*
* (c) Fabien Potencier <fabien@symfony.com>
* Dariusz Rumiński <dariusz.ruminski@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace PhpCsFixer\Tests\Tokenizer;
use PhpCsFix... |
JavaScript | UTF-8 | 8,271 | 3.984375 | 4 | [] | no_license | // 1. Оголосіть змінні str, num, flag и txt зі значеннями «Привіт», 123, true, «true».
// За допомогою typeof переконайтесь, що значення змінних належать типам: string, number и boolean.
let str5 = 'Привіт';
console.log(typeof str5);
let num = 123;
console.log(typeof num);
let flag = true;
console.log(flag);
let txt ... |
Java | UTF-8 | 302 | 1.820313 | 2 | [] | no_license | package com.test.application.designPatten.behavioralPattern.commandPattern;
import com.test.application.designPatten.behavioralPattern.commandPattern.editor.Editor;
public class Demo {
public static void main(String[] args) {
Editor editor = new Editor();
editor.init();
}
}
|
Python | UTF-8 | 1,773 | 2.671875 | 3 | [
"MIT"
] | permissive | """
Noise wrapper.
Created on Thu Feb 28 15:07:21 2019
@author: molano
"""
# !/usr/bin/env python3
# -*- coding: utf-8 -*-
import gym
class ReactionTime(gym.Wrapper): # TODO: Make this a trial wrapper instead?
"""Allow reaction time response.
Modifies a given environment by allowing the network to act at... |
Python | UTF-8 | 2,000 | 3.65625 | 4 | [] | no_license | import math
DEFAULT_RADIUS = 4
DEFAULT_LIFE = 200
DEFAULT_SP_LIFE = 150
HALF_TURN = 45
class Torpedo:
"""
the class representing the torpedoes in the game asteroids,
they each have speed and location on x and on the y axis and direction.
"""
def __init__(self, x_location=0, x_speed=0, y_location=... |
Swift | UTF-8 | 560 | 2.609375 | 3 | [] | no_license | /// MARK: - UIImage+DAView
extension UIImage {
/// MARK: - class method
/**
* create UIImage from UIView
* @param view UIView
* @return UIImage
**/
class func imageFromView(view: UIView) -> UIImage {
let scale = UIScreen.mainScreen().scale
UIGraphicsBeginImageContextWi... |
JavaScript | UTF-8 | 3,843 | 2.78125 | 3 | [
"MIT"
] | permissive | import { get, INTERCEPT_GET } from 'ember-metal/property_get';
import { set, INTERCEPT_SET, UNHANDLED_SET } from 'ember-metal/property_set';
QUnit.module('set');
QUnit.test('should set arbitrary properties on an object', function() {
var obj = {
string: 'string',
number: 23,
boolTrue: true,
boolFals... |
Python | UTF-8 | 281 | 3.28125 | 3 | [] | no_license | # def reverse(text):
# return text[::-1]
# def reverse(text):
# reversed_string = []
# for i in range(len(text) -1, -1, -1):
# reversed_string += text[i]
# return ''.join(reversed_string)
def reverse(text):
return ''.join([i for i in reversed(text)])
|
C# | UTF-8 | 1,170 | 2.84375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using NUnit.Framework.Internal;
using TestNinja.Fundamentals;
namespace TestNinja.UnitTests
{
[TestFixture]
public class DemeritPointsCalculatorTests
{
pr... |
C++ | UTF-8 | 2,260 | 2.53125 | 3 | [] | no_license | //=============================================================================
#ifndef TRIANGLE_BSP_H
#define TRIANGLE_BSP_H
//== INCLUDES =================================================================
#include <graphene/surface_mesh/data_structure/Surface_mesh.h>
#include <graphene/geometry/Plane.h>
#include <... |
Markdown | UTF-8 | 657 | 2.609375 | 3 | [] | no_license | Starting an "etch a sketch" project where each grid space can be changed into a different color.
Fun side project, most difficult part by far is the where I had to try to make the grid size stay the same,
while there are more or less squares. Meaning the sizes of the squares had to scale with how many there are, relat... |
Java | UTF-8 | 2,798 | 2.28125 | 2 | [] | no_license | package com.example.barbara.skytonight.presentation.core;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Vi... |
C# | UTF-8 | 27,073 | 2.53125 | 3 | [
"CC-BY-3.0-US",
"MIT",
"CC-BY-3.0"
] | permissive | //---------------------------------------------------------------------
// <copyright file="CombinatorialStrategy.cs" company="Microsoft">
// Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//-------------------------------... |
Java | UTF-8 | 781 | 2.484375 | 2 | [] | no_license | package util;
import com.alibaba.fastjson.JSON;
import entry.test.User;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.ArrayList;
import java.util.List;
public class UtillTool {
public static void main(String[] asd){
List<User> users = new Arr... |
Java | UTF-8 | 7,881 | 2.03125 | 2 | [] | no_license | package com.blowthem.app;
import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.graphics.Point;
import android.os.Bundle;
import android.os.Handle... |
Java | UTF-8 | 965 | 3.546875 | 4 | [] | no_license | /**
* Demo that static methods and variables in parent classes can be invoked through child classtypes and object references
*
*
*
* @author Alan Cowap
* @version 1.0 Initial code
* @version 1.1 Demo static call to Parent class method thrgugh a casted child class object reference, thx to Kevin... |
Markdown | UTF-8 | 849 | 2.984375 | 3 | [] | no_license | ---
title: 创建 Github 项目
---
创建一个新的 Github 项目,本地保存一个本项目的 clone 。学会 push/pull 同步项目。
### 项目简介
项目名叫 sleep-write ,是一个写文章的平台。
### 具体 Github 操作
到首页,点 New Repository 按钮,创建一个新的仓库。
### 本地创建项目
```
mkdir sleep-write
cd sleep-write
atom . # 添加一个 README.md
git init
git add -A
git commit -m"first commit"
```
### 添加目标仓库位置
... |
Java | UTF-8 | 1,404 | 1.71875 | 2 | [] | no_license | package com.gamsestop.pages;
import java.util.List;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;
public class EletronicsPage {
public WebDriver driver;
public EletronicsPage(WebDriver driver)... |
Java | UTF-8 | 572 | 3.359375 | 3 | [] | no_license | package Lab3.visitor;
public class DurationVisitor implements Visitor {
private int totalDuration = 0;
@Override
public void visit(Book book) {
totalDuration += book.getNumberOfPages() * 5;
}
public void visit (Video video) {
totalDuration += video.getTime() + video.getTime()/30 *... |
Ruby | UTF-8 | 1,943 | 2.796875 | 3 | [
"MIT"
] | permissive | class Seed
def self.genres(genres)
beer_genres = JSON.parse(genres)
beer_genres.each do |genre|
BeerGenre.create(genre)
end
end
def self.flavors(flavors)
food_flavors = JSON.parse(flavors)
food_flavors.each do |flavor|
FoodFlavor.create(flavor)
end
end
def self.matches(ma... |
Java | UTF-8 | 925 | 2.09375 | 2 | [] | no_license | package com.re.paas.internal.clustering.classes;
import java.io.Serializable;
public class NodeJoinResult implements Serializable {
private static final long serialVersionUID = 1L;
private boolean isSuccess;
private String message;
private String nodeId;
private String masterNodeId;
public boolean isSuccess... |
Java | UTF-8 | 685 | 3.28125 | 3 | [] | no_license | /**/
package collections;
import java.util.*;
public class MyLinkedList {
public static void main(String[] args) {
List <Integer> ll = new LinkedList<>();
List <Integer> al = new ArrayList<>();
getTimeDiff(al);
getTimeDiff(ll);
}
static void getTimeDiff(List<Integer> list) {
long s... |
Swift | UTF-8 | 260 | 2.8125 | 3 | [] | no_license | import Foundation
extension URLResponse {
func isHttpResponseValid() -> Bool {
guard let httpResponse = self as? HTTPURLResponse ,(200...299).contains(httpResponse.statusCode) else {
return false
}
return true
}
}
|
Python | UTF-8 | 200 | 3.1875 | 3 | [] | no_license | class Gate:
def __init__(self, x, y):
self.x = x
self.y = y
def match(self, x, y):
if self.x == x and self.y == y:
self.text = "* "
return True |
SQL | UTF-8 | 922 | 3.78125 | 4 | [] | no_license | --Views
CREATE VIEW [label].[vOptionGroupRepresentative]
AS
SELECT o.SortOrder, vo.DisplayName OptionName, ma.DisplayName MakeName, mo.DisplayName ModelName, t.YearId, t.TrimName FROM (
SELECT vo.SortOrder, MIN(vo.KbbVehicleId) KbbVehicleId FROM VehicleOption vo
JOIN VehicleCate... |
C++ | UTF-8 | 19,648 | 2.734375 | 3 | [] | no_license | #include <sstream>
#include <ctime>
#include <Windows.h>
#include "Snake.h"
#include "Utility.h"
#include <conio.h>
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_mixer.h>
#include <SDL_ttf.h>
#include <string>
#define LEFT VK_LEFT
#define RIGHT VK_RIGHT
#define UP VK_UP
#define DOWN VK_DOWN
#define ESC VK_E... |
C++ | UTF-8 | 452 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
class B {
int N, ans;
double A, T, H;
public:
void solve()
{
cin >> N >> T >> A;
double minDiff{ 999999 };
double tmpDiff;
for (int i{ 1 }; i <= N; i++)
{
cin >> H;
tmpDiff = abs((A - (T - 0.006 * H)));
if (tmpDiff < minDiff)
{
... |
C# | UTF-8 | 2,991 | 2.703125 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Flick_nishiwaki : MonoBehaviour
{
bool turikawa;
public bool Turikawa
{
get { return turikawa; }
set { turikawa = value; }
}
private Vector3 touchStartPos; // タッチ開始座標
private Vector3 t... |
C# | UTF-8 | 3,686 | 3.203125 | 3 | [] | no_license | // This exercise will show how to create WCF service.
// How to host it using IMPERATIVE end point creation
> Start visual studio . Create new project . Select WCF library.
> Rename default service interface. Add operation in it.
> Build this service. It will generate dll file.
> Add new console project for hosti... |
Java | UTF-8 | 620 | 2.125 | 2 | [
"MIT"
] | permissive | package ca.nexapp.starterkit.infrastructure.persistence.json.users;
import ca.nexapp.starterkit.domain.users.UserFactory;
import ca.nexapp.starterkit.domain.users.UserFactoryTest;
import ca.nexapp.starterkit.infrastructure.persistence.inmemory.users.UserInMemory;
public class UserJsonFactoryTest extends UserFactoryTe... |
C# | UTF-8 | 3,682 | 3.578125 | 4 | [] | no_license | /*
Para resolver os problemas do array, podemos trabalhar com uma classe do C# chamada List . Para
utilizarmos uma lista dentro do código precisamos informar qual é o tipo de elemento que a lista
armazenará. ex :
// cria uma lista que armazena o tipo Produto
List<Produto> lista = new List<Produto>();
Da mesma forma... |
JavaScript | UTF-8 | 910 | 2.671875 | 3 | [] | no_license | const imgMe = document.querySelector("#imgMe")
const imgMeBack = document.querySelector("#imgMeBack")
const svg1 = document.querySelector("#svg1")
const svg2 = document.querySelector("#svg2")
const descMe = document.querySelector("#descMe pre")
document.addEventListener("mousemove", (e) => {
imgMe.style = `bottom :... |
C++ | UTF-8 | 2,704 | 2.734375 | 3 | [] | no_license | #include "Shared/Items/Item.hpp"
using namespace std;
constexpr int Item::DefaultArmor;
constexpr int Item::DefaultSpell;
constexpr int Item::DefaultWeapon;
namespace {
const string invalid = "~~INVALID~~";
const vector<string> categories = {
"All",
"Armor",
"Weapons",
"Potions",
"Food",
"Spe... |
PHP | UTF-8 | 3,244 | 2.921875 | 3 | [] | no_license | <?php
require_once "db_engine/db_engine_admin.php";
class AdminEngine {
// Properties
// Constructor
// Methods
public function findMissingAudioEntriesInDatabase() {
$dbEngine = new dbEngine();
$missingGridAudio = $dbEngine->getMissingGridAudio();
$missingInventoryGa... |
JavaScript | UTF-8 | 815 | 2.625 | 3 | [] | no_license | import React, { createContext, useContext, useState, useEffect } from "react";
export const AuthContext = createContext({});
export const useAuth = () => useContext(AuthContext);
export const AuthProvider = ({ children }) => {
const [token, setToken] = useState("");
useEffect(() => {
if (token) {
salv... |
Markdown | UTF-8 | 899 | 2.859375 | 3 | [] | no_license | <h1>Projeto dt money</h1>
Aplicação prática e simples para gerenciamento das despesas pessoais.
Desenvolvido no programa Ignite da rocketseat.
## 🚀 Tecnologias
Esse projeto foi desenvolvido com as seguintes tecnologias:
- [React]
- [MirageJs]
## 💻 Projeto
<h4>Features:</h4>
<ul>
<li>Dashboard de apresent... |
Java | UTF-8 | 13,924 | 2.21875 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
test
* cosas por poner:
- Identificador de msg para poder usar varios thread sin ningun problema
-Verificar paquete si es para el mouse o el texto
- long press button para back y hacer delete mas seguidos.
... |
Markdown | UTF-8 | 1,705 | 3.109375 | 3 | [] | no_license | # Tools to help with creating a CoreML model file
This project contains the following:
1. download-images - NodeJS script that, given a URL on ImageNet, downloads all of the images, strips them of any irrelevant EXIF data and then puts them in the correct training data folder
2. train-model - Python script that trains ... |
Markdown | UTF-8 | 2,733 | 2.71875 | 3 | [
"MIT"
] | permissive | ---
title: REST API Lists
pageTitle: REST API Lists
description: "Learn all about GraphQL and why it is an API technology that's superior to REST. It is not only for React & Javascript developers but can be used for any API."
question: Which of these statements is true?
answers: ["GraphQL is a database technology", "Gr... |
C# | UTF-8 | 448 | 3.296875 | 3 | [] | no_license | using System;
namespace Coche_Solid.Algoritmos
{
public class MissingNumber
{
public int GetMissingNumber(int[] numbers, int totalCount)
{
int expectedSum = totalCount * ((totalCount + 1) / 2);
int actualSum = 0;
foreach (var i in numbers)
... |
JavaScript | UTF-8 | 2,484 | 2.75 | 3 | [] | no_license | let klikDodajPlus=function(dogodek){
let t=dogodek.target.parentElement.getElementsByTagName("p")[0];
t.innerText=Number(t.innerText)<9 ? Number(t.innerText)+1 : 9;
}
let klikDodajMinus=function(dogodek){
let t=dogodek.target.parentElement.getElementsByTagName("p")[0];
t.innerText=Number(t.innerText)>0... |
Python | UTF-8 | 4,188 | 3.125 | 3 | [] | no_license | import wda
import matplotlib.pyplot as plt
from PIL import Image, ImageFilter
import time
import pytesseract
# 计算战斗结算区域中的固定方框位置中的灰色面积
# 获取图片像素值的二维数组
# 战利品第一格坐标如下:
'''
(572,265)------(705,265)
| |
| |
| |
(572,395)------(705,395)
'''
# 计算目标区域里的灰色像素占比,小于1/5即出魔卡
# 灰... |
Java | UTF-8 | 2,409 | 3.71875 | 4 | [] | no_license | package lib;
import java.util.ArrayList;
import java.util.Stack;
public class FourFiveValidateBST {
public FourFiveValidateBST() {
// TODO Auto-generated constructor stub
}
public static boolean validateBST(TreeNode root) {
// In order traverse, the result should be sorted...
if(root == null) {
return... |
JavaScript | UTF-8 | 2,270 | 2.6875 | 3 | [
"MIT"
] | permissive | // Simple constraints object, for more advanced features see https://addpipe.com/blog/audio-constraints-getusermedia/
var constraints = {
audio: true,
video: false
}
/* We're using the standard promise based getUserMedia() https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia */
navigator.... |
PHP | UTF-8 | 351 | 3.859375 | 4 | [] | no_license | <?php
class ObjectIteration
{
public $a=10;
public $b=20;
public $name="Result";
private $private="Private";
public function method()
{
foreach($this as $key => $value)
{
print "$key => $value"."\n";
}
}
}
$class = new ObjectIteration();
foreach($class as $key => $value)
{
print "$key => $value".... |
Java | UTF-8 | 1,722 | 3.84375 | 4 | [] | no_license | package array;
import java.util.Deque;
import java.util.LinkedList;
import java.util.Stack;
/**
* Given an array and an integer k, find the maximum for each and every contiguous subarray of size k.
Examples :
Input :
arr[] = {1, 2, 3, 1, 4, 5, 2, 3, 6}
k = 3
Output :
3 3 4 5 5 5 6
*/
public class SlidingWind... |
Java | UTF-8 | 230 | 1.757813 | 2 | [] | no_license | package com.tientham.androidsample.ui;
import android.content.Context;
/**
* Created by tientham (tien.tominh@gmail.com) on 2019-05-26.
*/
public interface BaseView {
void showLoading();
void hideLoading();
Context context();
}
|
TypeScript | UTF-8 | 1,230 | 2.53125 | 3 | [] | no_license | import { Component, OnInit } from '@angular/core';
import { Burger } from '../models/Burguer';
import { JsonPipe } from '@angular/common';
import { Ingredient } from '../models/Ingredient';
const localkey = "burger;"
@Component({
selector: 'burger-builder',
templateUrl: './burger-builder.component.html',
styleU... |
Java | UTF-8 | 3,041 | 1.875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2002-2022 the original author or authors.
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
JavaScript | UTF-8 | 4,527 | 2.6875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react'
import Blog from './components/Blog'
import blogService from './services/blogs'
import Notification from './components/Notification'
import loginService from './services/login'
import BlogForm from './components/BlogForm'
import Togglable from './components/Togglable'
... |
Shell | UTF-8 | 429 | 3.75 | 4 | [] | no_license | #!/bin/bash
set -euo pipefail
readonly BASE_DIR="$(dirname $(realpath $BASH_SOURCE))"
source "$BASE_DIR/config/current.sh"
function main()
{
local name="$1"
cd "$REPOSITORIES_DIR/$name.git"
local newrev="$(git rev-parse ${2-HEAD})"
local oldrev="$(git rev-parse $newrev~)"
echo "$oldrev $newrev... |
Python | UTF-8 | 581 | 3.078125 | 3 | [] | no_license | import sys
def vauvau(lines):
a,b,c,d = [int(x) for x in lines[0].split()]
f_t = a+b
s_t = c+d
p,m,g = [int(x) for x in lines[1].split()]
for p in [p,m,g]:
p_t_1 = p % f_t
p_t_2 = p % s_t
# print(p, p_t_1, p_t_2)
if p_t_1 != 0 and p_t_1 <= a and p_t_2 != 0 and p_t... |
Shell | UTF-8 | 438 | 2.65625 | 3 | [] | no_license | #!/bin/bash -e
rails new $1
cd $1
git init
git add .
git commit -m "initial commit; 'rails new $1'"
heroku create $1
#TODO convert to heredoc
echo >> Gemfile
echo "# Heroku dependencies" >> Gemfile
echo "group :production do" >> Gemfile
echo " gem 'pg'" >> Gemfile
echo " gem 'thin'" >> Gemfile
echo "end" >> Gemfil... |
Markdown | UTF-8 | 2,148 | 2.609375 | 3 | [
"MIT"
] | permissive | # Ruby on Rails Patterns: Service Objects and Interactors

## About The Project
This is a Ruby on Rails demo application... |
Java | UTF-8 | 616 | 1.875 | 2 | [
"Apache-2.0"
] | permissive | package org.javamaster.b2c.classloader;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
/**
* @author yudong
* @date 2019/6/24
*/
@SpringBootApplication
@ComponentScan(basePackages =... |
Java | UTF-8 | 596 | 2.484375 | 2 | [] | no_license | package br.com.bandtec.Continuada01;
public class App {
public static void main(String[] args) {
PersonagemController pe = new PersonagemController();
Personagem p = new Sayajin("Terra", "Goku", "Kamehameha", 1500.00, 2);
Personagem p2 = new Sayajin("Vegeta", "Vegeta", "Final Flas... |
TypeScript | UTF-8 | 2,253 | 3.09375 | 3 | [
"Apache-2.0"
] | permissive | import _get from 'lodash.get';
import { Observable } from 'rxjs';
import { concat } from 'rxjs/internal/observable/concat';
import { debounceTime, map, switchMap } from 'rxjs/operators';
// Flattens an array of arrays: [1, [a, b], [c], d] = [1, a, b, c, d]
export const flatten = (arrays: Array<string>) => [].concat.ap... |
Java | UTF-8 | 691 | 3.046875 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package creational.builder;
/**
*
* Clase ProjectException que permite tirar una excepcion personalizada
* cuando se introduzca un ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.