使用 emacs 时,偶尔会出现错误Terminal 7 is locked, cannot read from it
。这个错误是什么意思?
目前,我在尝试使用 连接到 IRC 服务器时收到错误erc
,但我以前收到过它,但我不记得是什么原因。以前发生这种情况时,我能够重试并最终成功,但现在我每次都会遇到相同的错误。
我正在运行服务器会话,emacs --daemon
并已连接各种客户端emacsclient -t
。
我在网上搜索过这个,但我唯一能找到的就是这个。除了不是我提出的确切问题之外,它还没有公认的答案。:(
我刚刚从Laravel 4.1更新到4.2.7.我试图使用Soft Delete删除:
use SoftDeletingTrait; protected $dates = ['deleted_at'];
但这会给出错误'Not Found SoftDeletingTrait Class'.这个错误的原因是什么?
我有一个已经使用了几个星期的应用程序;我将Vagrant + Homestead用于本地开发,并将Forge + Linode用于暂存环境。直到几天前,我的工作流程还可以正常工作,但是现在当部署脚本在Forge中运行时(尤其是composer install
),它会出现错误:
[RuntimeException]
Error Output: PHP Fatal error: Class 'Reputationhub\ReputationhubServiceProvider' not found in /home/vagrant/Sites/reputationhu
b/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
PHP Stack trace:
PHP 1. {main}() /home/vagrant/Sites/reputationhub/artisan:0
PHP 2. require_once() /home/vagrant/Sites/reputationhub/artisan:30
PHP 3. require() /home/vagrant/Sites/reputationhub/bootstrap/start.php:60
PHP 4. Illuminate\Foundation\ProviderRepository->load() /home/vagrant/Sites/reputationhub/vendor/laravel/framework/src/Illumin
ate/Foundation/start.php:210
PHP 5. Illuminate\Foundation\ProviderRepository->compileManifest() /home/vagrant/Sites/reputationhub/vendor/laravel/framework/
src/Illuminate/Foundation/ProviderRepository.php:57
PHP 6. Illuminate\Foundation\ProviderRepository->createProvider() /home/vagrant/Sites/reputationhub/vendor/laravel/framework/s
rc/Illuminate/Foundation/ProviderRepository.php:121
Run Code Online (Sandbox Code Playgroud)
实际上,php artisan clear-compiled
此失败是后来Composer运行的子命令。如果我自己运行它,同样的问题。运行composer install --no-script
正常。当我查看时vendor/composer/autoload_classmap.php
,它会丢失所有的东西,并且只有几行长(通常更大),因此Laravel所做的任何事情都不能正确地找到正确的类。
奇怪的是,跑步composer dump-autoload -o
似乎可以解决问题;该autoload_classmap.php
文件耳目一新,并且应用程序运行正常,直到php artisan ...
尝试做任何事情,那么它打破了应用程序。
最终结果是Forge部署被破坏了。我可以手动跳到服务器上并运行composer dump-autoload -o …
go get github.com/gogo/protobuf/proto
尽管GOPATH
设置了该命令似乎不起作用。
GOPATH="/Users/tmp/Documents/workspace/app/go"
Run Code Online (Sandbox Code Playgroud)
我看到其他软件包也有类似的问题。
读取错误:
package github.com/gogo/protobuf/proto: cannot find package "github.com/gogo/protobuf/proto" in any of:
/usr/local/go/src/github.com/gogo/protobuf/proto (from $GOROOT)
/Users/tmp/Documents/workspace/app/go/src/github.com/gogo/protobuf/proto (from $GOPATH)
Run Code Online (Sandbox Code Playgroud)
跑步go env
节目:
GOARCH="amd64"
GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin"
GOPATH="/Users/tmp/Documents/workspace/app/go" GORACE=""
GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
Run Code Online (Sandbox Code Playgroud)
有什么问题,我该如何解决?我在网上没有找到任何东西,但这之前是有效的。
示例字符串:
This is "a" test
This & test
This test string-has more words
Run Code Online (Sandbox Code Playgroud)
在上面的每个例子中,我都有不同长度的单词串。这些字符串中的每一个都后跟一系列空格,之后没有任何内容。
()
如有必要,我的应用程序使用正则表达式的周围部分仅返回匹配模式的那部分。
我需要一个正则表达式,无论长度如何,都将返回完整的字符串,减去末尾的空格。
我的当前是(.*)\s{1,}$|(.*\S)$
如果字符串末尾有 0 个空格或字符串末尾有 1 个空格,但有 2 个或更多空格,并且这些空格包含在输出中,则此方法有效。
我正在使用 GrumPhp 嗅探我在 symfony 项目中的提交: https: //github.com/phpro/grumphp
这是我的配置:
parameters:
git_dir: .
bin_dir: vendor/bin
tasks:
phpcsfixer:
config_file: ~
config: sf23
fixers: [psr2, symfony, indentation]
level: psr2
verbose: true
Run Code Online (Sandbox Code Playgroud)
我的问题是:
有没有办法让Grumphp在我提交时自动运行php-cs-fixer
?
Azure资源管理器(ARM)模板可以使用链接模板。这些链接的模板可以定义在ARM模板部署期间创建的其他资源。
ARM模板支持相关性,以确保某些资源先于其他资源创建。
我想在链接模板中为在主模板中创建的资源指定依赖项。如果我在链接模板中包含依赖项,则它看起来像这样:
"resources": [
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[concat(parameters('siteName'),'/', parameters('fqdn'))]",
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('siteName'))]"
],
"properties": {
"siteName": "[parameters('siteName')]"
}
}
]
Run Code Online (Sandbox Code Playgroud)
当dependsOn
显示正确时,在处创建一个资源Microsoft.Web/sites/{siteNameParameter}
,部署ARM模板将输出以下错误消息:
InvalidTemplate:部署模板验证失败:'模板中未定义资源'Microsoft.Web / sites / blahblahblahblah'。请参阅https://aka.ms/arm-template了解用法详细信息。
我当前在定义链接模板调用时在主模板中定义此依赖关系。这似乎很脆弱,很容易打破。有没有比在主ARM模板中定义依赖项更好的方法?
{
"apiVersion": "2015-01-01",
"name": "SomeName",
"type": "Microsoft.Resources/deployments",
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('siteName'))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "https://tempuri.org/supersecrettemplatepath/azuredeploy.json",
"contentVersion": "1.0.0.0"
},
"parameters":
{
"fqdn": {
"value": "www.tempuri.org"
},
"siteName": {
"value": "[parameters('siteName')]"
}
} …
Run Code Online (Sandbox Code Playgroud) 我正在使用Ubuntu 16.04并尝试安装Laravel(任何版本).实际上我从GitHub克隆了Laravel项目(https://github.com/laravel/laravel)克隆后我正在运行如下命令:
root:/var/www/html/laravel$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Authentication required (packagist.org):
Username:
Run Code Online (Sandbox Code Playgroud)
这是我面临的问题,我不知道我要提供什么用户名,以及为什么要求身份验证..如果我运行,composer diagnose
我得到这个输出:
composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: Authentication required (packagist.org):
Username:
Run Code Online (Sandbox Code Playgroud)
任何建议或任何人都可以告诉我在这里缺少什么?
我分叉master
了一个分支。我不时合并master
到我的分支进行更新。
/--B--D--G--H--J--L--M--> dev (HEAD)
/ / /
-----A--C--E--F--I--K---> master
Run Code Online (Sandbox Code Playgroud)
如何仅在我的分支上显示更改,不包括合并中的更改?即仅在提交时显示差异B
,D
, H
, L
, M
。
git diff A
不起作用,因为它包含来自master
.
顺便说一句,如果有人知道A
无需继续向下滚动日志即可快速查找的方法,我将不胜感激。
分配了两个遥控器,origin
用于拉动变化并且harmeet
是生产.
我试过git reset --hard
但是一旦我拉出最新的更改,状态就会恢复master | MERGING
,然后我无法推送最新的代码,harmeet
因为Git告诉我一切都是最新的.我不确定这里有什么问题.