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
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> |
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
#!/usr/bin/env python | |
# | |
# Mersenne Twister predictor | |
# | |
# Feed this program the output of any 32-bit MT19937 Mersenne Twister and | |
# after seeing 624 values it will correctly predict the rest. | |
# | |
# The values may come from any point in the sequence -- the program does not | |
# need to see the first 624 values, just *any* 624 consecutive values. The | |
# seed used is also irrelevant, and it will work even if the generator was |
NewerOlder