Skip to content

Instantly share code, notes, and snippets.

2018

  • 64-bit Debian 9.3 (stretch)
  • Bash: GNU bash 4.4.12(1)
  • C: gcc 6.3.0 (packages: gcc, libc6-dev) -pthread -lm -O3
  • C++: gcc 6.3.0 (packages: gcc, g++) -std=c++14 -pthread -O3
  • C#: Mono JIT 4.62 (package: mono-devel)
  • Go: 1.7.4 (package: golang-go)
  • Haskell: The Glorious Glasgow Haskell Compilation System 8.0.1 (package: ghc) +RTS -V0 -RTS -rtsopts -O2
  • Java: openjdk 1.8.0_151 (package: openjdk-8-jdk)
@yak1ex
yak1ex / a.cpp
Created April 15, 2019 12:58
GCJ2019 R1A A and another C++ matters
#include <iomanip>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <limits>
#include <bitset>
#include <map>
#include <set>
#include <queue>
https://stackoverflow.com/a/38043447
@yak1ex
yak1ex / wp.driver
Last active February 21, 2019 10:53
/**************************************************************************/
/* */
/* This file is part of WP plug-in of Frama-C. */
/* */
/* Copyright (C) 2007-2018 */
/* CEA (Commissariat a l'energie atomique et aux energies */
/* alternatives) */
/* */
/* you can redistribute it and/or modify it under the terms of the GNU */
/* Lesser General Public License as published by the Free Software */
diff -ur Win32-Ldd-0.02-orig/Ldd.xs Win32-Ldd-0.02/Ldd.xs
--- Win32-Ldd-0.02-orig/Ldd.xs 2017-06-26 21:57:35.000000000 +0900
+++ Win32-Ldd-0.02/Ldd.xs 2018-05-09 21:23:20.769338100 +0900
@@ -62,7 +62,7 @@
static struct DepTreeElement *
build_dep_tree(char *pe_file,
SearchPaths *search_paths,
- int datarelocs, int recursive, int functionrelocs) {
+ int recursive, int datarelocs, int functionrelocs) {
/* warn("build_dep_tree(%s, %p, %d, %d)", pe_file, search_paths, datarelocs, functionrelocs); */
--- origsrc/subversion-1.10.0/subversion/libsvn_subr/io.c 2018-04-24 15:58:49.920742300 +0900
+++ src/subversion-1.10.0/subversion/libsvn_subr/io.c 2018-04-24 21:16:56.215447100 +0900
@@ -4294,6 +4294,7 @@ svn_io_file_rename2(const char *from_pat
status = apr_file_rename(from_path_apr, to_path_apr, pool);
}
#elif defined (__CYGWIN__)
+ status = apr_file_rename(from_path_apr, to_path_apr, pool);
WIN32_RETRY_LOOP(status, apr_file_rename(from_path_apr, to_path_apr, pool));
#else
status = apr_file_rename(from_path_apr, to_path_apr, pool);
@yak1ex
yak1ex / ToolTemplate.cpp
Last active June 4, 2018 12:39
Convert plain C array to C++ std::array by using clang::Tooling
//===---- tools/extra/ToolTemplate.cpp - Template for refactoring tool ----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements an empty refactoring tool using the clang tooling.
@yak1ex
yak1ex / .gitignore
Last active March 6, 2018 11:41
dupchecker
node_modules/
*.BAK
@yak1ex
yak1ex / Makefile
Last active January 16, 2018 11:19
About dialog from version resource
dlg.exe: dlg.obj dlg.res
cl /EHsc /I c:\usr\local\boost dlg.obj dlg.res user32.lib version.lib
dlg.obj: dlg.cpp
cl /EHsc /c /I c:\usr\local\boost dlg.cpp
dlg.res: dlg.rc
rc dlg.rc
@yak1ex
yak1ex / editor.c
Last active December 26, 2017 09:19
Editor redirector
#include <windows.h>
#define NUM_APP 2
LPWSTR lpszKey[NUM_APP][2] = {
{ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Hidemaru", L"DisplayIcon" },
{ L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Notepad++", L"DisplayIcon" }
};
LPWSTR lpszAppSpec[][NUM_APP] = {