安装CLion很简单,流程和JetBrains的其他IDE基本是一样的,只是最后需要配置一下工具链。我使用的是Cygwin。
安装Cygwin的教程网上有很多,cmake,make,gcc/clang, gdb/lldb这些是必须要安装的组件。
打开Cygwin,找一个合适的位置,将GoogleTest的最新源码克隆到本地,然后进行编译和安装。
| # eg: download exa | |
| curl -s https://api.github.com/repos/ogham/exa/releases/latest | grep browser_download_url | grep linux | cut -d'"' -f4 |
| $hexified = "00,00,00,00,00,00,00,00,03,00,00,00,3A,00,1D,00,1D,00,3A,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); |
| // vim: set ft=javascript: | |
| settings.tabsMRUOrder = false; | |
| mapkey('T', 'Choose a tab with omnibar', function() { | |
| Front.openOmnibar({type: "Tabs"}); | |
| }); | |
| mapkey('gt', '#8Open a URL', function() { | |
| Front.openOmnibar({type: "URLs", extra: "getAllSites"}); |
| package main | |
| import "fmt" | |
| func foo1() { | |
| fmt.Println("Hello, world") | |
| fmt.Println("Hello, world") | |
| fmt.Println("Hello, world") | |
| fmt.Println("Hello, world") | |
| fmt.Println("Hello, world") |
| package main | |
| import "fmt" | |
| func main() { | |
| for prime := range primes(100) { | |
| fmt.Println(prime) | |
| } | |
| } |
| gpg --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 --s2k-mode 3 \ | |
| --s2k-count 65000000 --edit-key <key id> |
| // 保证总和为100%的前提下损失精度最小的百分比Rounding算法 | |
| import com.google.common.math.IntMath | |
| fun percentageRound(a: List<Double>, precision: Int): List<Double> { | |
| val factor = IntMath.pow(10, precision) | |
| val scaled = a.map { it * factor } | |
| val rounded = scaled.mapIndexed { i, num -> i to Math.round(num) } | |
| val sum = rounded.fold(0L) { acc, pair -> acc + pair.second } |
将字符串分割成数组
str='Tom,Jarry'
users=(${(@s/,/)str})将数组合并成字符串
# 用回车符Join
${(j:\n:)users}