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 |
|---|---|---|---|---|---|---|---|
JavaScript | UTF-8 | 2,204 | 2.96875 | 3 | [] | no_license | let firstTime = localStorage.getItem("FirstTime")
const music = document.getElementById("mcPozeDoRodo")
const buttons = Array.from(document.getElementsByClassName("audioBtn"))
let [backwards, forwards, play, stop, volDown, volUp] = buttons
let audioBar = document.getElementsByClassName("musicBar")[0]
let musicTimer = d... |
C++ | UTF-8 | 6,944 | 3.640625 | 4 | [] | no_license | #ifndef LIST342_H
#define LIST342_H
#include <iostream>
#include <ostream>
#include <string>
#include <fstream>
using namespace std;
template <class ItemType>
class List342
{
// overloads "cout" operator
friend ostream& operator<< (ostream& output, const List342<ItemType>& outputList)
{
Node* traversingNode = o... |
C++ | UTF-8 | 938 | 2.96875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int n, m;
int arr[100000];
int segtree[100000*4];
int makeseg(int ti, int start, int end){
if(start == end){
segtree[ti] = arr[start];
}else{
int mid = (start + end) / 2;
segtree[ti] = makeseg(ti*2 + 1, start, mid) + makeseg(ti*2 + 2, mid+1, end... |
C# | UTF-8 | 3,742 | 3.34375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CustomList
{
public class CustomList<T>
{
T[] array;
public int capacity = 5;
public int size;
private int counter;
public int C... |
Java | UTF-8 | 778 | 1.921875 | 2 | [] | no_license | package org.ggyool.reservation.dao;
public class ProductPriceSqls {
public static final String SELECT_BY_PRODUCT_ID =
"SELECT create_date AS createDate " +
", discount_rate AS discountRate " +
", modify_date AS modifyDate " +
", price " +
", price_type_name AS priceTypeName " +
", product_id AS productId ... |
Python | UTF-8 | 459 | 3.109375 | 3 | [] | no_license | blockchain = []
def get_last_blockchain_value():
"""Returns the last blockchain value"""
return blockchain[-1]
def add_value(value, last_transaction=[1]):
blockchain.append([last_transaction, value])
def get_user_input():
return float(input('Enter Transaction amount: '))
add_value(get_user_input... |
Java | MacCentralEurope | 4,018 | 2.328125 | 2 | [] | no_license | package com.turquaz.engine.ui.component;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.swt.l... |
Java | UTF-8 | 562 | 1.773438 | 2 | [] | no_license | package com.qxf.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.qxf.pojo.OperateRecord;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface OperateRecordMapper extends BaseMapper<OperateRecord> {
... |
JavaScript | UTF-8 | 693 | 2.765625 | 3 | [] | no_license | const PubSub = require('../helpers/pub_sub.js');
const BeerView = require('./beer_view.js');
const BeersListView = function () {
this.listElement = document.querySelector('#beer-list');
}
BeersListView.prototype.bindEvents = function () {
PubSub.subscribe('Beers:data-ready', (evt) => {
this.clearList();
c... |
C# | UTF-8 | 859 | 2.625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LatihanAsosiasi
{
class Program
{
static void Main(string[] args)
{
//membuat objek kartu
Kartu kartu = new Kartu();
... |
JavaScript | UTF-8 | 3,366 | 2.71875 | 3 | [] | no_license | const FoxyWebhook = require("../../src/foxy/FoxyWebhook.js");
const { after, before, describe, it } = require("mocha");
const chai = require("chai");
const crypto = require("crypto");
const sinon = require("sinon");
const {expect} = chai;
let log;
let logError;
function silenceLog() {
log = sinon.stub(console, 'log... |
Python | UTF-8 | 15,399 | 2.578125 | 3 | [
"MIT"
] | permissive | import torch
import torch.nn as nn
import torch.nn.functional as F
def get_kl(m, v, m0, v0):
# adapted from: https://github.com/bunkerj/mlmi4-vcl/blob/master/src/KL.py
# numerical value for stability of log computation
eps = 1e-8
constTerm = -0.5 * m.numel()
logStdDiff = 0.5 * torch.sum(torch.log... |
Markdown | UTF-8 | 1,007 | 2.78125 | 3 | [
"MIT"
] | permissive | # JavaScript File
1. readFile(fileName, [encoding], [callback])
------------
- 비동기식 I / O 로 파일을 읽어들인다.
2. readFileSync(fileName, [encoding])
-----------------
- 동기식 I / O 로 파일을 읽어들인다.
3. writeFile(fileName, data, encoding='utf8', [callback])
------------
- 비동기식 I / O 로 파일을 쓴다.
4. wri... |
Ruby | UTF-8 | 3,478 | 3.46875 | 3 | [] | no_license | require 'byebug'
class Piece
attr_accessor :position, :color, :board, :symbol, :off_sets
def initialize(position, color, board)
@board = board
@position = position
@color = color
end
def opponent_there? new_pos
x, y = new_pos
if board.in_bounds?(new_pos) && !board.grid[x][y].nil?
ret... |
PHP | UTF-8 | 3,229 | 2.6875 | 3 | [] | no_license | <?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\CompositionsProduitRepository")
*/
class CompositionsProduit
{
/**
* @ORM\Id()
* @ORM\GeneratedVa... |
PHP | UTF-8 | 1,945 | 3.265625 | 3 | [
"MIT"
] | permissive | <?php
// 数据库连接-单例模式
namespace app\data;
use PDO;
use PDOException;
class Connection
{
const ERROR_UNABLE = '<br>ERROR: 数据库连接失败!<br>';
private static $instance = NULL;
private $conn;
// const DEFAULT_CONFIG = '../config/testDB.php';
const DEFAULT_CONFIG = '../../app/config/testDB.php';
priva... |
C++ | UTF-8 | 570 | 3.75 | 4 | [] | no_license | #include <iostream>
#include <deque>
using namespace std;
void print(deque<int> fl) {
for (auto x : fl)
cout << x << " ";
cout << endl;
}
int main() {
// basically stack/queue
deque<int> d = {1, 3, 5};
d.push_back(2);
d.push_front(4);
// other available methods - insert(), size... |
Markdown | UTF-8 | 645 | 3.046875 | 3 | [] | no_license | # one-side-moveable-Rectangle-using-js
use canvas html to make graphics drawing.
This is a simple javascript code to draw a rectangle and to move it by keeping one side fixed.
It contains two files animation.html and draw.js
Open the animation.html to view.
It contains a rectangle "abdc" with its breadth double tha... |
JavaScript | UTF-8 | 2,573 | 3.140625 | 3 | [] | no_license | const background = document.querySelector('body')
background.addEventListener( 'mousemove',(e)=>{
let clr = (e.clientX+e.clientY)/10
background.style.backgroundColor = `rgba(${e.clientX},${clr},${e.clientY},0.5)`
})
let r=100, g=100, b=100, a=1
let color = `rgba(${r},${g},${b},${a})`
//main circle for ... |
Java | UTF-8 | 1,633 | 2.078125 | 2 | [] | no_license | package com.appdevelopersumankr.suman_kumar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatButton;
import android.content.Intent;
import android.os.Bundle;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.fireba... |
JavaScript | UTF-8 | 2,056 | 3.4375 | 3 | [
"MIT"
] | permissive | import { cities } from "./cities";
export var aRandomPlace = {
city: undefined,
day: function() {
return getDayStatus()
},
}
//Gets a random city from an array
const firstCity = (Math.floor(Math.random() * (cities.length)));
var currentCity;
//Saves a random place in a variable
export function new... |
Python | UTF-8 | 401 | 3.0625 | 3 | [] | no_license | # Solution 1, simulation using dict
class Solution:
def oddCells(self, n: int, m: int, indices: List[List[int]]) -> int:
rs = collections.Counter()
cs = collections.Counter()
for i, j in indices:
rs[i] += 1
cs[j] += 1
res = sum(1 for i in ran... |
Java | UTF-8 | 2,272 | 2.328125 | 2 | [] | no_license | package ppcg;
import java.io.IOException;
import java.util.Collection;
import java.util.Hashtable;
import PrologPlusCG.PPCGIO_CLI;
import PrologPlusCG.cgspace.SpaceManager;
import PrologPlusCG.gui.PrologPlusCGFrame;
import PrologPlusCG.prolog.PPCGEnv;
import PrologPlusCG.prolog.RuleVector;
import PrologPlusCG.prolog.... |
Python | UTF-8 | 234 | 3.078125 | 3 | [] | no_license | def rotLeft(a, d):
arr2=[]
for i in range(len(a)):
k = len(a)-d
arr2.append(a[i-k])
return arr2
n = int(input())
d = int(input())
a = []
for i in range(n):
a.append(int(input()))
result = rotLeft(a, d)
print(result)
|
Python | UTF-8 | 947 | 3.59375 | 4 | [] | no_license | the_test = [[1,2,3],[4,5,6]]
the_count = [1, 2, 3, 4, 5]
fruits = ['apples', 'oranges', 'pears', 'bananna']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']
# lists aka arrays
#(for key word in python)
#(number could be anything just a temp variable
#(in key word directing python to list)
#(the_count list created abo... |
Python | UTF-8 | 4,719 | 2.640625 | 3 | [
"MIT"
] | permissive | import numpy as np
import argparse
from utils import data_utils
from utils import ml_utils
import pickle
def shuffle_labels(labels):
labelName_first = list(labels.keys())[0]
numLabels = labels[labelName_first].shape[0]
randIdxs = np.random.choice(numLabels, numLabels, replace=False)
for key in labe... |
Java | UTF-8 | 1,706 | 2.9375 | 3 | [] | no_license | package com.seven.ticket.enums;
/**
* @Description: TODO
* @Author chendongdong
* @Date 2019/11/8 9:56
* @Version V1.0
* "M":"一等座",
* "0":"二等座",
* "1":"硬座",
* "N":"无座",
* "2":"软座",
* "3":"硬卧",
* "4":"软卧",
* "F":"动卧",
* ... |
Markdown | UTF-8 | 2,275 | 3.09375 | 3 | [
"MIT"
] | permissive | # Ecosystem Algorithms
## What is Ecosystem Algorithms?
Ecosystem Algorithms business layer on top of Ecosystem Notebooks, demonstrating how to effectively use and implement different business cases.
## Requirements
* To use any of these algorithms [Ecosystem Notebooks](https://github.com/ecosystemai/ecosystem-note... |
Python | UTF-8 | 816 | 3.125 | 3 | [] | no_license | # coding=utf-8
# author: zengyuetian
# count test case number via keyword "@reviewer"
import os
def count_keyword(file_name, word):
count = 0
f = open(file_name)
lines = f.readlines()
for line in lines:
if line.find(word) >= 0:
count += 1
return count
if __name__ == "__main... |
Java | UTF-8 | 740 | 2.796875 | 3 | [
"MIT"
] | permissive | package org.samuelsmal.tree;
import org.samuelsmal.game.GPPlayer;
/**
* Created by samuel on 14/08/14.
*/
public class TournamentEntry implements Comparable<TournamentEntry> {
private GPPlayer player;
private int matchesWon;
public TournamentEntry(GPPlayer player) {
this.player = player;
... |
Java | UTF-8 | 485 | 2.03125 | 2 | [] | no_license | package nc.onlinelibrary.mvc.dao;
import nc.onlinelibrary.mvc.domain.Book;
import nc.onlinelibrary.mvc.domain.Issue;
import nc.onlinelibrary.mvc.domain.Users;
import java.util.List;
public interface UserDAO {
void addUser(Users user);
List listUsers();
void deleteUser(String username);
Users getUser(... |
Java | UTF-8 | 2,105 | 2.1875 | 2 | [
"MIT"
] | permissive | package com.cratorsoft.android.dialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.text.Editable;
import android.text.Selection;
import android.view.View;
import android.widget.AdapterView;
import android.widget.EditText;
import com.afollestad.mate... |
Java | UTF-8 | 18,590 | 2.078125 | 2 | [] | no_license | package com.tm.bltuth;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View... |
Java | UTF-8 | 1,412 | 2.09375 | 2 | [] | no_license | package com.softeem.entity;
import java.io.Serializable;
/**
* 报销单细节表(ExpenseReportDetail)实体类
*
* @author makejava
* @since 2021-01-24 15:24:52
*/
public class ExpenseReportDetail implements Serializable {
private static final long serialVersionUID = -17571713453405123L;
/**
* 报销单细节表id
*/
p... |
JavaScript | UTF-8 | 3,161 | 2.5625 | 3 | [
"MIT"
] | permissive | 'use strict';
module.exports = function() {
var _this = this;
if (!this.imagePosition) {
this.imagePosition = { x: 0, y: 0, width: 0, height: 0 };
}
if (this.image.blendingMode) {
this.context.globalCompositeOperation = this.image.blendingMode;
}
if (this.imageNode) {
setImagePosition();
return;
}
... |
Shell | UTF-8 | 864 | 3.203125 | 3 | [] | no_license | # ######################################################################
FileMarker "script:build_db.sh START"
# ######################################################################
BUILD_DB_SQL=${PIPE_DIR}/build_db_${v_team}.sql
ECHO "Drop and recreate database for branch ${v_team} using ${BUILD_DB_SQL}"
cat ${WOR... |
Markdown | UTF-8 | 838 | 2.53125 | 3 | [
"MIT"
] | permissive | # ブロックブラケットハンドラ(ブロックブラケットハンドラ)
Block Bracket Handler はゲーム内のブロックにアクセスできます。 ゲームに登録されているブロックのみを取得できます そのため、Modの追加や削除は、Block Bracket HandlerでModのブロックを参照すると問題が発生する可能性があります。
ブロックは次のようにブロックブラケットハンドラで参照されます。
```zenscript
<block:modID:blockName>
<block:minecraft:dirt>
```
If the block is found, this will return an [ICTBloc... |
Java | UTF-8 | 9,115 | 2.734375 | 3 | [
"Unlicense"
] | permissive | package net.hetimatan.io.file;
import java.io.File;
import java.io.IOException;
import net.hetimatan.io.filen.CashKyoroFile;
import junit.framework.TestCase;
public class TestForVirtualFile extends TestCase {
public void log(String message) {
// System.out.println("kiyo:"+"TestForViertualFile:"+messa... |
PHP | UTF-8 | 6,117 | 2.765625 | 3 | [] | no_license | <?php
/*////////////////////////////////////////////////////////////////////////////////////////////////////////////
@author Novi Sonko 2012
////////////////////////////////////////////////////////////////////////////////////////////////////////*/
class print_handler extends website_object
{
private $shelf;
... |
C# | UTF-8 | 1,667 | 2.6875 | 3 | [] | no_license | using System.Threading.Tasks;
using System.Collections.Generic;
using Newtonsoft.Json;
using Dingus.Models;
using Dingus.Helpers;
namespace Dingus.Services
{
class CompanyServices
{
private NetServices _service;
private JsonSerializerSettings _jsonSettings;
public CompanyServices()
... |
C | UTF-8 | 1,182 | 4.5625 | 5 | [] | no_license | /**
* Author: Dante Lawrence
* Date: October 1, 2019
*
* Thir program demonstrates pointers with functions.
**/
#include <stdlib.h>
#include <stdio.h>
//pass by value
int changeVals(int a, int b);
//ignore the ugly function name
//pass by reference
int changeValsWithPointers(int *a, int *b);
int main(int argc,... |
C++ | UTF-8 | 515 | 3.328125 | 3 | [] | no_license | #include<vector>
#include<map>
#include<string>
#include<queue>
#include<sstream>
#include<stack>
using namespace std;
/*
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
Note: Given n will be a posi... |
Java | UTF-8 | 4,126 | 2.265625 | 2 | [] | no_license | package client;
import java.io.Serializable;
/**
*An enum class to use database actions
*/
public class ActionsType implements Serializable
{
private static final long serialVersionUID = 3007036497465788417L;
public enum ActionNumber
{
QUESIOTN_GET_ALL,
QUESTION_GET_BY_CODE,
QUESTION_UPDATE,
QUESTION_GET_... |
Shell | UTF-8 | 1,431 | 2.671875 | 3 | [] | no_license | #!/bin/bash
echo updating all dependend repositories
cd ../plovr-main
git-hg pull
rm ../plovr/changes.txt
cd ../closure-compiler
git svn fetch
echo "Closure Compiler" >> ../plovr/changes.txt
echo "-----------------------------------------------------------------------------" >> ../plovr/changes.txt
git log master..... |
Python | UTF-8 | 441 | 3.265625 | 3 | [] | no_license | '''
# 예제 입력 1
8
4
3
6
8
7
5
2
1
# 예제 입력 2
5
1
2
5
3
4
'''
from sys import stdin
input = stdin.readline
stack = []
num = int(input())
t = list(range(num, 0, -1))
answer = ""
for _ in range(num):
i = int(input())
while len(stack) == 0 or stack[-1] < i:
stack.append(t.pop())
answer += '+\n'
if stack[-1] =... |
Java | UTF-8 | 976 | 1.6875 | 2 | [] | no_license | package com.tsing.product.api.dict.bo.request;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
* @author Tsing
* @version 0.0.1
* @date 2021/8/5 6:29 上午
* @description: 产品字典修改信息
*/
@Data
public class ProductDictUpdateRequest implements Serializable {
private static fina... |
C++ | UTF-8 | 1,396 | 3.734375 | 4 | [] | no_license | #include<math.h>
class Vector2D{
public:
double x,y;
Vector2D(double x,double y){this->x=x,this->y=y;}//initiallizes the vector
Vector2D(){this->x=this->y=0;}//initializes the zero vector
Vector2D polar(double r,double t){return {r*cos(t),r*sin(t)};}//creates a vector by polar form (radians)
Vector2... |
C++ | UTF-8 | 3,809 | 3.84375 | 4 | [] | no_license | //Jeremiah Kalmus
//P6 - STL
#include <iostream>
#include <iomanip>
#include <list>
#include <ctime>
using namespace std;
const int MAXSIZE = 10000;
//Largest any randomly generated value can be.
const int TOTALNUMS = 1000;
//Total numbers to be entered into a new list.
const int TEN = 10;
const int ZERO = 0;
cons... |
Markdown | UTF-8 | 7,246 | 3.046875 | 3 | [] | no_license | This example, based on the awesome [Ecommerce-UX](https://dribbble.com/shots/2249964-Ecommerce-UX) design by [Levani Ambokadze](https://dribbble.com/Amboka), shows the use of `SwipeGesture` and `SwipeNavigate`, as well as how you can achieve 3D transformations using `Rotate` and `Viewport`.
The icons are from Google's... |
JavaScript | UTF-8 | 1,484 | 2.515625 | 3 | [
"MIT"
] | permissive | const html = require('choo/html');
const donateButtons = require('./donateButtons');
const donateBitcoin = require('./donateBitcoin');
const donateResults = require('./donateResults');
const providerButtons = require('./providerButtons');
const renderDonateButton = require('./renderDonateButton');
module.exports = don... |
C++ | UTF-8 | 537 | 2.9375 | 3 | [] | no_license | //
// Created by Stephen Clyde on 2/15/17.
//
#ifndef WIDGETSORT_WIDGET_H
#define WIDGETSORT_WIDGET_H
#include <ostream>
#include <string>
class Widget {
private:
std::string m_name;
int m_value;
public:
Widget(std::string name, int value);
void print(std::ostream& out);
static bool compareByN... |
Markdown | UTF-8 | 3,743 | 3.015625 | 3 | [] | no_license | ---
date: 2020-08-16
title: Getting Started with Kubernetes Cronjob
tags:
- kubernetes
---
Configurations
===
Important fields
---
1. `.spec.jobTemplate.spec.template.spec.restartPolicy`: How to handle when a container in a pod. Note that this doesn't mean a job restarts or not (it's commented on [this github issue... |
C++ | UTF-8 | 12,437 | 2.875 | 3 | [] | no_license | /**
* @file rt_app.cpp
* @brief Source file for the ray-tracing test application.
* In this file I am experimenting with ray tracing.
* @author Michael Reim / Github: R-Michi
* Copyright (c) 2021 by Michael Reim
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRAN... |
Markdown | UTF-8 | 4,223 | 3.09375 | 3 | [] | no_license | # How to Assess Your Organization's Readiness to Migrate at Scale
**You will be successful if you are committed!**
## Common Migration Drivers (500+)
- Agility/Dev productivity
- Digitial transformation
- Facility or real-estate decisions
- Acquisisitions or divestitures
- Operational evolution
- Cost reduction
- Da... |
Java | UTF-8 | 3,217 | 2.609375 | 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 com.teamcs.controller;
import com.teamcs.database.bean.Contenu;
import com.teamcs.database.bean.Materiel;
import com.teamcs.se... |
JavaScript | UTF-8 | 1,685 | 3.203125 | 3 | [] | no_license | var url = require("url");
// Handler error 500
function handle500(request, response, error) {
response.writeHead(500)
response.write(`Internal server error : ${error}`)
response.end()
}
// Handler error 404
function handle404(request, response) {
response.writeHead(404)
response.write(`${url.parse... |
Swift | UTF-8 | 3,004 | 2.71875 | 3 | [] | no_license | //
// ViewController.swift
// CTATHelper
//
// Created by Paul on 9/27/19.
// Copyright © 2019 Mathemusician.net. All rights reserved.
//
import Cocoa
class ViewController: NSViewController {
@IBOutlet var stackView: NSStackView!
var allControls: [NSButton : (CommandType, NSTextField?)] = [:]
overr... |
Markdown | UTF-8 | 1,098 | 2.6875 | 3 | [
"MIT"
] | permissive | # MFA-CLI
A CLI client for MFA
It's a MFA code manager. You can manage MFA accounts and its secret code.
## Install
Download a latest mfa-cli from mfa-cli.zip link on below releases page.
https://github.com/tkhr0/mfa-cli/releases
Then unzip the file and move binary to $PATH dir.
```sh
$ unzip mfa-cli.zip
$ ls ./targ... |
Java | UTF-8 | 631 | 2.21875 | 2 | [] | no_license | package com.rupine.helloworld.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import com.rupine.helloworld.s... |
Java | UTF-8 | 698 | 2.890625 | 3 | [] | no_license |
import java.util.Scanner;
/*
* 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.
*/
/**
*
* @author Ajay
*/
public class problem10 {
public static void main(String[] args) {
Scann... |
PHP | UTF-8 | 1,188 | 2.65625 | 3 | [] | no_license | <?php
session_start();
//logout
if (isset($_SESSION['username']) && !isset($_POST['action'])) {
session_destroy();
unset($_SESSION['username']);
echo "<script>location.replace('../');</script>";
exit;
}
if (!isset($_POST['action'])) {
echo "<script>alert('Wrong Access');location.replace('../');</s... |
Shell | UTF-8 | 3,148 | 4.28125 | 4 | [] | no_license | #!/bin/bash
################################################################################
### Script to automate the socs sownload script ################################
################################################################################
#
### Preparations ###
SCRIPTNAME="$(basename "$(test -L "$0" && ... |
Markdown | UTF-8 | 2,540 | 2.53125 | 3 | [] | no_license |
Formats: [HTML](2006/02/26/index.html) [JSON](2006/02/26/index.json) [XML](2006/02/26/index.xml)
## [2006-02-26](/news/2006/02/26/index.md)
##### World population
### [ The world's population hits 6.5 billion at 0016 UTC, according to the U.S. Census Bureau's World Population Clock. ](/news/2006/02/26/the-world-... |
Java | UTF-8 | 367 | 1.796875 | 2 | [] | no_license | package com.zhiyi.falcon.gateway.result;
import java.io.Serializable;
import java.util.List;
/**
* Created by lirenguan on 7/3/15.
*/
public class TaskListResult {
private List<TaskResult> tasks;
public List<TaskResult> getTasks() {
return tasks;
}
public void setTasks(List<TaskResult> t... |
Java | UTF-8 | 3,461 | 2.53125 | 3 | [] | no_license | package de.hbrs.aspgen.plugin;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.e... |
C++ | UTF-8 | 1,079 | 2.703125 | 3 | [] | no_license | #ifndef _incl_texturebinding
#define _incl_texturebinding
//
// o_TextureBinding.h - Header for oGeM texturebinding
//
// Oliver Grau, 15-JUL-1993
//
#include "o_Property.h"
#include <o_Vector.h>
#include <vector>
using std::vector;
/*!
\class o_TextureBinding o_TextureBinding.h
\brief class for text... |
Java | UTF-8 | 1,859 | 2.9375 | 3 | [] | no_license | package chessHelper;
import java.util.ArrayList;
public class Evaluation implements Definitions{
public static final int MOBILITY_WEIGHT = 80;
public static final int MATERIAL_WEIGHT = 110;
public static final int CAPTURE_WEIGHT = 100;
public int evaluate (Board b, int color) {
... |
C++ | UTF-8 | 3,357 | 3.75 | 4 | [] | no_license | #include<iostream>
using namespace std;
#include<vector>
class Test
{
string str;
int var;
public:
#if 1 //Default constructor,Mandatory for Explicit constructor call Test(),V.V.Imp step
Test()
{
str = ' '; //space character
var =0;
}
#endif
Test(string s,int num)
{
st... |
Markdown | UTF-8 | 3,520 | 2.734375 | 3 | [
"MIT"
] | permissive | [[Research]][[Neuromorphic]]
# Enabling Resource-Aware Mapping of Spiking Neural Networks via Spatial Decomposition
[[Jeffrey Krichmar]]
### Introduction
- How to efficiently use crossbars when not all neurons have the same number of input synapses
- Unrolling technique
- Decompose neurons into homogeneous neural un... |
C# | UTF-8 | 2,059 | 3.296875 | 3 | [] | no_license | using System;
namespace GamingStore
{
class GamingStore
{
static void Main(string[] args)
{
double budget = double.Parse(Console.ReadLine());
string input = Console.ReadLine();
double totalSpent = 0;
double startingBudget = budget;
... |
Python | UTF-8 | 3,169 | 2.75 | 3 | [] | no_license | import numpy as np
import math
import time
input_layer_neurons = 2
l1_neurons = 2
l2_neurons = 2
test_x = np.array([[[0,1]],
[[1,0]],
[[1,1]],
[[0,0]]])
test_y = np.array([[[0,1]],
[[1,0]],
[[1,0]],
[[0,1]]])
l1_w = np.random.rand(input_layer_neurons,l1_ne... |
Python | UTF-8 | 5,399 | 3.125 | 3 | [] | no_license | # Takes as an input a list of .txt files in which each patent is on its own
# line: an output of one-patent-per-line.py | grep -i "COMPANY" > out.txt
# Extracts fields for output as a tidy .csv
import sys as sys
import re as re
import pandas as pd
def oppl_to_df(company, patent_file):
"""Takes a wide patent file... |
C | UTF-8 | 795 | 4 | 4 | [] | no_license | //
// main.c
// 107
//
// Created by Ayşıl Simge Karacan on 9.01.2020.
// Copyright © 2020 Ayşıl Simge Karacan. All rights reserved.
//
//Write a C program to count total number of even and odd elements in an array.
#include <stdio.h>
#define MAX_SIZE 1000
int main() {
int size,i,odd=0,even=0;
int arr[M... |
PHP | UTF-8 | 1,452 | 3.0625 | 3 | [
"MIT"
] | permissive | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Script
*
* Generates a script inclusion of a JavaScript file
* Based on the CodeIgniters original Link Tag.
*
*
* @access public
* @param mixed javascript sources or an array
* @param string language
* @param string type
* @pa... |
C++ | UTF-8 | 8,152 | 4.25 | 4 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
// Definition of a node of Link List
typedef struct node {
int data;
struct node * next;
}NODE;
// Code for presenting choices for operations to be performed
int choices() {
int ch = 0;
cout << "\n\nWhat would you like to do ? \n" <<end... |
C# | UTF-8 | 946 | 3.765625 | 4 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Q3
{
class Question3
{
static void Main(string[] args)
{
double length, width, area, woodLength;
Console.Write("Enter Window Width (in mm):\t")... |
Python | UTF-8 | 237 | 2.8125 | 3 | [] | no_license | def sock_merchant(lst):
colors = {}
for i in lst:
if i not in colors:
colors[i] = 1
else:
colors[i] += 1
counts = [colors[i]//2 for i in colors]
return sum(counts)
print(sock_merchant([10, 20, 20, 10, 10, 30, 50, 10, 20])) |
Python | UTF-8 | 1,187 | 2.5625 | 3 | [] | no_license | '''
--------《Python从菜鸟到高手》源代码------------
欧瑞科技版权所有
作者:李宁
如有任何技术问题,请加QQ技术讨论群:264268059
或关注“极客起源”订阅号或“欧瑞科技”服务号或扫码关注订阅号和服务号,二维码在源代码根目录
如果QQ群已满,请访问https://geekori.com,在右侧查看最新的QQ群,同时可以扫码关注公众号
“欧瑞学院”是欧瑞科技旗下在线IT教育学院,包含大量IT前沿视频课程,
请访问http://geekori.com/edu或关注前面提到的订阅号和服务号,进入移动版的欧瑞学院
“极客题库”是欧瑞科技旗下在线题库,请扫描源代码根目录中的小程序码安装“极客... |
C++ | UTF-8 | 2,130 | 3.65625 | 4 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *link;
};
struct node *head;
node* getnode(int data)
{
node* newNode = (node*)malloc(sizeof(node));
newNode->data = data;
newNode->link = NULL;
return newNode;
}
void list(int n)
{
struc... |
Python | UTF-8 | 266 | 2.8125 | 3 | [
"MIT"
] | permissive | import os
import inflection
class FileBase:
def __init__(self, filepath):
self.filepath = os.path.normpath(filepath)
def to_filename(self, root_path):
filepath = self.remove_base_directory(self.filepath, root_path)
return filepath
|
Java | UTF-8 | 2,417 | 2.859375 | 3 | [] | no_license | package com.aquatic.service.preprocessing.entity;
import java.util.ArrayList;
import java.util.List;
public class Sample {
//һ������������
private List<Parameters> series;
//һ�������еIJ�����������
private int numberOfNodes;
@Override
public String toString() {
String matrix="";
for(Parameters para... |
C# | UTF-8 | 6,056 | 3.140625 | 3 | [
"Unlicense"
] | permissive | using System;
using System.Collections.Generic;
namespace Func.Net
{
//Optional implementation for functional programming
public static class Optional
{
public static Optional<T> Of<T>(T value)
{
Validations.RequireNonNull(value);
return new Optional<T>(val... |
JavaScript | UTF-8 | 3,057 | 2.625 | 3 | [] | no_license | // fetch data
d3.json('data/party.json', function(response) {
var getAllTimes = function(actions) {
return _.chain(actions).pluck('time').uniq().value();
},
getPartiersAtTime = function(actions, time) {
return _.chain(actions).groupBy(function(action) {
return action.partier;
}).filt... |
Markdown | UTF-8 | 645 | 4.25 | 4 | [] | no_license | # Kata - [Valid Parentheses](https://www.codewars.com/kata/52774a314c2333f0a7000688)
### Description:
Write a function called `validParentheses` that takes a string of parentheses, and determines if the order of the parentheses is valid. validParentheses should return true if the string is valid, and false if it's inv... |
TypeScript | UTF-8 | 876 | 2.796875 | 3 | [] | no_license | import { getRepository } from "typeorm";
import { Url } from "../../entity/Url";
import { AsyncForEach } from "../../utils/jsUtils";
interface UrlSeed {
url: string;
accessKey: string;
accessCount: number;
}
export const urlSeeds: UrlSeed[] = [
{
url: "https://www.naver.com/",
accessKey: "1EiA912zuW",... |
Python | UTF-8 | 1,187 | 3.328125 | 3 | [] | no_license | # -*- coding: utf-8 -*-
"""some helper functions."""
import numpy as np
def compute_loss(y, tx, w):
"""Calculate the loss.
You can calculate the loss using mse or mae.
assumes w,y row arrays
"""
# convert row arrays to matrices in correct shape
w = np.matrix(w).T
y = np.matrix(y).T
... |
Python | UTF-8 | 4,825 | 3 | 3 | [
"MIT"
] | permissive | '''
PUSHBLOCK
the agent must push the block onto the goal square
Reward
------
step: -1
block moves closer to goal: 2, if warmercolder==True
block is on top of goal: 1000
Success
-------
block is on top of goal
Parameters
----------
frame : bool
... |
Java | UTF-8 | 10,017 | 1.882813 | 2 | [] | no_license | package com.lolapau.cobradordelfrac;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import org.json.JSONObject;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.DialogInterface;
imp... |
JavaScript | UTF-8 | 3,155 | 2.953125 | 3 | [
"MIT"
] | permissive | import createElement from '../../createElement';
export default function normalizeNode(obj) {
if(obj == null) {
return null;
}
const typeOfObj = typeof obj;
if(typeOfObj !== 'object') {
return typeOfObj === 'string'?
obj || null :
typeOfObj === 'boolean'?
... |
Ruby | UTF-8 | 135 | 3.046875 | 3 | [] | no_license |
puts "Salut, on fait des fausses adresses mails ?"
i = 01
num = 50
while (i <= num)
mail = ["jean#{i}@gmail.com"]
puts mail
i=i+1
end
|
PHP | UTF-8 | 2,265 | 2.78125 | 3 | [
"MIT"
] | permissive | <?php
use PHPUnit\Framework\TestCase;
use resolvers\QuotesResolver;
use models\Quote as QuoteModel;
use repositories\QuoteRepositoryInterface;
class QuoteRepositoryMock implements QuoteRepositoryInterface {
public function get(int $id): QuoteModel {
}
public function find(int $first, ?int $after, ?string $qu... |
Markdown | UTF-8 | 2,251 | 2.71875 | 3 | [
"Unlicense"
] | permissive | ### PHP SnapScan Class
Open a terminal and start playing.
#### Clone in
```shell
git clone git@github.com:drpain/SnapScan.git
cd SnapScan
```
#### Like Docker, run this with it :-D
```shell
docker run -it --rm --name PHP-SnapScan \
-v "$PWD":/usr/src/myapp \
-w /usr/src/myapp \
php:5.6-cli php index.php
```
Hopeful... |
Swift | UTF-8 | 5,087 | 2.953125 | 3 | [] | no_license | //
// TreeNode.swift
// AVLTree
//
// Created by Alex Nichol on 6/10/14.
// Copyright (c) 2014 Alex Nichol. All rights reserved.
//
import Cocoa
class TreeNode : NSView {
var left: TreeNode?
var right: TreeNode?
var depth: Int = 0
var value: Int!
var label: NSTextField!
class func nodeDepth(aNode: ... |
Shell | UTF-8 | 475 | 3.125 | 3 | [] | no_license | #! /bin/bash
# Will Check for the existance of stats for a team for a week and update them if they exist
# Otherwise will create them
week=$1
echo '--- Ingesting Football Outsiders Data ---'
python3 ./football-outsiders/foScrapeUpdate.py "$week"
echo '--- DONE ---'
echo '--- Ingesting Team Rankings Data ---'
python... |
Python | UTF-8 | 12,478 | 3.109375 | 3 | [] | no_license | # dependencies for our dijkstra's implementation
from .utils import *
from .timedistance import *
from .delay import *
from .route import *
from math import sin, cos, sqrt, atan2, radians,inf
from queue import PriorityQueue
from math import inf
import networkx as nx
class Routing:
"""
Modified Dijsktra
... |
Ruby | UTF-8 | 242 | 3.15625 | 3 | [] | no_license | class Robot
def name
@name ||= initialize_name
end
def reset
@name = nil
end
private
def initialize_name
digits = []
digits << ('A'..'Z').to_a.shuffle[0,2]
digits << rand(100..999)
digits.join
end
end
|
Java | UTF-8 | 189 | 1.6875 | 2 | [] | no_license | package org.concord.iot.listeners;
/**
* @author Charles Xie
*
*/
public interface GraphListener {
public void graphClosed(GraphEvent e);
public void graphOpened(GraphEvent e);
} |
JavaScript | UTF-8 | 6,974 | 3.1875 | 3 | [] | no_license | // Задаємо початкові точки
// -9,-2,-10,-4,-10,-6,-9,-7,2,-7,3,-7,4,-7,3,-10,5,-9,7,-2,8,-2,8,0,9,0
let points = [];
let html = "";
let Zn = [];
let ZnIndexes = [];
let pointsWithoutCenters = [];
let distances = [];
let maxDistance = [0];
let m;
let max = 0;
let lastDistances = [];
let clusters = [];
let extraArrayX... |
Shell | UTF-8 | 699 | 3.015625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env bash
set -euo pipefail
function installHammerspoon() {
brew install --cask hammerspoon
# enable AppleScript: https://github.com/Hammerspoon/hammerspoon/blob/c16bbeb8606486076cbcedf6891b1137bf65b8ec/Hammerspoon/HSAppleScript.m#L69-L71
defaults write org.hammerspoon.Hammerspoon HSAppleScriptE... |
Python | UTF-8 | 949 | 2.78125 | 3 | [] | no_license | #!/bin/python
from pyModbusTCP.server import ModbusServer, DataBank
from time import sleep
from random import uniform
import logging
import sys
#Create an instance of ModbusServer
logger = logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
try:
logging.info("Iniciando")
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.