Skip to content

Instantly share code, notes, and snippets.

@piratf
piratf / get_uac
Created April 20, 2017 10:39
get uac from cmd in windows
::::::::::::::::::::::::::::::::::::::::::::
:: Elevate.cmd - Version 4
:: Automatically check & get admin rights
::::::::::::::::::::::::::::::::::::::::::::
@echo off
CLS
ECHO.
ECHO =============================
ECHO Running Admin shell
ECHO =============================
@piratf
piratf / IsArithmeticProgression
Created October 23, 2016 05:47
判断数组是不是等差数列的时间 O(n),空间 O(1) 算法
#include <cstdio>
#include <vector>
#include <assert.h>
#include <limits>
static int main_ret = 0;
static int test_count = 0;
static int test_pass = 0;
#define EXPECT_EQ_BASE(equality, expect, actual, format) \
@piratf
piratf / IsArithmeticProgression
Last active October 25, 2016 10:33
判断数组是不是等差数列的时间 O(n),空间 O(1) 算法 - 这个算法是不正确的
#include <cstdio>
#include <vector>
#include <assert.h>
#include <limits>
// #include <iostream>
static int main_ret = 0;
static int test_count = 0;
static int test_pass = 0;