Skip to content

Instantly share code, notes, and snippets.

View justjanne's full-sized avatar

Janne Mareike Koschinski justjanne

View GitHub Profile
Aufgabe 1 (a)
=============
> Wie kann man einen Addierer als Subtrahierer verwenden?
Ein Addierer kann als Subtrahierer verwendet werden, indem das zweite Argument
negiert wird.
$a - b = a + (-b)$
Im Zweierkomplement können wir eine Zahl negieren, indem wir alle ihre Bits
/**
* Handler of incoming messages from CoreConnection, since it's in another
* read thread.
*/
class IncomingHandler extends Handler {
public boolean disabled = false;
@Override
public void handleMessage(android.os.Message msg) {
if (msg == null || coreConn == null || disabled) {
/*
* The addIrcUser function in the Network class is called whenever a new
* IRC user appears on a given network.
*/
} else if (className.equals("Network")) {
switch(function) {
case "addIrcUser":
String nick = (String) packedFunc.remove(0).getData();
IrcUser user = new IrcUser();
user.nick = nick.split("!")[0];
; Takes two sorted lists
; Returns a sorted list with all elements from the first 2 lists
; (Works like the set union from a previous series)
(: merge-lists ((list-of number) (list-of number) -> (list-of number)))
(define merge-lists
(lambda (xs ys)
(cond
[(empty? xs) ys]
[(empty? ys) xs]
[(< (first xs) (first ys))
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
text-align: center;
background: #7c7c7c;
}
.block {