分类 学无止境 下的文章

兔子生兔子问题(兔子会死亡)

作者: bmzz | 时间: | 浏览: 1925 | 留言: 2 | 分类: 算不出来

09 09

题目:

Consider a special type of animal known as an Ewwok that reproduces following the rules below:
An Ewwok dies six months after it is born. That is, if an Ewwok is born in month 0, it will die in month 6.
An Ewwok gives birth to two Ewwoks every two months until it dies. That is, if an Ewwok is born in month 0, it will reproduce in months 2 and 4. It does not reproduce in month 6 or beyond.
In each month, among all the Ewwoks that have been alive for exactly three months, there is one that dies. That is, if there are n (n > 0) Ewwoks that are born in month 0, one of them will die in month 3.
Given an integer initial representing the number of Ewwoks born in month 0, and an integer m representing a month, your task in this question is to write a program that calculates and returns the number of Ewwoks alive in month m.

- 阅读剩余部分 -

安装和使用Cloud Foundry CLI命令行工具

作者: bmzz | 时间: | 浏览: 943 | 留言: 0 | 分类: 学无止境

03 28

1.1. 安装Cloud Foundry CLI客户端

  所有预编译的客户端可以在 这里 下载,所有命令都可以在 这里 查看这里以linux为例:

# 下载 Linux 64-bit 二进制文件
curl -L "https://packages.cloudfoundry.org/stable?release=linux64-binary&source=github" | tar -zx
# 移动到 /usr/local/bin ,或其他可以加入$PATH环境变量的地方
mv cf /usr/local/bin
# 然后试着运行一下 cf CLI
cf --version

- 阅读剩余部分 -

扩展Nginx的WebDav支持

作者: bmzz | 时间: | 浏览: 2186 | 留言: 0 | 分类: 学无止境

05 26

1、简介

  废话可不看~

  WebDAV (Web-based Distributed Authoring and Versioning) 一种基于 HTTP 1.1协议的通信协议。它扩展了HTTP 1.1,在GET、POST、HEAD等几个HTTP标准方法以外添加了一些新的方法,使应用程序可对Web Server直接读写,并支持写文件锁定(Locking)及解锁(Unlock),还可以支持文件的版本控制。

  Nginx的轻量高效十分合我的胃口,但Nginx默认只实现了WebDAV的PUT、DELETE、MKCOL、COPY、MOVE,这显然不能满足日常的使用。所以,这里使用Nginx加载动态模块 nginx-dav-ext-module 来支持WebDAV额外需要的PROPFIND和OPTIONS方法。

- 阅读剩余部分 -

Visual Studio Code 安装Go插件

作者: bmzz | 时间: | 浏览: 474 | 留言: 0 | 分类: 开发工具

05 06

\bin\go.exe get -u -v github.com/sqs/goreturns
github.com/sqs/goreturns (download)
Fetching https://golang.org/x/tools/imports?go-get=1
https fetch failed: Get https://golang.org/x/tools/imports?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
package golang.org/x/tools/imports: unrecognized import path "golang.org/x/tools/imports" (https fetch: Get https://golang.org/x/tools/imports?go-get=1: dial tcp 216.239.37.1:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.)

- 阅读剩余部分 -

我好菜啊