我对 Material UI 很陌生,我正在尝试使用这样的文本颜色设置排版:
const theme = createMuiTheme({
palette: {
text:{
primary: "#FFFFFF"
}
}
});
const WhiteText = (props: { text:string, varient: Variant | 'inherit'}) => {
return <ThemeProvider theme={theme}>
<Typography variant={props.varient} align="center" color="textPrimary">{props.text}</Typography>
</ThemeProvider>
}
...
<WhiteText varient="h3" text="This text should be white"/>
Run Code Online (Sandbox Code Playgroud)
但文本不会改变颜色:/
我应用主题错了吗?
我发现 Busboy 和节点流 highWaterMark 属性存在一些我不理解的行为。我预计块的大小最大为 highWaterMark 值,但块大小看起来不受 highWaterMark 设置的影响。
我已经fileHwm: 5
在 Busboy 中设置了选项,并且我的快速路线设置如下
app.post('/upload', function(req, res, next) {
req.pipe(req.busboy); // Pipe it through busboy
req.busboy.on('file', (fieldname, file, filename) => {
console.log(`Upload of '${filename}' started`);
console.log(file);
file.on('readable', () => {
let chunk;
while (null !== (chunk = file.read())) {
console.log(`Received ${chunk.length} bytes of data.`);
}
});
});
});
Run Code Online (Sandbox Code Playgroud)
当我登录时file
,看起来不错,并且我看到该highWaterMark
属性已设置得很好
FileStream {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 5,
...
Run Code Online (Sandbox Code Playgroud)
但我得到的块的大小并不5
像我预期的那样 - 相反我看到
Received …
Run Code Online (Sandbox Code Playgroud) 以下CDK代码
const queue = new sqs.Queue(this, 'my-sqs-queue', {
visibilityTimeout: cdk.Duration.seconds(300)
});
const role = iam.Role.fromRoleArn(this, "myrole", "arn:aws:iam::1234:role/myrole")
const evtHandler = new lambda.Function(this, 'MyLambda', {
code: lambda.Code.fromInline(`
exports.handler = async function(event, context) {
console.log("EVENT: \n" + JSON.stringify(event, null, 2))
return context.logStreamName
}`),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_8_10,
role
});
evtHandler.addEventSource(new SqsEventSource(queue, {
batchSize: 10 // default
}));
Run Code Online (Sandbox Code Playgroud)
将设置一个轮询 SQS 的 lambda。惊人的!但是,它也会生成此 CF
myrolePolicy99283C52:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Statement:
- Action:
- sqs:ReceiveMessage
- sqs:ChangeMessageVisibility
- sqs:GetQueueUrl
- sqs:DeleteMessage
- sqs:GetQueueAttributes
Effect: Allow …
Run Code Online (Sandbox Code Playgroud) 我想坚持“所有基础设施都是代码”的政策。但是,对于 CloudFormation 的机密,我看不出有什么方法可以做到这一点。
SecretsManager 要求您以纯文本形式指定 SecretString。即使您从某处注入解密的值,纯文本字符串也会显示在模板视图的 CF 控制台中:/
在 SSM 中也不可能使用加密字符串。文档说,“AWS CloudFormation 不支持创建 SecureString 参数类型。”
真的没有办法使用 CloudFormation 将机密作为代码安全地管理吗?
我有一个生成jar的scala项目.我正在尝试在Java项目中使用jar.奇怪的是,当签名编译为.class文件时,签名正在丢失泛型类型信息.
def foo(x:List[Long]) = ...
Run Code Online (Sandbox Code Playgroud)
Lscala/collection/immutable/List<Ljava/lang/Object;>
在.class文件中生成一个方法.
它也一样
def foo(x:java.util.List[Long]) = ...
Run Code Online (Sandbox Code Playgroud)
.class文件说方法签名是
Ljava/util/List<Ljava/lang/Object;>
真正的问题是,当我在Java项目中使用这个jar时,我必须使用List<Object>
而不是List<Long>
我想要的.当然我可以施展它,但我宁愿不必.有任何想法吗?
我使用scala版本2.11.7