我想在我的rails应用程序上运行功能规格,该应用程序在ubuntu上运行.
我碰到了这个错误:
f.QueryInterface is not a function
Run Code Online (Sandbox Code Playgroud)
我在下面列出了重现此问题的步骤:
Install ubuntu
Install ruby 2.2.2p95
gem install rails -v 4.2.1
cd /tmp/
rails new myapp
Run Code Online (Sandbox Code Playgroud)
vi Gemfile所以我有这个:
ruby "2.2.2"
source 'https://rubygems.org'
gem 'thin' ,'1.6.3'
gem 'rails_12factor','0.0.3'
gem 'haml', '4.0.6'
gem 'haml-rails', '0.9.0'
gem 'pg', '0.18.1'
gem 'rails', '4.2.1'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
group :development, :test do
gem 'websocket' ,'1.2.2'
gem 'ffi' ,'1.9.8'
gem 'childprocess' ,'0.5.6'
gem …Run Code Online (Sandbox Code Playgroud) 我今天看着Meteor的分页.
我对这个回购感兴趣:
https://github.com/alethes/meteor-pages
显示的初始代码看起来很简单:
this.Pages = new Meteor.Pagination("collection-name");
Run Code Online (Sandbox Code Playgroud)
和:
<body>
{{> collection-name}}
</body>
<template name="collection-name">
{{> pages}}
{{> pagesNav}} <!--Bottom navigation-->
</template>
Run Code Online (Sandbox Code Playgroud)
我想分页这个演示:
https://github.com/meteor/simple-todos
我在那里看到的代码简化了这个:
Tasks = new Mongo.Collection("tasks");
if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish("tasks", function () {
return Tasks.find({})})}
if (Meteor.isClient) {
// This code only runs on the client
Meteor.subscribe("tasks");
// ...
}
Run Code Online (Sandbox Code Playgroud)
和:
<body>
<ul>
{{#each tasks}}
{{> task}}
{{/each}}
</ul>
</body>
<template name="task">
<li>
{{text}}
</li>
</template>
Run Code Online (Sandbox Code Playgroud)
也许今天我的大脑有点慢.我不清楚如何对上面的代码进行分页.
如何使用github.com/alethes/meteor-pages从simple-todos中分页上面的代码?
世界,
如何使用 Spark-Scala 从网络下载 CSV 文件并将文件加载到 spark-csv DataFrame 中?
目前我依靠 shell 命令中的 curl 来获取我的 CSV 文件。
这是我想要增强的语法:
/* fb_csv.scala
This script should load FB prices from Yahoo.
Demo:
spark-shell -i fb_csv.scala
*/
// I should get prices:
import sys.process._
"/usr/bin/curl -o /tmp/fb.csv http://ichart.finance.yahoo.com/table.csv?s=FB"!
import org.apache.spark.sql.SQLContext
val sqlContext = new SQLContext(sc)
val fb_df = sqlContext.read.format("com.databricks.spark.csv").option("header","true").option("inferSchema","true").load("/tmp/fb.csv")
fb_df.head(9)
Run Code Online (Sandbox Code Playgroud)
我想增强上面的脚本,使其成为纯 Scala,内部没有 shell 语法。
我对从readline on()方法中看到的一些简单行为感到困惑。
我有一个名为的文件small.csv,看起来像这样:
Date,Close
2015-11-12,2045.97
2015-11-11,2075.00
2015-11-10,2081.72
2015-11-09,2078.58
Run Code Online (Sandbox Code Playgroud)
我写了这个脚本:
my.js
var rl = require('readline').createInterface({
input: require('fs').createReadStream('small.csv')
});
global.myarray = [];
rl.on('line', function (line) {
console.log('Line from file:', line);
global.myarray.push(line);
});
console.log(global.myarray);
// done
Run Code Online (Sandbox Code Playgroud)
脚本输出:
dan@nia111:~/d1d2p $
dan@nia111:~/d1d2p $ node -v
v5.0.0
dan@nia111:~/d1d2p $
dan@nia111:~/d1d2p $
dan@nia111:~/d1d2p $ node my.js
[]
Line from file: Date,Close
Line from file: 2015-11-12,2045.97
Line from file: 2015-11-11,2075.00
Line from file: 2015-11-10,2081.72
Line from file: 2015-11-09,2078.58
dan@nia111:~/d1d2p $
dan@nia111:~/d1d2p $
Run Code Online (Sandbox Code Playgroud)
我想增强脚本,使其充满global.myarray …
在Elixir的"入门"指南中,我看到了表达式:byte_size/1和String.length/1.
这些表达的意义是什么?通过将标记除以1,作者想要通信什么?
软,
如何在 aws ec2 运行实例期间设置块设备映射?
我是 awscli 的新手。
我 pip 将它安装到我的 python 环境中。
我让这个例子正常工作:
aws ec2 run-instances --image-id ami-d2c924b2 --instance-type m4.large
Run Code Online (Sandbox Code Playgroud)
如何增强上述 shell 命令以便我以更多磁盘空间启动?
我尝试了这种语法,但失败了:
aws ec2 run-instances --image-id ami-d2c924b2 --instance-type m4.large --block-device-mappings {"DeviceName":"/dev/sda1","Ebs":{"VolumeSize":100}}
Run Code Online (Sandbox Code Playgroud) 我在这里学习内容:http : //www.django-rest-framework.org/
上面的页面建议我克隆一个 repo:
git clone git@github.com:tomchristie/django-rest-framework.git
Run Code Online (Sandbox Code Playgroud)
所以我这样做了;它说我应该INSTALLED_APPS在项目中添加一个条目settings.py,我这样做了。接下来,我在 github 上的 DRF 源中查看了项目 settings.py,但我看不到INSTALLED_APPS 那里的证据。
题:
为什么 DRF 源代码中缺少 INSTALLED_APPS?
我需要帮助在我的ubuntu 16笔记本电脑上安装sagemath.
我这样做了:
cat /etc/os-release
cd ~
wget http://mirrors.mit.edu/sage/linux/64bit/sage-7.2-Ubuntu_16.04-x86_64.tar.bz2
tar jxf sage-7.2-Ubuntu_16.04-x86_64.tar.bz2
SageMath/sage
Run Code Online (Sandbox Code Playgroud)
我看到了这个:
dan@al78:~ $ tar jxf sage-7.2-Ubuntu_16.04-x86_64.tar.bz2
dan@al78:~ $
dan@al78:~ $ ll SageMath/sage
-rwxr-xr-x 1 dan dan 4680 May 15 16:43 SageMath/sage*
dan@al78:~ $
dan@al78:~ $ SageMath/sage
RecursionError: maximum recursion depth exceeded during compilation
??????????????????????????????????????????????????????????????????????
? SageMath version 7.2, Release Date: 2016-05-15 ?
? Type "notebook()" for the browser-based notebook interface. ?
? Type "help()" for help. ?
??????????????????????????????????????????????????????????????????????
ERROR: The Sage installation tree has moved
Run Code Online (Sandbox Code Playgroud)
我欢迎有关如何调试此问题的线索.
javascript ×2
amazon-ec2 ×1
apache-spark ×1
capybara ×1
csv ×1
django ×1
elixir ×1
meteor ×1
node.js ×1
pagination ×1
rspec ×1
ruby ×1
sage ×1
scala ×1
ubuntu-16.04 ×1