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 | 477 | 1.882813 | 2 | [] | no_license | package com.survey.surveyapp.repository;
import javax.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.survey.surveyapp.entity.SurveyAnswer;
/**
* @author Harsh Jain
*
*
*/
@Repository
@Transactional
public int... |
Java | UTF-8 | 4,701 | 2.40625 | 2 | [
"Apache-2.0"
] | permissive | package com.example.customview.telescope;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.Shader;
import and... |
Java | UTF-8 | 131 | 1.625 | 2 | [] | no_license | package com.estg.masters.pedwm.smarthome.model.notification;
public enum ComparingTypeEnum {
BIGGER,
LESSER,
EQUALS
}
|
Java | GB18030 | 656 | 2.03125 | 2 | [] | no_license | package cn;
import org.openjdk.jmh.annotations.*;
public class TestPS {
// һδ
@Benchmark
// ԤȣJVMжضŻػԤȶڲԽҪ
// iterations Ԥ1 time Ԥʱ 3
@Warmup(iterations = 1, time = 3)
// öٸ߳ȥִǵij
@Fork(5)
// Եģʽ
// Throught
@BenchmarkMode(Mode.Throughput)
// ִܹжٴβ
// iterations time... |
Java | UTF-8 | 9,472 | 2.171875 | 2 | [
"Apache-2.0"
] | permissive | package com.daedafusion.iconfactory.framework.providers;
import com.daedafusion.iconfactory.framework.providers.util.TranscoderUtil;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.GVTBuilder;
import org.apache.batik.bridge.UserAgentAdapter;
import org.apache.batik.dom.svg.SAXSVGDocumentFa... |
Java | GB18030 | 1,973 | 2.46875 | 2 | [] | no_license | package com.example.testfinalmvp;
import com.org.finalmvp.view.BaseView;
import com.presenter.UserPresenter;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Te... |
C++ | UTF-8 | 729 | 3.34375 | 3 | [] | no_license | #include "LeetCode.hpp"
/*
409. Longest Palindrome
Easy
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.
This is case sensitive, for example "Aa" is not considered a palindrome here.
Note:
Assume the length of given strin... |
C# | UTF-8 | 1,021 | 2.671875 | 3 | [] | no_license | using Graphics.Contracts;
using OpenTK.Graphics.OpenGL;
namespace Graphics
{
public sealed class TextureChanger : ITextureChanger
{
private int _textureId;
public TextureChanger()
{
_textureId = -1;
}
void ITextureChanger.SetTexture(int textureId, int chan... |
Java | UTF-8 | 8,995 | 2.46875 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... |
Java | UTF-8 | 3,014 | 2.28125 | 2 | [] | no_license | /**
* Copyright 2018 SinoSoft. All Rights Reserved.
*/
package com.sinosoft.station.modules.station.service;
import java.util.List;
import com.sinosoft.station.modules.station.model.Station;
/**
* <B>系统名称:</B><BR>
* <B>模块名称:</B><BR>
* <B>中文类名:</B><BR>
* <B>概要说明:</B><BR>
*
* @author 中科软科技 liha... |
Java | UTF-8 | 18,108 | 1.820313 | 2 | [] | no_license | package minecrafttransportsimulator.items.instances;
import java.util.Iterator;
import java.util.List;
import minecrafttransportsimulator.baseclasses.BoundingBox;
import minecrafttransportsimulator.baseclasses.Point3d;
import minecrafttransportsimulator.blocks.components.ABlockBase.Axis;
import minecrafttransportsimu... |
Python | UTF-8 | 1,390 | 3.171875 | 3 | [] | no_license | """Dojo Model
Usage:
andela.py create_office <room_names>
andela.py create_livingspace <room_names>
andela.py add_fellow <name>
andela.py add_staff <name>
andela.py print_office <room>
andela.py print_livingspace <room>
py andela.py -h | --help
Examples:
python andela.py create_office Nairobi
python andela.... |
Python | UTF-8 | 414 | 3.09375 | 3 | [
"MIT"
] | permissive | # best solution
# https://leetcode.com/problems/contains-duplicate-ii/discuss/61375/Python-concise-solution-with-dictionary.
class Solution:
def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool:
dct = {}
for i, num in enumerate(nums):
if num in dct and i - dct[num... |
C++ | UTF-8 | 1,811 | 2.6875 | 3 | [] | no_license | #pragma once
namespace dae
{
void SetColor( const Color4f& color );
void DrawPoint( float x, float y, float pointSize = 1.0f );
void DrawPoint( const Point2f & p, float pointSize = 1.0f );
void DrawPoints( Point2f *pVertices, int nrVertices, float pointSize = 1.0f );
void DrawLine( float x1, float y1, float x2... |
Java | UTF-8 | 282 | 1.609375 | 2 | [] | no_license | package ru.ppr.cppk.ui.activity.pdrepeal.poscancel;
import ru.ppr.core.ui.mvp.view.MvpView;
/**
* @author Aleksandr Brazhkin
*/
interface PosCancelView extends MvpView {
void showConnectingState(long timeout);
void showConnectionTimeoutState();
void showConnectedState();
}
|
Markdown | UTF-8 | 6,860 | 2.6875 | 3 | [] | no_license | ---
description: "Recipe of Award-winning Potato and Mentaiko Mayo Stir Fry"
title: "Recipe of Award-winning Potato and Mentaiko Mayo Stir Fry"
slug: 512-recipe-of-award-winning-potato-and-mentaiko-mayo-stir-fry
date: 2020-08-15T11:03:07.842Z
image: https://img-global.cpcdn.com/recipes/5543121229185024/751x532cq70/pota... |
Java | UTF-8 | 292 | 1.796875 | 2 | [] | no_license | package org.gradle.test.performance49_3;
import static org.junit.Assert.*;
public class Test49_248 {
private final Production49_248 production = new Production49_248("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} |
Markdown | UTF-8 | 4,187 | 3.390625 | 3 | [] | no_license | ---
title: 显式锁
date: 2017-8-29
categories:
- Java
tags:
- java
- 多线程
- 读书笔记
---
# 显式锁
## Lock与ReentrantLock
```java
public interface Lock {
void lock();
void lockInterruptibly() throws InterruptedException;
boolean tryLock();
boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException;
... |
Java | UTF-8 | 10,398 | 2.109375 | 2 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package views;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import models.Paciente;
/**
*
* @author Jessele ... |
C# | UTF-8 | 1,039 | 2.765625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace geometrifessor.Models
{
public class Emner // Her defineres klassen 'Emner'
{
public string Id { get; set; } // Her fåes string Id fra... |
PHP | UTF-8 | 1,051 | 2.53125 | 3 | [
"MIT"
] | permissive | <?php
/**
* Class BasicTest.
*
* Long
*/
class BasicTest extends PHPUnit\Framework\TestCase
{
public function testBasic1()
{
$this->assertTrue(true);
}
public function testBasic2()
{
$this->assertTrue(true);
}
public function testBasic3()
{
$this->assertTru... |
C# | UTF-8 | 7,937 | 2.609375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.IO;
namespace WindowsFormsApp2
{
public partial class Form... |
C++ | UTF-8 | 400 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
template<class T, int n>
class STACK
{
private: T a[n];
int counter;
public:
void MakeStack(){counter = 0;}
bool FullStack()
{return (counter==n)? true:false;}
bool EmptyStack()
{return (counter==0)? true:false;}
void PushStack(T x)
{ a[cou... |
C# | UTF-8 | 679 | 3.375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ObjectArray
{
class Program
{
static void Main(string[] args)
{
Object[] oArrObjects = new Object[3];
oArrObjects[0] = "1st Element";
... |
Java | UTF-8 | 2,456 | 1.960938 | 2 | [] | no_license | /**
* Project Name:esearch
* File Name:YougoPoiServiceImpl.java
* Package Name:com.xinguang.esearch.dubbo.impl
* Date:2016年9月29日下午5:31:20
*
*/
package com.xinguang.esearch.dubbo.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import c... |
C++ | UTF-8 | 3,482 | 2.59375 | 3 | [
"MIT"
] | permissive | #ifndef SPARSEASSEMBLYNATIVE_H
#define SPARSEASSEMBLYNATIVE_H
#include <algorithm>
#include <cstdint>
#include <cstdlib>
#ifndef LL_TYPES
#define LL_TYPES
using Real = double;
using Integer = std::int64_t;
using UInteger = std::uint64_t;
#endif
#ifndef BINARY_LOCATE_DEF_
#define BINARY_LOCATE_DEF_
template<class Ra... |
Java | UTF-8 | 2,548 | 2.5625 | 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 Karhabti.modeles;
import java.util.Objects;
/**
*
* @author Mohamed
*/
public class Rate {
private int id;
private... |
Java | UTF-8 | 806 | 2.15625 | 2 | [] | no_license | package com.apirest.octoevents.entity;
public class IssueDTO {
private String title;
private String body;
private String number;
private String created_at;
private String updated_at;
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String get... |
Java | UTF-8 | 7,459 | 2.6875 | 3 | [] | no_license | package org.streaminer.stream.frequency;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import org.streaminer.stream.frequency.util.CountEntry;
import org.streaminer.util.hash.HashUtils;
/*... |
Markdown | UTF-8 | 2,228 | 2.890625 | 3 | [
"Unlicense"
] | permissive |
# ביהד: הבינלאומי יכיר בוועד בנק אוצר החייל לאחר המיזוג
Published at: **2019-11-06T00:00:00+00:00**
Author: **בילי פרנקל**
Original: [כלכליסט - www.calcalist.co.il](https://www.calcalist.co.il/money/articles/0,7340,L-3773190,00.html)
בית הדין האזורי לעבודה בתל אביב קבע אתמול (ג') כי על הנהלת הבינלאומי לכבד את ההסכ... |
C++ | UTF-8 | 431 | 2.640625 | 3 | [] | no_license | /*
muddler.h
Author: C. Painter-Wakefield
Course and Assignment: CSCI 262 Lab 1
Description: Header for the muddler class.
*/
#ifndef _MUDDLER_H
#define _MUDDLER_H
#include <string>
using namespace std;
/**********************************************************
class muddler
Muddles strings.
*... |
JavaScript | UTF-8 | 724 | 4.1875 | 4 | [] | no_license | // Clase 6 ¿Que se implemento en ES7?
// En esta version se incorporan dos cambios muy particulares
// 1 El valor de include
// 2 Operaciones en forma exponencial (POW)
// Sustitulle index of
// Iclude metodo que trabaja sonbre un arreglo o string, nos permite saber si hay un elemento dentro de este valor
let number... |
C# | UTF-8 | 721 | 2.875 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum Size {
none = 0,
small = 70,
medium = 100,
large = 130
}
public enum Tea {
black,
green,
oolong
}
public enum Topping {
boba
}
public class Order
{
// Size of the current cup
public Siz... |
Java | UTF-8 | 353 | 1.625 | 2 | [] | no_license | package com.example.cassandra.repository.table;
import java.sql.Timestamp;
/**
* Created by Menaka on 10/14/16.
*/
public interface LoginEventTable {
String PERSON_ID = "person_id";
String EVENT_TIME = "event_time";
String EVENT_CODE = "event_code";
String IP_ADDRESS = "ip_address";
String LOGIN... |
PHP | UTF-8 | 518 | 2.5625 | 3 | [] | no_license | <?php
namespace Tests\Infrastructure\Persistence;
use Infrastructure\Persistence\AbstractEntity;
use Infrastructure\Persistence\AbstractRepository;
use Infrastructure\ValueObject\Identity\Uuid;
class UserRepository extends AbstractRepository
{
/**
* @param Uuid $uuid
* @return AbstractEntity
*/
... |
Python | UTF-8 | 314 | 2.890625 | 3 | [] | no_license | import sprites
class mario():
def __init__(self,x,y):
self.x = x
self.y = y
self.vel = {x:0,y:0}
self.marioSprite = sprites.sprites().mario
def drawMario(self,screen):
screen.blit(self.marioSprite,(self.x*32,self.y*32))
def updateMario(self):
pass
|
PHP | UTF-8 | 4,843 | 2.875 | 3 | [] | no_license | <?php
require_once "conexion.php";
class ModeloActividad{
/*============================================
Mostrar todas los actividades
============================================*/
static public function index($tabla, $cantidad, $desde){
//$stmt = Conexion::conectar()->prepare("SELECT * FROM $tabla");
if ... |
Python | UTF-8 | 84 | 3.484375 | 3 | [
"Apache-2.0"
] | permissive | a=int(input())
b=int(input())
print (a//b)
print (a%b)
c=divmod(a, b)
print (c) |
Markdown | UTF-8 | 7,948 | 2.890625 | 3 | [
"MIT"
] | permissive | ---
layout: category
title: PCA
---
```python
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
def np_summary(np_array):
if np_array is None:
print('\nNone')
else:
dim = np.ndim(np_array)
print('\nndim: %s / shape: %s / size: %s' %... |
Java | UTF-8 | 551 | 2.09375 | 2 | [] | no_license | package ua.study.command.impl.info;
import ua.study.command.Command;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by dima on 13.05.17.
*/
public class NewsCommand implements Command {
... |
C# | UTF-8 | 2,327 | 2.609375 | 3 | [] | no_license | using CattleCompanion.Core;
using CattleCompanion.Core.Models;
using CattleCompanion.Core.Repositories;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
namespace CattleCompanion.Persistence.Repositories
{
public class CowRepository : ICowRepository
{
private readonly IAp... |
Java | UTF-8 | 1,465 | 2.203125 | 2 | [] | no_license | package model;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
@Entity
public class User {
@Id
@Gen... |
Java | UTF-8 | 150 | 1.921875 | 2 | [] | no_license | package digitcashiermvc.models;
public class AdminEmployee extends Employee{
public AdminEmployee(String password) {
super(password);
}
}
|
PHP | UTF-8 | 1,518 | 2.65625 | 3 | [] | no_license | <?php
require_once 'inc/header.php';
require_once 'classes/Product.php';
require_once 'classes/helpers/Str.php';
use helpers\Str;
//call func getAllProducts from
$prod=new Product;
$products=$prod->getAllProducts();
?>
<div class="container py-4">
<div class="row">
<?php if($products!=[]) {?>
<?p... |
Java | UTF-8 | 548 | 2.75 | 3 | [] | no_license | package sample;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class Faculty_data {
final private StringProperty Subject;
final private StringProperty Class1;
Faculty_data(String subject,String Class)
{
this.Subject=new SimpleSt... |
JavaScript | UTF-8 | 3,581 | 3.015625 | 3 | [] | no_license | /**
* @file - make fetch requests
*/
// Third party imports
// Local imports
// Global contants
const fetchOptions = {
method: "",
// mode: 'no-cors', // Uncheck for cors
// cache: 'no-cahce' // valid options default, no-cache, reload, force-cache, only-if-chached
// credentials: 'same-origin', // include,... |
C++ | UTF-8 | 2,647 | 2.671875 | 3 | [] | no_license | // ****************************************************************************
// LOAD BALANCING
// Copyright (C) 2012 Gerasimov, Smoryakova, Katerov, Afanasov, Kulakovich, Sobolev
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as pub... |
Java | UTF-8 | 576 | 2.0625 | 2 | [] | no_license | package top.cyixlq.core.net.bean;
import androidx.annotation.Nullable;
public class DnsConfig {
private String url;
@Nullable
private String[] hosts;
public DnsConfig(String url, @Nullable String[] hosts) {
this.url = url;
this.hosts = hosts;
}
public String getUrl() {
... |
Java | UTF-8 | 1,152 | 3.734375 | 4 | [] | no_license | package com.damladincer.oop.userinteraction;
import java.util.Scanner;
public class GuessTheNumberGame {
public static void main(String[] args) {
int guessNumber;
int random = randomNumber();
boolean win=false;
System.out.println("I have randomly choosen a number between [1,100]");
System.out.p... |
Java | UTF-8 | 6,806 | 2.59375 | 3 | [] | no_license | package lk.rgd.prs.core.service;
import junit.framework.Assert;
import junit.framework.TestCase;
import lk.rgd.UnitTestManager;
import lk.rgd.prs.api.dao.PINNumberDAO;
import lk.rgd.prs.api.service.PINGenerator;
import org.springframework.context.ApplicationContext;
import java.util.Calendar;
import java.util.Gregori... |
Shell | UTF-8 | 2,318 | 3.8125 | 4 | [] | no_license | #!/bin/bash
# Basic script to install gcc5.2 on ubuntu 14.04
# For CMPE 275 class 2015
# Author: Ashish Bende
# Source: https://gist.github.com/maxlevesque/5813df2fcee107c757f4#file-howto-gcc-5-2-ubuntu15-04-sh
#
# Use it at your own risk.
# This script doesn't run testsuites from gcc package.
[ "$(whoami)" != "ro... |
JavaScript | UTF-8 | 2,323 | 3.234375 | 3 | [] | no_license | const { map, filter, findIndex , reduce} = require('./index');
describe('array methods', () => {
describe('map function', () => {
it('returns an array', () => {
const numbers = [1, 2, 3];
const mapped = map(numbers, number => number * 2);
expect(mapped).toEqual(expect.any(Array));
});
... |
Markdown | UTF-8 | 1,565 | 2.578125 | 3 | [] | no_license | ### Keybase proof
I hereby claim:
* I am bryceryan-docker on github.
* I am bryceryan (https://keybase.io/bryceryan) on keybase.
* I have a public key whose fingerprint is 5137 5FC9 35F0 F060 7C01 B07C B104 38E6 072F 47A8
To claim this, I am signing this object:
```json
{
"body": {
"key": {
... |
Java | UTF-8 | 1,529 | 2.796875 | 3 | [] | no_license |
package pe.edu.pucp.congresoft.model;
import java.sql.Date;
public class Congreso{
private int idCongreso;
private String nombre;
private Date fechaInicio;
private Date fechaFin;
private String pais;
private boolean activo;
public Congreso(){
}
public Congreso( String nombre, Date fechaInicio, Da... |
C++ | UTF-8 | 716 | 3.484375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
TreeNode* sortedArrayToBST(vector<int>& nums) {
return sortedArrayToBSTStep(nums,0,nums... |
Python | UTF-8 | 1,590 | 2.90625 | 3 | [] | no_license | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
"""
pyapp.py
去除log日志的某行-带'抛弃原文'的去掉
Version: 1.0
Author: LC
DateTime: 2019年2月18日12:29:06
UpdateTime: None
一加壹博客最Top-一起共创1+1>2的力量!~LC
LC博客url: http://oneplusone.top/index.html
"""
def main():
with open("pyapp.log", "r", encoding="utf-8") as f:
lines = f.readl... |
PHP | UTF-8 | 2,819 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | <?php
// +-----------------------------------------------------------------------------------
// | TangFrameWork 致力于WEB快速解决方案
// +-----------------------------------------------------------------------------------
// | Copyright (c) 2012-2014 http://www.tangframework.com All rights reserved.
// +------------------... |
Java | UTF-8 | 514 | 2.515625 | 3 | [] | no_license | package com.tec.datos1.gameofsorts.game;
import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
public class Games extends Game {
SpriteBatch batch;
Texture img;
MainScreen main;
@Override
public void create () {
batch = new SpriteBatch();
... |
C# | UTF-8 | 586 | 2.578125 | 3 | [
"MIT"
] | permissive | using Newtonsoft.Json.Linq;
using System;
namespace DataStorage.DataObjects.Events
{
public class PlayerLeftEvent : Event
{
public PlayerLeftEvent(Guid sessionId, string playerName) : base(sessionId, EventType.PlayerLeft, $"Player {playerName} left", $"Player {playerName} left the session.")
{... |
C++ | UTF-8 | 1,053 | 2.53125 | 3 | [] | no_license | #include <Vaango_UIComponentBase.h>
#define STB_IMAGE_IMPLEMENTATION
#include <stb_image.h>
using namespace VaangoUI;
Vaango_UIIcon
Vaango_UIComponentBase::creatIconTextureFromImageFile(const std::string& fileName)
{
Vaango_UIIcon icon;
int textureComp;
void* textureData =
stbi_load(fileName.c_str(), &ico... |
Python | UTF-8 | 2,332 | 2.65625 | 3 | [] | no_license | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sn
from sklearn.model_selection import train_test_split
from sklearn.metrics import confusion_matrix
#Import necessary libraries
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Conv2D, MaxPoolin... |
Swift | UTF-8 | 11,654 | 2.6875 | 3 | [
"MIT"
] | permissive | //
// InterfaceElement.swift
// AR MultiPendulum
//
// Created by Philip Turner on 7/28/21.
//
import SwiftUI
import simd
extension InterfaceRenderer {
struct InterfaceElement {
private var centralObject: CentralObject
private var inverseScale: simd_float4
private(set) var... |
Python | UTF-8 | 189 | 2.859375 | 3 | [] | no_license | # -*- coding: UTF-8 -*-
import time
import datetime
import sys
a = sys.argv[1]
t = time.strptime(a, "%Y-%m-%d")
y, m, d = t[0:3]
print(datetime.date(y, m, d) + datetime.timedelta(days=1))
|
Java | UTF-8 | 2,016 | 2.6875 | 3 | [] | no_license | package Enumeration;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import READ_TXT.Read_INPUT_TXT_filter;
import READ_TXT.Read_distance;
public class Enumeration {
public static int d;
public static void main() throws Exception {
Read_INPUT_TXT_filter.loadData(); //讀取SQL資料
... |
Java | UTF-8 | 127 | 1.640625 | 2 | [] | no_license | package com.tengke.android.interfaces;
public interface ITabBarShowListener {
void showTabBar();
void hideTabBar();
}
|
Java | UTF-8 | 1,851 | 3.765625 | 4 | [] | no_license | /**
* this class describes the customer's information
* @author veronicaL5
*
*/
public class Customer {
private String secretLairLocation;
private String name;
private double evilFunds;
// stores values to variables (values are nothing really)
public Customer () {
secretLairLocation = "... |
C++ | UTF-8 | 639 | 3.171875 | 3 | [] | no_license |
#include<iostream>
#include<algorithm>
using namespace std ;
int main()
{
int m ;
cin >> m ;
while(m--)
{
int i ;
int L,n ;
cin >> L >> n ;
int *ants = new int[n] ;
int max=0,min=0 ;
for(i=0 ; i<n ; ++i)
{
cin >> ants[i] ;
if( L-ants[i] > ants[i])
{
if( ants[i]>min )
min... |
Markdown | UTF-8 | 3,020 | 3.328125 | 3 | [] | no_license | ---
title: 顺序执行的异步操作:命名,Promise,任务,非队列
summary: 针对比特币的交易,涉及到收集UTXO,创建交易,发送交易,获取网络反馈,进入内存池,打包进入区块,等等一系列的异步操作。而每一步都需要等待之前的步骤完成
date: 2020-07-28 12:37:45
tags:
- Javascript
- node.js
---
针对比特币的交易,涉及到收集UTXO,创建交易,发送交易,获取网络反馈,进入内存池,打包进入区块,等等一系列的异步操作。而每一步都需要等待之前的步骤完成。
下面这个刚刚创建的库,可以帮助解决部分异步等待问题
[https://www.npmjs.com/pack... |
C++ | GB18030 | 2,069 | 3.734375 | 4 | [
"Apache-2.0"
] | permissive | /************************************************************************/
/*
https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
... |
Markdown | UTF-8 | 1,492 | 3.375 | 3 | [] | no_license | # Yuk mengenal Babel
Pernah nggak kamu mau menggunakan fitur yang keren dan simpel banget tapi browser nggak dukung?
Misalnya aja kamu mau menggunakan arrow function bersamaan dengan string literal di Javascript seperti contoh di bawah ini:
```javascript
let sebut = nama => console.log(`Halo ${nama}`)
```
Tapi saya... |
Java | UTF-8 | 1,059 | 2.09375 | 2 | [] | no_license | package com.jrmf.domain;
import java.io.Serializable;
/**
* @author 种路路
* @version 创建时间:2017年11月23日 14:49:49
* 类说明 日结利息
*/
public class Interest implements Serializable{
/**
* @Fields serialVersionUID : TODO()
*/
private static final long serialVersionUID = 3787502829679696582L;
/**
* @Fields serialVe... |
Python | UTF-8 | 320 | 3.9375 | 4 | [] | no_license | #Pedirle al usuario que ingrese su nombre, horas trabajadas en el mes y precio por hora.
#Devolver lo que cobra esa persona
name = input("Ingrese su nombre\n")
hours = int(input("Ingrese cantidad de horas trabajadas\n"))
price = int(input("Ingrese precio por hora\n"))
print(name, "este mes vas a cobrar: ", price*hours) |
Java | UTF-8 | 1,766 | 2.40625 | 2 | [] | no_license | package net.minemora.eggwarscore.extras;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.minemora.eggwarscore.config.Config;
public abstract class IExtraManager extends ExtraManager {
private Map<String, IExtra> iExtras = new HashMap<>();
p... |
Java | UTF-8 | 1,843 | 2.3125 | 2 | [] | no_license | package co.com.rempe.impresiones.negocio.delegado;
import co.com.rempe.impresiones.negocio.constantes.ECodigoRespuesta;
import co.com.rempe.impresiones.negocio.respuesta.Respuesta;
import co.com.rempe.impresiones.persistencia.dao.ModoImpresionDAO;
import co.com.rempe.impresiones.persistencia.entidades.ModoImpresi... |
C | UTF-8 | 1,264 | 2.625 | 3 | [] | no_license | // Copyright 2013 Mats Ekberg
//
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wr... |
Markdown | UTF-8 | 2,611 | 3.078125 | 3 | [] | no_license | # CMPEN/EE 454: Computer Vision I Fall 2020
#### Course Description:
Introduction to computer vision topics, including image formation, feature extraction, matching, stereo, motion, tracking and object recognition.
#### Goal and Objectives:
- Introduce the fundamental problems of computer vision.
- Introduce the ma... |
Python | UTF-8 | 1,713 | 4.3125 | 4 | [] | no_license | """
Find Pivot Index
Given an array of integers nums, write a method that returns the "pivot" index of this array.
We define the pivot index as the index where the sum of the numbers to the left of the index is equal to the sum of the numbers to the right of the index.
If no such index exists, we should return -1. I... |
JavaScript | UTF-8 | 1,102 | 2.515625 | 3 | [] | no_license | const User = require('../models/user');
module.exports.getUsers = (req, res) => {
User.find({})
.then((users) => res.send({ data: users }))
.catch(() => res.status(500).send({ message: 'Произошла ошибка' }));
};
module.exports.getUsersId = (req, res) => {
User.find({ _id: req.params.userId })
.orFail(... |
Java | UTF-8 | 846 | 1.992188 | 2 | [
"Apache-2.0"
] | permissive | package com.tal.file.transform.common.rest.client;
/**
* RESTClient的配置信息类
*
* @author lazycathome
*
*/
public class RestConfig {
private static final String DEFAULT_USER_AGENT = "xes-en/0.1 RestClient/0.1";
private int socketTimeout = 10000;
private int connectTimeout = 10000;
private Strin... |
Markdown | UTF-8 | 5,346 | 3.296875 | 3 | [] | no_license | I needed to implement a keyboard autocompletion algorithm recently. Given a set of training words, it can provide autocomplete suggestions for a given typed word. For example, if trained on previously typed words like "the thing I like is the thing over there", typing the prefix "th" would result in "the", "thing", and... |
Python | UTF-8 | 660 | 3.734375 | 4 | [] | no_license | #multiple inheritance
class Base1:
def __init__(self):
self.i=10
self.j=20
print("inside base1 constructor")
class Base2:
def __init__(self):
self.x=11
self.y=21
print("inside base2 constructor")
class Derived(Base1,Base2):
def __init__(self... |
JavaScript | UTF-8 | 6,537 | 3.078125 | 3 | [] | no_license | function changeGraph(graphSource) {
var imgagecontainer = document.getElementById("GraphBase");
imgagecontainer.src = graphSource;
document.getElementById("GraphBase").innerHtml = imgagecontainer;
}
// function appendData(data) {
// var mainContainer = document.getElementById("testData");
// for (var i =... |
Go | UTF-8 | 11,218 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | /**
Grom
Copyright 2013 Sergio de Mingo
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
C | UTF-8 | 1,765 | 2.78125 | 3 | [
"MIT"
] | permissive | /*********************************************************************
*
* Montagne Fractale decoupage.h
* -----------------
* 02.01.10
*
* Bertrand CHAZOT
*
*********************************************************************/
#ifndef DECOUPAGE_H
#define DECOUPAGE_H
#include "general.h"
Poi... |
Shell | UTF-8 | 1,609 | 2.703125 | 3 | [] | no_license |
# include global config
source ../_buildscripts/${current_repo}-${_arch}-cfg.conf
pkgname=kamoso
pkgver=${_kdever}
pkgrel=1
pkgdesc="Kamoso is an application to take pictures and videos out of your webcam."
url="https://userbase.kde.org/Kamoso"
arch=('x86_64')
license=('GPL' 'LGPL' 'FDL')
depends=('kconfig' 'kconfigw... |
TypeScript | UTF-8 | 878 | 2.703125 | 3 | [] | no_license | import { IUserState } from './userState'
import { IHandler, IAction } from './../../interfaces/Context'
import { ActionTypes } from './../actionTypes'
const handlers: IHandler = {
[ActionTypes.GET_USERS]: (state: IUserState, action: IAction): IUserState => ({...state, users: action.payload, loading: false}),
[... |
JavaScript | UTF-8 | 3,660 | 2.5625 | 3 | [] | no_license | const { assert } = require('chai');
const News = artifacts.require("News"); // dependencies
// connect smart contract
require('chai') // chai
.use(require('chai-as-promised'))
.should()
contract('News', ([deployer, author, tipper]) => {
l... |
Python | UTF-8 | 225 | 2.796875 | 3 | [] | no_license | import sys
output = open("locus.stripped.txt", 'w')
with open(sys.argv[1]) as file:
i = 0
for line in file:
line = line.split()
if i>0:
output.write(line[1][1:line[1].find(":")]+"\n")
i += 1
print "loci stripped"
|
SQL | UTF-8 | 1,110 | 3.859375 | 4 | [] | no_license | SET PAGESIZE 70;
SET LINESIZE 100;
clear col
TTITLE LEFT ' Zoznam klientov najcastejsie vyuzivajucich bankomaty podla miest';
COLUMN nazov_mesto HEADING 'Mesto' format A20;
COLUMN meno HEADING 'Meno' format A20;
COLUMN priezvisko HEADING 'Priezvisko' format A20;
COLUMN pocet HEADING 'Pocet';
select nazov_mesto, me... |
Markdown | UTF-8 | 1,524 | 2.65625 | 3 | [] | no_license | # hyper-selenium
⚠️ ⚠️ **Go Noob Warning:** This is my first ever Go project. Please expect to see a lot of stupid noobish unidiomatic Go code in here. PRs welcome. ⚠️ ⚠️
## Architecture
<img src="https://docs.google.com/drawings/d/e/2PACX-1vSmoU3tAQIhgiMLSLD0Ut-XUBv41VqJdVbCElUL3bEAusVq3QaoORLnTXQGVsxzqx9X6ejYj29KS... |
Java | UTF-8 | 1,069 | 2.375 | 2 | [] | no_license | package com.example.ismai.projectbase.Models;
public class mdlTourList {
private String bolge;
private String pax;
private String tarih;
private String tur;
private boolean selected;
public mdlTourList(String bolge, String pax, String tarih, String tur) {
this.bolge = bolge;
t... |
Java | UTF-8 | 397 | 2.359375 | 2 | [] | no_license | package lanami.example.springsecurity.app.domain;
import java.io.Serializable;
/**
* @author lanami
* @date 2016-09-06
*/
public enum UserRoleType implements Serializable {
USER("USER"),
MANAGER ("MANAGER"),
ADMIN ("ADMIN");
String value;
private UserRoleType(String value){
this.value... |
Python | UTF-8 | 6,005 | 2.53125 | 3 | [] | no_license | import dash_vtk
import numpy as np
import dash
import dash_html_components as html
try:
# v9 and above
from vtkmodules.util.numpy_support import vtk_to_numpy
from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter
except:
# v8.1.2 and below
print("Can't import vtkmodules. Falling bac... |
PHP | UTF-8 | 4,365 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | <?php
// ===============================
// 自定义扩展函数
// ===============================
/**
* id列表转换成数字
* @param string|array &$ids id列表。比如:1,2,3 或 array('1','2','3')
* @param string $delimiter 当$ids是字符串时,id之间的分隔符
* @return string|array
* @author swh <swh@admpub.com>
*/
function toInt(&$ids, $delimiter =... |
Java | UTF-8 | 419 | 1.890625 | 2 | [] | no_license | package spring_extends.cn.itcast.spring0909.extend;
import org.junit.Test;
import spring_ioc.cn.itcast.spring0909.utils.SpringHelper;
public class PersonTest extends SpringHelper{
static{
path = "maven-ssm-web/src/main/java/spring/spring_extends/cn/itcast/spring0909/extend/applicationContext.xml";
}
@Test
... |
Python | UTF-8 | 1,076 | 2.953125 | 3 | [] | no_license | import threading
import time
class RepeatedTimer(object):
def __init__(self, interval, function, *args, **kwargs):
self._timer = None
self.interval = interval
self.function = function
self.args = args
self.kwargs = kwargs
self.is_running = False
self.wait = ... |
Python | UTF-8 | 2,882 | 2.765625 | 3 | [] | no_license | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
'''Usage: ./plot_corr_dist_by_chr.py correlations_wrn_{}.txt'''
font = {'size' : 18}
plt.rc('font', **font)
file_base = sys.argv[1]
chroms = []
for i in range(1,20):
chroms.append('chr{}'.format(i))
chroms.append('chrX')
co... |
Java | UTF-8 | 400 | 2.59375 | 3 | [] | no_license | package akrnote.core.singleton;
public class SingletonService {
//static 영역 공부하기
private static final SingletonService instance = new SingletonService();
public static SingletonService getInstance(){
return instance;
}
private SingletonService(){
}
public void logic(){
Sys... |
PHP | UTF-8 | 4,385 | 2.546875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Http\Controllers;
use Illuminate\Routing\Controller as BaseController;
use Session;
use User;
use Products;
use LikesProducts;
use Likes;
use Comment;
use DB;
class ProductsController extends BaseController
{
public function products() {
... |
Markdown | UTF-8 | 1,495 | 2.796875 | 3 | [] | no_license | #Portfolio App Code
This is the README for my portfolio app. The screenshots below are only of this app, not of the apps in my portfolio.
You might have reached this page through the actual portfolio website:
<br>http://greggallant.net<br>or<br>http://gallantportfolio.herokuapp.com/<br>
Scroll down to see some addi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.