Mathematica 10默认的色调是挺好看,但是想写一篇蓝色为主色调的报告,然后就去查修改绘图的色调,了解到了ColorData这个玩意。它内置了一系列的色调,每个色调可通过向其传递一个0-1的数值获取一个对应的色调中颜色。具体操作敬请参考Mathematica内置的强大帮助引擎。

然后找到了一个比较理想的"DeepSeaColors",但是当它作为参数传递给不论是ChartStyle还是ColorFunction的时候,都相当地不尽人意,要么全局颜色过浅,要么全局颜色过深。后来想,能不能从中提取出部分色调供自己使用?因为觉得其中某段颜色还是挺好看的。

然后在网上查到了用匿名函数和Resize实现的方法。不过当时不知道ColorData里面取出来的是ColorDataFunction

暂时记在这:
https://community.wolfram.com/groups/-/m/t/113779

ColorFunction -> (ColorData["VisibleSpectrum"][
    Rescale[#, k*{-1, 1}, {380, 750}]] &)

然后就有了后来自己的想法,由于时间有限,只使用了一次函数来表达进行映射:

myBlueSeries = Table[
   ColorData[{"DeepSeaColors", "Reversed"}][x/1.6 + 0.1], {x, 0, 1, 0.2}];

然后使用的时候在图表中添加选项ChartStyle -> myBlueSeries,即可获得效果还可以的蓝色图例系列。 生成颜色的数量和变化规律都在上面那句Table里设置,有需要的自行修改即可。

红帽系的系统安装moreutils包,可以提供errno命令,快速查看errno含义。

不记得之前为什么用过了,反正在配置VS2019+CUDA9.2的时候用过这个方法,至于有没有用,为啥用都忘记了

https://devtalk.nvidia.com/default/topic/1049858/cuda-setup-and-installation/msvs-2019-and-cuda-10-1-issues/

复制一下防止原链翻车

I found a solution to this.

  1. Copying the content of the folder: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\extras\visual_studio_integration\MSBuildExtensions

    to:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations

  2. Close all running instances of Visual Studio. Go to C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\Extensions\NVIDIA. Create a directory here called CUDA 10.1 Wizards, then create a sub-directory underneath it called 10.1.

  3. In this 10.1 sub-directory, create shortcuts to: (VS will not allow to create the shortcuts directly here. Create the shortcuts on the desktop and move them from there to this 10.1 sub-directory):

    C:\ProgramData\NVIDIA GPU Computing Toolkit\v10.0\extras\visual_studio_integration\CudaProjectVsWizards\2019\extension.vsixmanifest

    and

    C:\ProgramData\NVIDIA GPU Computing Toolkit\v10.1\extras\visual_studio_integration\CudaProjectVsWizards\Nvda.Vsip.CudaWizards.dll.pkgdef

  4. Once these shortcuts are in place, open a Visual Studio 2019 developer command prompt in administrator mode and run 'devenv.com /setup /nosetupvstemplates'.

  5. Re-start Visual Studio 2019 and see if the project templates are available now.

All information collected above are from the forums. Only summarizing it here.

However the intellisense does not work.

Thanks.

今天配VS2019+CUDA10.0的时候又看到这个了,码一下

这波很诡异,NSight for Visual Studio Edition已经卸载过了,扩展里的选项卡居然还在。重置一下VS试试。

之前拿appveyor编译hadoop试手的时候,突然发现了一个严肃的问题:Windows下没有自带默认的命令行下载工具。之前用Windows的时候一直是图形界面操作,需要敲命令的时候才打开cmd,然而我需要指明从网络上下载某个文件

之后看到Stackoverflow上有人推荐用Powershell,Powershell有内置的下载功能,然后去试了一下。觉得也是时候与时俱进一下了。

示例如下:

$cloent = new-object System.Net.WebClient
$client.DownloadFile("https://github.com/protocolbuffers/protobuf/releases/download/v2.5.0/protoc-2.5.0-win32.zip", "C:\protoc-2.5.0-win32.zip")

顺带码一下操作zip文件的Compress-Archive / Expand-Archive命令。

结果发现set不能用了,对应的Get-Value命令里由缺失了不少环境变量,最后决定换回cmd,因为不想将一个工作拆分为cmd和Powershell两个脚本= =

然后决定使用cmd调用Powershell,问题出在这里:Powershell函数的参数需要双引号。cmd有转义符吗?

又是一个让人沉思的问题。咕果一下之后发现,有是有,不过是^(Ctrl+6),而且似乎对双引号没有作用。
此时顺便查了一下,Powershell的转义符是`esc下面那个),不过由于Powershell相对于cmd是个新产品,功能还是能正常使用的。

最后解决cmd向Powershell传递双引号的方法是 连着三个双引号"""。特别神奇,不知道为什么。
管他的,只要能用就行了

AppVeyor作为一个CI/CD平台,提供自动的持续集成和持续部署的服务。

何谓持续集成呢,从我个人的角度理解,项目都是以源码的形式编写的。在交付用户使用的时候,显然通常需要编译为机器可直接运行的二进制文件。二进制文件的修改往往很困难,因而一般都会选择从修改后的源码重新编译一份。在产品的开发或者维护中,经常需要进行小修小补式的更改,来添加新功能或者修复bug。而每次重新编译这个过程繁琐而不可避免。CI做的就是这个事情,不但一键编译,连这个触发编译的操作都是自动探测完成的。比如说Github,CI可以做到提交一个commit就自动编译项目。

用别人的话总结说就是,CI可以完成项目中重复性的工作。

然后个人感觉,上手前主要需要了解两个东西:整个CI过程的分段定义,以及appveyor.yml的作用和用法。这个可以通过看官方文档完成。了解基本用途的耗时并不长。参见https://www.appveyor.com/docs