Today I Learned (TIL). I try to write down what I have learned every day. They’re usually short technical notes which I find useful or interesting to me. These are some of the TIL entries which are worth sharing :
df
du
is 8kbdu
du
See this post from Mike Golvach for thorough explanation: Why DU And DF Display Different Values On Linux And Unix
Java class with enum switch statement is translated to switch statement with ordinal:
public enum MyEnum {
YES,
NO;
public static void main(String[] args) {
MyEnum e = NO;
switch (e) { // uses e.ordinal()
case YES:
System.out.println("Yes");
break;
case NO:
System.out.println("No");
break;
}
}
}
You can use extract() in oracle in order to get the date parts
select
extract(year from created_timestamp),
extract(month from created_timestamp),
extract(day from created_timestamp)
from student;
Source: EXTRACT
Process bound to 127.0.0.1 can only be accessed by other programs from the same machine
binding to 0.0.0.0 means listen to all interfaces ( e.g. all network interfaces connected to the machine )
on Mac 27.0.0.1 /32 is bound to loopback
on Windows 127.0.0.0 /8 is bound to loopback
Source: 0.0.0.0 vs 127.0.0.1