两者似乎都被用于web开发领域,例如HTML5 Cross Browser Polyfills,它说:

所以我们在这里收集所有的垫片、备用材料和填充物……

或者,还有es5-shim项目。

在我目前的项目中,我们使用了许多这些,我想把它们都放在同一个目录中。所以,我应该叫这个目录——垫片,还是填充物?

我有一个应用程序,执行各种有趣的东西与Git(像运行Git克隆& Git推送),我试图docker-ize它。

我遇到了一个问题,虽然我需要能够添加一个SSH密钥到容器的容器“用户”使用。

我试着把它复制到/root/。ssh/,更改$HOME,创建一个git ssh包装器,仍然没有运气。

以下是Dockerfile供参考:

#DOCKER-VERSION 0.3.4                                                           

from  ubuntu:12.04                                                              

RUN  apt-get update                                                             
RUN  apt-get install python-software-properties python g++ make git-core openssh-server -y
RUN  add-apt-repository ppa:chris-lea/node.js                                   
RUN  echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
RUN  apt-get update                                                             
RUN  apt-get install nodejs -y                                                  

ADD . /src                                                                       
ADD ../../home/ubuntu/.ssh/id_rsa /root/.ssh/id_rsa                             
RUN   cd /src; npm install                                                      

EXPOSE  808:808                                                                 

CMD   [ "node", "/src/app.js"]

App.js运行git命令,比如git pull

有人让我注意到这篇文章,声称STL术语被误用来指代整个c++标准库,而不是从SGI STL中提取的部分。

(...) it refers to the "STL", despite the fact that very few people still use the STL (which was designed at SGI). Parts of the C++ Standard Library were based on parts of the STL, and it is these parts that many people (including several authors and the notoriously error-ridden cplusplus.com) still refer to as "the STL". However, this is inaccurate; indeed, the C++ standard never mentions "STL", and there are content differences between the two. (...) "STL" is rarely used to refer to the bits of the stdlib that happen to be based on the SGI STL. People think it's the entire standard library. It gets put on CVs. And it is misleading.

我对c++的历史几乎一无所知,所以我无法判断这篇文章的正确性。我应该避免使用STL这个术语吗?或者这只是一个孤立的观点?

我已经使用PuTTYgen生成了密钥对,并一直使用Pageant登录,因此当系统启动时,我只需输入一次密码短语。

如何在Linux中实现这一点?我听说过钥匙串,但我听说它使用了不同的密钥对格式——我不想改变我的Windows密钥,如果我能在Windows和Linux中以相同的方式无缝连接就太好了。

Record<K, T>在Typescript中是什么意思?

Typescript 2.1引入了Record类型,在一个例子中描述了它:

//对于每一个T类型的属性K,将其转换为U 函数mapObject<K扩展字符串,T, U>(obj:记录<K, T>, f: (x: T) => U):记录<K, U>

参见Typescript 2.1

高级类型页面在映射类型标题下提到了Record,与Readonly, Partial和Pick并列,这似乎是它的定义:

type记录<K扩展字符串,T> = { [P in K]: T; }

Readonly、Partial和Pick是同态的,而Record不是。Record不是同态的一个线索是,它不需要输入类型来复制属性: type ThreeStringProps =记录<'prop1' | 'prop2' | 'prop3',字符串>

就是这样。除了上面的引用,typescriptlang.org上没有提到Record。

问题

Can someone give a simple definition of what Record is? Is Record<K,T> merely a way of saying "all properties on this object will have type T"? Probably not all properties, since K has some purpose... Does the K generic forbid additional keys on the object that are not K, or does it allow them and just indicate that their properties are not transformed to T? With the given example: type ThreeStringProps = Record<'prop1' | 'prop2' | 'prop3', string> Is it exactly the same as this?: type ThreeStringProps = {prop1: string, prop2: string, prop3: string}

我有一个非常简单的功能组件如下:

import * as React from 'react';

export interface AuxProps  { 
    children: React.ReactNode
 }


const aux = (props: AuxProps) => props.children;

export default aux;

另一个组成部分:

import * as React from "react";

export interface LayoutProps  { 
   children: React.ReactNode
}

const layout = (props: LayoutProps) => (
    <Aux>
        <div>Toolbar, SideDrawer, Backdrop</div>
        <main>
            {props.children}
        </main>
    <Aux/>
);

export default layout;

我一直得到以下错误:

(ts) JSX元素类型“ReactNode”不是JSX元素的构造函数。 类型'undefined'不能赋值给类型'ElementClass'。[2605]

我如何正确地输入这个?

当我克隆一个存储库时,我一直有点“忍受”Github总是问我的用户名和密码。我想绕过这一步,因为这是我的工作流中的一个烦恼。

我尝试使用本指南设置SSH密钥(我成功地做到了)。https://help.github.com/articles/generating-ssh-keys,我成功了。

我的问题是,当克隆一个存储库(使用SSH)时,我仍然被要求输入我的github密码和密码短语。我的理解是,在我设置了这个SSH密钥之后,我就不再需要这样做了。

我不知道该问什么,所以我就说说我的目标吧。

我希望能够克隆存储库,而不必一直把我的Github信息。

我的SSH密钥丢失了什么?如果有人能提供一些指导或资源,我会很感激,因为当涉及到GitHub中的SSH身份验证时,我总是感到有点失落。

据我所知,这是一个测试事情是否正常工作的命令,下面是来自我的控制台的输出:

~ $ ssh -T git@github.com
Saving password to keychain failed
Enter passphrase for key '/Users/MYNAME/.ssh/id_rsa':
Hi MYNAME! You've successfully authenticated, but GitHub does not provide shell access.

当我输入密码时,应该先失败吗?然后,当我输入密码时,它就通过了。

我要做的就是检查向量中是否存在一个元素,这样我就可以处理每一种情况。

if ( item_present )
   do_this();
else
   do_that();

我用的是Mac雪豹,刚刚安装了git。

我只是试了

git clone git@thechaw.com:cakebook.git

但这给了我这个错误:

Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

我错过了什么? 我也试过做ssh-keygen没有密码,但仍然错误。

我需要为GitHub做SSH密钥审计,但我不确定如何找到我的RSA密钥指纹。我最初是按照指南在Linux上生成SSH密钥的。

我需要输入什么命令来查找我当前的RSA密钥指纹?