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
18,852
3.1875
3
[]
no_license
# 1 监视集群组件状态 ## 1.1 概述 一旦你有一个可以运行的集群之后,你就可以在集群里执行一些命令来监控集群中的健康状态、对进群进行一些运维操作等。Ceph中提供了一个核心命令ceph,通常默认会被安装在\/usr\/bin\/目录下。Ceph中所有组件的操作,都通过它提供的子命令完成。同时,它也提供两种访问模式,交互模式和普通命令行模式,如下所示: ceph> health ``` EALTH_OK ceph> status cluster 8b9a9a32-c11b-4719-95fd-8c9aa4730cc9 health HEALTH_OK monmap e5: 3 mons...
TypeScript
UTF-8
591
3.828125
4
[]
no_license
// enum类型是对JavaScript标准数据类型的一个补充,使用枚举类型可以为一组数值赋予友好的名字 enum Color { // 默认情况下,从0开始为元素编号。 你也可以手动的指定成员的数值 Red, Blue, Green } /* 枚举ts会编译成一个对象 var Color; (function (Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Blue"] = 1] = "Blue"; Color[Color["Green"] = 2] = "Green"; })(Color || (Co...
Python
UTF-8
9,500
3.34375
3
[]
no_license
#!/usr/bin/env python3 """ audio.py: Utilities for dealing with audio files """ from pathlib import Path import io import librosa import soundfile import numpy as np import pandas as pd import warnings class OpsoLoadAudioInputError(Exception): """ Custom exception indicating we can't load input """ pass...
C++
UTF-8
719
2.671875
3
[ "Apache-2.0" ]
permissive
#pragma once namespace recipe_4_02 { #define MAKE_STR2(x) #x #define MAKE_STR(x) MAKE_STR2(x) #define MERGE2(x, y) x##y #define MERGE(x, y) MERGE2(x, y) #define DECL_MAKE(x) DECL_MAKE2(x) #define DECL_MAKE2(x) x* make##_##x() { return new x(); } #define NUMBER 42 struct bar {}; struct foo ...
Java
UTF-8
1,917
1.851563
2
[]
no_license
package com.serviceindeed.yike.yikemo.mapper; import com.serviceindeed.yike.yikemo.domain.User; import com.serviceindeed.yike.yikemo.domain.model.UserInfo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; @Mapper public interface UserMapper { /** ...
Python
UTF-8
6,267
2.796875
3
[]
no_license
from requests.auth import _basic_auth_str from termcolor import colored import unittest import requests class SecurityTests(unittest.TestCase): def setUp(self): self.PORT = 5000 self.API_URL = f"http://127.0.0.1:{self.PORT}/" self.customers = [ {'username': 'applicant1', 'pass...
Swift
UTF-8
968
2.671875
3
[]
no_license
// // UIViewControllerExtension.swift // Tribe // // Created by Vahagn Gevorgyan on 13/10/2018. // Copyright © 2018 Vahagn Gevorgyan. All rights reserved. // import UIKit extension UIViewController { func hideKeyboardWhenTappedAround() { let tap: UITapGestureRecognizer = UITapGestureRecognizer(ta...
Java
UTF-8
2,602
2.53125
3
[]
no_license
package br.cnpem.gef.palette; import org.eclipse.gef.palette.CombinedTemplateCreationEntry; import org.eclipse.gef.palette.ConnectionCreationToolEntry; import org.eclipse.gef.palette.CreationToolEntry; import org.eclipse.gef.palette.PaletteGroup; import org.eclipse.gef.palette.PaletteRoot; import org.eclipse.gef.palet...
Java
UTF-8
5,970
2.59375
3
[ "Apache-2.0" ]
permissive
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bbd; import java.sql.ResultSet; import java.sql.SQLException; import org.junit.*; import static org.junit.Assert.*; /** * * @author James Gamber */ public class BBDBeanAPITest extends BBDUnitTestCase { ...
C#
UTF-8
1,370
2.671875
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace PUnit.Framework.Results { public class MethodResult { private bool _success = true; private bool _ignored = false; private Exception _exception; private stri...
Rust
UTF-8
315
2.640625
3
[]
no_license
use crate::test_kernel::create_test_kernel; use crate::Hit; use std::rc::Rc; #[test] fn it_should_check_if_a_key_exists() { let kernel = Rc::new(create_test_kernel()); let hit = Hit::new("id", "test/test", kernel).unwrap(); assert!(hit.contains_key("id")); assert!(!hit.contains_key("failure")); }
Markdown
UTF-8
1,301
2.59375
3
[]
no_license
--- title: Does work make you happy? sourceUri: https://hbr.org/2017/03/does-work-make-you-happy-evidence-from-the-world-happiness-report source: Harvard Business Review author: Jan-Emmanuel De Neve thumbnailUri: https://lh5.googleusercontent.com/TP5aSroZTNHYS24kzC-ktYL6IDLl3QgJsOOeChwbWKNQ7-wYQKYN8V0mFCxKBEauWZlAbxfgx...
Java
UTF-8
1,377
2.671875
3
[]
no_license
package br.com.fabricadeprogramador.repository; import br.com.fabricadeprogramador.model.Pessoa; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; import org.springframework.stereotype.Repository; import java.io.File; import java.io.IOException; import java.util.ArrayList; im...
C#
UTF-8
533
2.796875
3
[ "MIT" ]
permissive
using System.Collections; using System.Collections.Generic; using UnityEngine; public static class GameObjectUtil { /// <summary> /// 获取或者创建组件 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="obj"></param> /// <returns></returns> public static T GetOrCreateComponent<T>(...
C++
UTF-8
283
3.109375
3
[]
no_license
int sumaM (int a[], int x, int y, int alto, int ancho) { if (x == ancho && y == alto) return 0; else if (x == ancho) y++; return a[x,y] + sumaM(a,x-1,y,alto,ancho); else return a[x,y] + sumaM(a,x+1,y,alto,ancho); }
C#
UTF-8
2,584
2.546875
3
[]
no_license
using UnityEngine; using System.Collections; using System.Collections.Generic; public class TalkingMinion : TalkingNpc { public TalkingMinion() { } public override void setupConversation() { conversationDialogue = new Dictionary<int, TalkingCharacterInformation> (); if (timesTalkedTo == 0) { conversationD...
Java
UTF-8
2,901
2.390625
2
[]
no_license
package com.yu.hang.code.creator; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.StringWriter; import java.io.Writer; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import...
Markdown
UTF-8
1,483
2.734375
3
[]
no_license
## 关于奥运纪念钞 ## 因为爹妈在银行工作,且不说其他,钱还是看过很多的,码的齐齐的纸币,砖头重的盒装一元硬币,而且最主要的是纪念币了,记得以前最多的是主席纪念币和植树节纪念币,还有北京亚运会的熊猫盼盼纪念币,好怀念~~ 不过到底亚运和奥运是不同的,这次的奥运纪念钞,宜春只有50张,我反正是没那个激情了,等到老妈办公室听同事聊,才知道这么回事 话说知道只有50张纪念钞后,农行马上成立了抢钞小分队,貌似正是由农行来押送的,但是由人民银行的领导监督,所以压钞车后跟了10来辆农行抢钞车,最厉害的是一个叔叔居然打的跟着,所谓全民皆兵,不过于此 压钞车在市区转了几圈,然后突然掉头往市外走,抢钞小分队产生了疑惑,部...
Markdown
UTF-8
484
2.671875
3
[]
no_license
# Contact Keeper Keep your contacts privately. This application made with Express, Node.js and MySql. Sequelize used for MySql database operations. ## Usage Download or clone the repo. Create a database, open `config/default.json` and set your database configuration. Then enter the commands below. All datab...
Java
UTF-8
26,332
1.554688
2
[ "MIT" ]
permissive
/* * Adyen Checkout API * * The version of the OpenAPI document: 69 * Contact: developer-experience@adyen.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ package com.adyen.model.checkout; ...
Go
UTF-8
1,056
2.578125
3
[]
no_license
package controllers import ( "encoding/json" "github.com/rapando/finance-api/api/entities" "github.com/rapando/finance-api/api/middleware" "github.com/rapando/finance-api/api/models" "github.com/rapando/finance-api/api/utils" "net/http" ) func (s *Server) AccountTypes(w http.ResponseWriter, r *http.Request) { ...
PHP
UTF-8
4,642
2.875
3
[]
no_license
<?php class UserModel { public static function getUserId() { return isset($_SESSION['id']) ? $_SESSION['id'] : false; } public static function getUserLogin() { return isset($_SESSION['login']) ? $_SESSION['login'] : false; } public static function getUserTheme() { ...
Java
UTF-8
1,037
1.585938
2
[]
no_license
package p005b.p096l.p097a.p113c.p119b.p120l.p121k; import android.app.NotificationManager; import android.content.Context; import java.util.Objects; import p005b.p096l.p097a.p113c.p119b.C1763f; import p005b.p096l.p097a.p113c.p119b.C1767i; /* renamed from: b.l.a.c.b.l.k.w */ public final class C1873w implements Runnab...
Python
UTF-8
744
3.421875
3
[]
no_license
import webbrowser class Movie(): ''' Creates a class, Movie, to storing movie information and open movie trailers Attributes: title: Title of the movie storyline: One line summary of the movie poster_image_url: URL of the poster from wikipedia trailer_youtube_url: YouTube URL of the trailer ''' def __...
PHP
UTF-8
814
2.828125
3
[]
no_license
<?php /** * Created by PhpStorm. * User: kevin * Date: 15-10-10 * Time: 上午12:36 */ //header("Status: 404 Not Found"); if(isset($_GET['a'])){ $act = $_GET['a']; switch($act){ case 'one': rangeFun(0,100); break; case 'two': rangeFun(0,200); brea...
Java
UTF-8
1,558
2.21875
2
[]
no_license
package com.asuper.zhihudailynews.model; import com.asuper.zhihudailynews.bean.LaunchImageBean; import com.asuper.zhihudailynews.network.ZhiHuRetrofitHelper; import com.asuper.zhihudailynews.presenter.ILaunchPresenter; import com.asuper.zhihudailynews.utils.Log; import rx.Subscriber; import rx.android.schedulers.Andr...
Java
UTF-8
1,001
2.328125
2
[]
no_license
package TeamTask.models; import javax.persistence.*; import java.util.UUID; @Entity @Table(name = "user_roles") public class UserRoles { // @Id // @GeneratedValue(strategy = GenerationType.SEQUENCE,generator="user_roles_sequence") @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Inte...
Java
UTF-8
498
3.46875
3
[]
no_license
package Lesson7OOp; /** * Created by Артем on 26.09.2016. */ public class For { public static void main(String[] args) { For mimi = new For(); mimi.go(); } void go() { int y = 7; for (int i = 1; i < 8; i++) { y++; if (i > 4) { Syst...
Python
UTF-8
2,917
3.25
3
[]
no_license
#Replace your-device-ID-goes-here with your actual device ID #and replace your-access-token-goes-here with your actual access token #Importing libraries from tkinter import * import tkinter.font from tkinter import filedialog from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing i...
C++
UTF-8
2,525
2.546875
3
[]
no_license
#pragma once #ifndef CONSOLE_UTILS_H #define CONSOLE_UTILS_H #include <opencv2/opencv.hpp> #include<opencv2/core/utils/filesystem.hpp> namespace cu { class ConsoleUtils { public: static void getImages(cv::String relativepath, std::vector<cv::String>& filenames) { /*Inputs: relativepath : eg, "../../data/cap...
C++
UTF-8
5,484
3.234375
3
[ "MIT" ]
permissive
//////////////////////////////////////////////////////////////////////////////////////////////////// // // Project: tiler // File: Nest.h // Authors: Ofer Dekel // //////////////////////////////////////////////////////////////////////////////////////////////////// #pragma once #include "Variable.h" #include "...
Java
UTF-8
495
2.28125
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 eaics.SER; /** * * @author Markcuz */ public class AirPressure { double sensorValue; public AirPressure() { ...
Python
UTF-8
1,959
3.5
4
[]
no_license
# -*- coding: utf-8 -*- """ Created on Sat Apr 1 18:27:31 2017 @author: LIN Lu """ """ Une module pour filtrer les points. """ import numpy as np def filtre1(f, X, seuil = 0.502): """ First filter : Monte-Carlo, puis garder les points qui sont dans la zone d'intérêt f : Fonction é...
Java
UTF-8
736
1.632813
2
[]
no_license
package com.tencent.mm.plugin.appbrand.jsapi.e; import com.tencent.mm.plugin.appbrand.page.p; import com.tencent.mm.plugin.appbrand.widget.input.AppBrandInputInvokeHandler; import com.tencent.mm.plugin.appbrand.widget.input.AppBrandInputInvokeHandler$a; class c$2 implements AppBrandInputInvokeHandler$a { final /*...
PHP
UTF-8
7,231
2.734375
3
[]
no_license
<?php //start php session session_start(); //if user not logged in, force to login.php if( $_SESSION['access'] != 1 ) { require( 'login.php' ); } else { include "includes/db_config.php"; $conn = mysqli_connect($servername, $username, $password, $db); $unit = mysqli_real_escape_string($conn, $_POST['uni...
C++
UTF-8
4,970
2.53125
3
[]
no_license
/*++ Copyright (c) 2000 Microsoft Corporation Module Name: BigActionConstruction.cpp Abstract: The uninstall was not uninstalling the .lnk files on the ALLUSER start Menu. This was because the uninstaller script was not getting the right path. This is an app specific shim. Hi...
Java
UTF-8
1,287
2.28125
2
[ "Apache-2.0" ]
permissive
package br.unifor.saa.rest.model; import java.util.Date; /** * @author Marcelo Rosa * @since 7 de dez de 2016 */ public class Aula{ private Long id; private Turma turma; private String descricao; private Date dataAula; private Double media; private Long sequencia; private Boolean ativo; privat...
Ruby
UTF-8
557
4.03125
4
[]
no_license
# 20時から翌朝7時までにオウムに喋られると問題があるのでその場合は「NG」、 # それ以外は「OK」と出力するメソッドを作成します。 # オウムが喋る時をture、喋らない時をfalseと入力することにし、時刻も同時に入力します。 def parrot_trouble(talking, hour) talking && (7 > hour || 20 <= hour) ? (puts "NG") : (puts "OK") end parrot_trouble(true, 6) parrot_trouble(true, 7) parrot_trouble(false, 6) parrot_trouble(false, 7...
SQL
UTF-8
1,061
3.328125
3
[]
no_license
USE [SnackOverflowDB] GO IF EXISTS(SELECT * FROM sys.objects WHERE type = 'P' AND name = 'sp_create_product_order') BEGIN DROP PROCEDURE sp_create_product_order Print '' print ' *** dropping procedure sp_create_product_order' End GO Print '' print ' *** creating procedure sp_create_product_order' GO Create PROCEDUR...
JavaScript
UTF-8
2,148
3.09375
3
[]
no_license
/* ** DOM Navigate: ** find_ancestor_class: find first ancestor by classname ** find_ancestor_tag: find first ancestor by tagname ** find_1stDescendant_with: find first descendant by tag and then class ** ** Event control (IE fallback): ** getTriggerEle ** preventLinkAction ** stopBubbling ** addEvent ** ** Other: ** e...
Java
UTF-8
679
1.9375
2
[]
no_license
package ee.bcs.valiit.controller; import java.math.BigInteger; public class CreateAccountRequest { private Integer accountNr; private BigInteger balance; private BigInteger clientId; public Integer getAccountNr() { return accountNr; } public void setAccountNr(Integer accountNr) { ...
Markdown
UTF-8
7,946
3.265625
3
[ "Apache-2.0" ]
permissive
<!--Title: Glossary--> There are some terms that reoccur throughout the documentation and show up in the StructureMap API. Understanding these terms and how they relate to StructureMap isn't a prerequisite to using StructureMap, but it helps. ## Container Tools like StructureMap are generally known as *Inversion of...
JavaScript
UTF-8
1,160
2.578125
3
[ "MIT", "BSD-3-Clause" ]
permissive
( function( $ ) { "use strict"; $.extend( { openCageGeocode: function(options) { options = $.extend( { place: "", apikey: "", success: function(_geoData) {}, error: function(_message) {} }, options ); var errorMsg = "Could not geocode this location."; f...
JavaScript
UTF-8
1,222
3.0625
3
[]
no_license
import React from 'react'; import HitPoint from './HitPoint.js' const HPBar = (props) => { const {HP} = props; let displayArr = []; const fillSlots = () => { //Fill array with 1 until reaching the HP in props for(let i = 0; i < HP; i++ ){ displayArr.push(1) } /...
Java
UTF-8
3,357
2.46875
2
[]
no_license
package com.muye.kl.config; import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.PropertyAccessor; import com.fasterxml.jackson.databind.ObjectMapper; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.CachingConfigurerSupport; import o...
C#
UTF-8
545
2.546875
3
[]
no_license
using(SqlConnection con = new SqlConnection("your conn")) { con.Open(); string sql = "SELECT MA_BO_CAU_HOI FROM R_NGUOICHOI_BOCAUHOI where MA_NGUOI_CHOI=@Param1"; DataTable data = new DataTable(); using(SqlDataAdapter adapter = new SqlDataAdapter()) { ...
Java
UTF-8
984
3.65625
4
[]
no_license
package LeetCode; import java.util.Arrays; public class Q53MaxSubArray { //有滑窗的感觉,但不需要用左右指针 //用sum记录当前连续子数组的值,如果这个值大于0,那sum就更新为当前值加sum。 //如果这个值小于0,说明到目前为止的子数组对后面是副作用,就直接丢掉,子数组从当前位置开始。 public static int maxSubArray(int[] nums) { int res = nums[0]; int sum = 0; for (int i = 0; i ...
Markdown
UTF-8
2,516
3.109375
3
[]
no_license
--- layout: post title: GM History page date: 2020-08-20 tags: - post - New Feature --- Back in [the old days](https://basketball-gm.com/old/), there was no way to switch your team in Basketball GM. If you got fired from your job, it was game over. Try again a new league. In part that was just because I hadn't got...
Markdown
UTF-8
78,101
2.6875
3
[]
no_license
# 谷歌Python代码风格指南 中文翻译 Update: 2020.01.31 Translator: [shendeguize@github]( https://github.com/shendeguize) Link: [ https://github.com/shendeguize/GooglePythonStyleGuideCN]( https://github.com/shendeguize/GooglePythonStyleGuideCN) 本翻译囿于水平,可能有不准确的地方,欢迎指出,谢谢大家 *如有引用,请注明出处* ## 0 目录 - - [谷歌Python代码风格指南 中文翻译](#谷歌python代...
Shell
UTF-8
156
2.828125
3
[ "MIT" ]
permissive
#!/bin/bash status_code=`curl -LI $1 -o /dev/null -w "%{http_code}" -s` if [ "$status_code" != 200 ]; then zenity --error --text "$1 is down." exit fi
Python
UTF-8
2,477
3.296875
3
[]
no_license
import math class ComplexNumber: def __init__(self, r, i): self.r = r self.i = i def add(self, liczba): return ComplexNumber(self.r + liczba.r, self.i + liczba.i) def subtrack(self, liczba): return ComplexNumber(self.r - liczba.r, self.i - liczba.i) def multiply(self...
Java
UTF-8
855
2.546875
3
[]
no_license
package com.example.cachedemo.service; import com.example.cachedemo.controllers.DemoController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cache.annotation.Cacheable; import org.springframework.stereotype.Service; @Service public class NumberService { private static final...
Go
UTF-8
3,684
2.671875
3
[ "BSD-2-Clause" ]
permissive
package conveyor import ( "testing" "golang.org/x/net/context" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sqs" "github.com/remind101/conveyor/builder" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) func TestBuildQueue(t *testing.T) { q := &buildQueue{ que...
Ruby
UTF-8
5,199
4.0625
4
[]
no_license
############################################################### # Ejercicio 1: Sintaxis ############################################################### # Corregir los errores para poder ejecutar ambos métodos class MiClase def de_instancia puts 'Método de instancia!' end def self.de_clase p...
TypeScript
UTF-8
888
3
3
[ "MIT" ]
permissive
import { Point3 } from "../vec/point3"; import { Vec3 } from "../vec"; import { Ray } from "../ray"; import { Material, IMaterial } from "../material"; interface IHitRecord { p: Point3; normal: Vec3; material: Material; t: number; fontFace: boolean; setFaceNormal: (r: Ray, outwardNormal: Vec3) => void; } ...
C#
UTF-8
960
2.84375
3
[]
no_license
using System; using System.Collections.Generic; public static class DailyAchievementDictionary { // Key : DB_DailyAchieveList.Index // Value : // [IMPLEMENT] // int -> enum private static readonly Dictionary<int, Type> s_AchvCompDict = new Dictionary<int, Type>(); static DailyAchievementDic...
JavaScript
UTF-8
242
3.25
3
[]
no_license
function mostrar() { var numeroIngresado; for(var i=0; numeroIngresado!=9; i++) { numeroIngresado = prompt("Ingrese un numero"); numeroIngresado = parseInt(numeroIngresado); } alert("Usted ingreso el numero 9, fin del ciclo"); }
Java
UTF-8
483
1.84375
2
[]
no_license
package com.facebook.compactdiskmodule; import com.facebook.common.init.INeedInit; import com.facebook.compactdisk.LazyDispatcher; import javax.inject.Inject; /* compiled from: max_impressions */ public class LazyDispatcherInit implements INeedInit { private final LazyDispatcher f8194a; @Inject public La...
TypeScript
UTF-8
478
3.125
3
[ "MIT", "JSON" ]
permissive
import { ArgumentException } from './argument-exception' export class ArgumentNullException extends ArgumentException { /* istanbul ignore next */ public constructor(paramName?: string, message?: string) { super(paramName, composite(paramName, message)) } } function composite(paramName?: string, message?: s...
C++
UTF-8
585
2.8125
3
[]
no_license
#ifndef DEFAULT_RANDOM_ENGINE_HPP #define DEFAULT_RANDOM_ENGINE_HPP /*! @file default_random_engine.hpp @brief グローバルの乱数生成エンジン */ #include <random> /*! @namespace estd @brief extended std */ namespace estd { using DefaultRandomEngineType = std::mt19937; inline DefaultRandomEngineType& GetDefaultRandomEngine(...
Markdown
UTF-8
2,756
4.25
4
[ "MIT" ]
permissive
--- title: C++ 运算符重载 key: 2015-10-31-operator date: 2015-10-31 10:50 categories: C++ tags: [C++] --- 本例为实现复数运算,定义一个复数类,其中私有成员变量有两个,实数部real和虚数部image,通过运算符重载实现复数的直接相加减。 ```cpp #include<iostream> using namespace std; class Complex { //复数类 private: //定义私有成员变量 double real; //定义实数部 double image; ...
C
UTF-8
2,677
2.9375
3
[]
no_license
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 24 struct Natal{ char pais[50]; char saudacao[50]; }; typedef struct Natal natal; int main() { char p[50]; natal * trad = NULL; int i, aux; trad = calloc(N, sizeof(natal)); sprintf(trad[0].pais,"brasil"); sprintf(...
Python
UTF-8
1,786
3.359375
3
[]
no_license
# # @lc app=leetcode.cn id=124 lang=python3 # # [124] 二叉树中的最大路径和 # # https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/description/ # # algorithms # Hard (44.67%) # Likes: 1389 # Dislikes: 0 # Total Accepted: 184.7K # Total Submissions: 413.4K # Testcase Example: '[1,2,3]' # # 路径 被定义为一条从树中任意节点出发,沿父节点...
PHP
UTF-8
2,077
3.6875
4
[]
no_license
<?php #2020.7.9 三数之和 /** * @param Integer[] $nums * @return Integer[][] */ function threeSum($nums) { $threeArray = []; $count = count($nums); sort($nums); for ($i = 0; $i < $count - 2; ++$i) { if ($nums[$i] > 0) break; if ($i > 0 && $nums[$i] === $nums[$i - 1]) continue; $fi...
Markdown
UTF-8
2,967
3.140625
3
[]
no_license
# YouTube iFrame API Wrapper A convenient way to add custom functionality and styles to YouTube's video player using the iFrame API provided by YouTube. > ***Warning*** Bug in IE9. Player carrys on playing after the preload play/pause/seek cycle. ### Basic Usage Add the template wherever you want the video ...
Swift
UTF-8
3,497
3.28125
3
[]
no_license
// // TextSettingAttribute.swift // SwiftUIPractice // // Created by 灵 Q on 2020/4/13. // Copyright © 2020 灵 Q. All rights reserved. // import SwiftUI struct TextSettingAttribute: View { var body: some View { VStack { //设置字体之间的间隙 Text("Hello, World!,哈哈哈,") .trac...
Swift
UTF-8
6,542
2.515625
3
[ "MIT" ]
permissive
// // ViewController.swift // Actions // // Created by Infraestructura on 6/14/19. // Copyright © 2019 Daniel Rosales. All rights reserved. // import UIKit import Alamofire class ViewController: UIViewController, UITextFieldDelegate { @IBAction func unwindToHome(_ unwindSegue: UIStoryboardSegue) { ...
C
UTF-8
787
2.609375
3
[]
no_license
#include "screenster.h" typedef struct { draw_state_t draw_state; } saved_graphics_state_t; #define GRAPHICS_STACK_SIZE 32 static saved_graphics_state_t graphics_stack[GRAPHICS_STACK_SIZE]; static int graphics_stack_count = 0; void reset_graphics_state() { graphics_stack_count = 0...
Python
UTF-8
561
3.75
4
[]
no_license
# Given the head of a singly linked list, return the middle node of the linked list. # If there are two middle nodes, return the second middle node. # Definition for singly-linked list. # class ListNode(object): # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solu...
Markdown
UTF-8
608
2.875
3
[]
no_license
# using-mixpanel This sample website explains how you can use mixpanel to track user activities on your website # Steps These will be the steps 1. Create an account on mixpanel. 2. You will get an installation script for every language, I am using JavaScript here. 3. Add that script just above your closing head code...
JavaScript
UTF-8
1,231
2.59375
3
[]
no_license
const jwt = require("jsonwebtoken"); const authMiddleware = {}; authMiddleware.loginRequired = async (req, res, next) => { try { // 1. Get the token from request const tokenString = req.headers.authorization; if (!tokenString) { throw new Error("Token not found"); } const token = tokenStri...
Java
UTF-8
1,069
2
2
[]
no_license
package com.siliconlabs.bluetoothmesh.App; import com.siliconlabs.bluetoothmesh.App.Fragments.NetworkList.NetworkListFragment; import com.siliconlabs.bluetoothmesh.App.Fragments.NetworkList.NetworkListModule; import dagger.Binds; import dagger.Module; import dagger.Subcomponent; import dagger.android.AndroidInjector; ...
Markdown
UTF-8
776
3.21875
3
[]
no_license
#React Native and Redux <hr> This application was a tutorial to work with react native and redux. The app takes some dummy JSON objects displaying different library names such as "Webpack", "React", etc and displays them in a list view. Then as the user taps through the different names, an action creater to update th...
JavaScript
UTF-8
2,688
2.640625
3
[]
no_license
var doctors = require('./data/doctors.json') var restaurants = require('./data/restaurants.json') var users = require('./data/users.json') var tips = require('./data/tips.json') module.exports = function(app) { app.get('/search', function(req, res) { res.render('search') }) app.get('/search/resta...
Markdown
UTF-8
664
3.078125
3
[ "Apache-2.0" ]
permissive
# Simple node app A pretty simple node application to show how to create and use a docker container. It can be used for creating simple one off services that exit after running. ## For Building the container ``` docker build -t my-node-app . ``` ## For Running the container ``` docker run my-node-app ``` ## Resour...
Java
UTF-8
1,376
2.046875
2
[]
no_license
package project.club.p002.service; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import project.club.p002.dao.ClubP002_d002DAO; import project.club.vo.ClubMemberVO; @Service public class ClubP002_d002Service...
Python
UTF-8
913
3.1875
3
[]
no_license
#!/bin/env python3 import glob import os, sys def main(dovedir): """This is the main commandline function (list_unique_dates.py) It reads the SR image files in a directory and lists the unique dates in standard output """ imglist = glob.glob(dovedir+'/2*_SR.tif') print("Number of images: %d" % (len(imgli...
Python
UTF-8
51
3.140625
3
[]
no_license
nombre = input ("ingrese su nombre") print(nombre)
JavaScript
UTF-8
1,012
2.78125
3
[]
no_license
const Sequelize = require('sequelize'); const sequelize = new Sequelize('clase_4', 'root', '', { host: 'localhost', dialect: 'mariadb' }); sequelize .authenticate() .then(() => { console.log('Connection has been established successfully.'); }) .catch(err => { console.error('Unable to connect to th...
Java
UTF-8
1,517
3.59375
4
[]
no_license
import java.util.Stack; /* * @Author: Scarlett Chen * @date: 12/27/2014 Sat 11:42 PM * LeetCode 156 Largest Rectangle in Histogram * 1. o(n^2) + 剪枝可过 * 2. 线段树,维护线段之中的最小值 + 分治 recursive 可过 http://www.geeksforgeeks.org/largest-rectangular-area-in-a-histogram-set-1/ * 3. 用栈 保持递增序列 * 这个讲得特别好:http://blog.csdn.net/...
Python
UTF-8
1,897
2.5625
3
[]
no_license
import cv2 import matplotlib.pyplot as plt import numpy as np import torch from object_detection_dataset import DataTransform from object_detection_SSD import SSD def main(): voc_classes = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'dini...
Python
UTF-8
1,658
3.140625
3
[]
no_license
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Apr 30 18:19:51 2019 @author: ashleshashinde """ import csv import pandas as pd feedback_dict={} new_dict={} column_list = ['title', 'artist', 'lyrics','genre', 'mood'] def max_voting(feedback_dict): for key in feedback_dict: value=feedba...
Java
UTF-8
3,138
2.640625
3
[]
no_license
package ourneighborschild; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JRadioButton; public class StoplightPanel extends JPanel implements ActionListener, DatabaseListener { /** * This class implements a stop lig...
Rust
UTF-8
906
3.90625
4
[]
no_license
// Complete this function to return the factorial of a given number pub fn factorial(num: u64) -> u64 {} fn main() { println!("The factorial of 0 = {}", factorial(0)); println!("The factorial of 1 = {}", factorial(1)); println!("The factorial of 5 = {}", factorial(5)); println!("The factorial of 10...
C++
UTF-8
514
3.3125
3
[]
no_license
#include <iostream> #include <time.h> /*there is few comment present */ using namespace std; int main() { int numbers[10]; srand(time(NULL)); for (int i = 0; i < 10; i++) { numbers[i] = rand() % 41 - 20; // -20 ... 20 } for (int i = 0; i < 10; i++) { cout << numbers[i] << " "; } if (numbers[0] > 0) { ...
Python
UTF-8
1,326
2.921875
3
[]
no_license
# Testing the things in the funcs.py file. # Most of the underlying functions point directly to # numpy funcs so no need to test those ones. import inspect import numpy as np from src.funcs import get_funcs, create_args def test_create_args(): """ Test the creat_args function which creates random paramet...
Markdown
UTF-8
3,344
3.46875
3
[ "MIT" ]
permissive
# Get an undergraduate internship I'm writing this repo to keep track of everything I have done and continue to do in order to get an internship at basically any company I want. I messed up, it's already March of my Junior year. My very first piece of advice is to do this stuff earlier. Start your Sophomore year, even ...
Java
UTF-8
4,060
2.421875
2
[]
no_license
package com.example.zickler.projete4.controleur; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.example.zickler.projete4.R; import ...
C#
UTF-8
612
3.15625
3
[]
no_license
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace RemoveObsoleteSpaces { class Program { static void Main(string[] args) { char[] delim = { ' ' }; string strOriginal = "Jestem jaki jestem i...
C
UTF-8
683
3.71875
4
[]
no_license
#include <stdio.h> #include "utils.h" int main() { int count; char filename[50]; printf("Enter Filename to write to >> "); scanf("%s", filename); printf("Enter Number of Lines to write >> "); scanf("%d", &count); // extremely weird bug where not doing this skips over the first // ite...
C#
UTF-8
72,442
2.515625
3
[ "MIT" ]
permissive
using System; using System.ComponentModel; using System.Data; using System.Data.OleDb; using System.Data.SqlClient; using System.Reflection; using System.Text; namespace Fynydd.Halide { /// <summary> /// The Reader class provides a more powerful, flexible SQL reader class. /// </summary> /// <example>...
Java
UTF-8
2,069
2.25
2
[]
no_license
package cn.com.bbut.iy.itemmaster.service.base; import cn.com.bbut.iy.itemmaster.constant.ConstantsCache; import cn.com.bbut.iy.itemmaster.dto.base.GridDataDTO; import cn.com.bbut.iy.itemmaster.dto.base.MenuDTO; import cn.com.bbut.iy.itemmaster.dto.base.MenuParamDTO; import cn.com.bbut.iy.itemmaster.dto.base.role.Menu...
Ruby
UTF-8
1,403
2.78125
3
[]
no_license
require 'van' describe Van do describe 'initialization' do it 'has a default capacity' do van = Van.new expect(van.capacity).to eq Van::DEFAULT_CAPACITY end it 'can be created with any capacity' do van = Van.new(5) expect(van.capacity).to eq 5 end end describe '#collect_b...
Shell
UTF-8
890
2.90625
3
[]
no_license
#!/bin/bash [[ -z "${SPARK_ACTION}" ]] && { echo "SPARK_ACTION required"; exit 1; } # ACTIONS start-zk, start-kafka, create-topic, echo "Running action ${SPARK_ACTION}" case ${SPARK_ACTION} in "spark-submit-python") ./bin/spark-submit --packages $2 /opt/tap/$1 ;; "showdown") # ./bin/spark-submit --packages $2 /opt...
Python
UTF-8
1,536
3.328125
3
[]
no_license
# --- Day 3: ####### --- # # Part 1: Count trees hit down path through tiled hillside # Part 2: Count trees hit down multiple paths # import sys sys.path.append("..") from AoCCommon.InputToArray import InputToArray a = InputToArray() mydata = a.array testinput =\ """ ..##....... #...#...#.. .#....#..#. ..#.#....
PHP
UTF-8
6,557
2.515625
3
[]
no_license
<?php class AdminBuildingController extends \BaseController { /** * Display a listing of the resource. * * @return Response */ public function index() { $data['customers'] = Customer::orderBy('name')->get(); $data['buildings'] = Building::all(); return View::make('admin.building.index',...
Python
UTF-8
5,139
2.53125
3
[ "MIT" ]
permissive
import cv2 import json import logging import numpy as np import os import sys def get_name(): return "object_detection" def get_short_description(): return "Dectect objects using Yolo model" def get_description(): return """Retrieves objects on images. It will return a frame by frame analysis. ...
Java
UTF-8
277
1.78125
2
[]
no_license
package com.MQ.www; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; public class Basic { public static void main(String[] args) { WebDriver driver=new ChromeDriver(); driver.get("https://www.flipkart.com"); } }
Markdown
UTF-8
647
2.921875
3
[]
no_license
# Jopus Simple, fast, and efficient wrapper for libopusfile which allows you easily read `.ogg` files from Python. # Installation ## Requirements ### Ubuntu `apt-get install libogg-dev libopus-dev libopusfile-dev` ### MacOS `brew install opus opusfile libogg` When requirements have been installed: 1. `git clone https...
Java
UTF-8
2,287
3.765625
4
[]
no_license
import java.util.Comparator; /** * TODO: Complete the implementation of this class. * * A HuffmanTree represents a variable-length code such that the shorter the * bit pattern associated with a character, the more frequently that character * appears in the text to be encoded. */ public class HuffmanTree { ...