Skip to content

Instantly share code, notes, and snippets.

View bhamiltoncx's full-sized avatar

Ben Hamilton (Ben Gertzfield) bhamiltoncx

View GitHub Profile
@bhamiltoncx
bhamiltoncx / gist:83895a77882c96c081d200cf37505036
Created December 21, 2023 22:45
Repro for clang GMLT + LTO missing C++ namespace info
% clang++ --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.2.0
Thread model: posix
InstalledDir: /Applications/Xcode_15.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
% cat test.cc
#include <stdio.h>
namespace foo {
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.headerViewController.headerView.trackingScrollView) {
[self.headerViewController.headerView trackingScrollViewDidScroll];
}
}
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
if (scrollView == self.headerViewController.headerView.trackingScrollView) {
public final class CodePointCounter {
private final String input;
public int inputIndex = 0;
public int codePointIndex = 0;
public int advanceToIndex(int newCodePointIndex) {
assert newCodePointIndex >= codePointIndex;
while (codePointIndex < newCodePointOffset) {
int codePoint = Character.codePointAt(input, inputIndex);
inputIndex += Character.charCount(codePoint);
@bhamiltoncx
bhamiltoncx / classify21.g4
Created February 17, 2017 18:47
Unicode code point classifier using new ANTLR4 full Unicode syntax
/** classify21.g4
Automatically generated Unicode 9.0.0 codepoint classification grammar.
Generated by "makeGrammars.py".
Author: Jonathan D. Lettvin (jlettvin@gmail.com)
Date: 20161023
Legal: Copyright(c) Jonathan D. Lettvin, All Rights Reserved
License:GPL 3.0
@bhamiltoncx
bhamiltoncx / gist:ee72545f17794af133ce6347f1c1f3d9
Created August 12, 2016 16:12
Sampling profile of 4 clients simultaneously querying watchman with reader-writer lock
% sample watchman
Sampling process 1877 for 10 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Sample analysis of process 1877 written to file /tmp/watchman_2016-08-12_090108_qS3o.sample.txt
Analysis of sampling watchman (pid 1877) every 1 millisecond
Process: watchman [1877]
Path: /usr/local/bin/watchman
Load Address: 0x103d27000
Identifier: watchman
build.xml:311: The following error occurred while executing this line:
build.xml:347: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:80)
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1160)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:936)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
@bhamiltoncx
bhamiltoncx / gist:de92dc5716b16cbe9daf
Last active March 17, 2016 18:22
Immutables.org issue 286 buck build repro
% ant
Buildfile: /Users/bgertzfield/devtools/buck/build.xml
checkversion:
compile-testrunner:
[mkdir] Created dir: /Users/bgertzfield/devtools/buck/build/testrunner/classes
[javac] Compiling 15 source files to /Users/bgertzfield/devtools/buck/build/testrunner/classes
compile-aosp:
diff --git a/src/com/facebook/buck/io/AsynchronousDirectoryContentsCleaner.java b/src/com/facebook/buck/io/AsynchronousDirectoryContentsCleaner.java
index 0c540f4..567ab27 100644
--- a/src/com/facebook/buck/io/AsynchronousDirectoryContentsCleaner.java
+++ b/src/com/facebook/buck/io/AsynchronousDirectoryContentsCleaner.java
@@ -82,6 +82,7 @@ public class AsynchronousDirectoryContentsCleaner {
* instance of directory cleaning will occur at a time.
*/
public void startCleaningDirectory() {
+ LOG.warn("hello %s", "ben");
executor.execute(
% git diff
diff --git a/build.xml b/build.xml
index 39bf8e4..a4a1d2a 100644
--- a/build.xml
+++ b/build.xml
@@ -664,6 +664,8 @@
forkmode="perBatch"
haltonfailure="on"
haltonerror="on">
+ <sysproperty key="user.language" value="de" />
% rm /path/to/buck/build/successful-build
% rm -f buck-out/log/buck*.log; buck clean && rm -rf buck-out eclipse-out && buck build gerrit-common:server
Buck does not appear to have been built -- building Buck!
All done, continuing with build.
Shutting down nailgun server...
Using watchman.
[-] PROCESSING BUCK FILES...FINISHED 0.6s [100%]
[-] BUILDING...FINISHED 0.9s [100%] (1/76 JOBS, 1 UPDATED, 0.0% CACHE MISS)