Flutter是什么?
Flutter是Google开源的移动应用程序SDK,一份代码可以同时生成iOS和Android两个高性能、高保真的应用程序。Flutter目标是使开发人员能够交付在不同平台上都感觉自然流畅的高性能应用程序。我们兼容滚动行为、排版、图标等方面的差异。
在Ubuntu系统下,从零开始运行起来第一个Flutter程序不是那么容易的事情,有一些tricky的配置可能会浪费你很多时间。
现在(2019.07) Anaconda官网上下载到的Anaconda安装包,已经对应的是Python 3.7版本了,如果想要安装Python 3.6版,那么有如下几种方法:
最近我的Ubuntu台式机每隔两三天就会进入一种硬盘狂读+点击鼠标无反应的死机状态,由于SSD已经用了很多年,我非常担心它会随时挂掉,导致数据丢失的惨剧发生,于是我提前预防,买了块同品牌、同容量的SSD来替换它。但是从头开始重装系统+配置各种软件的过程实在太痛苦了,所以我决定做一次全盘复制,这样就能省去很多时间。
如果一个JSON字符串里有一个字段,它的值又是一个完整的JSON字符串,那么这时候,它可能会含有转义字符。举个例子,我们有一个文件 codelast.json,它的内容为一行字符串:
{"aaa":"{\"ccc\":\"ccc\",\"ddd\":\"ddd\"}","bbb":{"ccc":"ccc","ddd":"ddd"}}
现在要用Jackson解析它为一个Java对象,怎么做?
与Ubuntu系统下的配置过程比较相似,先安装Privoxy:
brew install privoxy
再修改其配置文件 /usr/local/etc/privoxy/config,在文件末尾添加如下内容:
在Ubuntu下,除了浏览器之外,为了能在系统全局层面上自动使用代理访问那些“不存在的网站”,有一个常用的做法就是,在Chrome的SwitchyOmega插件里的“自动切换”情景模式下“导出PAC”,得到一个PAC文件,放在磁盘的某个路径下(假设为:/home/codelast/OmegaProfile__.pac),然后在Ubuntu系统的网络设置里如下设置:
今天在MAC OS上用 brew install openssh 之后,再用iTerm2打开一个新窗口的时候,都会提示以下错误:
ssh-add: illegal option -- K
usage: ssh-add [options] [file …]
在我的例子中,是由于安装openssh之后装上了一个新的ssh-add程序,和MAC OS原来自带的ssh-add有些不一样,MAC自带的ssh-add程序包含-K参数,而openssh带的那个ssh-add没有-K参数,因此不能识别,从而造成了错误。
Ubuntu不知道什么原因,不能用 apt-get install 安装任何软件了,并且在屏幕上输出海量错误信息,非常迷惑人,例如下面这一例:
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!insserv: There is a loop between service vpnagentd_init and mountkernfs if startedinsserv: loop involving service mountkernfs at depth 1insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!insserv: There is a loop between service vpnagentd_init and dns-clean if startedinsserv: loop involving service dns-clean at depth 1......
insserv: Starting vpnagentd_init depends on plymouth and therefore on system facility `$all' which can not be true!insserv: exiting now without changing boot order!update-rc.d: error: insserv rejected the script headerdpkg: error processing package binfmt-support (--configure):subprocess installed post-installation script returned error exit status 1No apport report written because MaxReports is reached alreadyProcessing triggers for initramfs-tools (0.122ubuntu8.10) ...update-initramfs: Generating /boot/initrd.img-4.13.0-32-genericErrors were encountered while processing:udevgrub-commongrub2-commongrub-pc-bingrub-pcresolvconfbinfmt-supportE: Sub-process /usr/bin/dpkg returned an error code (1)
查看本系列文章合集,请点击这里。
为了对蒙特卡罗方法有一个直观的印象,我们先举一个实例(计算圆周率 \(\pi \) ),让从来没有接触过蒙特卡罗方法的人产生“原来这就是Monte Carlo”的感觉,以减少刚开始学习的困惑。
圆周率 \(\pi \) 可以怎么计算?其中一个“常规”的方法就是利用 \(\pi \) 的莱布尼茨公式:
\(\frac{\pi }{4} = \sum\limits_{n = 0}^\infty {\frac{{{{\left( { - 1} \right)}^n}}}{{2n + 1}}} = 1 - \frac{1}{3} + \frac{1}{5} - \frac{1}{7} + \frac{1}{9} - \cdots \)
不断增大 \(n\) 的值,就能越来越逼近 \(\frac{\pi }{4}\)
OS:Ubuntu 16.04.3 LTS
JDK:1.8.0_60
Selenium:3.0.0
Chrome:61.0.3163.100
本文描述了用JAVA编程控制Selenium时,遇到的“failed to change window state to maximized, current state is normal”错误的解决方法。
本文是上一篇文章的续文。
《Neural Networks and Deep Learning》一书的中文译名是《神经网络与深度学习》,书如其名,不需要解释也知道它是讲什么的,这是本入门级的好书。
在第一章中,作者展示了如何编写一个简单的、用于识别MNIST数据的Python神经网络程序。
本文接着上一篇文章对程序代码进行解析。