curl -b "oraclelicense=accept-securebackup-cookie" -L -C - -O http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
// This is the source code for Integer.bitCount() for Java 1.5+ | |
// <http://www.docjar.com/html/api/java/lang/Integer.java.html> line 1132 | |
public static int bitCount(int i) { | |
i = i - ((i >>> 1) & 0x55555555); | |
i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); | |
i = (i + (i >>> 4)) & 0x0f0f0f0f; | |
i = i + (i >>> 8); | |
i = i + (i >>> 16); | |
return i & 0x3f; |
@Entity | |
public class Parent { | |
@Id | |
private Long id; | |
@OneToOne(fetch = FetchType.LAZY) | |
@NotFound(action=NotFoundAction.IGNORE) // You don't need this annotation if you use the approach below | |
private Son son; | |
States. The final frontier. These are the voyages of an enterprising developer. Her eternal mission: to explore strange new techniques, to seek out better ways to engineer for mental models and new design patterns. To boldly go where a few awesome devs have gone before.
So you’ve found our poignant guide to SCXML and surely you’re wondering “Why should I want to go out of my way to use formal state machines?” or something like that. Hopefully this introduction addresses that kind of question.
It seems that it does not matter what timezone is on the server as long as you have the time set right for the current timezone, know the timezone of the datetime columns that you store, and are aware of the issues with daylight savings time.
On the other hand if you have control of the timezones of the servers you work with then you can have everything set to UTC internally and never worry about timezones and DST.
Here are some notes I collected of how to work with timezones as a form of cheatsheet for myself and others which might influence what timezone the person will choose for his/her server and how he/she will store date and time.
Prereq:
apt-get install zsh
apt-get install git-core
Getting zsh to work in ubuntu is weird, since sh
does not understand the source
command. So, you do this to install zsh
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
The book Java Generics and Collections has this information (pages: 188, 211, 222, 240).
List implementations:
get add contains next remove(0) iterator.remove
ArrayList O(1) O(1) O(n) O(1) O(n) O(n)
LinkedList O(n) O(1) O(n) O(1) O(1) O(1)
/** | |
* Executor which useful for unit testing | |
*/ | |
public class CurrentThreadExecutor implements ExecutorService { | |
@Override | |
public void execute(Runnable command) { | |
command.run(); | |
} |
This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12
- Installing Homebrew is effortless, open Terminal and enter :
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :
#################################################################################################### | |
# This function converts any file into C/C++ source code. | |
# Example: | |
# - input file: data.dat | |
# - output file: data.h | |
# - variable name declared in output file: DATA | |
# - data length: sizeof(DATA) | |
# embed_resource("data.dat" "data.h" "DATA") | |
#################################################################################################### |