小编Cyz*_*far的帖子

semantic-ui下拉菜单不起作用

我一直在尝试使用Semantic-UI构建菜单.我无法让下拉菜单工作.我拿了一份菜单示例页面的副本,然后拉出除分层菜单以外的所有内容,并将其放在一个单独的文件中.尽管没有错误,但只有下拉菜单才会起作用.谁能告诉我我错过了什么?

<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Content-Script-Type" content="text/jscript" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />    
    <link rel="stylesheet" type="text/css" class="ui" href="http://semantic-ui.com/build/packaged/css/semantic.min.css">
    <link rel="stylesheet" type="text/css" href="http://semantic-ui.com/stylesheets/semantic.css">  
    <script src="http://semantic-ui.com/javascript/library/jquery.min.js"></script>
    <script src="http://semantic-ui.com/javascript/library/history.js"></script>
    <script src="http://semantic-ui.com/javascript/library/easing.js"></script>
    <script src="http://semantic-ui.com/javascript/library/ace/ace.js"></script>
    <script src="http://semantic-ui.com/javascript/library/tablesort.js"></script>
    <script src="http://semantic-ui.com/javascript/library/waypoints.js"></script>
    <script src="http://semantic-ui.com/build/packaged/javascript/semantic.min.js"></script>
    <script src="http://semantic-ui.com/javascript/semantic.js"></script>
  </head>
  <body class="menu" >
    <div class="ui tiered menu">
      <div class="menu">
        <a class="active item">
          <i class="users icon"></i>
          Friends
        </a>
        <a class="item">
          <i class="grid layout icon"></i> Browse
        </a>
        <a class="item">
          <i class="mail icon"></i> Messages
        </a>
        <div class="right menu">
          <div class="item"> …
Run Code Online (Sandbox Code Playgroud)

html javascript semantic-ui

46
推荐指数
5
解决办法
6万
查看次数

Heroku命令错误.local/share/heroku/client/bin/heroku:第21行:

我的heroku toolbelt一直工作正常,直到上周,它给了我所有heroku命令的这个错误.

$ heroku run console -a abc
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我不知道我的heroku已经自动升级了,但是改变的是我安装了heroku-vi插件.不确定是不是这样.

有没有人见过这个问题?

注意到我使用自制软件在我的Mac上安装了heroku.

heroku

20
推荐指数
2
解决办法
3851
查看次数

如何通过Paperclip rails 4上传图像,文档文档和/或PDF文件

我想让用户将Word文档PDF文件上传到我的rails应用程序.我的应用程序类似于Pinterest应用程序,用户可以创建Pins,其中附加图片后跟描述(使用Paperclip将图像附加到Pin).

这是我的Pins模型:

class Pin < ActiveRecord::Base
    belongs_to :user
    has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
    validates_attachment :image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"] }
    validates :image, presence: true

    end
Run Code Online (Sandbox Code Playgroud)

我的Pins控制器:

class PinsController < ApplicationController
  before_action :set_pin, only: [:show, :edit, :update, :destroy]
  before_action :correct_user, only: [:edit, :update, :destroy]
  before_action :authenticate_user!, except: [:index, :show]

  def index
    @pins = Pin.all.order("created_at DESC").paginate(:page => params[:page], …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails paperclip

15
推荐指数
1
解决办法
2万
查看次数

运行服务器本地主机时,Django Watchtower 连接被拒绝

我使用 Django了望塔将事件记录到 AWS Cloudwatch 并在设置文件中添加了日志配置。

开发.py

boto3_session = Session(
    aws_access_key_id=AWS_ACCESS_KEY_ID,
    aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
    region_name=AWS_REGION)


LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'simple': {
            'format': "%(asctime)s [%(levelname)-8s] %(message)s",
            'datefmt': "%Y-%m-%d %H:%M:%S"
        },
        'aws': {
            # you can add specific format for aws here
            'format': "%(asctime)s [%(levelname)-8s] %(message)s",
            'datefmt': "%Y-%m-%d %H:%M:%S"
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
        },
        'watchtower': {
            'level': 'INFO',
            'class': 'watchtower.CloudWatchLogHandler',
            'boto3_session': boto3_session,
            'log_group': 'StagingBeagleApi',
            'stream_name': 'ApplicationLogStream',
            'formatter': 'aws',
        },
    },
    'loggers': {
        'django': { …
Run Code Online (Sandbox Code Playgroud)

python django watchtower

7
推荐指数
1
解决办法
851
查看次数

谷歌表格,只读回答字段

我想将Google表单中的一个答案字段设置为只读或隐藏,以便表单收件人无法修改/查看它.

那可能吗?

这是上下文:

所以基本上我的最终目标是利用Google表单功能向收件人发送调查并在响应电子表格中跟踪他们的答案.

到现在为止还挺好...

现在让我向您介绍两个强加于我的限制:

  1. 发送给收件人的表单需要有一些已预先填写的收件人信息.

  2. 提供给每个收件人以访问表单的URL用于提交并稍后更新表单上提供的答案.

看到第二个制约因素是棘手的...做的共同点是生成预填充网址发送给收件人,一旦他们已经回答的形式,你可以有一个确认页面,您为他们提供一个编辑URL,他们可以使用然后更新他们的答案(最后更新的答案已经预先填写).

就我而言,我无法为他们提供第二个网址(编辑网址).这是一次性的事情:我为每个收件人提供一个网址,他们必须能够使用相同的网址来回答和更新问题 - 如果他们需要,可以在以后再次使用.

Google不支持此功能,因此我必须编写一个从电子表格中读取的脚本,使用每行中的数据预先填写指定的表单,提交每个表单,然后为每个收件人生成一个编辑网址,然后我插入在我的电子表格的"编辑网址"列中.我现在可以将网址提供给收件人,他们将能够一遍又一遍地使用该网址来更新他们在调查中的答案.

现在回到隐藏/只读字段.在我的电子表格中,我为每个收件人提供了唯一的字母数字值.我希望将其传递给表单,以便当他们回答(答案记录在响应电子表格中)时,我将能够通过这个唯一的"id"识别每个收件人.

我在这里写了很多,但我知道为人们提供背景是很重要的,这样他们才能以精确和深思熟虑的方式互相帮助.

google-apps-script google-forms

6
推荐指数
1
解决办法
1万
查看次数

TypeError:google.maps.latLng不是构造函数

我正在使用Firefox加载GeoLocation的html文件。问题是我在控制台中收到以下两条消息:

TypeError: google.maps.latLng is not a constructor index.html:26
error in parsing value for 'background'.  Declaration dropped.
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>Navigator</title>
</head>
<script src="js/jquery.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>

<script>

x = navigator.geolocation;

x.getCurrentPosition(success, failure);

function success(position) {

    // fetch coordinates

    var mylat = position.coords.latitude;
    var mylong = position.coords.longitude;

    // google api ready latitude and longitude string

    var coords = new google.maps.latLng(mylat, mylong);

    // setting up out google map

    var mapOptions = {
        zoom: 16,
        center: coords,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    } …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps geolocation

5
推荐指数
1
解决办法
7857
查看次数

更改默认的“选择文件”按钮栏

我想更改 Rails 应用程序中默认的“选择文件”按钮。我正在使用Bootstrap,并且想用Bootstrap Glyphicons 之一替换该按钮。

在此输入图像描述


div这 是class form-group控制“选择文件”按钮的

<div class="form-group">
    <%= f.label :image %><br>
    <%= f.file_field :image, class: "form-control" %>
</div>
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails twitter-bootstrap

5
推荐指数
1
解决办法
7900
查看次数

Google应用脚本收到错误"抱歉,此回复已提交."

我一直在努力解决这个问题,现在无法让它发挥作用.基本上,我有一个Google表格和一个Google电子表格.

timestamp         | name  |   email | revenue | Edit Url
2015-2-2 02:22:22 | David |         |         |
2015-2-2 07:22:22 | Paul  |         |         |
2015-2-2 09:22:22 | Olive |         |         |
Run Code Online (Sandbox Code Playgroud)

我想要完成的事情:

  • 根据电子表格中的信息(姓名,电子邮件,收入),我想以编程方式迭代每一行,根据每行中的信息填充表单,然后提交表单,并为每个提交的表单生成一个编辑URL,存储在"编辑URL"列中.

到目前为止,这是我的Google应用脚本:

function myFunction() {
  createSurveyResponses();
}


function createSurveyResponses() {

  // Open a form by ID and add a new text item.
  var form = FormApp.openById('form_id');

  var response = form.createResponse();


  var sheet = SpreadsheetApp.openById('spreadsheet_id');

  var getAct = sheet.getActiveSheet();

  var data = sheet.getDataRange().getValues();
  // …
Run Code Online (Sandbox Code Playgroud)

google-sheets google-apps-script google-forms

5
推荐指数
1
解决办法
613
查看次数

Activerecord-import 获取 ArgumentError:无效参数!错误

我正在尝试使用 activerecord 导入进行导入。我收到无效参数错误我该如何解决这个问题?

谢谢

我在 postgresql 中的表架构:

create_table "vehicle_locations", force: :cascade do |t|
t.string "plate"
t.datetime "timestamp"
t.float "latitude"
t.float "longitude"
t.integer "speed"
t.integer "mileage"
t.boolean "ignition_on"
t.string "address"
end
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用以下代码导入:

values = [{"plate":"xxx","timestamp":"2017-11-28 
 20:42:57","latitude":41.9322,"longitude":27.3253,"speed":0,"mileage":1984
 04,"ignition_on":true,"address":"address"},{"plate":"xxx","timestamp":"2017-11-28 20:43:46","latitude":47.0148,"longitude":39.1805,"speed":16,"mileage":209726,"ignition_on":true,"address":"address"}]

   columns = [:plate, :timestamp, :latitude, :longitude, :speed, :mileage, :ignition_on,  :address ]
  VehicleLocation.import columns, values
Run Code Online (Sandbox Code Playgroud)

我正在使用 postgresql、rails 5.1。

提前致谢。

 2017-11-28T17:45:08.844Z 17976 TID-gn4tnwlkc WARN: ArgumentError: Invalid arguments!
2017-11-28T17:45:08.844Z 17976 TID-gn4tnwlkc WARN: /home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-import-0.21.0/lib/activerecord-import/import.rb:508:in `import_helper'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-import-0.21.0/lib/activerecord-import/import.rb:399:in `import'
/home/kayayan/Projects/RoR/trasportapp/app/workers/trio_worker.rb:23:in `perform'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:188:in `execute_job'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:170:in `block (2 levels) in process' …
Run Code Online (Sandbox Code Playgroud)

ruby activerecord ruby-on-rails activerecord-import

5
推荐指数
1
解决办法
1858
查看次数

使文本在div中可滚动

我希望div通过向上或向下滚动来将一些冗长的文本包含在可以查看文本的位置.现在,"描述"文本是这样呈现的,<%= @pin.description.html_safe %>并且在<div class="panel-body>(我正在使用Bootstrap)中.

html css ruby-on-rails scrollable

4
推荐指数
1
解决办法
1万
查看次数