小编And*_*luk的帖子

如何将容器推送到 Google 容器注册表(无法创建存储库)

编辑:我只是将其归咎于平台不一致。我现在已经放弃推送到 Google Cloud Container Registry,而是创建了一个 Ubuntu VM,我正在其中执行此操作。出于前面所述的原因,我也投票决定结束这个问题,并且因为这可能应该首先在服务器故障上提出。感谢大家的帮助!

运行$ gcloud docker push gcr.io/kubernetes-test-1367/myapp结果为:

The push refers to a repository [gcr.io/kubernetes-test-1367/myapp]
595e622f9b8f: Preparing
219bf89d98c1: Preparing
53cad0e0f952: Preparing
765e7b2efe23: Preparing
5f2f91b41de9: Preparing
ec0200a19d76: Preparing
338cb8e0e9ed: Preparing
d1c800db26c7: Preparing
42755cf4ee95: Preparing
ec0200a19d76: Waiting
338cb8e0e9ed: Waiting
d1c800db26c7: Waiting
42755cf4ee95: Waiting
denied: Unable to create the repository, please check that you have access to do so.
Run Code Online (Sandbox Code Playgroud)

$ gcloud init结果是:

Welcome! This command will take you through the configuration of gcloud.

Settings from your …
Run Code Online (Sandbox Code Playgroud)

windows docker google-cloud-platform kubernetes google-container-registry

5
推荐指数
1
解决办法
4120
查看次数

项目欧拉233

设f(N)是在通过(0,0),(N,0),(0,N)和(N,N)的圆上具有整数坐标的点的数量.

可以证明f(10000)= 36.

所有正整数N 1011的总和是多少,f(N)= 420?

好吧,所以我认为我有项目欧拉号233的基本想法.这是我的代码:

/*
 * Andrew Koroluk
 */

public class euler233 {
public static void main(String[] args) {
    System.out.println(f(10000));
    System.out.println(f(1328125));
    System.out.println(f(84246500));
    System.out.println(f(248431625));
    //if(true) return;

    double ans = 0;
    for(double N=10000; N<=(Math.pow(10, 11)); N++) {
        //System.out.println(N);
        if( f(N)==420 ) {
            ans+= N;
            System.out.println(N);
        }
    }
    System.out.println(ans);
}
static double f(double N) {
    double ans = 0;     
    double r = Math.sqrt(2*N*N)/2;
    //System.out.println(r*r);
    double r2 = r*r;

    for(int x=1; x<=r; x++) {
        for(int y=1; y<=r; y++) {
            if( x*x …
Run Code Online (Sandbox Code Playgroud)

c#

1
推荐指数
1
解决办法
1555
查看次数

处理Web应用程序中的未知URL的最佳做法是什么?

我有一个由Angular Fullstack Generator生成的Web应用程序.如果ExpressJS服务器收到某些特定目录的未知URL请求,它将返回404:

app.route('/:url(api|auth|components|app|bower_components|assets)/*')
    .get(errors[404]);
Run Code Online (Sandbox Code Playgroud)

对于所有其他未知路由,它只是重定向到主页:

app.route('/*')
    .get(function(req, res) {
        res.sendfile(path.resolve(app.get('appPath') + '/index.html'));
    });
Run Code Online (Sandbox Code Playgroud)

这是一个好主意吗?我问的原因是因为谷歌报告我的网站可能被黑客入侵.它一直试图获取像http://andrewkoroluk.com/survival-games-1-e7733-map这样的URL ,当它获得200 OK响应时,它会标记该站点.

express url-redirection

1
推荐指数
1
解决办法
339
查看次数

a/b mod m =(a mod m)/(b mod m)?

a/b mod m = (a mod m)/(b mod m)吗?

我试图为非常大的数字找到nCr mod m.如果a/b mod m = (a mod m)/(b mod m)那时认为我会解决我的问题.

这是项目欧拉.我正在使用使用阶乘的nCr公式.

binomial-coefficients modulus

0
推荐指数
1
解决办法
6479
查看次数