那时我的html给出了这个输出:

但我想这样:

所以你怎么看我试图添加一个span数字有空间的地方.我给了这个班级:
.spanContainer{
height:100%;
padding-right:15px
}
Run Code Online (Sandbox Code Playgroud)
但不知何故,这height:100%给了我不想要的效果!我该怎么办?谢谢
http://jsfiddle.net/52VtD/3398/
<ul class="list-group">
<li class="list-group-item">
<span class="spanContainer">
<a class="text-success">02401</a>
</span>
H2-Atemtest
</li>
<li class="list-group-item">
<span class="spanContainer">
<a class="text-success">03241</a>
</span>
Computergestützte Auswertung eines kontinuierlich aufgezeichneten Langzeit-EKG von mindestens 18 Stunden Dauer
</li>
</ul>
Run Code Online (Sandbox Code Playgroud) 我尝试启动一个简单的 tcp 服务器:
chrome.sockets.tcpServer.create({}, function(info){
chrome.sockets.tcpServer.listen(info.socketId, 'localhost', 2000, function(result){
console.log(result);
});
});
Run Code Online (Sandbox Code Playgroud)
但不知何故console.log(result);总是打印出来undefined!
http://developer.chrome.com/apps/sockets_tcpServer#method-create
http://developer.chrome.com/apps/sockets_tcpServer#method-listen
我做错了什么?谢谢!
我创建了一个新的迁移,它看起来像这样:
class AddCommentsToUsers < ActiveRecord::Migration
def change
add_column :users, :comments, :text
end
end
Run Code Online (Sandbox Code Playgroud)
现在有了Code Climate,我被警告了一个问题:
Missing frozen string literal comment.
我试着像这样解决它:
# frozen_string_literal: true
class AddCommentsToUsers < ActiveRecord::Migration
def change
add_column :users, :comments, :text
end
end
Run Code Online (Sandbox Code Playgroud)
但我仍然有同样的问题.我该如何解决?谢谢.
在Ruby类中,我覆盖了三种方法,并且在每种方法中,我基本上都做同样的事情:
class ExampleClass
def confirmation_required?
is_allowed && super
end
def postpone_email_change?
is_allowed && super
end
def reconfirmation_required?
is_allowed && super
end
end
Run Code Online (Sandbox Code Playgroud)
是否有更紧凑的语法?如何缩短代码?
如果我有一个模型:
User :firstname :lastname
joseph smith
anna bauer
... ...
Run Code Online (Sandbox Code Playgroud)
还有一个输入字段,您可以在其中搜索用户.不同的搜索查询可能是:
searchquery1: smith joseph
searchquery2: joseph smith
searchquery3: joseph
searchquery4: smith
Run Code Online (Sandbox Code Playgroud)
在sql中搜索查询会是最好的吗?其实我可以想象这个搜索查询:
where 'firstname OR lastname LIKE ?', "%#{search}"
Run Code Online (Sandbox Code Playgroud)
第一次尝试:
def self.search(search)
if search
select('CONCAT(vorname, " ", nachname) as full_name, *')
where ['vorname LIKE :s OR nachname LIKE :s OR full_name LIKE :s', :s => "%#{search}"]
else
scoped
end
end
Run Code Online (Sandbox Code Playgroud)
错误: SQLite3::SQLException: no such column: full_name
第二次尝试:
def self.search(search)
if search
a = search.split
where('firstname OR lastname LIKE …Run Code Online (Sandbox Code Playgroud) 你怎么看我尝试在svg上发布一个ul列表.

我用z-index尝试了一些东西,但它不起作用!
我的HTML:
<nav>
<svg id="bigTriangleColor" style="z-index:-100;fill:rgb(0,0,255);" xmlns="http://www.w3.org/2000/svg" width="100%" height="100" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 0 L50 100 L100 0 Z" />
</svg>
<ul>
<li><a href="" title="Übersicht">Übersicht</a></li>
<li><a href="" title="Leute">Leute</a></li>
<li><a href="" title="Links">Links</a></li>
</ul>
</nav>
Run Code Online (Sandbox Code Playgroud)
css:
nav {background-color: rgb(14, 131, 205);}
nav{
border-width:1px 0;
list-style:none;
margin:0;
padding:0;
text-align:center;
}
nav li{
display:inline;
}
nav a{
display:inline-block;
padding:15px;
font-size: 17px;
font-family: 'Open Sans', sans-serif;
text-decoration:none;
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!
我有一个红宝石背景和我新的java我写了一个基本的程序,但不知怎的,我得到一个错误,我无法修复!我的代码:
import java.util.ArrayList;
public class Music {
private ArrayList<String> files;
public static void main(String args[]){
Music a = new Music();
a.addFile("Chasen Paper");
a.addFile("Mama");
a.addFile("Hell Yes");
a.removeFile("Hell Yes");
}
public Music(){
files = new ArrayList<String>();
}
public void addFile(String filename){
files.add(filename);
}
public void returnFiles(){
for(int i = 0; files.size() <= i; i++){
System.out.println( i + ". Ist: " + files[i]);
}
}
public void removeFile(String filename){
System.out.println("Vorher gab es " + files.size() + " Dateien");
files.remove(filename);
System.out.println("Jetzt gibt es " …Run Code Online (Sandbox Code Playgroud) 我有这个小jquery函数:
$.each($('#TableBody tr:gt(0)'), function(index, element){
element.find('td').last().html($('<span/>', {class: "input-group-addon", text: 'Auswählen'}));
});
Run Code Online (Sandbox Code Playgroud)
不知怎的,我在第一行得到了这个错误:
Uncaught TypeError: undefined is not a function
Run Code Online (Sandbox Code Playgroud)
我在控制台中试了一些东西来解决这个问题!但不知何故没有用!
现在我希望你能帮助我!JSFIDDLE:http://jsfiddle.net/3C98M/
谢谢
假设我有两个具有相同回调的模型:
class Entry < ActiveRecord::Base
belongs_to :patient
validates :text, presence: true
after_validation :normalizeDate
def normalizeDate
self.created_at = return_DateTime(self.created_at)
end
end
class Post < ActiveRecord::Base
after_validation :normalizeDate
def normalizeDate
self.created_at = return_DateTime(self.created_at)
end
end
Run Code Online (Sandbox Code Playgroud)
我在哪里可以放置共享回调代码?谢谢
def normalizeDate
self.created_at = return_DateTime(self.created_at)
end
Run Code Online (Sandbox Code Playgroud) 这是我的型号代码:
after_create :notify_cards_create
after_destroy :notify_cards_destroy
after_update :notify_cards_update
def notify_cards_update
WebsocketRails[:home].trigger 'cards', {type: 'update', card: self.as_json({small: true})}
end
def notify_cards_create
WebsocketRails[:home].trigger 'cards', {type: 'create', card: self.as_json({small: true})}
end
def notify_cards_destroy
WebsocketRails[:home].trigger 'cards', {type: 'destroy', card: self.as_json({small: true})}
end
Run Code Online (Sandbox Code Playgroud)
如你所见,它包含许多重复!如何将此代码缩短为:
after_create :notify_cards_create, 'create'
after_destroy :notify_cards_destroy, 'destroy'
after_update :notify_cards_update, 'update'
Run Code Online (Sandbox Code Playgroud)
谢谢!