language stringclasses 15
values | src_encoding stringclasses 34
values | length_bytes int64 6 7.85M | score float64 1.5 5.69 | int_score int64 2 5 | detected_licenses listlengths 0 160 | license_type stringclasses 2
values | text stringlengths 9 7.85M |
|---|---|---|---|---|---|---|---|
Python | UTF-8 | 1,262 | 2.6875 | 3 | [] | no_license | #coding=utf-8
import psutil
from util import data_from_pipe, l_split
# Implementations for Mac OS X system
def physmem():
return psutil.TOTAL_PHYMEM
def swapinfo():
return (psutil.total_virtmem(),psutil.used_virtmem(),) # Return total and used swap
def meminfo():
return (physmem(), psutil.avail_phymem(), psutil.... |
Java | UTF-8 | 3,204 | 2.40625 | 2 | [] | no_license | package com.zybooks.twister;
import android.content.Context;
import android.util.Log;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonO... |
Markdown | UTF-8 | 44,198 | 3.265625 | 3 | [] | no_license |
# Object-Oriented Programming — The Trillion Dollar Disaster
Original Article: https://betterprogramming.pub/object-oriented-programming-the-trillion-dollar-disaster-92a4b666c7c7
## Why it’s time to move on from OOP
<img src="./images/2*9S9l47dN6pCSTT7yPa6nyg.jpeg" width="60">
Ilya Suzdalnitski
Jul 10, 2019 · 27... |
SQL | UTF-8 | 5,871 | 3.25 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Дек 06 2018 г., 00:46
-- Версия сервера: 10.0.36-MariaDB-0ubuntu0.16.04.1
-- Версия PHP: 7.0.32-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET ... |
TypeScript | UTF-8 | 624 | 2.5625 | 3 | [] | no_license | import axios from 'axios'
// create an axios instance
const service = axios.create({
timeout: 5000 // request timeout
})
// request interceptor
service.interceptors.request.use(
config => {
return config
},
error => {
// do something with request error
return Promise.reject(error)
}
)
// respon... |
Rust | UTF-8 | 956 | 3.125 | 3 | [] | no_license | use std::borrow::Borrow;
use std::hash::Hash;
use std::any::Any;
use std::sync::Arc;
use std::collections::HashMap;
#[derive(Default, Clone, Debug)]
pub struct AnyHashMap<K>(HashMap<K, Arc<dyn Any + 'static + Send + Sync>>);
impl<K: Eq + Hash> AnyHashMap<K> {
pub fn insert<V: 'static + Send + Sync>(&mut self, key... |
Java | UTF-8 | 520 | 2.09375 | 2 | [
"Apache-2.0"
] | permissive | package customer;
import static org.junit.Assert.assertTrue;
import java.net.MalformedURLException;
import java.net.URL;
import org.junit.Test;
import com.cloudant.client.api.ClientBuilder;
public class CloudantDatabaseBuilder_cbTest {
@Test
public void clientBuilder_good() throws MalformedURLException {
Clo... |
C++ | UTF-8 | 256 | 2.90625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
for (int i=1;i<=100;i++){
if(i%3==0){
cout<<"Fizz ";
}
else if(i%5==0){
cout<<"Buzz ";
}
else if(i%15==0){
cout<<"FizzBuzz ";
}
else{
cout<<i<<" ";
}
}
}
|
Java | UTF-8 | 2,013 | 2.078125 | 2 | [] | no_license | package com.test.kambi.task;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.test.kambi.handler.NetworkHandler;
import com.test.kambi.handler.ResponseHandler;
import com.test.kambi.model.Event;
import com.test.kambi.model.LiveEvent;
import com.t... |
Markdown | UTF-8 | 1,377 | 3.671875 | 4 | [] | no_license | _Exercise 3-1: In English, write out the ow for a simple computer game, such as Pong. If you’re not familiar with Pong,
visit: http://en.wikipedia.org/wiki/Pong to find out about it_
# PONG
1. Draw a centerline, paddles on left and right edges of the screen, a ball in the centre, and a score for each paddle at the t... |
Python | UTF-8 | 2,667 | 2.515625 | 3 | [
"MIT"
] | permissive | import torch
from utils.ipa_encoder import SOS_ID, EOS_ID
def get_seq_len(x, eos_id=EOS_ID):
mask = x != eos_id
inds = (torch.arange(x.size(1), device=x.device)
.unsqueeze(0)
.repeat(x.size(0), 1))
inds.masked_fill_(mask, x.size(1) - 1)
return inds.min(dim=1).values
def edit_... |
Markdown | UTF-8 | 480 | 2.515625 | 3 | [] | no_license | # 定时触发方式
定时触发方式可以让用户在指定时间触发流水线,适用于希望在构建资源空闲的时间(比如深夜)触发流水线的场景。用户可以选择基础规则和 crontab 表达式,两者可以同时选择。
**注意:** 触发时间以服务器时间为准,建议将BKCI服务器时区调整到用户所在时区


|
Java | UTF-8 | 4,851 | 1.953125 | 2 | [] | no_license | package com.rainbowland.service.hotfixes.domain;
import io.r2dbc.spi.Row;
import org.springframework.data.relational.core.mapping.Table;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.ReadingConverter;... |
Go | UTF-8 | 341 | 2.953125 | 3 | [] | no_license | //project eular - problem 5 - Smallest multiple
package main
import "fmt"
// با دادن مقدار 2520 به شمارشگر i
// و شروع j از 11 خیلی سرعت برنامه بیشتر شد
func main() {
i:=2520
for j :=11;j<=20 ; j++{
if i%j==0 {
continue
}else {
i += 2520
j=11
continue
}
}
fmt.Println(i)
} |
Java | UTF-8 | 1,277 | 3.46875 | 3 | [] | no_license | package com.charlieperson;
public class Car extends Vehicle {
private int wheels;
private int doors;
private String manufacturer;
private boolean automatic;
public Car(String color, int wheels, int doors, String manufacturer, boolean automatic) {
super(color);
this.wheels = wheels;... |
Java | UTF-8 | 2,489 | 2.203125 | 2 | [
"Apache-2.0"
] | permissive | package cn.k12soft.servo.domain;
import cn.k12soft.servo.domain.enumeration.PlanType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.time.Instant;
import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persi... |
Java | UTF-8 | 293 | 1.804688 | 2 | [] | no_license | import org.junit.Test;
public class CareersTest extends RidezumBaseTest {
protected HomePage homePage;
protected CareersPage careersPage;
@Test
public void testCareers() {
homePage = new HomePage(driver);
careersPage = homePage.clickCareerButton();
}
}
|
Java | UTF-8 | 3,281 | 2.796875 | 3 | [] | no_license | package web.asana.servelet;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
/**
* @author Aniruddha varshney
*
*/
public class Database_Handler {
private Connection connect = null;
private Statement statement = ... |
JavaScript | UTF-8 | 702 | 3.484375 | 3 | [] | no_license | /**
* @param {number[]} nums
* @param {number} target
* @return {number}
*/
var search = function(nums, target) {
var len = nums.length;
var l = 0, r = nums.length - 1, m;
while (l <= r) {
m = parseInt((l + r) / 2);
if (nums[m - 1] >= nums[m] || l === r) {
break;
} else if (nums[m] <= ... |
C# | UTF-8 | 1,465 | 3.015625 | 3 | [] | no_license | private static void DecryptFile(string path, byte[] key)
{
using (var fs = new FileStream(path, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
{
byte[] buffer = new byte[1024];
byte[] iv = new byte[16];
long readPos = 0;
long writePos = 0;
... |
Markdown | UTF-8 | 2,128 | 2.78125 | 3 | [] | no_license | Overview
========
A POC to take a list of content sets (basically a listing of directories) and
pack them into a format optimized for space efficieny and reading.
For details on the file format, please see `FORMAT.md`, `ALGORITHM.md`, and the
included source.
Compilation and Usage
=====================
This repo ho... |
Ruby | UTF-8 | 70 | 2.84375 | 3 | [] | no_license | array = []
50.times do |i|
i +=1
array << "jean.dupont.#{i}@email.com"
end
puts array |
Python | UTF-8 | 4,567 | 3.15625 | 3 | [] | no_license | import csv
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from sklearn.decomposition import PCA
from sklearn.cluster import KMeans
from sklearn.linear_model import LogisticRegression
# REDUCE, MULTI-CLUSTER, AND PLOT
# first applies PCA, then clusters using k-means for k up to 'max_clusters... |
C++ | UTF-8 | 6,578 | 2.84375 | 3 | [
"MIT"
] | permissive | #include "AABB.h"
#include "math.h"
#include <algorithm>
namespace tzw {
AABB::AABB()
{
reset();
}
AABB::~AABB()
{
}
void AABB::update(vec3 *vec, int num)
{
for (size_t i = 0; i < num; i++)
{
// Leftmost point.
if (vec[i].x < m_min.x)
m_min.setX(vec[i].x);
// Lowest... |
TypeScript | UTF-8 | 3,741 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | export interface ResourceData<S> {
[index: string]: S;
}
export interface ResourceIdMap {
[index: string]: string;
}
export interface ResourceOrder {
[index: string]: string[];
}
export interface Pagination {
[index: string]: PaginationResult;
}
export interface PaginationResult {
total: number;
pages: {
[i... |
Markdown | UTF-8 | 9,277 | 2.53125 | 3 | [] | no_license | Use Amazon ECS Containers to setup (docker-based) elastic build
executors.
# About
[Amazon EC2 Container Service (ECS)](https://aws.amazon.com/ecs/) is
AWS' service for Docker container orchestration letting you deploy
Docker based applications on a cluster.
This plugin lets you use Amazon ECS Container Service to m... |
JavaScript | UTF-8 | 2,258 | 2.75 | 3 | [] | no_license | const register = async () => {
let linkedinEmail = document.getElementById('linkedinEmail').value;
let twitterUsername = await document.getElementById('twitterUsername').value;
window.localStorage.setItem('twitterUsername',twitterUsername);
let response = await fetch('http://3.227.193.57:8001/applicants')... |
Markdown | UTF-8 | 3,374 | 4.03125 | 4 | [
"MIT"
] | permissive | Angular animation comes with a handy function called `animateChild()` which as the name suggests, executes the child’s animation. You might be asking why would we need this if we can execute the child’s animation independent of the parent?
One of the common use case for this is when you have an `*ngIf` attached to the... |
Python | UTF-8 | 259 | 2.984375 | 3 | [] | no_license | S = input()
k = input()
result = list()
if not k in S:
print((-1, -1))
else:
len0 = len(S)
len1 = len(k)
for i in range(len0):
if S[i:i + len1] == k:
result.append((i,i + len1 - 1))
for j in result:
print(j)
|
C# | UTF-8 | 1,987 | 2.609375 | 3 | [] | no_license | using masterCore.Entities;
using masterCore.Interfaces;
using masterInfrastructure.Data;
using Microsoft.EntityFrameworkCore;
using System;
using System.Threading.Tasks;
namespace masterInfrastructure.Repositories
{
public class MenuItemUserGroupRepo : IMenuItemUserGroupRepo
{
private readonly AppDbCo... |
Python | UTF-8 | 1,142 | 2.546875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
# !/usr/bin/env python3
"""
@Author : ziheng.ni
@Time : 2021/2/8 17:31
@Contact : nzh199266@163.com
@Desc :
"""
from __future__ import annotations
from abc import ABC, abstractmethod
from create_mode.generator.product import Product1
class Builder(ABC):
@property
@abstractmeth... |
C# | UTF-8 | 1,243 | 2.53125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Uppgift1
{
class ShopStorage : ItemStorage<Item>
{
int sortIndex = 0;
public ShopStorage()
{
Add(new Item { ID=1, Cat = Category.Food, Name = "Morot... |
JavaScript | UTF-8 | 4,171 | 2.703125 | 3 | [] | no_license | const low = require('lowdb')
const FileSync = require('lowdb/adapters/FileSync')
const adapter = new FileSync('db.json')
const db = low(adapter)
const writeToTerminal = require("./writeToTerminal")
module.exports = {
ValidateAccount : function ValidateAccount(cardType, cardNumber){
db.read()
let v... |
C++ | UTF-8 | 2,108 | 2.5625 | 3 | [
"MIT"
] | permissive | #define _CRT_SECURE_NO_WARNINGS
#include<cstring>
#include<iostream>
#include<algorithm>
#include<sstream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<fstream>
#include<cassert>
#include<numeric>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<deque>... |
C# | UTF-8 | 575 | 2.734375 | 3 | [] | no_license | namespace Domain
{
public class Sync
{
//class for syncing of timer threads
private readonly object _syncObject = new object();
private bool _changeDetected = false;
public bool WasChangeDetected()
{
lock (_syncObject) return _changeDetected;
... |
Python | UTF-8 | 558 | 2.640625 | 3 | [] | no_license | class GameStats():
"""game stats class for storing various statsitics
concerning the flow of the game,like high score
,normal score,and ships reaming and level which the player is currently on
TODO the high score hould be saved in a text file"""
def __init__(self,def_settings):
self.def_se... |
PHP | UTF-8 | 1,522 | 3.078125 | 3 | [
"MIT"
] | permissive | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Post extends Model
{
// Hacemos esto para indicar que este variable debe tomarlo como una instacia de carbon
protected $dates = ['published_at'];
// Creamos un nuevo metodo para crear la relacion post con categoria
// como el post ti... |
JavaScript | UTF-8 | 662 | 2.59375 | 3 | [] | no_license | // mostly code from reactjs.org/docs/error-boundaries.html
import React from 'react';
import {Link} from '@reach/router';
export default class ErrorBoundary extends React.Component {
state = {hasError: false}
static getDerivedStateFromError() {
return { hasError: true };
}
componentDidCatch(error, info) {... |
C++ | UTF-8 | 1,379 | 3.015625 | 3 | [] | no_license | #include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <sstream>
#include <InetAddress.hpp>
#include <Logging.hpp>
namespace Net {
InetAddressIPV4::InetAddressIPV4(uint16_t port, std::string address):
port_(port),
address_(address) {}
InetAddressIPV4::InetAddressIPV4(sockaddr_in &socke... |
Python | UTF-8 | 385 | 4 | 4 | [] | no_license | print ('Aula 12: Condições Aninhadas')
nome = str(input('Qual é o seu Nome: '))
if nome == 'Gustavo':
print('Que nome bonito!')
elif nome == 'Pedro' or nome == 'Paulo' or nome == 'Maria':
print('Seu nome é bem popular no Brasil')
elif nome in 'Jessica Marcia Ana Claudia':
print ('Belo nome feminino')
else:
... |
Markdown | UTF-8 | 1,239 | 3.078125 | 3 | [] | no_license | # ModEarlyAccess
*Namespace: [MSCLoader](API/MSCLoader.md)*
### Description
Simple date handler for mods, with this you can time limit your mods, and optionally prevent the mod from loading if 'todays' date is outside a specified range.
It can take both local time and online time.
### Static Functions
Name | Des... |
TypeScript | UTF-8 | 925 | 2.546875 | 3 | [
"MIT"
] | permissive | import { FormControl, NG_VALIDATORS, Validator } from '@angular/forms';
import { Directive } from '@angular/core';
@Directive({
selector: '[FileTypeValidator]',
providers: [
{
provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true
}
]
})
export class FileTypeValidator implements Valida... |
Python | UTF-8 | 5,580 | 2.828125 | 3 | [] | no_license | # encoding=utf-8
import threading
import time
from lib.api.okex.spot_api import SpotApi
from lib.api.okex.swap_api import SwapApi
from lib.common import get_dict, TimeOperation
from lib.trade.collection.volume_store import VolumeStore
class CoinThread(threading.Thread):
"""
成交数据采集
"""
__trade_type = ... |
Java | UTF-8 | 1,441 | 2.734375 | 3 | [] | no_license | package Thread_pool;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
//read .pre file and get seg,parse result
public class ReadFile
{
public ArrayList<ArrayList<String>> seg_result;
public ArrayList<ArrayList<String>... |
JavaScript | UTF-8 | 2,827 | 2.75 | 3 | [] | no_license | //dependency
var db = require("../models");
//routes
module.exports = function (app) {
// get all the cases to be put on the main page
app.get("/api/cases", function (req, res) {
db.Employee.findAll({}).then(function (dbQuar) {
res.json(dbQuar);
});
});
// get all the employees with the status of... |
Markdown | UTF-8 | 1,191 | 3.171875 | 3 | [] | no_license | ## Frontend-nanodegree-resume
Project that programmatically fills in resume information.
Description
-----------
Project to write code that takes the given resume information, filters and formats it using a list of variables that contain the formatting for each of the sections and then places it in the index.html fil... |
C++ | UTF-8 | 509 | 2.75 | 3 | [] | no_license | class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
if(n == 0)
return 0;
else if(n == 1)
return nums[0];
else if(n == 2)
return max(nums[0], nums[1]);
int day_m1 = max(nums[0], nums[1]), day_m2 = nums[0], today;
... |
C++ | UTF-8 | 1,165 | 3.015625 | 3 | [] | no_license | // Problem: STPAR - Street Parade
// Link: https://www.spoj.com/problems/STPAR/
// Solution: Mai Thanh Hiep
// Complexity: O(N)
#include <iostream>
#include <stack>
using namespace std;
#define MAX 1000
int arr[MAX];
int main() {
int n;
while (true) {
cin >> n;
if (n == 0)
... |
SQL | UTF-8 | 147 | 2.609375 | 3 | [] | no_license | CREATE PROCEDURE Billing.FeeGroupReadAll
AS
BEGIN
SELECT Id, Name, FrequencyId, IsActive
FROM Billing.FeeGroup WITH (NOLOCK)
END |
C# | UTF-8 | 8,808 | 2.515625 | 3 | [
"MIT"
] | permissive | using System;
using System.Collections.Generic;
using Windows.Foundation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Leisn.UI.Xaml.Extensions;
using System.Diagnostics;
using Microsoft.UI.Xaml.Controls;
using System.Collections.Specialized;
namespace Leisn.UI.Xaml.Controls
{
public class AutoF... |
C++ | UTF-8 | 2,571 | 3.640625 | 4 | [] | no_license | // leetcode_5350.cpp : This file contains the 'main' function. Program execution begins and ends there.
// https://leetcode.com/contest/biweekly-contest-22/problems/sort-integers-by-the-power-value/
/*
The power of an integer x is defined as the number of steps needed to transform x into 1
using the following steps:
... |
C++ | UTF-8 | 1,671 | 2.546875 | 3 | [] | no_license | #include "cute.h"
#include "ide_listener.h"
#include "xml_listener.h"
#include "cute_runner.h"
#include <sstream>
#include "long_function.h"
#include <fstream>
#include <cstdio>
void testWriting3Times() {
std::ostringstream out;
writeNTimesToStream(out,"hello",4);
ASSERT_EQUAL("hello\nhello\nhello\n",out.str());
}
v... |
C# | UTF-8 | 1,063 | 3.3125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sunglasses
{
class Sunglasses
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
char asteriks = '*';
char ... |
C++ | UTF-8 | 602 | 3 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void read_input(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
}
int main(){
read_input();
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++) {
cin>>arr[i];
}
int max_ind=0;... |
Java | UTF-8 | 3,895 | 1.960938 | 2 | [
"BSD-3-Clause",
"MIT",
"Apache-2.0"
] | permissive | package in.partake.controller.api.user;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import in.partake.base.DateTime;
import in.partake.base.Pair;
import in.partake.base.TimeUtil;
import in.partake.controller.api.APIControllerTest;
import in.partake.model.dto.Event;
import in.part... |
Java | UTF-8 | 5,981 | 1.96875 | 2 | [] | no_license | package com.qysd.lawtree.lawtreefragment;
import android.content.Intent;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import c... |
JavaScript | UTF-8 | 1,292 | 2.53125 | 3 | [] | no_license | var React = require('react');
var ReactDOM = require('react-dom');
var TaskList = require('./TaskList.jsx');
var TaskItem = require('./TaskItem.jsx');
var GlobalSidebar = React.createClass({
getInitialState: function() {
return {
tasksInList: [],
city: "Las Vegas",
temperature: ""
}
},
... |
Java | UTF-8 | 4,045 | 1.539063 | 2 | [] | no_license | package org.springframework.eam.dao;
import java.util.List;
import org.springframework.dao.DataAccessException;
import org.springframework.eam.domain.Personas;
import org.springframework.eam.domain.ProActTar;
import org.springframework.eam.domain.Usuarios;
import org.springframework.eam.domain.Menues;
import org.spri... |
Python | UTF-8 | 1,313 | 3.453125 | 3 | [] | no_license | with open("password_db.dat") as passwordData:
passwordEntries = passwordData.read().split('\n')
passwordOK = 0
passwordBad = 0
for entry in passwordEntries:
charMin = int(entry.split('-')[0])
charMax = int(entry.split('-')[1].split(' ')[0])
char = entry.split(' ')[1].split(':')[0]
password = entry... |
C++ | UTF-8 | 1,096 | 3.515625 | 4 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
struct node {
int num;
node* parent;
node* left;
node* right;
};
node* create(int a) {
node* temp = new node;
temp->num = a;
temp->left = NULL;
temp->right = NULL;
temp->parent = NULL;
return temp;
}
void insert(node* n, int a) {
if (n->num > a) ... |
Java | UTF-8 | 18,350 | 2.09375 | 2 | [] | no_license | /*
* Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package ws.daley.genealogy.laf.family;
import java.awt.Color;
import java.awt.Component;
import java.a... |
Java | UTF-8 | 1,885 | 3.265625 | 3 | [] | no_license | package models.spaceships.weapons;
import models.spaceships.weapons.bullets.Bullet;
import java.awt.*;
import java.util.ArrayList;
public abstract class Weapon {
private ArrayList<Bullet> bulletsFired;
private int damage;
protected int cooldown;
protected int cooldownCounter;
protected boolean ... |
JavaScript | UTF-8 | 2,470 | 2.859375 | 3 | [] | no_license | exports.fill = fill;
var _ = require('./public/lib/underscore-min'),
wordservice = require('./wordservice'),
puz = require('./puzzle');
function randomMember (array) {
return array[Math.floor(Math.random()*array.length)];
}
function fill (puzzle, callback) {
var firstSlot = randomMember(puzzle.slots... |
C++ | UTF-8 | 1,717 | 2.703125 | 3 | [] | no_license | #include "..\include\Enemy.h"
using namespace std;
void Enemy::switchFps()
{
if (anim.y > 3)
anim.y = 0;
if (!pony) {
if (anim.x < 2)
sprite.setTextureRect(sf::IntRect(100 * anim.x, 94 * anim.y, 100, 94));
else
sprite.setTextureRect(sf::IntRect(86 + 57 * anim.x, 94 * anim.y, 57, 94));
}
else {
sprite... |
Java | UTF-8 | 792 | 2.640625 | 3 | [
"MIT"
] | permissive | package com.edicarlosls.rungoat.jogo;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Typeface;
public class HDU
{
private int distancia = 0;
private int moedas = 0;
private Paint paint;
private Moeda moeda;
public HDU(){
paint = new Paint();
paint.setColor(0xffffffff... |
Python | UTF-8 | 729 | 2.515625 | 3 | [] | no_license | #!/usr/local/bin/python3
#-*- coding: UTF-8 -*-
"""
Log setting.
"""
import os
import logging
import define
def setLogger(loggername, level, formaterStr, dirpath):
"""
Set loger, using logging lib.
"""
if not os.path.isdir(dirpath):
try:
os.makedirs(dirpath)
except:
... |
Java | UTF-8 | 692 | 3.140625 | 3 | [] | no_license | class Solution {
public ListNode oddEvenList(ListNode head) {
if(head == null) {
return null;
}
ListNode dummy1 = new ListNode(0);
ListNode dummy2 = new ListNode(0);
dummy1.next = head;
dummy2.next = head.next;
ListNode headOdd = head;
ListNode h... |
Python | UTF-8 | 618 | 4.0625 | 4 | [] | no_license | #crie um programa que leia uma frase qualquer e diga se ela é um palindromo, desconsiderando os espaçõs.
#ex: APOS A SOPA, A SACADA DA CASA, A TORRE DA DERROTA, O LOBO AMA O BOLO , ANOTARAM A DATA DA MARATONA
import unicodedata
print('*'*45,'\nVamos ver se essa frase é um palindromo.')
f = input('Digite uma Frase. \n: ... |
Python | UTF-8 | 788 | 2.9375 | 3 | [
"MIT"
] | permissive | """Lololo."""
from operator import itemgetter
from itertools import groupby
import json
mylist = [
[
30.0,
"C",
"Third",
"0003",
"First sensor",
"Температура"
],
[
25.0,
"C",
"First",
"0001",
"First sensor",
"... |
Shell | UTF-8 | 337 | 3.171875 | 3 | [] | no_license | #!/bin/sh
# SPDX-License-Identifier: Apache-2.0
if ! grep -q operations/dns .gitreview 2>/dev/null; then
echo "ERROR: must be executed from the DNS repo root"
exit 2
fi
(git --no-pager grep -P '\t') && HAS_TAB=1 || HAS_TAB=0
if [ $HAS_TAB -eq 1 ]; then
echo "ERROR: Tabs found"
else
echo "OK: No tabs"
... |
SQL | UTF-8 | 1,465 | 2.921875 | 3 | [] | no_license | DROP DATABASE ItProfi IF EXISTS;
CREATE DATABASE ItProfi;
USE ItProfi;
CREATE TABLE login (
Id Int(11) NOT NULL auto_increment,
EMail VarChar(50) NOT NULL default '',
Kennwort VarChar(50) NOT NULL default '',
ProfilTyp VarCHar(50) NOT NULL default'',
PRIMARY KEY (Id)
);
CREATE TABLE register_perso... |
SQL | UTF-8 | 1,057 | 3.125 | 3 | [] | no_license | -- pack_liste_situation_logiciel PL/SQL
--
-- Equipe SOPRA
-- cree le 15/03/1999
--
-- Objet : Permet la creation de la liste top amortissable dans top_amort
-- Tables : type_amort
-- Pour le fichier HTML : dccamo.htm
-- Attention le nom du package ne peut etre le nom
-- de la table...
CREATE OR REPLACE PACKAGE pac... |
Java | UTF-8 | 299 | 3.109375 | 3 | [
"MIT"
] | permissive | public class Item {
String name;
String type;
double price;
Item(String name,String type, double price){
this.type = type;
this.name = name;
this.price = price;
}
public String toString(){
return name+":"+type+":"+price;
}
}
|
PHP | UTF-8 | 1,561 | 3.375 | 3 | [] | no_license | <?php
function returnSeason($month){
switch($month)
case "January":
case "December":
case "February":
echo "Winter";
break;
case "March":
case "April":
case "May":
echo "Spring";
break;
case "June":
case "July":
case "August":
echo "summer";
break;
case "September":
case ... |
Java | UTF-8 | 1,745 | 2.25 | 2 | [] | no_license | package com.tsinghua.course.Base.CustomizedClass;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* @描述 一条评论的格式
*/
@Document("CommentItem")
public class CommentItem {
// 评论id
String commentId;
// 用户名
String commentUsername;
// 昵称
String commentNickname;
// 备注
Strin... |
C++ | UTF-8 | 731 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include "fit/infix.h"
#include "fit/compose.h"
#include "fit/lambda.h"
#include "fit/placeholders.h"
using namespace fit;
struct increment
{
template<class T>
T operator()(T x) const
{
return x + 1;
}
};
struct decrement
{
template<class T>
T operator()(T x) cons... |
Java | UTF-8 | 1,626 | 2.515625 | 3 | [] | no_license | package com.atlas.atlasEarth._VirtualGlobe.Source.Renderer;
import android.graphics.Bitmap;
import com.atlas.atlasEarth._VirtualGlobe.Source.Core.ByteFlags;
import com.atlas.atlasEarth._VirtualGlobe.Source.Renderer.GL3x.NamesGL3x.TextureNameGL3x;
/**
* Class for a Texture for OpenGL, loaded by {@link com.atlas.at... |
Java | UTF-8 | 916 | 2.265625 | 2 | [] | no_license | package com.dell.tsp.admin.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "service_group")
public class ServiceGroupEntity {
public ServiceGroupEntity() {
super();
}
public ServiceGroupEntity(int ser... |
C++ | UTF-8 | 543 | 3.09375 | 3 | [] | no_license | class Solution {
public:
int countNumbersWithUniqueDigits(int n) {
if (!n) return 1;
if (n == 1) return 10;
if (n == 2) return 91;
vector<int> dp (n+1, 0);
dp[1] = 10;
dp[2] = 81;
int res = dp[1] + dp[2];
for (int i = 3; i <= n; ++ i) {
if (i >= 11) return res;
dp[i] = dp[i-1] * (9-i+2);
... |
Python | UTF-8 | 2,738 | 4.03125 | 4 | [] | no_license | # This is my first try at a tic tac toe game with a 1v1 system
import random
from os import system
import time
board = []
def setup():
global board
board = [' ']*10
def get_letter():
letter = input("What letter do you want to be? (X/O): ").upper()
while not (letter == "X" or letter == ... |
TypeScript | UTF-8 | 29,168 | 2.546875 | 3 | [] | no_license | import {
HttpRedirect,
HttpRequest,
HttpResponse,
JavascriptCookieRecord,
JavascriptOperation,
Navigation,
UiInteraction,
UiState,
} from "../shared-resources/openwpm-webext-instrumentation";
import { CapturedContent, LogEntry } from "./OpenWpmPacketHandler";
import { isoDateTimeStringsWithinFutureSecon... |
Markdown | UTF-8 | 4,734 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | import {useState} from 'react';
import { Meta, Story, Preview, Props } from '@storybook/addon-docs/blocks';
import AppWrapper from '.';
<Meta title="AppWrapper" parameters={{ info: { disable: true }}} />
# AppWrapper
AppWrapper manages the width and containment of your application.
## Contents
- [Quick Start](#quic... |
Java | UTF-8 | 2,142 | 3.734375 | 4 | [] | no_license | package edu.ncsu.csc316.grocerystore2.map;
import java.util.Iterator;
import edu.ncsu.csc316.grocerystore2.list.LinkedList;
import edu.ncsu.csc316.grocerystore2.order.Product;
/**
* Dictionary to find products
* @author Eric Mcallister
*
*/
public class ProductDictionary {
/** Array of linked list */
private L... |
Go | UTF-8 | 1,956 | 3.015625 | 3 | [] | no_license | package controller
import (
"errors"
"io/ioutil"
"net/http"
"strings"
"testing"
meetupmanager "github.com/lucas-dev-it/62252aee-9d11-4149-a0ea-de587cbcd233"
"github.com/lucas-dev-it/62252aee-9d11-4149-a0ea-de587cbcd233/business"
"github.com/stretchr/testify/assert"
)
type uService struct{}
func (u *uService... |
Python | UTF-8 | 5,427 | 2.625 | 3 | [
"BSD-3-Clause"
] | permissive | '''
Populates the SQLite database with
a user and a sequence with three components.
'''
import json
from pyelixys.web.database.model import session
from pyelixys.web.database.model import Roles
from pyelixys.web.database.model import User
from pyelixys.web.database.model import Sequence
from pyelixys.web.database.model... |
C# | UTF-8 | 663 | 2.640625 | 3 | [] | no_license | using UnityEngine;
using System.Collections;
public static class EventLog{
//Here we simply print to Console
public static void Log_Message(string message)
{
UnityEngine.Debug.Log(message);
}
public static void Draw_Square(Vector3 botLeft, Vector3 topRight, Color color)
{
//Bottom Line
UnityEngine.Debu... |
Java | UTF-8 | 630 | 3.46875 | 3 | [] | no_license | package com.riverlcn.proxy;
/**
* 静态代理的例子.
* 代理的目的,在调用具体方法前,可以预处理或者后处理一些信息,对处理方法进行条件过滤等操作.
*
* @author river
*/
public class HelloProxy implements HelloInterface {
protected HelloInterface hello = new Hello();
@Override
public void sayHello() {
System.out.println("Before say hello");
... |
Python | UTF-8 | 3,174 | 2.953125 | 3 | [] | no_license | import numpy as np
class FCMeans(object):
def __init__(self, n_clusters=3, n_iter=300, fuzzy_c=2, tolerance=0.001):
self.n_clusters = n_clusters
self.n_iter = n_iter
self.fuzzy_c = fuzzy_c
self.tolerance = tolerance
self.run = False
def fit(self, x):
self.run =... |
Java | UTF-8 | 2,129 | 2.015625 | 2 | [] | no_license | package br.com.unip.stan.resourceserver.adapter.web;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMappin... |
C# | UTF-8 | 1,369 | 3.046875 | 3 | [] | no_license | /*########################################################
*# InternalLib.dll #
*# Copyright 2018 by WesTex Enterprises #
*########################################################*/
using System;
using System.Text.RegularExpressions;
//3rd party
using ... |
Java | UTF-8 | 599 | 1.890625 | 2 | [
"Apache-2.0"
] | permissive | package com.city.phonemall.ware.feign;
import com.city.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author liuZhongKun
* @email 1071607950@qq.com
* @date 202... |
Python | UTF-8 | 837 | 3.828125 | 4 | [] | no_license | class User:
def __init__(self, name):
self.name = name
self.account_balance = 0
def make_deposit(self, amount):
self.account_balance += amount
def make_withdrawal(self, amount):
self.account_balance -= amount
def display_user_balance(self):
print(f"User: {self.nam... |
Go | UTF-8 | 1,464 | 2.890625 | 3 | [
"MIT"
] | permissive | package filters
import (
"math"
"github.com/bspaans/bleep/audio"
)
type FlangerFilter struct {
Time float64
Factor float64
LFORate float64
LeftDelayed []float64
RightDelayed []float64
Phase int
}
func NewFlangerFilter(time, factor, rate float64) *FlangerFilter {
return &FlangerFilter{
Time: ... |
C# | UTF-8 | 3,888 | 3.578125 | 4 | [] | no_license | using System;
using System.Linq;
using System.Text.RegularExpressions;
using Utils.Encryption;
namespace Utils
{
public enum EncryptionMode
{
SHA_256,
SHA_512
}
public static class StringExtensions
{
/// <summary>
/// check if string is number
/// </summary... |
Java | WINDOWS-1250 | 3,298 | 4.8125 | 5 | [] | no_license | package algorithm.number;
/*
* Given an integer, print the next smallest and next largest number that have the same
number of 1 bits in their binary representation.
*/
public class NextSmallestAndLargest {
/*
* The Brute Force Approach: An easy approach is simply brute force: count
* the number of 1s in n, and... |
Java | UTF-8 | 2,572 | 4.03125 | 4 | [] | no_license | package com.lec.java.for01;
/*
* ■ 순환문(loop)
* - for
* - while
* - do ~ while
*
* ■ for 순환문 구문
*
* for(①초기식; ②조건식; ④증감식){
* ③수행문;
* ..
* }
* ①초기식 : 최초에 단한번 수행
* ②조건식 : true / false 결과값
* 위 조건식의 결과가 false 이면 for문 종료
* ③수행문 : 위 조건식이 true 이면 수행
* ... |
TypeScript | UTF-8 | 1,524 | 2.796875 | 3 | [] | no_license | import { ofType } from 'redux-observable';
import { switchMap, map, tap } from 'rxjs/operators';
import { BehaviorSubject } from 'rxjs';
import { wait } from './wait';
export class IteratorBehaviorSubject<T> extends BehaviorSubject<T | undefined> {
constructor(private iterator: any) {
super(undefined);
this... |
Swift | UTF-8 | 438 | 3.046875 | 3 | [] | no_license | //
// Question.swift
// DbzTrivia
//
// Created by Anthony Torres on 5/18/19.
// Copyright © 2019 Anthony Torres. All rights reserved.
//
import Foundation
class Question {
var question: String
var player1: Character
var player2: Character
var answer: Bool
init(q:String,p1:Character,... |
C# | UTF-8 | 9,487 | 3.15625 | 3 | [] | no_license | using System;
using System.Threading;
//* Implement the "Falling Rocks" game in the text console.
//A small dwarf stays at the bottom of the screen and can move
//left and right (by the arrows keys).
//A number of rocks of different sizes and forms constantly fall
//down and you need to avoid a crash.
//Rocks are t... |
Java | UTF-8 | 1,105 | 3.484375 | 3 | [
"MIT"
] | permissive | package Utils;
import Model.Chromosome;
public class MergeSort {
public static void sort(Chromosome[] a, int n) {
if (n < 2) {
return;
}
int mid = n / 2;
Chromosome[] l = new Chromosome[mid];
Chromosome[] r = new Chromosome[n - mid];
for (int i = 0; i ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.