use annotation “@Encoded”
Ex:
@Path("{first}/get") public Response getYouWant(@Context HttpHeaders httpHeaders, @PathParam("first") String first, @QueryParam("second") @Encoded String second);
use annotation “@Encoded”
Ex:
@Path("{first}/get") public Response getYouWant(@Context HttpHeaders httpHeaders, @PathParam("first") String first, @QueryParam("second") @Encoded String second);
src: Linux command to get time in milliseconds
date +”%T.%N” returns the current time with nanoseconds.
date +”%T.%6N” returns the current time with nanoseconds rounded to the first 6 digits, which is microseconds.
date +”%T.%3N” returns the current time with nanoseconds rounded to the first 3 digits, which is milliseconds.
String[] cmds = {"open", tempFile.getAbsolutePath(), "-a", "/Applications/Microsoft Office 2011/Microsoft Excel.app"}; Runtime.getRuntime().exec(cmds);
edit ~/.bash_profile
if [ -f $(xcode-select -p)/usr/share/git-core/git-completion.bash ]; then . $(xcode-select -p)/usr/share/git-core/git-completion.bash . $(xcode-select -p)/usr/share/git-core/git-prompt.sh fi #enables color in the terminal bash shell export CLICOLOR=1 #sets up the color scheme for list export LSCOLORS=ExFxCxDxBxegedabagacad #sets up the prompt color (currently a green similar to linux terminal) export PS1='\n\[\e[1;30m\]┌─\[\e[0m\]\[\e[01;343m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\n\[\e[1;30m\]└──\[\e[0m\]\$ \[\e[00;33m\]$(__git_ps1 "(%s)")\[\e[00m\]' #enables color for iTerm export TERM=xterm-color
Download hbase package tar.gz file from https://www.cloudera.com/documentation/enterprise/release-notes/topics/cdh_vd_cdh_package_tarball_59.html
Untar tar.gz file
edit conf/hbase-env.sh
export JAVA_HOME={{JAVA_HOME Directory path}}
edit conf/hbase-site.xml
<property> <name>hbase.rootdir</name> <value>file:///{{location}}/data</value> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>{{location}}/zookeeper</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>{{hostname}}</value> </property>
start hbase service
bin/start-hbase.sh
run hbase shell
bin/hbase shell
stop hbase shell service
bin/stop-hbase.sh
avoid to face the exception ‘java.lang.ClassCastException With com.google.gson.internal.LinkedTreeMap cannot be cast to…’, we use the TypeToken to convert json to List
public class Object { @SerializedName("n") private String name; @SerializedName("i") private String id; public String getName() { return name; } public Object setName(String name) { this.name = name; return this; } public String getId() { return id; } public Object setId(String id) { this.id = id; return this; } } // [{"n":"cowman","i":"cowman@xxx.com.tw"}, {"n":"cowman1","i":"cowman1@xxx.com.tw"}] List<Object> ObjectList = new Gson().fromJson(targets, new TypeToken<List<Object>>(){}.getType());
exec > >(tee -i logfile.txt)
source: stackoverflow: redirect COPY of stdout to log file from within bash script itself
Private Sub Worksheet_Change(ByVal Target As Range) 'Does the validation range still have validation? Set range1 = Range("B2:B6500") If HasValidation(range1) Then Exit Sub Else Application.Undo MsgBox "您的操作將會被取消, " & vbCrLf & "請使用下拉選單進行選擇", vbCritical End If End Sub Private Function HasValidation(r) As Boolean ' Returns True if every cell in Range r uses Data Validation On Error Resume Next x = r.Validation.Type If Err.Number = 0 Then HasValidation = True Else HasValidation = False End Function
echo $(($(date +%s%N)/1000000))
in Mac OS X, the command date
does not support the %N flag, we can install coreutils
using homebrew.
brew install coreutils
Then use gdate
to get which we want.
echo $(($(gdate +%s%N)/1000000))
find /var/log/radius/radacct -type f -name "reply*" -mtime +60 -exec rm -rf {} \;
-mtime N — more than N days without being edited
-exec CMD {} \; — comands, {} means the files which be found.