我是git的新手,所以我决定使用github的教程学习git.第三章说:
"对于第一个例子,我们将修改README文件以将自己添加为项目的作者.所以我们只需编辑文件.现在我们要提交更改,因此我们运行
git commit -a
命令."
当我使用该git commit -a
命令时,控制台打开一个vim,我写了我的消息,但我不知道如何从控制台关闭这个vim编辑器.如何保存邮件并关闭vim?
我正在尝试安装pg gem以便再次使用我的rails项目.但我得到这个错误:
构建原生扩展.这可能需要一段时间...错误:安装pg时出错:错误:无法构建gem原生扩展.
Run Code Online (Sandbox Code Playgroud)/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If
构建失败,请再次尝试使用--with -pg-config =/path/to/pg_config检查libpq-fe.h ...否找不到'libpq-fe.h header *extconf.rb失败*由于某些原因无法创建Makefile,可能缺少必要的库和/或标头.检查mkmf.log文件以获取更多详细信息.您可能需要配置选项.
提供的配置选项: - with-opt-dir --without-opt-dir --with-opt-include --without-opt-include = $ {opt-dir}/include --with-opt-lib - without-opt-lib = $ {opt-dir}/lib --with-make-prog --without-make-prog --srcdir =.--curdir --ruby =/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby --with-pg --without-pg --with-pg-config --without-pg -config --with-pg_config --without-pg_config --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include = $ {pg-dir}/include - -with-pg-lib --without-pg-lib = $ {pg-dir} /
Gem文件将保留在/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0中进行检查.结果记录到/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0/ext/gem_make.out
我尝试了在stackoverflow上找到的所有内容,但我仍然遇到此错误.
如果我尝试使用brew安装postgresql,我会得到以下警告:
警告:postgresql-9.2.4已经安装,它只是没有链接
如果我尝试链接
brew链接postgresql链接/usr/local/Cellar/postgresql/9.2.4 ...警告:无法链接postgresql.取消链接...
错误:无法符号链接文件:/usr/local/Cellar/postgresql/9.2.4/share/man/man7/WITH.7/usr/local/share/man/man7不可写.您应该更改其权限.
请帮忙
注意:我已经为小牛队安装了命令行工具.
如果我使用自制程序卸载并尝试再次安装,我收到此错误:
==>正在下载http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2
################################################## ################ 100.0%==>修补修补文件src/pl/plpython/Makefile修补文件contrib/uuid-ossp/uuid-ossp.c …
当尝试使用-retain
,-release
并-dealloc
在使用Xcode 4.2中的自动引用计数构建我的应用程序时,我收到如下错误:
自动引用计数禁止'dealloc'的显式消息发送
为什么我看到这个错误?在自动引用计数下是否-retain
,-release
并且-dealloc
不再允许这样做?
我的表单中有这个输入代码:
<input maxlength="255" id="information_name" name="information[name]" oninvalid="check(this)" placeholder="Nombre Completo" required="required" size="30" style="width:528px;height:25px;" tabindex="3" type="text">
Run Code Online (Sandbox Code Playgroud)
我用这个javascritp代码更改了oninvalid消息:
<script>
function check(input) {
if (input.value == "") {
input.setCustomValidity('Debe completar este campo.');
} else {
input.setCustomValidity('Debe corregir este campo.');
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
这是问题所在,如果我点击提交并且该字段为空,则该字段显示错误,因此我需要填写该字段,但填写该字段后,即使填充不为空,我仍然会收到警告.
我做错了什么???
我使用node.js,express和socket.io进行了聊天.这是app.js代码:
var express = require('express'),
app = express(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
server.listen(process.env.PORT || 8080);
app.use(express.static(__dirname + '/'));
io.on('connection', function(socket){
socket.on('message sent', function(data){
io.emit('receive', { msg: data.msg, uname: data.uname, uid: data.uid, uimg: data.uimg });
});
socket.on('message sent room', function(data){
console.log(data.mid);
io.in(data.uroom).emit('receive', { msg: data.msg, uname: data.uname, uid: data.uid, uimg: data.uimg, mid: data.mid });
});
socket.on('join', function(data){
io.emit('join user', { uname: data.uname, uid: data.uid });
});
socket.on('create', function (room) {
socket.join(room);
});
});
Run Code Online (Sandbox Code Playgroud)
这是我的haml文件中的代码
%script{:src => "https://cdn.socket.io/socket.io-1.2.0.js"}
- if …
Run Code Online (Sandbox Code Playgroud) 我有以下组件:
export default class StoreComponent extends Component {
render() {
return (
<View style={styles.container}>
<ScrollView contentContainerStyle={styles.scroll}>
<StoreCarouselComponent />
<StoreDiscountComponent />
<StoreDetailsComponent />
</ScrollView>
</View>
);
}
}
Run Code Online (Sandbox Code Playgroud)
用这种风格
import { StyleSheet, Dimensions, } from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#ffffff',
},
scroll: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center'
},
image: {
width: Dimensions.get('window').width,
height: 350,
},
box: {
width: Dimensions.get('window').width - 30,
position: 'absolute',
shadowColor: '#000000',
shadowOpacity: 0.34,
shadowRadius: 5,
shadowOffset: {
width: 0, …
Run Code Online (Sandbox Code Playgroud) 如果记录距离created_at日期超过60天,我需要删除我的商品模型中的记录.
我只找到了有关如何使用rake任务填充模型的信息,但是我找不到有关如何使rake任务删除记录的信息.所以我只是想知道是否必须通过任务执行此操作,或者rails是否还有其他功能可以执行此操作.
伙计们,我正在尝试备份数据库。
首先,我使用 ssh tunel 连接到服务器,然后执行以下命令:
mongodump -d mydatabase -o ~/myfolder
Run Code Online (Sandbox Code Playgroud)
我收到这条消息:
连接到:127.0.0.1 Thu Feb 6 18:00:56 数据库:mydatabase 到 /home/backups/myfolder/myfolder
如您所见,mongodump 正在文件夹内创建一个文件夹,但在该文件夹内我没有任何文件,没有 json,没有 bson 文件。
有人可以解释我如何使用 ssh 在我的服务器上进行备份并将文件移动到我的本地机器上。
提前致谢。
我有以下方法:
componentDidLoad() {
this.image = this.element.shadowRoot.querySelector('.lazy-img');
this.observeImage();
}
observeImage = () => {
if ('IntersectionObserver' in window) {
const options = {
rootMargin: '0px',
threshold: 0.1
};
this.observer = new window.IntersectionObserver(
this.handleIntersection,
options
);
this.observer.observe(this.image);
} else {
this.image.src = this.src;
}
};
Run Code Online (Sandbox Code Playgroud)
我试图像这样测试 IntersectionObserver.observe 调用:
it('should create an observer if IntersectionObserver is available', async () => {
await newSpecPage({
components: [UIImageComponent],
html: `<ui-image alt="Lorem ipsum dolor sit amet" src="http://image.example.com"></ui-image>`
});
const mockObserveFn = () => {
return {
observe: …
Run Code Online (Sandbox Code Playgroud) 使用以下命令在我的控制台上启动redis服务器后:
redis-server
Run Code Online (Sandbox Code Playgroud)
我像这样执行以下ruby脚本:
script/user/generate_roster_kids.rb start
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我得到:
generate_roster_kids] Pid not found, process seems doesn't exist!
[generate_roster_kids] Process daemonized with pid 1110 with thread and Forever v.0.3.2
Run Code Online (Sandbox Code Playgroud)
如果我再次执行相同的命令,我得到以下内容:
generate_roster_kids] Found pid 1110...
[generate_roster_kids] Waiting the daemon's death . DONE
[generate_roster_kids] Process daemonized with pid 1385 with thread and Forever v.0.3.2
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我做错了什么.
这是generate_roster_kids.rb文件的内容:
#!/usr/bin/ruby
require 'rubygems' unless defined?(Gem)
require 'forever'
require 'redis'
Forever.run do
REDIS = Redis.new()
#
# dir "foo" # Default: File.expand_path('../../', __FILE__)
# file "bar" # Default: __FILE__
log "bar.log" …
Run Code Online (Sandbox Code Playgroud) android ×1
gem ×1
git ×1
heroku ×1
html ×1
html5 ×1
javascript ×1
jestjs ×1
mocking ×1
mongodb ×1
node.js ×1
objective-c ×1
postgresql ×1
react-native ×1
redis ×1
ruby ×1
sockets ×1
ssh ×1
stenciljs ×1
vim ×1