Sonntag, 30. November 2014

How to fix Yosemite WiFi

In case you are struggling with Yosemite WiFi lags like slow emailing, slow surfing, and slow-whatever-has-to-do-withweb turn off AirDrop! You can shutdown the very aggressive AirDrop with this terminal command:

sudo ifconfig awdl0 down

TL,DR: AirDrop sends very often and especially when you have multiple Apple devices (Yosemite + iOS) the cause so called network collisions (that is when multiple services try to go through one connection). After a collision your OS will try to resend the collided packets again and try over and over until they are transmitted. However this 'try over and over' takes a while which slows down everything and causes even more collisions.

Samstag, 29. November 2014

Android: A better, easier and more comfortable Log - determines automatically a Tag

I can't understand why Google made Log so complex. It could be that easy. Instead of Log.X just type  L.X (import the class first). The tag  is set automatically - you can choose between the Class, Class.Method, Class:LineNumer or Class.Method:LineNumber as tags - awesome, right?
//Use it:
L.e("Hello World! I am an error.");
L.e("wow so easy!");

import android.util.Log;

public class L {

 public static enum LogType {
 private static LogType mType = LogType.CLASS;
 public static void setLogType(LogType type) {
  mType = type;
 public static void e(String msg) {
  Log.e(getTag(), msg);
 public static void i(String msg) {
  Log.i(getTag(), msg);
 public static void d(String msg) {
  Log.d(getTag(), msg);
 public static void v(String msg) {
  Log.v(getTag(), msg);
 public static void w(String msg) {
  Log.w(getTag(), msg);
 public static void wtf(String msg) {, msg);
 private static String getTag() {
  StackTraceElement[] s = Thread.currentThread().getStackTrace();
  switch (mType) {
  case CLASS:
   return s[4].getClassName();
   return s[4].getClassName()+":"+s[4].getLineNumber();
   return s[4].getClassName()+"."+s[4].getMethodName();
   return s[4].getClassName()+"."+s[4].getMethodName()+":"+s[4].getLineNumber();
  return null;