升级到13.04完全搞砸了我的系统.我在跑步时遇到这个问题
./manage.py runserver
Traceback (most recent call last):
File "./manage.py", line 8, in <module>
from django.core.management import execute_from_command_line
File "/home/rats/rats/local/lib/python2.7/site-packages/django/core/management
/__init__.py", line 4, in <module>
from optparse import OptionParser, NO_DEFAULT
File "/usr/lib/python2.7/optparse.py", line 77, in <module>
import textwrap
File "/usr/lib/python2.7/textwrap.py", line 10, in <module>
import string, re
File "/usr/lib/python2.7/string.py", line 83, in <module>
import re as _re
File "/home/rats/rats/lib/python2.7/re.py", line 105, in <module>
import sre_compile
File "/home/rats/rats/lib/python2.7/sre_compile.py", line 14, in <module>
import sre_parse
File "/home/rats/rats/lib/python2.7/sre_parse.py", line 17, in <module>
from …Run Code Online (Sandbox Code Playgroud) 我正在尝试在EC2上设置Grails Web应用程序
InstanceType:m3 xlarge
从http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html安装了JAVA
版本:java版"1.7.0_80"Java(TM)SE运行时环境(版本1.7.0_80-b15)Java HotSpot(TM)64位服务器VM(版本24.80-b11,混合模式)
(因为JAVA 8存在问题:https://github.com/spring-projects/spring-loaded/issues/98)
从GVMtools安装Grails
grails version : 2.4.3
Run Code Online (Sandbox Code Playgroud)
从中安装了mongoDB
http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
与版本MongoDB shell版本:3.0.2连接到:test
我的DataSource.groovy配置是:
environments {
development {
grails {
mongo {
host = "localhost"
port = 27017
username = "root"
password = "root"
databaseName = "someDatabase"
}
}
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
}
}
Run Code Online (Sandbox Code Playgroud)
我的Buildconfig.groovy有最新的mongo插件:
compile ":mongodb:3.0.3"
Run Code Online (Sandbox Code Playgroud)
但启动服务器后
grails run-app
Run Code Online (Sandbox Code Playgroud)
并打开我得到的任何页面
Error:
Stacktrace follows:
Message: …Run Code Online (Sandbox Code Playgroud) 我已成功将数据表与bootstrap合并(感谢datatable的优秀文档!).我现在想使用bootstrap的glyphicons作为输入搜索字段.要做到这一点,我需要放置一个图标<i class="icon-search"></i>.有没有一种简单的方法来实现这一目标?
我尝试过的事情是:
$(document).ready(function() {
$('#table').dataTable( {
sDom: '<"icon-search"r><"H"lf>t<"F"ip>',
oLanguage: {sSearch: ""},
"bPaginate": false,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo": false,
"bAutoWidth": false } );
} );
Run Code Online (Sandbox Code Playgroud)
但这会将图标放在输入字段内.
我想将输入字段包装为:
<div class="control-group">
<label class="control-label" for="inputIcon">Search : </label>
<div class="controls">
<div class="input-prepend">
<span class="add-on"><i class="icon-envelope"></i></span>
<input class="span2" id="inputIcon" type="text">
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我在检测管道流结束时遇到问题。脚步:
这是检测管道流读写结束的正确方法。
var inp = fs.createReadStream(fileName);
var out = fs.createWriteStream(fileName + '.gz');
var gzip = zlib.createGzip();
inp.pipe(gzip).pipe(out);
out.on('finish', function () { ....
Run Code Online (Sandbox Code Playgroud)
对比
var inp = fs.createReadStream(fileName);
var out = fs.createWriteStream(fileName + '.gz');
var gzip = zlib.createGzip();
var zipStream = inp.pipe(gzip).pipe(out);
zipStream.on('finish', function () { ....
Run Code Online (Sandbox Code Playgroud)
我有两个div我想通过onclick事件有条件地展示它们.
我的棱角,app.js
$(document).on('click', '#showless', function(el) {
var appElement = document.querySelector('[ng-app=myapp]');
var $scope = angular.element(appElement).scope();
$scope.$apply(function() {
$scope.value = false;
});
});
$(document).on('click', '#showmore', function(el) {
var appElement = document.querySelector('[ng-app=myapp]');
var $scope = angular.element(appElement).scope();
$scope.$apply(function() {
$scope.value = true;
});
});
Run Code Online (Sandbox Code Playgroud)
和myapp的my div(myapp.html)
<div ng-show="desc" id="description" class="text-muted" style="padding-top:5px;padding-left:10px;padding-right:10px;color:#2E2E2E;font-size:11px;">{{myapp.value|truncate}}<span><a id="showmore" href="">more</a></span>
</div>
<div ng-show="!desc" id="description" class="text-muted" style="padding-top:5px;padding-left:10px;padding-right:10px;color:#2E2E2E;font-size:11px;">{{myapp.value}}<span><a id="showless" href="">less</a></span>
</div>
Run Code Online (Sandbox Code Playgroud)
(truncate是我编写的过滤器,工作正常.)
amazon-ec2 ×1
angularjs ×1
datatable ×1
grails ×1
javascript ×1
mongodb ×1
node.js ×1
python ×1
ubuntu ×1