我宣布:
Discursiva[] questoesDiscursivas = new Discursiva[10];
Run Code Online (Sandbox Code Playgroud)
这是:
public class Discursiva extends Questao{
private String criteriosCorrecao;
}
Run Code Online (Sandbox Code Playgroud)
而Questao是:
public class Questao {
private String pergunta;
private double peso;
}
Run Code Online (Sandbox Code Playgroud)
所以我做了:
str = JOptionPane.showInputDialog("Pergunta da Questao:");
questoesObjetivas[i].setPergunta(str);
Run Code Online (Sandbox Code Playgroud)
并得到了java.lang.NullPointerException.
我在oracle docs中读过:当一个应用程序试图在需要对象的情况下使用null时抛出.这些包括:
Run Code Online (Sandbox Code Playgroud)Calling the instance method of a null object. Accessing or modifying the field of a null object. Taking the length of null as if it were an array. Accessing or modifying the slots of null as if it were an array. Throwing …
我在ActiveAdmin中有一个名为statistics的自定义页面,我想在其中显示包含数据库数据的图表.
现在我使用了Gon gem并希望通过实例变量将数据传递给我的自定义页面.
通常,您会将gon行添加到索引操作中
class ProductsController < ApplicationController
def index
gon.rabl "app/views/products/index.json.rabl", as: "products"
end
end
Run Code Online (Sandbox Code Playgroud)
但是我的自定义页面的活动管理员中没有控制器.我该怎么做?或者我是否必须通过仪表板执行此操作?
REST API railscast具有以下代码示例:
module Api
module V1
class ProductsController < ApplicationController
class Product < ::Product
def as_json(options={})
super.merge(released_on: released_at.to_date)
end
end
end
end
end
Run Code Online (Sandbox Code Playgroud)
我无法遵循以下内容:
class Product < ::Product
Run Code Online (Sandbox Code Playgroud)
......呢?当我尝试在irb中重新创建类似的东西时,我得到:
module Fooirb(main):001:0> module Foobar
irb(main):002:1> class Product < ::Product
irb(main):003:2> end
irb(main):004:1> end
NameError: uninitialized constant Product
from (irb):2:in `<module:Foobar>'
from (irb):1
Run Code Online (Sandbox Code Playgroud)
使用CSS(参见下面的CSS),它适用于所有浏览器.不幸的是,正如预期的那样它在IE 8中不起作用.他们是一种替代方式,我可以为IE 8获得类似的3列输出吗?
#site-map .site-map-box {
-webkit-column-count: 3;
-moz-column-count: 3;
column-count: 3;
-webkit-column-gap: 250px;
-moz-column-gap: 250px;
column-gap: 250px; }
Run Code Online (Sandbox Code Playgroud) 我明白那个
border-top: 50px solid transparent;
Run Code Online (Sandbox Code Playgroud)
意味着顶部边框的厚度为50px,将是实心的并且没有颜色.
我也理解这一点
border-right: 100px solid red;
Run Code Online (Sandbox Code Playgroud)
意味着右边框将是100px厚将是实心的并且将是红色的.
但我不明白怎么...
#triangle-left
{ width: 0;
height: 0;
border-top: 50px solid transparent;
border-right: 100px solid red;
border-bottom: 50px solid transparent;}
Run Code Online (Sandbox Code Playgroud)
可以制作一个指向左边的三角形?
并且将有助于理解.
如何从键模式开始删除,取消设置会话变量
钥匙就像
Guard_1660743344
Guard_4323340344
Guard_5343332233
.....
Guard_[dynamicvalue]
Run Code Online (Sandbox Code Playgroud)
如果会话密钥以"Guard_"开头,我想从托盘中删除所有会话变量
unset($_SESSION[$key]);
Run Code Online (Sandbox Code Playgroud)
对不起,我尽力找到解决方案,但失败了,因此问道
css ×2
activeadmin ×1
controller ×1
css3 ×1
html ×1
java ×1
loops ×1
php ×1
ruby ×1
session ×1