Skip to content

Instantly share code, notes, and snippets.

View eseidel's full-sized avatar

Eric Seidel eseidel

View GitHub Profile
@eseidel
eseidel / main.dart
Created May 26, 2020 02:25
Boids with Align and Avoid working (if not fully tuned)
import 'dart:ui';
import 'package:flutter/material.dart';
import 'dart:math';
const double kBoidVelocity = 5.0;
const double kBoidScale = 2.0;
const int kBoidCount = 100;
const double kBoidMaxAvoidSteerSpeed = .1;
// Angles above maxAlignAngle are treeted the same (caps the turn speed).
@eseidel
eseidel / main.dart
Created May 26, 2020 15:16
Boid (bird-like flocking) simulation, inspired by https://www.youtube.com/watch?v=bqtqltqcQhw
import 'dart:ui';
import 'package:flutter/material.dart';
import 'dart:math';
const double kBoidVelocity = 5.0;
const double kBoidScale = 2.0;
const int kBoidCount = 100;
const double kBoidMaxAvoidSteerSpeed = .1;
// Angles above maxAlignAngle are treeted the same (caps the turn speed).
@eseidel
eseidel / log.txt
Last active June 10, 2020 21:19
Error building on Windows
PS C:\Users\Study\Documents\GitHub\engine\src> ninja -C .\out\host_debug_unopt ninja: Entering directory `.\out\host_debug_unopt'
[2/3854] CXX obj/third_party/angle/src/libGLESv2/libGLESv2_static.global_state.obj
FAILED: obj/third_party/angle/src/libGLESv2/libGLESv2_static.global_state.obj
ninja -t msvc -e environment.x64 -- ../../third_party/llvm-build/Release+Asserts/bin/clang-cl.exe /nologo /showIncludes /FC @obj/third_party/angle/src/libGLESv2/libGLESv2_static.global_state.obj.rsp /c ../../third_party/angle/src/libGLESv2/global_state.cpp /Foobj/third_party/angle/src/libGLESv2/libGLESv2_static.global_state.obj /Fdobj/third_party/angle/libGLESv2_static_cc.pdb
../../third_party/angle/src/libGLESv2/global_state.cpp(39,1): error: static_assert failed due to requirement 'std::is_trivially_constructible<std::atomic<std::mutex *>>::value' "global mutex is not trivially constructible"
static_assert(std::is_trivially_constructible<decltype(g_Mutex)>::value,
^ ~~~
@eseidel
eseidel / log.txt
Created June 15, 2020 23:25
clean build
C:\Users\Study\Documents\GitHub\slide_puzzle [master ≡ +1 ~0 -0 !]> flutter run -d web --web-port 8080 --local-engine=host_debug_unopt --local-engine-src-path=/src/engine/src -v
[ +116 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[ +74 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 248d746575b713da74144750527356a1c0095546
[ +1 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git tag --contains HEAD
[ +257 ms] Exit code 0 from: git tag --contains HEAD
[ +2 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git describe --match *.*.*-*.*.pre --first-parent
--long --tags
[ +106 ms] Exit code 0 from: git describe --match *.*.*-*.*.pre --first-parent --long --tags
@eseidel
eseidel / normal_run.txt
Created June 15, 2020 23:55
log from a normal (no local-engine-path) run
C:\Users\Study\Documents\GitHub\slide_puzzle [master ≡ +1 ~0 -0 !]> flutter run -d web --web-port 8080 -v
[ +108 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[ +75 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 248d746575b713da74144750527356a1c0095546
[ ] executing: [C:\Users\Study\Documents\GitHub\flutter/] git tag --contains HEAD
[ +252 ms] Exit code 0 from: git tag --contains HEAD
[ +2 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git describe --match *.*.*-*.*.pre --first-parent
--long --tags
[ +103 ms] Exit code 0 from: git describe --match *.*.*-*.*.pre --first-parent --long --tags
@eseidel
eseidel / success.txt
Created June 15, 2020 23:59
Successful run with windows-style path for --local-engine-src-path
C:\Users\Study\Documents\GitHub\slide_puzzle [master ≡ +1 ~0 -0 !]> flutter run -d web --web-port 8080 --local-engine=host_debug_unopt --local-engine-src-path=C:\src\engine\src -v
[ +114 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[ +75 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 248d746575b713da74144750527356a1c0095546
[ +1 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git tag --contains HEAD
[ +253 ms] Exit code 0 from: git tag --contains HEAD
[ +2 ms] executing: [C:\Users\Study\Documents\GitHub\flutter/] git describe --match *.*.*-*.*.pre --first-parent
--long --tags
@eseidel
eseidel / log.txt
Created June 16, 2020 01:14
Log from felt_windows.bat build -w
C:\src\engine\src [master]> .\flutter\lib\web_ui\dev\felt_windows.bat build -w
"Running \`pub get\` in 'engine/src/flutter/web_sdk/web_engine_tester'"
Resolving dependencies...
Got dependencies!
"Running \`pub get\` in 'engine/src/flutter/lib/web_ui'"
Resolving dependencies...
Got dependencies!
Running gn...
Generating GN files in: out\host_debug_unopt
Generating Visual Studio projects took 4102ms
@eseidel
eseidel / ninja.txt
Created June 17, 2020 16:12
null build with -d explain
C:\src\engine\src [master]> ninja -C .\out\host_debug_unopt -v -d explain
ninja: Entering directory `.\out\host_debug_unopt'
ninja explain: output gen_snapshot.lib doesn't exist
ninja explain: gen_snapshot.exe is dirty
ninja explain: gen_snapshot.exe is dirty
ninja explain: gen/flutter/lib/snapshot/vm_isolate_snapshot.bin is dirty
ninja explain: gen/flutter/lib/snapshot/vm_snapshot_instructions.bin is dirty
ninja explain: gen/flutter/lib/snapshot/isolate_snapshot.bin is dirty
ninja explain: gen/flutter/lib/snapshot/isolate_snapshot_instructions.bin is dirty
ninja explain: obj/flutter/lib/snapshot/generate_snapshot_bin.stamp is dirty
@eseidel
eseidel / null_build.txt
Created June 17, 2020 22:40
null build after dart.lib patches
C:\src\engine\src [master +4 ~1 -0 !]> ninja -C .\out\host_debug_unopt\ -v -d explain
ninja: Entering directory `.\out\host_debug_unopt\'
ninja explain: output flutter_web_sdk_stamp doesn't exist
ninja explain: flutter_web_sdk_stamp is dirty
ninja explain: obj/flutter/web_sdk/web_engine_sources.stamp is dirty
ninja explain: output flutter_web_engine_sdk_stamp doesn't exist
ninja explain: flutter_web_engine_sdk_stamp is dirty
ninja explain: obj/flutter/web_sdk/web_ui_sources.stamp is dirty
ninja explain: obj/flutter/web_sdk/web_sdk.stamp is dirty
ninja explain: obj/flutter/flutter.stamp is dirty
@eseidel
eseidel / main.dart
Created February 27, 2021 21:48
Set<List<String>> lack of uniqueness footgun
void main() {
Set test = Set();
test.add(['a']);
test.add(['a']);
// The fact that this is not 1, is a footgun. :/
print("test: ${test.length}");
}