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
/* | |
* Copyright (C) 2011 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 |
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
#!/bin/sh | |
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply | |
BW="56kbps" | |
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms | |
LATENCY="60ms" | |
# Chance of packet loss. Also applied to both interfaces, so it is 1%. | |
LOSS="0.5%" | |
# The device name of your wifi device. | |
WIFI="wlan0" |
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
public class AmazonKindlePaddingGuesser() { | |
/** | |
* Certain devices (I'm looking at you, Amazon) don't displace the root of the view | |
* hierarchy by the width of the status bar. | |
* See https://developer.amazon.com/public/solutions/devices/fire-tablets/specifications/03-ux-specifications and | |
* https://developer.amazon.com/appsandservices/solutions/devices/kindle-fire/specifications/01-device-and-feature-specifications for | |
* more info | |
* @param layout A layout that should get the right padding applied | |
* @return the width of the right padding in px | |
*/ |
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 time | |
import sys | |
import logging | |
from pyhomematic import HMConnection | |
logging.basicConfig(level=logging.DEBUG) | |
def systemcallback(src, *args): | |
print(src) | |
for arg in args: |