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 | 29,983 | 2.71875 | 3 | [
"Unlicense"
] | permissive |
import numpy as np
WEIGHT = 1e-4 # critical weight for roulette
CHANCE = 0.1 # Chance of roulette survival
PARTIALREFLECTION = 0 # 1=split photon, 0=statistical reflection.
COSZERO = 1.0 - 1.0e-12 # cosine of about 1e-6 rad
COS90D = 1.0e-6 # cosine of about 1.57 - 1e-6 rad
class Medium:
""... |
C++ | UTF-8 | 659 | 4 | 4 | [] | no_license | /*
* Determine whether an integer is a palindrome.
* An integer is a palindrome when it reads the same backward as forward.
* Without converting the interger to string
*/
#include <iostream>
class Solution {
public:
bool isPalindrome(int x) {
if (x < 0) return false;
int _x = x;
int rev = 0;
while (_x !=... |
Markdown | UTF-8 | 6,584 | 2.515625 | 3 | [] | no_license | ---
author: allen
comments: true
date: 2014-06-30 23:00:00
layout: post
slug: "a-company-made-of-people"
summary: "Apple proves it's human."
title: "A Company Made of People"
categories:
- Article
oldtags:
- Apple
---
<img src='/images/2014/apple-cube.jpg' style='width:250px'>
The worst misconception I see about Appl... |
JavaScript | UTF-8 | 1,682 | 2.6875 | 3 | [] | no_license | import Mecab from 'mecab-async'
import { SourceModel, WordModel } from '../models'
export default class ParseService {
constructor() {
this.mecab = new Mecab()
}
parse(callback, limit = 1000) {
(async () => {
let sources = await SourceModel.findAll({where: {parsed: 0}, limit: limit})
let ... |
Python | UTF-8 | 8,975 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/python
# install via pip: web3, jsonschema
#
# ethInterface.py
# python script that listens for json requests, parses them and interacts with the ethereum blockchain
# to store the delivered via smart contract. Needs contract address, abi and an ethereum (light) node including account with some eth
# works ... |
C# | UTF-8 | 3,754 | 3.09375 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Advent_of_Code_2020.Day7
{
public class Day7 : IDay
{
private static readonly Regex BagRegex = new Regex("^(?<color>.+?)\\sbags\\scontain\\s(?:\\s*(?<amount>\\d+)\\s(?<child>.+?)\\sbags?[,... |
Python | UTF-8 | 22,128 | 2.59375 | 3 | [] | no_license | import os
import numpy as np
import pandas
import HRV_METHODS
import globals
import openpyxl
def flag_match_exec(par, parSIM, lst, col_name): # flag_match(parECG, parSIM, list_of_bpm_flag, 'BPM')
"""
Match the scenario flag
from:simulation data
to:ecg data
--> by time
:pa... |
Java | UTF-8 | 1,727 | 2 | 2 | [] | no_license | package com.qingboat.as.dao;
import com.qingboat.as.entity.ReadonEntity;
import com.qingboat.as.vo.ReadOnVo;
import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper
public interface ReadOnDao {
@Insert("insert into apps_readon (user_id,content_type,content_id,creator_id,height,create_at,updated_at... |
PHP | UTF-8 | 421 | 2.6875 | 3 | [] | no_license | <?php
/**
* User: filway
* Email: filway@126.com
* Date: 2022/5/21
* Time: 00:20
*/
namespace Filway\Component;
trait Singleton
{
private static $instance;
/**
* @param mixed ...$args
* @return static
*/
static function getInstance(...$args)
{
if(!isset(static::$instance)... |
Java | UTF-8 | 4,080 | 2.65625 | 3 | [] | no_license | package com.eyecall.server;
import java.io.IOException;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.eyecall.connection.Connection;
import com.eyecall.connection... |
TypeScript | UTF-8 | 13,187 | 2.515625 | 3 | [] | no_license | import Core from "../../core/Core";
import {CoreConfig} from "../../core/CoreConfig";
import {HookSkill} from "../skill/tickSkill/HookSkill";
import {SpeedUpSkill} from "../skill/tickSkill/SpeedUpSkill";
import {Unit} from "../common/Unit";
import {MoveToSkill} from "../skill/tickSkill/MoveToSkill";
import {BaseTicker}... |
Go | UTF-8 | 1,549 | 3.265625 | 3 | [
"MIT"
] | permissive |
type sum struct {
i, j, val int
}
type MinValHeap []sum
func (a MinValHeap) Len() int { return len(a) }
func (a MinValHeap) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a MinValHeap) Less(i, j int) bool { return a[i].val < a[j].val }
func (a *MinValHeap) Push(v interface{}) {
*a = appe... |
Markdown | UTF-8 | 7,031 | 3.140625 | 3 | [] | no_license | ## Filter
- 테스트 조건을 만족하는 항목들만 배출
> Observavle 변형할때 사용
- Map : 전달받은 이벤트를 다른 값으로 변경
```java
public void doMap() {
observable
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.filter( item -> item.equals("May")?false:true)
.map( it... |
Java | UTF-8 | 208 | 1.625 | 2 | [] | no_license | package in.bananaa.pass.helper.exception;
public class BusinessNoRollbackException extends BusinessException {
private static final long serialVersionUID = 1L;
public BusinessNoRollbackException() {
}
}
|
C++ | UTF-8 | 595 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
int main()
{
cout << "writing to the file" ;
ofstream fout;
ifstream fin;
fout.open("Task 2", ios::out);
int age; char name[15];
cout << "Enter your name: ";
cin >> name;
cout << endl;
cout << "Enter your age: ";
cin >> age; cout << endl;
if (fout) ... |
C++ | UTF-8 | 1,616 | 2.984375 | 3 | [] | no_license | #include <stdio.h>
int main (){
int n;
bool cs = true;
while (cs){
do {
printf("Vui long chon chuc nang:\n");
printf("1.Goi mon an\n");
printf("2.Goi do uong\n");
printf("3.Tinh tien\n");
printf("4.Thoat chuong trinh\n");
scanf("%d",&n);
}while (n>4||n<1);
switch (n){
case 1:
{
... |
Java | UTF-8 | 1,180 | 1.875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2017-2021 original authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
JavaScript | UTF-8 | 5,969 | 2.640625 | 3 | [] | no_license | /**
* loadJSON Ejecuta una llamada asíncrona dependiendo del entorno para obtener el cursoJSON
* @param function callback Función de callback del ajax.
* @return boolean False en caso de que no haya callback.
*/
function loadJSON(callback) {
if (!callback && typeof callback === 'undefined') {
return false;
... |
C++ | UTF-8 | 525 | 2.59375 | 3 | [] | no_license | //
// main.cpp
// boj_n2133
//https://www.acmicpc.net/problem/2133
// Created by Sujin Han on 2018. 6. 15..
// Copyright © 2018년 ddudini. All rights reserved.
//
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
int n;
cin >> n;
int dp[30];
dp[0] = 1;
dp[1] = 0... |
Python | UTF-8 | 934 | 3.03125 | 3 | [] | no_license | #!/usr/bin/python
import sys
import json
import requests
def parse_json(json_object):
parsed_json = json.loads(json_object)
periods = parsed_json['properties']['periods']
count = len(periods)
count -= 1
while count > -1:
#print count
print str(periods[count])
count -= 1
... |
Ruby | UTF-8 | 1,552 | 2.59375 | 3 | [] | no_license | require "thor"
require "yaml"
require "bulk_publisher/version"
class BulkPublisher::Runner < Thor
$0 = "BulkPublisher - #{::BulkPublisher::Version::STRING}"
desc "start", "Run the bulk_publisher"
option :daemonize, type: :boolean, aliases: '-d', desc: "Running as a daemon"
option :message... |
Python | UTF-8 | 1,298 | 2.890625 | 3 | [] | no_license | import pygame
import sys
import src.controllers.views.viewinfo as vi
import src.controllers.entity_handlers as eh
import src.controllers.tile_handlers as th
import src.controllers.gui_handlers as gh
# main game surface
surface = pygame.display.set_mode(
(vi.window_size_in_units[0]*vi.unit_size[0],
vi.window_... |
C++ | GB18030 | 666 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<list>
using namespace std;
void TestListIterator1()
{
int array[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
list<int> l(array, array + sizeof(array) / sizeof(array[0]));
auto it = l.begin();
while (it != l.end())
{
// erase()ִкitָĽڵѱɾitЧһʹitʱȸ丳
l.erase(it);
++it;
}
}
//
void TestList... |
Java | UTF-8 | 1,590 | 2.859375 | 3 | [] | no_license | package language;
import lombok.Getter;
import process.parser.KeywordMatchStrategy;
import process.parser.StringTree;
import util.Token;
import util.Word;
import java.util.*;
public abstract class Language {
@Getter protected Map<Token, List<String>> tokenMap;
@Getter protected Map<Word, String> wordMap;
... |
C++ | UTF-8 | 514 | 3.34375 | 3 | [] | no_license | #ifndef ANIMAL_H // Include guards that prevent redefinition error
#define ANIMAL_H // #ifndef checks if it has been defined and #define begins defining
#include <string>
using namespace std;
// Prototype for animal class
class animal
{
public:
static int count; // Static variable count that counts t... |
JavaScript | UTF-8 | 1,772 | 3.359375 | 3 | [] | no_license | const pegaInput = document.querySelector("input");
const btnCadastrar = document.querySelector('button');
const ul = document.querySelector('ul');
//O que será executado ao clicar no botão cadastrar
function cadastrar(){
if(pegaInput.value){
const textElemento = document.createElement('span');
... |
PHP | UTF-8 | 3,139 | 2.671875 | 3 | [] | no_license | <div class="settingsDiv1">
<div class="settingsDiv2">
<form method="post" enctype="multipart/form-data">
<?php
$settings = new Settings();
$settings = $settings->getSettings($_SESSION['showtime_userid']);
if(is_array($settings)) {
... |
PHP | UTF-8 | 993 | 2.71875 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class Subprograma extends Migration {
/**
* Run the migrations.
* Migracion para crear la tabla subprograma en la base de datos con todos sus atributos con el metodo up
* @return void
*/
public function up()
{... |
Java | UTF-8 | 167 | 1.507813 | 2 | [
"Apache-2.0"
] | permissive | package ga.thesis.hibernate.service;
import ga.thesis.hibernate.entities.StudentList;
public interface StudentListService extends CRUDService<StudentList, Long> {
}
|
Java | UTF-8 | 518 | 1.898438 | 2 | [] | no_license | /*
*
* BaseModel.java
* gogame-android
*
* Created by Alan Keh on 19-1-13 下午8:36
* Copyright (c) 2019 melote. All rights reserved.
* /
*/
package com.phubber.loopback;
import com.strongloop.android.loopback.Model;
import java.io.Serializable;
public class BaseModel extends Model implements Serializabl... |
C | UTF-8 | 354 | 3.359375 | 3 | [] | no_license | #include <stdio.h>
int main(){
int a=10,b=20,c,d;
printf("give me value of c:");
scanf("%d",&c);
d= a+b/c;
printf("d=%d\n",d);
d = a%c + b/d; // if there are operators with euqal precedence
// they are executed fromleft to right
printf("d = %d\n", d);
d = (a+40>c) + (b<=a);
printf("d = %d\n",d);
d = ... |
Java | UTF-8 | 9,240 | 2.75 | 3 | [] | no_license | //// Project 3, Teng Lin 2015/11/4.
Ball c, r, g, b, y;
Buttons reset, rwall, bird, rat;
Bird o, p, q;
////global
float ratx= 40, raty=random(250,350), ratdx=random(2,6);
float cloudx=40, cloudy=30, clouddx=random(1,2) ; // cloud variables
int tableRed=70, tableGreen=240, tableBlue=230; ... |
Java | UTF-8 | 3,861 | 2.296875 | 2 | [
"Apache-2.0"
] | permissive | /*
* Trident - A Multithreaded Server Alternative
* Copyright 2014 The TridentSDK Team
*
* 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.... |
Java | UTF-8 | 1,052 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright (C) 2015 Jack Jiang(cngeeker.com) The DroidUIBuilder Project.
* All rights reserved.
* Project URL:https://github.com/JackJiang2011/DroidUIBuilder
* Version 1.0
*
* Jack Jiang PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
* FloatProperty.java at 2015-2-6 16:12:03, original versi... |
Java | UTF-8 | 1,748 | 2.71875 | 3 | [] | no_license | package ch11.FromTextBookDemo;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.FlowPane;
import jav... |
JavaScript | UTF-8 | 5,207 | 2.546875 | 3 | [] | no_license | import multiparty from 'multiparty';
import path from 'path';
import fse from 'fs-extra';
const extractExt = fileName => fileName.slice(fileName.lastIndexOf('.'), fileName.length); // 提取后缀名
const UPLOAD_DIR = path.resolve(__dirname, '..', 'target'); // 大文件存储目录
// 返回已经上传切片名
const createUploadedList = async fileHash =>... |
PHP | UTF-8 | 919 | 2.703125 | 3 | [] | no_license | <?php
include_once("addAnimal.php");
$location ="pictures/";
$target_file=$location.basename($_FILES["fileToUpload"]["name"]);
$success=1;
$fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
if(isset($_POST["submit"])) {
if (hash_equals($_SESSION['token'], $_POST['token'])) {
if($fileType !="jpg"){
... |
Ruby | UTF-8 | 2,038 | 2.65625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | #
# DNA Shipistrano
#
# = Htaccess
#
# Provides ways of adjusting the .htaccess file
#
# == Variables
#
# - *auth_user* username for basic auth
# - *auth_pass* password for basic auth
# - *auth_folder* folder to protect auth
#
# == Tasks
#
# - *htaccess:auth:protect* add a htpasswd protection to the server.
# - *htacce... |
Java | UTF-8 | 789 | 3.015625 | 3 | [] | no_license | package com.example.demo.chap05_책임할당하기_영화예매;
import java.time.DayOfWeek;
import java.time.LocalDateTime;
import java.time.LocalTime;
public class PeriodCondition implements DiscountCondition {
private DayOfWeek dayOfWeek;
private LocalTime startTime;
private LocalTime endTime;
public PeriodCondition(DayOfWeek... |
Shell | UTF-8 | 1,683 | 2.8125 | 3 | [
"MIT"
] | permissive | echo "Using Docker"
# If a value is not set here a default will be assigned.
# MariaDB Connection Information
unset MARIADB_USER
unset MARIADB_PWD
export MARIADB_HOST=MARIA10-01
unset MARIADB_PORT
unset MARIADB_DBNAME
# Generic SQL Server Connection Information
unset MSSQL_USER
unset MSSQL_PWD
export MSSQL_HOST=MSSQL19... |
C | UTF-8 | 430 | 3.21875 | 3 | [] | no_license | //
// Created by saud1 on 12-09-2020.
//
#include <stdio.h>
#include "Stack.h"
int main(){
Stack * s;
int max,i;
printf("Stack size?:");
scanf("%d",&max);
s=createStack(max);
if(!s)return 1;
if(isempty(s))return 2;
for(i=0;i<max;i++)
push(s,i);
if(!isempty(s))return 3;
w... |
PHP | UTF-8 | 1,416 | 2.765625 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Phone extends Model
{
const TYPE_HOME = 'home';
const TYPE_WORK = 'work';
const TYPE_MOBILE = 'mobile';
/**
* The model's default values for attributes.
*
* @var array
*/
protected $attributes = [
... |
C# | UTF-8 | 4,367 | 2.515625 | 3 | [] | no_license | using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TriangleNet.Geometry;
public class GeneratePaths : MonoBehaviour
{
public float PathMultiplier = 1f; //How many paths should be removed after spanning path is found?
public bool superLink;
MapGenerator2 MapGen;
List<F... |
JavaScript | UTF-8 | 4,777 | 2.796875 | 3 | [
"MIT"
] | permissive | $(function() {
var img_urls = ["img/deer.png", "img/dolphin.png", "img/kangaroo.png", "img/leopard.png", "img/panther.png", "img/penguin.png", "img/rabbit.png", "img/sheep.png", "img/swan.png", "img/wolf.png", "img/zebra.png", "img/duck.png", "img/deer.png", "img/dolphin.png", "img/kangaroo.png", "img/leopard.pn... |
TypeScript | UTF-8 | 743 | 2.546875 | 3 | [] | no_license | import {Transformer} from './compile';
declare var require;
let closure:((string)=>{compiledCode:string})|null|undefined = undefined;
export class OptimizeUtil {
static closure(flags:any = {}):Transformer|null {
if (closure === undefined) {
try {
closure = require('google-closure-compiler-js').c... |
Java | UTF-8 | 20,690 | 2.09375 | 2 | [
"Apache-2.0",
"AGPL-3.0-or-later",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /* ******************************************************************************
* Copyright (c) 2022 Konduit K.K.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unle... |
Python | UTF-8 | 2,664 | 2.8125 | 3 | [] | no_license | import random
class Display(object):
def __init__(self, settings, screen):
self.settings = settings
self.screen = screen
self.place = self.map = self.origin_map = None
self.reset_data()
self.map_flag = False
def reset_data(self):
self.place = list()
s... |
Java | UTF-8 | 3,545 | 3.25 | 3 | [] | no_license | import java.util.ArrayList;
import java.util.Iterator;
public class FuzzySet extends ListSet {
ArrayList<Float> degreeValue;
public FuzzySet ()
{
super();
degreeValue = new ArrayList<Float>();
}
public FuzzySet (int values[] , ArrayList<Float> degree)
{
super(values);... |
PHP | UTF-8 | 5,367 | 2.859375 | 3 | [
"MIT"
] | permissive | <?php
declare(strict_types=1);
/**
* This file is part of the server-status package.
*
* (c) Roberto Martin <rmh.dev@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace ServerStatus\Tests\Domain\Model\Common\Date... |
TypeScript | UTF-8 | 3,532 | 2.796875 | 3 | [] | no_license | import logger from 'logger'
import WebSocket from 'ws'
import Connection from './connection'
const BASE_URL = 'wss://ws.cobinhood.com/v2/ws'
const PING_INTERVAL = 1000 * 20
const HEARTBEAT_INTERVAL = 1000 * 30
export namespace CobinhoodConnectionTypes {
type OrderBookEntry = [string, string, string]
export type ... |
C++ | UTF-8 | 337 | 2.65625 | 3 | [] | no_license | #ifndef OUTPUT_H
#define OUTPUT_H
#include <string>
class Model;
#include "model.h"
#include <thread>
class Output
{
public:
Output();
virtual ~Output(){}
virtual void print()=0;
auto getModel(){
return model;
}
std::thread mThread;
protected:
Model*model;
size_t count;
};
#e... |
Python | UTF-8 | 1,611 | 2.796875 | 3 | [
"MIT"
] | permissive | import util as util
import torch
import unittest
class TestUtil(unittest.TestCase):
def test_masked_max(self):
hiddens = torch.tensor([[[3, 3, 3, 3], [2, 2, 2, 7], [8, 8, 8, 8]],
[[1, 1, 17, 1], [9, 9, 9, 9], [11, 1, 11, 11]]])
lengths = torch.LongTensor([2, 3])
... |
Python | UTF-8 | 335 | 2.8125 | 3 | [] | no_license | from shapes import Paper , Rectangle
paper = Paper()
rect = Rectangle()
rect.set_color('yellow')
rect.set_height(50)
rect.set_width(150)
rect.draw()
rect.set_x(0)
rect.set_y(0)
rect2 = Rectangle()
rect2.set_color('blue')
rect2.set_height(10)
rect2.set_width(10)
rect2.draw()
rect2.set_x(150)
rect2.set_y(200)
pape... |
Java | UTF-8 | 3,052 | 1.679688 | 2 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2014-2015 by Cloudsoft Corporation Limited
*
* 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 applic... |
Java | UTF-8 | 2,524 | 2.09375 | 2 | [] | no_license | package com.example.javapwpb;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
Ed... |
Java | UTF-8 | 5,499 | 2.109375 | 2 | [] | no_license | package com.finki.mobilniproekt;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
impo... |
TypeScript | UTF-8 | 1,260 | 3.265625 | 3 | [
"MIT"
] | permissive | module lazyness {
function lazyFind<T>(arr: T[], filter: (i: T) => boolean): T {
let hero: T | null = null;
const proxy = new Proxy(
{},
{
get: (obj, prop) => {
console.log("Filtering...");
if (!hero) {
... |
JavaScript | UTF-8 | 1,666 | 2.5625 | 3 | [] | no_license | const mysql = require('mysql2/promise');
const pool = mysql.createPool({
host: 'localhost',
port: 3306,
user: 'admin',
password: 'hello',
database: 'es_starter'
}); //maybe should be const options
const connection = pool;
class User {
constructor(username, hash, salt) {
//this.user... |
C# | UTF-8 | 1,209 | 2.828125 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace CodeNameTwang.Views
{
public class MenuItem:INotifyPropertyChanged
{
... |
Java | UTF-8 | 381 | 1.976563 | 2 | [] | no_license | package mx.ssmxli.food.repository;
import mx.ssmxli.food.entity.Recibo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.io.Serializable;
@Repository("reciboRepository")
public interface ReciboRepository extends JpaRepository<Recibo, Serializ... |
Python | UTF-8 | 11,666 | 3.40625 | 3 | [
"MIT"
] | permissive | from enum import Enum
class LaserPathType(Enum):
hit = "hit"
bounce = "bounce"
through = "pass"
# destroy = "destroy"
class MoveType(Enum):
rotate = "ROTATE"
move = "MOVE"
swap = "SWAP"
class TeamColor(Enum):
red = "red"
silver = "silver"
blank = "blank"
@staticmethod
... |
Python | UTF-8 | 191 | 3.296875 | 3 | [] | no_license | a = [0,1]
a.append(3)
a.append(4)
for loopStart in a :
print(loopStart)
myMap = {7 :"Hola" 8:"Adios"}
for element in myMap
print("key" + str(element)+ "value"+ str(myMap))
|
Markdown | UTF-8 | 2,898 | 3.171875 | 3 | [
"MIT"
] | permissive | # Live code coverage
[](https://travis-ci.org/matthiasnoback/live-code-coverage)
This library should help you generate code coverage reports on a live server (it doesn't have to be a production server of course).
Install this l... |
Markdown | UTF-8 | 1,212 | 2.65625 | 3 | [] | no_license | ---
title: Glacier Connector FAQ
---
Here are the answers to some frequently asked questions.
## Why can't I create an **Archive** or **Restore** rule in a Records Management site?
The **Archive** or **Restore** rule isn't available on a folder when creating a rule on a Records Management site. To move declared reco... |
SQL | UTF-8 | 402 | 4.03125 | 4 | [] | no_license | SELECT de.emp_no, dm.emp_no manager_no, s1.salary emp_salary, s2.salary manager_salary
FROM dept_emp de
INNER JOIN dept_manager dm
ON de.dept_no = dm.dept_no
INNER JOIN salaries s1
ON de.emp_no = s1.emp_no
INNER JOIN salaries s2
ON dm.emp_no = s2.emp_no
WHERE s1.salary > s2.salary
AND de.to_date = '9999-01-01'
AND dm.t... |
Python | UTF-8 | 1,302 | 2.640625 | 3 | [] | no_license | import pandas as pd
import streamlit as st
import numpy as np
from pandas import DataFrame
from pmdarima import auto_arima
def AutoARIMA(df, type, split):
data = df.sort_index(ascending=True, axis=0)
train = data[:split]
valid = data[split:]
training = train[type]
validation = valid[... |
Ruby | UTF-8 | 1,322 | 2.890625 | 3 | [] | no_license | require_relative 'base_scrapper'
require 'nokogiri'
require 'open-uri'
require_relative 'table'
require_relative 'github_worker'
require_relative 'does_not_include'
class GithubRepoScrapper < BaseScrapper
attr_accessor :user_list, :table
def initialize(user_list, workers_count = 3)
super workers_count
se... |
C# | UTF-8 | 1,984 | 2.734375 | 3 | [] | no_license | using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using Zapchastulkin.Models;
namespace Zapchastulkin.Controllers
{
[ApiController]
[Route("api/units")]
public class UnitController : Controller
{
ApplicationCont... |
Shell | UTF-8 | 361 | 3.640625 | 4 | [] | no_license | #!/bin/bash
set -e
CURRENT_DIR=$(cd $(dirname $0) ; pwd)
SRC_FILE="$1"
TARGET_FILE="$2"
if [ -e "$TARGET_FILE" ] || [ -L "$TARGET_FILE" ] ; then
echo "Backing up $TARGET_FILE"
mv "$TARGET_FILE" "$TARGET_FILE.$(date '+%Y-%m-%d-%H:%M:%S').backup"
fi
echo "$SRC_FILE -> $TARGET_FILE"
mkdir -p "$(dirname $TARGET... |
Java | UTF-8 | 14,185 | 2.6875 | 3 | [] | no_license | package courtreferences.model;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import courtreferences.southafrica.SouthAfricanCourtDocument;
public class CaseDetailsMo... |
Python | UTF-8 | 2,013 | 2.796875 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python3
# Echo server program
import socket
import logging
import json
logging.basicConfig(level=logging.INFO)
class SpringConnector(object):
def __init__(self, host, port):
self.host = host
self.port = port
self.callbacks = {}
def register(self, name, callback):
if... |
Python | UTF-8 | 1,563 | 3.03125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | # -*- coding: utf-8 -*-
"""A simple processor that does simple image transforms, e.g. color transform or transferring an image to a GPU
"""
import cv2
from .base import *
class ImageTransform(ProcessorBase):
"""Class implementing simple image transforms
"""
def __init__(self, vision, ocl=False, color=... |
Java | UTF-8 | 1,221 | 3.0625 | 3 | [] | no_license | package com.amao.Ademo_kp;
public class Summary {
/*
- 能够知道private关键字的特点
可以修饰成员变量和成员方法,被private修饰的成员变量或者成员方法只能在本类中访问
- 能够知道this关键字的作用
this关键字可以用来区别同名的成员变量和成员方法
格式: this.成员变量名
- 能够知道构造方法的格式和注意事项
public 类名(){}
public 类名(形参列表){}
注意:
1.构造方法没有返回值类型,连void都不能写
2.构造方法的方法名一定是类名
3.构... |
JavaScript | UTF-8 | 1,041 | 2.703125 | 3 | [] | no_license | const request = require('request');
const {apiKeys} = require('./../apikeys');
let geocodeAddress = (address, callback) => {
if (address) {
const apiKey = apiKeys.geocode;
let encodedAddress = encodeURIComponent(address);
request({
url: `https://maps.googleapis.com/maps/api/geocode/json?address=$... |
Python | UTF-8 | 5,130 | 3.5 | 4 | [] | no_license | #---------------------------------------------------------------
# HASH TABLE
#---------------------------------------------------------------
# V0
class Node:
def __init__(self, key, value):
self.key = key
self.value = value
class HashTable:
def __init__(self, init_size, hash=hash):
... |
C | UTF-8 | 2,930 | 2.515625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* loop.c :+: :+: :+: ... |
Python | UTF-8 | 1,346 | 2.6875 | 3 | [] | no_license | import pygame
class Utils:
#Class attributes (static)
init_pos_x = 100
init_pos_y = 570# 410
enemy_init_pos_x = init_pos_x+100
enemy_init_pos_y = init_pos_y
screen_width = 990 #500
screen_height = 675 #480
charact_width = 40
charact_height = 60
enemy_width = 64
enemy_height ... |
Java | UTF-8 | 1,546 | 2.171875 | 2 | [] | no_license | package com.cg.flight.web;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.ann... |
C++ | UTF-8 | 5,196 | 2.578125 | 3 | [
"MIT"
] | permissive | #include "GLDepthTesting.h"
GLDepthTesting::GLDepthTesting(QWidget *parent)
: QOpenGLWidget(parent)
{
}
GLDepthTesting::~GLDepthTesting()
{
//initializeGL在显示时才调用,释放未初始化的会异常
if(!isValid())
return;
//QOpenGLWidget
//三个虚函数不需要makeCurrent,对应的操作已由框架完成
//但是释放时需要设置当前上下文
makeCurrent();
... |
C++ | UTF-8 | 1,729 | 3.28125 | 3 | [] | no_license | #ifndef lesson3LogicConstnessAndBitwise_h
#define lesson3LogicConstnessAndBitwise_h
/*
Logic Constness: do not change variable that you think is import
如果const function改变了一些次要的varible,
两个方法解决:
1. mutable int a; 在次要的variable 加mutable
2. const_cast<BigArray*>(this)->accessCounter++; 不提倡,cast constness
const ... |
JavaScript | UTF-8 | 1,804 | 2.828125 | 3 | [] | no_license | 'use strict'
async function getTasks() {
const URL = 'https://7wc.zhehaizhang.com/task/get/275707420595191808'
const Params = {
headers: {
'x-access-token': '7wc-zhehai',
'Content-Type': 'application/json'
},
method: 'GET'
}
return await fetch(URL, Params)
.then(res => r... |
PHP | UTF-8 | 9,789 | 2.515625 | 3 | [] | no_license | <?php
//Se incluye el modelo donde conectará el controlador.
require_once '../Modelo/alumno.php';
require_once '../Modelo/seguimiento.php';
require_once '../Modelo/profesor.php';
require_once '../Modelo/tutoria.php';
require_once '../Modelo/usuario.php';
require_once '../Modelo/database.php';
require_once '../Modelo/co... |
Python | UTF-8 | 1,645 | 2.609375 | 3 | [] | no_license | from terio.async import AsyncIO
import logging
import ds18b20
from config import config
import subprocess
class TempSensorsManager():
QUEUE_CHECK_PERIOD = 0.2 # seconds
def __init__(self):
self.log = logging.getLogger('TEMP_T')
self.bus = ds18b20.DS18B20()
self.asyncIO = AsyncIO(self.Q... |
JavaScript | UTF-8 | 223 | 2.84375 | 3 | [] | no_license | const url = location.pathname;
const nav = document.querySelectorAll('a');
nav.forEach((link) => {
const href = link.href.match(/(\/\w*.html?)+/g)[0];
if (url.indexOf(href) >= 0) {
link.className = 'active';
}
}); |
SQL | UTF-8 | 1,068 | 2.859375 | 3 | [] | no_license | .mode columns
.header on
.nullvalue NULL
PRAGMA foreign_keys = ON;
.print ''
.print '<<<Estado atual de Viagem>>>'
.print ''
SELECT id , lugares_ocupados
FROM viagem
WHERE id = 1;
.print ''
.print '<<<Apos criacao de LocalParagem -> dispara gatilho que incrementa o número de lugares ocupados de Viagem>>>'
.print ''... |
Java | UTF-8 | 7,377 | 2.0625 | 2 | [] | no_license | package com.taugame.tau.server;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import java.util.logging.Logger;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.h... |
PHP | UTF-8 | 671 | 2.75 | 3 | [
"MIT"
] | permissive | <?php
use Illuminate\Database\Seeder;
use Carbon\Carbon;
class RoomsTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$rooms = [
'Carlo corinto' => 'Sala de juntas para 10 personas.',
'Moschino' => 'Sala de junt... |
PHP | UTF-8 | 3,233 | 2.796875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Services;
/**
* Class NTLMRequestService
* @package App\Services
*/
class NTLMRequestService
{
/**
* @var string
*/
private const USER_AGENT = 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.... |
Markdown | UTF-8 | 8,442 | 2.71875 | 3 | [
"MIT"
] | permissive | ---
layout: post
title: freertos学习
subtitle:
date: 2017-03-04
author: 高庆东
header-img: img/ceshi.jpg
catalog: true
tags:
- c语言
- 操作系统
- 进程
- 任务
- 中断
---
# Freertos操作系统学习
## 任务关系
有点类似ucos 但是涉及到api函数 需要理解创建任务的api都有神马功能
创建任务函数完成任务的创建 任务函数完成具体的任务
任务函数必须返回void 而且带有一个void指针参数... |
Java | UTF-8 | 952 | 1.851563 | 2 | [] | no_license | package com.cartmatic.estore.common.model.content;
import com.cartmatic.estore.core.model.BaseObject;
public class IndexMsg extends BaseObject
{
private Integer id;
private String msg;
private Integer status;
private String url;
public Integer getId() {
return id;
}
public void setId(Integer id) {
... |
Markdown | UTF-8 | 4,779 | 2.53125 | 3 | [
"MIT"
] | permissive | # SeisNoise.jl :sound: :earth_americas:
SeisNoise.jl is designed for fast and easy ambient noise cross-correlation on the CPU and GPU in Julia.
| **Documentation** | **Build Status** | **Coverage** | **Chat** |
|:---------------------------------------:|:---------------------------... |
Java | UTF-8 | 988 | 2.46875 | 2 | [] | no_license | package com.mewin.stc.state;
import com.mewin.stc.game.Unit;
import com.mewin.util.CameraUtil;
import com.mewin.util.GameUtil;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
/**
*
* @author mewin<mewin001@hotmail.de>
*/
public abstract cla... |
C++ | BIG5 | 511 | 3.28125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int A,B,C;
cout << "пJAȡH";
cin >> A;
cout << "пJBȡH";
cin >> B;
cout << "пJCȡH";
cin >> C;
if (A > B) {
if (A > C) {
cout << "A=" << A <<"̤j" << endl;
} else {
cout << "C=" << C <<"̤j" << endl;
}
}else {
if ... |
Python | UTF-8 | 570 | 2.65625 | 3 | [] | no_license | from flask import Flask
from flask import redirect
from flask import url_for
app=Flask(__name__)
@app.route("/")
def index():
return "hello"
@app.route("/index02/<user>")
def index2(user):
return "hello222%s"%user
@app.route("/redirect01",methods=["get","put"])
def redirect1():
return redirect("https://w... |
Shell | UTF-8 | 364 | 2.734375 | 3 | [] | no_license | # tasks/init.sh
function btask.init.run() {
local file="$(dirname $(readlink -f $(which xp)))/etc/xp.completion.bash"
if [ -n "$file" ]; then
if [ -e "$file" ]; then
cat $file
else
b.raise FileNotFoundException
fi
else
b.raise StringIsNullException
... |
Shell | UTF-8 | 867 | 2.890625 | 3 | [] | no_license | #!/usr/bin/env bash
scriptDir=$(dirname `realpath -P "$0"`)
# Generate hotkey file
export WM_NAME="${1}"
"${scriptDir}"/hotkeys
# Change desktop theme
"${scriptDir}"/theme 'y'
[[ ! $(pgrep 'sxhkd') ]] && ("${scriptDir}"/xwait sxhkd -c ~/.config/sxhkd/sxhkdrc) &
[[ ! $(pgrep 'dunst') ]] && ("${scriptDir}"/xwait duns... |
JavaScript | UTF-8 | 2,946 | 2.71875 | 3 | [] | no_license | const chai = require('chai');
const supertest = require('supertest');
const expect = require('chai').expect;
const api = supertest('http://107.170.223.162:1337/api');
const nonexistantID = 1234567890123456;
const dummyID = null;
const dummyProductionID = null;
describe('Users:', () => {
it('a GET/ should return a ... |
Java | UTF-8 | 14,094 | 2.265625 | 2 | [] | no_license | package com.oldhigh.customchildlayout.ui;
import android.content.ClipData;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
import android.support.v4.content.Conte... |
Java | UTF-8 | 460 | 2.375 | 2 | [] | no_license | package com.razil.noteit.util;
import org.junit.Test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
public class ValidatorTest {
@Test
public void isNullOrEmpty_returnsTrue() {
String str = "";
assertThat(Validator.isNullOrEmpty(str), is(true));
}
@Test
pu... |
Java | UTF-8 | 1,229 | 2.046875 | 2 | [] | no_license | package com.ai.opt.sol.business.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ai.opt.sol.api.apisol.param.APISolServiceDesignInput;
import com.ai.opt.sol.business.in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.