Skip to content

Instantly share code, notes, and snippets.

View havealex's full-sized avatar
🍊

havealex havealex

🍊
View GitHub Profile
@havealex
havealex / qtyaml.h
Created February 20, 2024 06:28 — forked from brcha/qtyaml.h
Qt Yaml support using yaml-cpp library
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* ***** END LICENSE BLOCK ***** */
/*
@havealex
havealex / TrainClassifier.md
Created January 20, 2024 01:14 — forked from yxiao1996/TrainClassifier.md
工作指南:OpenCV Cascade Classifier

How to Train Detection Model with OpenCV

  • get OpenCV

    • 请从OpenCV的官方网站获取源程序(版本2.4以上即可):

      https://opencv.org/releases.html
      
  • 按照官方指导安装OpenCV:

@havealex
havealex / Main.cs
Created January 8, 2024 02:28 — forked from fjl/Main.cs
detect foreground window switch in C#
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace ShellEventsTest
{
class Program
{
static void Main(string[] args)
{
@havealex
havealex / esm-package.md
Created December 26, 2023 01:23 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@havealex
havealex / win-gettimeofday.c
Created December 5, 2023 01:58 — forked from ugovaretto/win-gettimeofday.c
gettimeofday implementaiton for windows
/*
* Author: Ugo Varetto - [email protected]
* This code is distributed under the terms of the Apache Software License version 2.0
* https://opensource.org/licenses/Apache-2.0
*/
#include < time.h >
#include < windows.h >
#if defined(_MSC_VER) || defined(_MSC_EXTENSIONS)
@havealex
havealex / effective_modern_cmake.md
Created July 26, 2023 03:51 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@havealex
havealex / curlget.cpp
Created November 10, 2022 02:19 — forked from whoshuu/curlget.cpp
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_DLGMAIN), NULL, DlgProc);
windows CMD命令大全及详细解释和语法
引用:
http://letle.iteye.com/blog/169045
http://www.cppblog.com/kyelin/archive/2007/04/21/22540.aspx
windows批处理程序中的特殊字符
批处理介绍
纯以dos系统而言,可执行程序大约可以细分为五类,依照执行优先级由高到低排列分别是:
DOSKEY宏命令(预先驻留内存)