https://stackoverflow.com/questions/1509391/how-to-get-the-one-entry-from-hashmap-without-iterating
This file contains hidden or 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
| https://stackoverflow.com/questions/1509391/how-to-get-the-one-entry-from-hashmap-without-iterating |
This file contains hidden or 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
| http://yikun.github.io/2015/04/06/Java-TreeMap%E5%B7%A5%E4%BD%9C%E5%8E%9F%E7%90%86%E5%8F%8A%E5%AE%9E%E7%8E%B0/ |
This file contains hidden or 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
| 原文:http://www.malcolmhardie.com/weblogs/angus/2004/10/23/java-filewriter-xml-and-utf-8/ | |
| Java FileWriter 默认是用(ISO-8859-1 or US-ASCII)西方编码的,总之不是UTF-8的,而FileWriter类有getEncoding方法,却没有setEncoding的方法,如下的写法可以使正确输出UTF-8的文件: | |
| OutputStreamWriter out = new OutputStreamWriter(new FileOutputStream(path),"UTF-8"); | |
| 或者 | |
| Writer out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(this.outputFilename),”UTF-8″)); |
This file contains hidden or 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
| chrome: | |
| +t 新 tab | |
| +shit+t 打开最近关闭的 tab | |
| +n 新窗口 | |
| +l 地址栏 | |
| +o 打开文件 | |
| +w 关闭 tab | |
| +r reload | |
| +shift+r force reload | |
| +shift+{ 上一个 tab |
#include <stdio.h>
int is_sufficient(const int* cur_avail, const int* cur_req){
for(int i = 0; i < 3; i++){
if(cur_avail[i] < cur_req[i]){
return 0;
}
}
return 1;Modern Linux desktop environments (Gnome 3, Ubuntu Unity, Docky) use the WMClass property to associate windows with the owning application. Many Java-based applications have the problem where the windows created by the application are not associated with the shortcut used to start the application (so the dock contains multiple copies of the same icon).
So the field called StartupWMClass is a string that defines in which class the application is grouped in the Unity Launcher at startup.
You can find out which WM_CLASS your window has got when you type in a terminal:
xprop WM_CLASS
and then click at the window. In case of the gnome terminal the output is as follows:
WM_CLASS(STRING) = "gnome-terminal", "Gnome-terminal"
This file contains hidden or 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
| # https://www.mavjs.org/post/swap-ctrl-and-capslock-on-windows/ | |
| $hexified = "00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00".Split(",") | % { "0x$_"}; | |
| $kbLayout = 'HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout'; | |
| New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified) |
This file contains hidden or 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
| #!/usr/bin/env zsh | |
| # | |
| # Check file exists | |
| # | |
| if [ ! -f /tmp/foo.txt ]; then | |
| echo "File not found!" >&2 | |
| exit 1 | |
| fi |
OlderNewer