x86 GAS uses reverse order of destination and source registers compared to Intel documentation. This was very confusing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let points = [ | |
{ x: 38, y: 136 }, | |
{ x: 65, y: 89 }, | |
{ x: 99, y: 178 }, | |
{ x: 149, y: 93 }, | |
{ x: 191, y: 163 }, | |
{ x: 227, y: 122 }, | |
{ x: 251, y: 132 }, | |
]; | |
let tension = 0.5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
Future<void> main() async { | |
final completer = Completer<bool>(); | |
final future = completer.future; | |
completer.complete(true); | |
print(await future); | |
print(await future); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by tejag on 2024-04-26. | |
// | |
#include <cstdint> | |
#include <cstring> | |
#include <functional> | |
#include <iostream> | |
#include <queue> | |
#include <syncstream> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename I> | |
const char *tcNegSlow(I *out, const I *inp, uint64_t nel) { | |
constexpr size_t laneSize = simdSize<I>(); | |
uint16_t concurrency = std::thread::hardware_concurrency(); | |
uint64_t totalLanes = (nel + laneSize - 1) / laneSize; | |
uint64_t lanesPerThread = std::max( | |
uint64_t((totalLanes + concurrency - 1) / concurrency), uint64_t(1) | |
); | |
std::vector<std::future<void>> futures(concurrency); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> class Simd; | |
#if defined(TC_ARCH_X86) | |
#include <bits/stdc++.h> | |
#include <x86intrin.h> | |
uint16_t simdSize = 128; | |
uint16_t detectSimdSize() { | |
if (__builtin_cpu_supports("avx512f")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by tejag on 2024-04-26. | |
// | |
#include <iostream> | |
#include <type_traits> | |
#include <typeinfo> | |
#include <cstdint> | |
#include <cxxabi.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by tejag on 2024-04-26. | |
// | |
#include <cxxabi.h> | |
#include <experimental/simd> | |
#include <iostream> | |
#include <vector> | |
template <typename T> void printType() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl 'http://localhost:9515/status' | |
# Create new headless session | |
curl -XPOST 'http://localhost:9515/session' -d '{"desiredCapabilities": {"browserName": "chrome", "goog:chromeOptions": {"args": ["--headless", "--no-sandbox"]}}}' | |
# Navigate to URL | |
curl -XPOST "http://localhost:9515/session/$1/url" -d '{"url": "https://google.com"}' | |
# Execute script | |
curl -XPOST http://localhost:9515/session/$1/execute/sync -d '{"script": "window.alert(\"Annoying\")", "args": []}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="scaffolded-by" content="https://github.com/dart-lang/stagehand"> | |
<title>Dart WebGL triangle</title> | |
<style> |
NewerOlder