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 |
|---|---|---|---|---|---|---|---|
Markdown | UTF-8 | 1,992 | 3.25 | 3 | [] | no_license | # 新的一年,祝你简单勇敢
春节一个人过,头两天的确感觉比较孤单,但是一打游戏就忘了孤单,利用低成本的娱乐设施,缓解对抗世俗的痛苦,可以说是非常高效的了。这么做的后果就是,产生了负罪感,因为每次放假还都带回去一堆书的。但是负罪感没有像以前那么重了,因为我现在能够接纳自己了,真是一个很大的进步。我厌恶喧嚣,厌恶仪式,曾经也试图妥协,可是无奈自己骗不了自己。
我已经三十一岁了,可以说才刚刚看到了人格独立之后的自己。我不再花心思去讨好别人,所以别人对我的看法不如以前了,可是我觉得自己走对了路。三个月的时间,学了python,学了神经网络,学了GUI编程,最重要的是,学会了坚持自己。当然,人格的独立也不是那么简单就能够做到。比如,我还会... |
Java | UTF-8 | 716 | 2.09375 | 2 | [] | no_license | package com.rianta9.dao.impl;
import java.util.List;
import com.rianta9.dao.ICommentDAO;
import com.rianta9.model.CommentModel;
public class CommentDAO implements ICommentDAO{
@Override
public List<CommentModel> getAll() {
// TODO Auto-generated method stub
return null;
}
@Override
public long insert(Comm... |
Shell | UTF-8 | 277 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #! /bin/bash
set -e
pushd $( dirname $0 )
dotnet publish ../ --configuration Release
docker-compose rm -f
docker-compose -p ci up --build --force-recreate -d
docker container ls
exitCode=$(docker wait test)
docker logs -f test
docker-compose stop -t 1
popd
exit $exitCode
|
C++ | UTF-8 | 461 | 3.1875 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int FindtheDuplicateNumber(vector<int>&nums){
int fast=0,slow=0;
do{
fast=nums[nums[fast]];
slow=nums[slow];
}while(fast!=slow);
slow=0;
while(slow!=fast){
slow=nums[slow];
fast=nums[fast];
}
return slow... |
C | UTF-8 | 5,292 | 3.296875 | 3 | [] | no_license | //#include "uarray2.h"
#include "array.h"
#include "mem.h"
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#define T UArray2b_T
typedef struct T *T;
struct T{
int height; //rows
int width; //cols
int blocksize;
int size;
Array_T uarrayb;
};
extern T UArray2b_new (int width, int height, in... |
TypeScript | UTF-8 | 396 | 2.921875 | 3 | [] | no_license | export const getYear = (date: string): string => {
let year = '';
if (date !== '') {
let newDate = new Date(date);
year = newDate.getFullYear().toString();
}
return year;
};
export const convertTime = (time: number): string => {
let hours = Math.floor(time / 60);
let minutes = time % 60;
let conv... |
JavaScript | UTF-8 | 1,279 | 2.828125 | 3 | [] | no_license | // this handles some scripts to update data on the server
var hackerApp = {
server: app.server,
queryResults: {},
msgFilter: function() { return true; }
};
hackerApp.geMessages = function() {
const qurl = app.server + '?order=-createdAt';
$.ajax({url: qurl, type: 'GET', success: (data)=>queryResults = data... |
PHP | UTF-8 | 1,405 | 2.6875 | 3 | [
"MIT"
] | permissive | <?php
namespace App\Business\Utils\Sms\Zwj;
use App\Business\Utils\Unique;
use App\Business\Utils\Util;
use Illuminate\Support\Facades\Log;
/**
* 假装某个发送短信的渠道
*/
class Zhu
{
public $tempId = '1'; // 默认的短信模板
/**
* 发送短信
*
* @param $tel
* @param $params
* @param string $tempId
... |
Python | UTF-8 | 1,463 | 3.828125 | 4 | [] | no_license | def count_compression(string):
string += '~'
previous_letter = string[0]
compression_list = []
consecutive_letters = 0
for char in string:
if previous_letter == char:
consecutive_letters += 1
else:
compression_list.append((previous_letter, consecutive_letters))
consecutive_letters = ... |
JavaScript | UTF-8 | 890 | 3.265625 | 3 | [] | no_license | // alert('hi')
// structure de base IF
if (true) {
// code
}
var nb1 = 10;
if (nb1 < 50){
console.log("nb1 est inférieur à 50");
}
//---------------------
if (true) {
// code si vrai
} else {
// code si faux
}
if (nb1 > 50) {
console.log("nb1 est bien supérieur à 50");
... |
C++ | UTF-8 | 697 | 3.125 | 3 | [] | no_license | #include "StdAfx.h"
#include "Kernel.h"
#include <math.h>
void Kernel::calcKernel(int half_x, int half_y)
{
double euclideanDistance;
for( int x = -half_x; x<half_x; x++ )
for( int y = -half_y; y<half_y; y++ )
{
euclideanDistance = getKernelAt(x, y, half_x, half_y);
m_pKlArr[x+half_x][y+half_y] = euclidean... |
C | UTF-8 | 195 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
int main(int argc, char const *argv[])
{
int k;
float m;
printf("enter value in kmph:\n");
scanf("%d", &k);
m=0.278 * k;
printf("value in m/s is:%f\n", m );
return 0;
} |
Python | UTF-8 | 1,497 | 2.515625 | 3 | [] | no_license | import pandas as pd
import spacy
from tqdm import tqdm
train_p = 'data/snli_1.0/snli_1.0_train.txt'
dev_p = 'data/snli_1.0/snli_1.0_dev.txt'
test_p= 'data/snli_1.0/snli_1.0_test.txt'
train_df = pd.read_csv(train_p, sep='\t', keep_default_na=False)
dev_df = pd.read_csv(dev_p, sep='\t', keep_default_na=False)
test_df =... |
PHP | UTF-8 | 1,995 | 2.921875 | 3 | [] | no_license | <?php
class venda{
private $cod_venda;
private $forma_pagamento;
private $qtd_parcela;
private $obs;
private $data;
private $cliente;
private $produto;
private $funcionario;
public function __construct() {
$n_args = (int) func_num_args();
$args = @func_get_arg();
i... |
C | UTF-8 | 524 | 4.21875 | 4 | [] | no_license | //Seção 08 - Exercício 03
/*Faça um programa que carregue um vetor com dez números inteiros.
Mostre o vetor na ordem inversa a que foi digitado.*/
#include <stdio.h>
int main(){
//variável
int vetor[10];
//entradas
for(int i = 0; i <10; i++){ //vetor[10] = 0,1,2...9
printf("Informe um valor inteiro para o ... |
Java | UTF-8 | 3,960 | 2.375 | 2 | [
"Apache-2.0"
] | permissive | package com.github.wtiger001.brigade.general;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
public class BrigadeGeneralConfiguration {
public static final String MESOS_MASTER = "MESOS_MASTER";
public ... |
Markdown | UTF-8 | 1,955 | 2.625 | 3 | [] | no_license | #### 本文诞生的起因
1. 在使用 egg 之后,首先大家都知道它是基于 koa 封装的一个企业级应用 web 框架,那么到底它是如何封装、如何启动、如何集群部署、如何停止多线程服务的呢
2. 在蚂蚁金服的面试中也多次问到我是否看过 egg-core 的源码(我当时没看),这也侧面让我明白到其在内部的地位,因为我们都知道 egg 是在阿里内部经过大量实践后才经过处理后开源出来的,所以在这之后我花了一些时间去消化 egg-core 的源码,然后知道了 egg 跑起来是如何做环境区分的、如何根据环境变量去做配置、插件、全局中间件(在插件中判断)注入应用的,插件是如何作为一个单独应用被注入等
3. 随后我发现在自己粗略分析的过程中其实... |
Java | UTF-8 | 821 | 2.96875 | 3 | [] | no_license | package io.zipcoder.polymorphism;
import io.zipcoder.pets.Cat;
import io.zipcoder.pets.Pet;
import org.junit.Assert;
import org.junit.Test;
public class CatTest {
@Test
public void catInstanceOfTest(){
Cat cat= new Cat("Ay");
Assert.assertTrue(cat instanceof Pet);
}
@Test
public vo... |
Java | UTF-8 | 753 | 1.867188 | 2 | [] | no_license | package cn.eeepay.framework.daoSuperbank;
import org.apache.ibatis.annotations.Insert;
import cn.eeepay.framework.model.CreditloanEnterData;
public interface CreditloanEnterDataDao {
/**新增数据分析记录*/
@Insert("insert into creditloan_enter_data" +
"(analysis_code,login_source,business_source,credit_bank,loan_sour... |
PHP | UTF-8 | 530 | 3.015625 | 3 | [] | no_license | <?php
$name = 'Женя';
$age = 29;
date_default_timezone_set('Europe/Moscow');
$date = date('d-m-y H:i');
$string = 'Меня зовут $name.'
. '<br>'
. 'Через год мне будет '
. ($age + 1)
. ' лет, а еще через год '
. ($age + 2)
. ' год.'
. '<br>'
. 'На моих часах сейчас: '
. $date
. '... |
Markdown | UTF-8 | 3,097 | 2.71875 | 3 | [] | no_license | +++
categories = ["personal"]
tags = ["misc"]
date = "2016-06-02T18:43:22-07:00"
title = "Big Pitch - Mild Depression"
+++
I make a bid to change the job I have into the job I want, with luke-warm result.
<!--more-->
<hr/><br/>
It seems, for whatever reason, the people I work with don't want me to leave.
Lucky for th... |
Python | UTF-8 | 372 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | from TrainingController.TrainingController import TrainingController
class MaxIterations(TrainingController):
def __init__(self, max_iterations):
self.max_iterations = max_iterations
def after_training_iteration(self, trainable):
'''Stop training if epochs is greater than max_iterations'''
... |
Swift | UTF-8 | 4,274 | 2.546875 | 3 | [] | no_license | //
// RecipeDetailViewModel.swift
// recipeApp
//
// Created by Maggie Williams on 11/6/19.
// Copyright © 2019 CMU. All rights reserved.
//
import Foundation
import CoreData
import UIKit
class RecipeDetailViewModel {
let client = GetRecipeDetailClient()
var recipeDetail: RecipeDetail?
var recipeID: Int... |
JavaScript | UTF-8 | 1,665 | 3.875 | 4 | [] | no_license | // (c) Enroute 2018
//
// Prepared by AMG
//
// FOR LOOP
for (let i = 0; i <= 10; i++) {
if (i === 5) {
console.log("We are just in the middle");
continue;
}
console.log(i);
}
startTime = new Date().getTime();
//console.log(startTime);
// FOR LOOP - Break & Continue
for (let i = 0; i < 100; i++) {... |
Java | UTF-8 | 2,388 | 3.0625 | 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 pecl1;
import java.util.List;
import java.util.ArrayList;
import java.util.concurrent.Semaphore;
import javax.swing.... |
C++ | UTF-8 | 4,447 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
* DbgTraceContext.cpp
*
* Created on: 14.04.2015
* Author: aschoepfer
*/
#include "DbgTraceContext.h"
#include "DbgTracePort.h"
#include "DbgTraceOut.h"
#include <string.h>
DbgTrace_Context* DbgTrace_Context::s_context = 0;
DbgTrace_Context::DbgTrace_Context(DbgCli_Topic* cliParentNode)
: m_contextDbgT... |
Rust | UTF-8 | 4,546 | 3.328125 | 3 | [] | no_license | use crate::random::{random, random_min_max};
use crate::vector::dot;
use std::f32::consts::PI;
use std::ops;
#[derive(Debug, Clone, Copy, Default, PartialEq)]
pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
impl Vec3 {
pub fn new(x: f32, y: f32, z: f32) -> Self {
Vec3 { x, y, z }
}... |
Java | UTF-8 | 311 | 1.640625 | 2 | [
"BSD-3-Clause"
] | permissive | package org.firstinspires.ftc.teamcode.control;
public class Stages {
interface basicStage {
String name();
boolean finishState();
void startFunction();
void mainFunction();
void endFunction();
StageStartVars AUTO_START_VARS = new StageStartVars();
}
}
|
Java | UTF-8 | 308 | 1.851563 | 2 | [] | no_license | package com.topvision.ems.epon.fault.helper;
/**
* 上联口 转换 辅助类
*
* @author w1992wishes
* @created @2018年1月18日-下午4:40:10
*
*/
public interface PortConvertHelper {
Integer convertPort(Long entityId, Integer port);
Integer convertSlot(Long entityId, Integer slot);
}
|
C++ | UTF-8 | 3,177 | 3.703125 | 4 | [] | no_license | // 103. Binary Tree Zigzag Level Order Traversal
// Given the root of a binary tree, return the zigzag level order traversal of
// its nodes' values. (i.e., from left to right, then right to left for the next level
// and alternate between).
// Explanation:
// used two stacks<pair<TreeNode*, int>>, pair stores the n... |
Java | UTF-8 | 1,738 | 3.078125 | 3 | [] | no_license | import java.util.ArrayList;
public class AdministradorDeAlquileres {
private ArrayList<Alquiler> alquilers;
public AdministradorDeAlquileres(){
alquilers = new ArrayList<>();
}
public void agregarAlquiler(Alquiler alquiler){
alquilers.add(alquiler);
}
public Alquiler g... |
Python | UTF-8 | 309 | 2.796875 | 3 | [] | no_license | #!/usr/bin/evn python
# excoding: utf-8
import Image
import ImageFont
import ImageDraw
text = u"7"
im = Image.open('./image.jpg')
dr = ImageDraw.Draw(im)
font = ImageFont.truetype("msyh.ttf", 34)
dr.text(im.size[0]*0.85, im.size[1]*0.05, text, font=font, fill="#ff0000")
im.show()
im.save('result.jpg')
|
Python | UTF-8 | 2,171 | 2.59375 | 3 | [
"MIT"
] | permissive | from test.dungeons.TestDungeon import TestDungeon
class TestThievesTown(TestDungeon):
def testThievesTown(self):
self.starting_regions = ['Thieves Town (Entrance)']
self.run_tests([
["Thieves' Town - Attic", False, []],
["Thieves' Town - Attic", False, [], ['Big Key (T... |
Java | UTF-8 | 454 | 2.125 | 2 | [] | no_license | package project.web;
import project.model.Book;
import project.service.Service;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import java.util.List;
@ManagedBean
@SessionScoped
public class Controller {
@EJB
private Service service;
public String getT... |
C++ | UTF-8 | 1,202 | 3.40625 | 3 | [] | no_license | //counthdt.cpp
//Bradley Morton
//9/30/18
//Contains definitions of functions for Assignment 4
#include "counthdt.h" //For prototypes
#include <vector>
using std::vector;
#include <iostream>
int countHDT(int dim_x, int dim_y, int forbid1_x, int forbid1_y, int forbid2_x, int forbid2_y)
{
vector<vector<int>> board(... |
Java | UTF-8 | 748 | 1.976563 | 2 | [] | no_license | package com.action;
import com.service.UserRelationshipService;
import com.vo.ResponseBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("frie... |
C++ | UTF-8 | 1,533 | 2.71875 | 3 | [] | no_license | #include "Bomb.h"
Bomb::Bomb(float x, float y, float SpeedX, float SpeedY):
GameObject("images/bomb/bomb0.png", x, y, SpeedX, SpeedY)
{
parent = NULL;
relativeX = 0;
relativeY = 0;
time = 0.f;
Alive = true;
animation[0] = al_load_bitmap("images/bomb/bomb0.png");
animation[1] = al_load_bitmap("images/bomb/bo... |
Markdown | UTF-8 | 5,228 | 3.140625 | 3 | [] | no_license | # Web_html (웹사이트 완성)
우리는 Link 까지 배움으로 각각의 페이지를 역어 하나의 책으로 만들수 있는 방법을 배웠다 대신 이 Web 에선 이 책을 Website 라고 일컫는다.
그럼 우리는 이제 우리가 Webpage 를 만들고 역어 역어서 하나의 Website 로 만들어 볼 것이다.
```
파일명 : main.html
<!doctype html>
<html>
<head>
<title> Web html </title>
<mata charset="utf-8">
</head>
<body>
<h1><a href="main.html"> ... |
C++ | UTF-8 | 1,912 | 2.71875 | 3 | [
"Apache-2.0"
] | permissive | #include "stdafx.h"
// General
#include "ObjectGUID.h"
// Additional
#include <sstream>
#include <iomanip>
CWoWObjectGuid const CWoWObjectGuid::Empty = CWoWObjectGuid();
char const* CWoWObjectGuid::GetTypeName(EWoWObjectHighGuid high)
{
switch (high)
{
case EWoWObjectHighGuid::Item: return "Item";
case ... |
JavaScript | UTF-8 | 1,741 | 3.203125 | 3 | [] | no_license | import apiManager from "./apiManager.js"
import contactListPrinter from "./contactList.js"
// get contacts from json server
apiManager.getAllContacts().then(parsedContacts => {
// loop through contacts from json server
parsedContacts.forEach(contact => {
contactListPrinter.printSingleEntry(contact)
... |
Java | UTF-8 | 396 | 1.921875 | 2 | [] | no_license | package com.gz.manager.domain;
/**
* 描述:<br>
* 版权:Copyright (c) 2011-2018<br>
* 公司:北京活力天汇<br>
* 作者:龚钊<br>
* 版本:1.0<br>
* 创建日期:2019年02月19日<br>
*/
public class UserName {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = ... |
JavaScript | UTF-8 | 2,426 | 2.6875 | 3 | [] | no_license | const sql = require("./connection");
// constructor
const Teacher = function (teacher) {
this.teacherID = teacher.teacherID;
this.fullName = teacher.fullName;
this.gender = teacher.gender;
this.birthday = teacher.birthday;
this.cccd = teacher.cccd;
this.position = teacher.position;
this.addressName = tea... |
TypeScript | UTF-8 | 2,750 | 2.875 | 3 | [] | no_license | import User, { UserInstance } from '../models/User';
import { Op } from 'sequelize';
import bcrypt from 'bcryptjs';
export class UserService {
async create(name: string, email: string, password: string): Promise<UserInstance | null> {
let user = null;
if (await this.existingEmail(email)) {
... |
Python | UTF-8 | 1,012 | 3.03125 | 3 | [] | no_license | '''
Define funções responsáveis pelo controle interno da aplicação (ações, por exemplo)
'''
import datetime as dt
import monitoradas
import constantes as cte
def update_action(app, action=None):
'''
Atualiza o texto que indica a ação sendo realizada pela aplicação ('Edição', 'Remoção', etc.).
... |
TypeScript | UTF-8 | 1,382 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | import { buildParams, getCommonOptions, Omit } from 'miniprogram-network-utils';
import { UploaderResponse, UploadOption, wx } from './uploader';
/**
* 微信请求参数 (不包含回调函数)
*/
export type UploadParams = Omit<wx.UploadFileOption, 'success' | 'fail' | 'complete'>;
/**
* 构建请求参数
* baseUrl和dataUrl不同时为空
* @param data - 完整... |
Java | UTF-8 | 615 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | package com.itvillage.chapter05.chapter0501;
import com.itvillage.utils.LogType;
import com.itvillage.utils.Logger;
import com.itvillage.utils.TimeUtil;
import io.reactivex.Observable;
import java.util.concurrent.TimeUnit;
public class ObservableTimerExample {
public static void main(String[] args) {
Log... |
TypeScript | UTF-8 | 297 | 2.625 | 3 | [] | no_license | import { isBefore, startOfDay } from 'date-fns';
import { MilestoneType } from 'src/app/domain/milestone';
export abstract class AbstractMilestone {
abstract type: MilestoneType;
abstract isValid(): boolean;
isExpired(date: Date) {
return isBefore(startOfDay(new Date()), date);
}
}
|
Markdown | UTF-8 | 3,104 | 3.3125 | 3 | [] | no_license | ---
layout: post
title: leetcode 第 341 场算法比赛
description: 树形DP,屡试不爽?
keywords: 算法,leetcode,算法比赛
tags: [算法,leetcode,算法比赛]
categories: [算法]
updateData: 2023-04-16 18:13:00
published: true
---
## 零、背景
这次比赛比较简单,拼手速的时候到了。
## 一、一最多的行
题意:给一个矩阵,问矩阵的哪一行之和最大,有多个时输出第一个。
思路:循环计算,比大... |
Python | UTF-8 | 2,136 | 2.859375 | 3 | [] | no_license | #-*-coding:utf-8-*-
from numpy import *
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import time
def sigmod (num) :
return 1.0 / (1 + exp (-num));
def gradientDescent (train_x , train_y , operation) :
startTime = time.time ()
cntSample , cntFeature = shape (train_x)
alpha = operation['alp... |
PHP | UTF-8 | 13,227 | 2.65625 | 3 | [] | no_license | <?php
/**
* Yii view VoiUtil
*
* @author luunguyen
* @since Oct 2, 2012 - 10:30:44 AM
*/
class VoiUtil
{
static function currentUrl($full = TRUE)
{
return $full ? "http://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"] : $_SERVER["REQUEST_URI"];
}
static function word_limiter($str,... |
TypeScript | UTF-8 | 886 | 2.796875 | 3 | [] | no_license | import styled from "styled-components";
import { Button as SemanticButton } from "semantic-ui-react";
import { ITheme } from "constants/theme";
enum Emphasis {
primary = "primary",
secondary = "secondary",
warning = "warning",
}
const EMPHASIS = {
primary: "primary",
secondary: "secondary",
warning: "warn... |
Markdown | UTF-8 | 939 | 3.109375 | 3 | [] | no_license | ### Schedule
**9:00 am**: Coffee up, squad.
**9:30 am**: Present Project Luther!
**12:00 pm**: Must we eat lunch?
**1:00 pm**: Even more Luther.
**2:00 pm**: Start your blogs, finish project, prepare for trivia!
Second project done, third project starting on Monday!
Take this time to wrap up Luther. You won't h... |
Java | UTF-8 | 1,973 | 2.4375 | 2 | [] | no_license | package steps;
import pages.YandexMarketElectronicsTVPage;
import ru.yandex.qatools.allure.annotations.Step;
public class StepsYandexMarketElectronicsTVPage {
@Step("открыть все фильтры")
public void clickAllFilters() {
new YandexMarketElectronicsTVPage().clickAllFilters();
}
@Step("поле 'цена... |
PHP | UTF-8 | 2,243 | 3.390625 | 3 | [] | no_license | <?php
class Page{
private $total; //保存所有的数据表记录的总条数
private $page; //保存当前是第几页
private $num; //保存每页显示记录的条数
private $pageNum; //保存一共分的页数
private $offset ; //保存从数据库中取得的记录的开始偏移数
function __construct($total,$page=1,$num=5){
$this->total = $total;
$this->page = $page;... |
C# | UTF-8 | 612 | 3.78125 | 4 | [] | no_license | using System;
namespace P06CalculateTriangleArea
{
class Program
{
static void Main(string[] args)
{
double triangleBase = double.Parse(Console.ReadLine());
double triangleHeight = double.Parse(Console.ReadLine());
double area = GetTriangleArea(triangleBase... |
C++ | UTF-8 | 2,709 | 2.96875 | 3 | [] | no_license | #include "SmokeManager.h"
#include <time.h>
#include <Windows.h>
#include <GL/glut.h>
// Code gotten and adapted from http://snipplr.com/view/54306/opengl-particle-system-smoke-stream/
struct Particle
{
float posX;
float posY;
float posZ;
float alpha;
};
const int MAX_PARTICLES = 50;
const int MIN_PA... |
Java | UTF-8 | 436 | 1.851563 | 2 | [] | no_license | package com.techkid.anh82.randomquote.network.services;
import com.techkid.anh82.randomquote.network.RegisterRequest;
import com.techkid.anh82.randomquote.network.RegisterResponse;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.POST;
/**
* Created by AnhLT on 5/27/2017.
*/
public interf... |
Python | UTF-8 | 1,823 | 4.28125 | 4 | [] | no_license | # Write two functions, the first, validity_check which takes a potential
# cover and the adjacency matrix of a graph as its inputs and returns True
# if the potential cover is a cover of the graph and False otherwise.
# The second, vertex_cover_naive, takes the adjacency matrix of a graph
# as its input, checks all pot... |
Markdown | UTF-8 | 1,371 | 2.90625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | ---
layout: post
title: " 함수 스코프(Function Scope)와 실행 컨텍스트(Excution Context)"
categories: JavaScript
author: goodGid
---
* content
{:toc}

* 둘의 **가장 큰 차이**는 각각 **발생하는 시점**에 있다.

: base(name, weight, livingRegion)
{
}
public override void AskForFood()
{
Console.WriteLine("Squeak");
}
... |
JavaScript | UTF-8 | 846 | 2.53125 | 3 | [
"MIT"
] | permissive | var picpik = picpik || {};
(function () {
'use strict';
/**
* The basic Pic Model represents an image that can be
* favorited or deleted as needed.
*/
picpik.Pic = Backbone.Model.extend({
/*
* Default attribtues for the pic. Ensures it has the deleted
... |
JavaScript | UTF-8 | 9,023 | 2.625 | 3 | [] | no_license | const readline = require("readline");
const fs = require("fs");
const path = require("path");
const { execSync } = require("child_process");
const { randInt } = require("./rng.js");
const __rootdir = path.resolve(__dirname, "../..");
const config = require(__rootdir + "/config");
const rl = readline.createInterface(... |
C# | UTF-8 | 1,665 | 2.890625 | 3 | [] | no_license | using System;
using System.Collections.Generic;
using Proiect1.API;
namespace Proiect1.Service
{
public class FileService
{
private FileRepository fileRepository = new FileRepository();
public void SaveFile(File file)
{
if (GetAllFiles().Exists(f => f.FilePath == file.FileP... |
Go | UTF-8 | 2,890 | 2.5625 | 3 | [
"MIT"
] | permissive | package auth
import (
"context"
"strconv"
"github.com/google/go-github/v32/github"
"github.com/wearedevx/keystone/api/pkg/models"
"golang.org/x/oauth2"
)
var (
githubClientId string
githubClientSecret string
)
type PublicKey struct {
Typ string
KeyID string
PublicKey string
}
type gitHubAut... |
Java | UTF-8 | 1,100 | 2.5 | 2 | [] | no_license | package com.pathfinder.app;
import java.util.ArrayList;
class NavPoint extends MapEntity
{
int type;
int floorNum;
int buildingNum;
ArrayList<NavPoint> visiblePoints;
public NavPoint(double xCoord, double yCoord, int thisId)
{
super(xCoord, yCoord, thisId);
}
public NavPoint(... |
C | ISO-8859-1 | 1,365 | 4.0625 | 4 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
/*/
@type: Function - int main()
@title: Preenchimento de Vetor III
@author: Rafael Lima Coelho
@since: 23-10-2019
@version: RLC.1.0.URI
@description: Leia um valor X. Coloque este valor na primeira posio de um vetor N[100].
Em cada posio subsequente de ... |
Python | UTF-8 | 1,365 | 3.375 | 3 | [] | no_license | # this is test of development branch
def print_fig(fig):
for i in range(len(fig)):
if fig[i] == '':
print('_',end='')
else:
print(fig[i],end='')
if i == 2 or i == 5 or i == 8:
print('')
else:
print('|',end='')
def check_fig(fig):
wi... |
Shell | UTF-8 | 702 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | #!/bin/bash
set -u
START_DIR=$(pwd)
OUTPUT_DIR=${START_DIR}/OUTPUT
if [ "X$TAG_VERSION" != "X" ]; then
VER=$TAG_VERSION
else
VER=$(cat etc/version)
fi
set -e
LINUX_BASE_NAME="stardog-graviton_$VER""_linux_amd64.zip"
LINUX_ZIP=$OUTPUT_DIR/$VER/$LINUX_BASE_NAME
DARWIN_BASE_NAME="stardog-graviton_$VER""_darw... |
JavaScript | UTF-8 | 489 | 3.125 | 3 | [] | no_license | var symbolSize = 16;
var streams = [];
var toggle = true;
function setup() {
createCanvas(window.innerWidth, window.innerHeight);
textSize(symbolSize);
for(var i = 0; i < width; i+=symbolSize) {
var stream = new Stream(i);
stream.generateSymbols();
streams.push(stream);
}
}
function draw() {
if(... |
Python | UTF-8 | 11,311 | 2.703125 | 3 | [] | no_license | import json
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.express as px
import numpy as np
import plotly.graph_objs as go
import pandas as pd
import math
from flask import Flask
from dash.dependencies import Input, Output
ser... |
C# | UTF-8 | 4,074 | 2.703125 | 3 | [
"MIT"
] | permissive | // Copyright (c) Dmytro Kyshchenko. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
namespace xFunc.Maths.Expressions.Matrices;
/// <summary>
/// Represents a matrix e... |
C | UTF-8 | 329 | 3.703125 | 4 | [] | no_license | #include <stdio.h>
int main(int argc, char** argv) {
printf("Arithemetic mean:\n");
float sum;
float ar;
for (int i = 1; i <= 5; i++) {
printf("Enter number -> ");
float a;
scanf("%f", &a);
sum = sum + a;
ar = sum / i;
printf("number entered %.0i: %.2f arithmetic mean %.2f\n", i, a, ar);
}
re... |
JavaScript | UTF-8 | 2,623 | 3.328125 | 3 | [] | no_license | //object that has all the getElementById of the main page (of users)
var divs = { stats: document.getElementById("stats"), users: document.getElementById("users-managment"), game: document.getElementById("game"), user: document.getElementById("user") }
//store what section the website is showing
var showing = "stats"
... |
Markdown | UTF-8 | 18,100 | 2.765625 | 3 | [
"CC-BY-4.0",
"MIT"
] | permissive | ---
title: MABS & System Center DPM support matrix
description: This article summarizes Azure Backup support when you use Microsoft Azure Backup Server (MABS) or System Center DPM to back up on-premises and Azure VM resources.
ms.date: 04/20/2023
ms.topic: conceptual
author: AbhishekMallick-MS
ms.author: v-abhmallick
-... |
Java | UTF-8 | 24,516 | 1.898438 | 2 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.agnux.kemikal.reportes;
import com.agnux.common.helpers.StringHelper;
import java.net.URISyntaxException;
import java.util.Iterator;
import org.apache.commons.lang.StringEscapeUtils;
import com.itextpdf.text.... |
Python | UTF-8 | 2,050 | 2.5625 | 3 | [
"MIT"
] | permissive |
from .base import Distribution
import tensorflow as tf
import numpy as np
TINY = 1e-8
class Bernoulli(Distribution):
def __init__(self, dim):
self._dim = dim
@property
def dim(self):
return self._dim
def kl_sym(self, old_dist_info_vars, new_dist_info_vars):
old_p = old_dis... |
Go | UTF-8 | 8,814 | 3.265625 | 3 | [] | no_license | package donothing
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"os"
"strings"
)
// A Procedure is a sequence of Steps that can be executed or rendered to markdown.
type Procedure struct {
// The root step of the procedure, of which all other steps are descendants.
rootStep *Step
stdin io.Reader
stdout io... |
JavaScript | UTF-8 | 454 | 2.59375 | 3 | [] | no_license | import * as type from './actions';
const initialState = {
visibleBlocks: []
}
export default function (state = initialState, action){
switch(action.type){
case type.GET_BLOCKS: {
const shuffled = action.payload.sort(() => 0.5 - Math.random());
const random = shuffled.sli... |
C# | UTF-8 | 6,109 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | // Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.Fonts.WellKnownIds
{
/// <summary>
/// Provides enumeration of common name ids
/// <see href="https://docs.microsoft.com/en-us/typography/opentype/spec/name#name-ids"/>
/// </summary>
public enum Kno... |
Java | UTF-8 | 465 | 3 | 3 | [] | no_license | package ru.job4j.oop;
/**
* Class College
* @author Dmitry Razumov
* @version 1
*/
public class College {
/**
* Главный метод программы. В методе практикуется приведение типов.
* @param args Параметры командной строки
*/
public static void main(String[] args) {
Freshman tom = new Fre... |
Python | UTF-8 | 2,401 | 2.671875 | 3 | [] | no_license | import requests
from bs4 import BeautifulSoup
import smtplib
import time
import os
import pathlib
URL = 'https://www.amazon.com.au/gp/product/B079HYCWR1/ref=ox_sc_act_title_1?smid=A2NLI3B5IXPZVP&psc=1'
headers = {
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chro... |
Shell | UTF-8 | 719 | 3.15625 | 3 | [] | no_license | #!/bin/bash
function getUrlOfLastPage() {
#http://www.collectedcurios.com/battlebunnies.php?s=38
wget http://www.collectedcurios.com/battlebunnies.php?s=1 -O /tmp/battlebunniescollectedcurios
lastpage=$( grep 'title="Last"' /tmp/battlebunniescollectedcurios | sed 's/title="Forward ten"//;s/.*s=//;s/".*//' )
echo ${las... |
Java | UTF-8 | 301 | 1.65625 | 2 | [] | no_license | package com.ccms.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.ccms.domain.AccountLengthSetup;
@Repository
public interface AccountLengthSetupRepository extends JpaRepository<AccountLengthSetup, Integer> {
}
|
Markdown | UTF-8 | 3,446 | 2.796875 | 3 | [] | no_license | ---
title: "Moodle"
class_name: docs
full_width: true
---
Please be sure to check out the [Codio LTI App](/docs/classes/lti/lti1_0/ltiapp) which allows for an easy way to integrate and to map Codio class units to your LMS system. Moodle added support for LTI™ apps in version 2.2. The [following page](https://docs.mood... |
Java | UTF-8 | 889 | 2.15625 | 2 | [] | no_license | public abstract class cke
extends ckc
{
public final chi b;
public cke(chi paramchi, chj paramchj)
{
super(paramchj);
if (paramchi == null) {
throw new IllegalArgumentException("The field must not be null");
}
if (!paramchi.c()) {
throw new IllegalArgumentException("The field must... |
Python | UTF-8 | 264 | 3.484375 | 3 | [] | no_license | def reverseString(s):
return s[::-1]
def reverseString_2(s):
str = ''
long = len(s) - 1
while long != -1:
str += s[long]
long -= 1
return str
def reverseString_3(s):
return ''.join(s[i] for i in range(len(s) - 1, -1, -1))
|
Python | UTF-8 | 331 | 4 | 4 | [
"Apache-2.0"
] | permissive | from random import randint
numeros = (randint(0,10),randint(0,10),randint(0,10),randint(0,10),randint(0,10))
print('Os valores sorteados foram: ', end='')
for n in numeros:
print(f'{n} ', end='')
print('\nO maior valor sorteado foi {}'.format(max(numeros)))
print('O menor valor sorteado foi {}'.format(min(n... |
TypeScript | UTF-8 | 218 | 2.625 | 3 | [] | no_license | export interface Category {
name: string;
id: string;
songs: Song[];
selected?: boolean;
}
export interface Song {
id: string;
src: string;
point: number;
isPlaying?: boolean;
isPlayed?: boolean;
}
|
Java | UTF-8 | 4,074 | 3.5 | 4 | [] | no_license | /*****************************************************
Team Over The Moon (Sachal Malick and Kyle Moon)
APCS2 pd10
HW27 -- You Lot at Fake Terrys
2016--04--06
******************************************************/
public class RQueue<T> implements Queue<T> {
private LLNode<T> _front, _end;
private int _siz... |
Java | UTF-8 | 13,166 | 2.296875 | 2 | [] | no_license | /*******************************************************************************
* Copyright (c) 2002, 2011 Innoopract Informationssysteme GmbH.
* 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 di... |
C# | UTF-8 | 634 | 3.3125 | 3 | [] | no_license | using System;
namespace reversi
{
public class Cell
{
public int State;
public int Row;
public int Col;
public Cell(int row, int col)
{
this.State = 0;
this.Row = row;
this.Col = col;
}
public char GetMark()
{
... |
TypeScript | UTF-8 | 223 | 2.890625 | 3 | [] | no_license | /**
* Model Class to log messages on server
*/
export class Log {
message: any;
logLevel: any;
constructor(
message: any,
logLevel: any
) {
this.message = message;
this.logLevel = logLevel;
}
}
|
Python | UTF-8 | 861 | 3.21875 | 3 | [] | no_license | # -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import urllib.request
URL = 'https://www.codewars.com/users/leaderboard'
def solution():
# do it
return Leaderboard()
class dotdict(dict):
__getattr__ = dict.get
class Leaderboard:
def __init__(self):
self.position = {}
for i,... |
Python | UTF-8 | 3,001 | 2.75 | 3 | [
"MIT"
] | permissive | #!/usr/bin/python
from . import market_data_crawler
from bot.shared_config import *
import time
import sys
import operator
import pprint
def calculate_arbitrage_opportunities(exchanges):
start_time = time.time()
market_data = market_data_crawler.update_market_data_for_symbol_and_exchange(exchanges)
sorte... |
Markdown | UTF-8 | 36,004 | 2.828125 | 3 | [] | no_license | # deep_learning_final_assignment
# 2048实验报告
18373105 童涛 18373676 黎昊轩 https://github.com/LeavesLi1015/deep_learning_final_assignment
18373528 杨凌华 https://github.com/LarryHawkingYoung/deep_learning_final_assignment
18373542 胥浩宇 https://github.com/cpxhylty/deep_learning_final_assignment
## 绪论
在进行调研之后,我们从两个方向分别展开了实... |
Python | UTF-8 | 2,946 | 2.625 | 3 | [] | no_license | import pytest
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from time import sleep
@pytest.mark.usefixtures("driver_init")
class BaseTest:
url = "https://uat.ormuco.com/login"
email = "qa@orm... |
C# | UTF-8 | 3,488 | 2.734375 | 3 | [] | no_license | using EShopWebAPI.DTO;
using EShopWebAPI.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
namespace EShopWebAPI.Controllers
{
public class CategoryController : ApiController
{
// GET: ... |
Java | UTF-8 | 1,870 | 2.90625 | 3 | [] | no_license | package com.chengguo.zhy.utils;
import android.content.Context;
import android.content.SharedPreferences;
/*
*
* 本地文件 存取工具类
*
* */
public class PrefUtils {
//本地文件名
public static final String PREF_NAME="config";
/**
* @param ctx 上下文对象
* @param key 要获取的数据名(键)
* @param defaultValue 默认... |
PHP | UTF-8 | 1,822 | 2.640625 | 3 | [] | no_license | <!DOCTYPE html>
<html>
<?php
session_start();
if(!isset($_SESSION['membre_connected']))
{
header('Location: index.php');
}
$id_membre = $_SESSION['id'];
?>
<head>
<meta charset="utf-8" />
<title>ExpliqueSimplement</title>
</head>
<body>
<h1>ExpliqueSimplement</h1>
<p>
<a href="nouveau_sujet.php">Nouveau suj... |
C | UTF-8 | 1,765 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "PCA9685.h"
#include <stdio.h>
#include <math.h>
#define BASE_ADDRESS 0b10000000
#define CHIPCLK 25000000
struct __attribute__((__packed__)) pca9685datareg {
uint8_t registeraddress;
uint16_t start;
uint16_t stop;
};
struct __attribute__((__packed__)) pca9685setupreg {
uint8_t registeraddress;
uint8_t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.