我的问题:我发现这项练习非常具有挑战性.我被困在出生日期.
挑战:尝试使用正则表达式来验证以下文本字符串(不要担心不区分大小写):
我能够拿到前三个名字.但是我被困在出生日期.
"^[a-z]{1,10}$", // First name
"^[a-z]$", // Middle initial
"^[a-z']{2,10}$", // Last name
Run Code Online (Sandbox Code Playgroud)
请帮我.
几个月前我将我的 Flask 应用程序推送到 Heroku https://shakespeare-tweet.herokuapp.com/(现场)这是本地主机的屏幕截图:https : //berkeley.app.box.com/file/303628505050 但是我试图更新它,但它一直在中断:
这是 stackoverflow 解决方案:Heroku + gunicorn 不工作(bash: gunicorn: command not found)
但是当我将它更新到新版本时,它给了我错误 Heroku + gunicorn 不工作(bash: gunicorn: command not found )
web: gunicorn myapp:app --log-file=- 但应用程序在部署时崩溃:
bash: gunicorn: command not found 我尝试添加 heroku python buildpack,但没有运气。如果我回滚到以前的提交(其中 requirements.txt 和 Procile 都没有改变)。
我仍然收到相同的错误日志:
2018-07-10T21:52:11.855058+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=shakespeare-tweet-pr-16.herokuapp.com request_id=068bae51-052e-4bf4-9b25-336c9a036709 fwd="165.124.160.252" dyno= connect= service= status=503 bytes= protocol=https
2018-07-10T21:52:31.144603+00:00 heroku[web.1]: State changed from crashed to starting
2018-07-10T21:52:34.984576+00:00 heroku[web.1]: Starting process with …Run Code Online (Sandbox Code Playgroud) Objective C只读
我想将我的NSCoding属性更改为只读.例如,让我们在Person上设置lastName属性的readonly属性:
Person.h
@interface Person : NSObject
@property NSString *firstName;
@property (readonly) NSString *lastName;
@end
Run Code Online (Sandbox Code Playgroud)
分配给只读属性
好的,所以外部代码不能设置属性值,但是当我在@property声明之后通过包含(readonly)标记带有readonly属性的lastName属性时.但我仍然收到这样的错误:
Person.m
#import "Person.h"
@implementation Person
- (void) changeLastName:(NSString *)newLastName;
{
self.lastName = newLastName;
}
@end
Run Code Online (Sandbox Code Playgroud)
分配给只读属性
这里发生了什么?有人能告诉我为什么它不起作用.谢谢.