Skip to content

Instantly share code, notes, and snippets.

@stefanhaustein
stefanhaustein / SynchronizedObject.donating.kt
Last active December 13, 2024 15:13
SynchronizedObject qos-awareness prototyes for darwin (in compose for benchmarking)
/*
* Copyright 2024 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
import java.io.*;
import java.net.*;
public class Httpd {
public static void main(String[] args) throws IOException {
ServerSocket v = new ServerSocket(8080);
for (;;) {
Socket s = v.accept();
try {
InputStream i = new FileInputStream(new BufferedReader(new InputStreamReader(s.getInputStream())).readLine().split(" ")[1]);
new PrintStream(s.getOutputStream()).println("HTTP/1.0 200 OK\n");
// Original: https://gist.github.com/rherrmann/b1a2a633cd4c9b607fe7
// package com.codeaffine.scrolledcomposite;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
class BinaryTree<T> {
T value;
BinaryTree<T> leftChild;
BinaryTree<T> rightChild;
}