我有一个新的rails 3应用程序,这是我的Gemfile:
source 'http://rubygems.org'
gem 'rails', '3.0.0' gem 'delayed_job'
gem 'sqlite3-ruby', :require => 'sqlite3'
Run Code Online (Sandbox Code Playgroud)
这是表示我想要排队的作业的类:
class Me < Struct.new(:something)
def perform
puts "Hello from me"
logger.info "Hello from me"
logger.debug "Hello from me"
raise Exception.new
end
end
Run Code Online (Sandbox Code Playgroud)
从没有工作人员运行的控制台:
irb(main):002:0> Delayed::Job.enqueue Me.new(1)
=> #<Delayed::Backend::ActiveRecord::Job id: 7, priority: 0, attempts: 0, handler: "--- !ruby/struct:Me \nsomething: 1\n", last_error: nil, run_at: "2010-12-29 07:24:11", locked_at: nil, failed_at: nil, locked_by: nil, created_at: "2010-12-29 07:24:11", updated_at: "2010-12-29 07:24:11">
Run Code Online (Sandbox Code Playgroud)
就像我提到的:没有工人在运行:
irb(main):003:0> Delayed::Job.all
=> [#<Delayed::Backend::ActiveRecord::Job id: 7, priority: 0, …Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中使用MultiAutoCompleteTextView来显示各种建议.
我注意到MultiAutoCompleteTextView不支持默认带有EditText的常规android suggerstion(弹出软键盘上方的建议条带).
有没有办法显示常规建议,以及我想在MultiAutoCompleteTextView中显示的建议?
有人可以将其转换为 Clojure,我不知道该做setMainWindow(argument)这样的事情....
import com.vaadin.Application;
class something {
public void init() {
Window main = new Window("The Main Window");
setMainWindow(main);
addComponent(new WindowOpener("Window Opener", main));
}
}
Run Code Online (Sandbox Code Playgroud)
更新:
package app;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Window;
/**
* The Application's "main" class
*/
@SuppressWarnings("serial")
public class MyVaadinApplication extends Application{
private Window window;
@Override
public void init(){
window = new Window("My Vaadin Application");
setMainWindow(window);
window.addComponent(new Button("Click Me"));
}
}
Run Code Online (Sandbox Code Playgroud)
有一个“/lib/vaadin.jar”,其中包含所有“com.vaadin.*”的东西。
我认为setMainWindow(window);是来自扩展类。我不会写那个方法。
我在我的ViewModel中实现了IDataErrorInfo,如果文本框有错误,则返回一个字符串.
public string this[string columnName]
{
get { return "Error-- This is a long error message - sd"; }
}
Run Code Online (Sandbox Code Playgroud)
但是此错误消息会在UI上的其他控件后面显示,如下所示.

下面是xaml:
<Window x:Class="Test.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600">
<Window.Resources>
<ControlTemplate x:Key="validationTemplateNew">
<DockPanel LastChildFill="True">
<TextBlock Name="ErrorText" DockPanel.Dock="Bottom" Foreground="White" Background="Red"
FontSize="12" Padding="2" FontFamily="Trebuchet MS"
Margin="5,5,0,0"
TextWrapping="Wrap"
Text="{Binding [0].ErrorContent}" ></TextBlock>
<AdornedElementPlaceholder Name="ErrorTextBox" />
</DockPanel>
</ControlTemplate>
<Style x:Key="ValidationStyle" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BitmapEffect">
<Setter.Value>
<BitmapEffectGroup>
<OuterGlowBitmapEffect GlowColor="Red" GlowSize="3" Noise="0.6"></OuterGlowBitmapEffect>
</BitmapEffectGroup>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources> …Run Code Online (Sandbox Code Playgroud) 我一直在尝试用postgresql类路径运行以下程序一小时
class Test{
public static void main(String[] args){
try {
Class.forName("org.postgresql.Driver");
} catch (ClassNotFoundException cnfe) {
System.err.println("Couldn't find Postgresql driver class!");
}
}
}
Run Code Online (Sandbox Code Playgroud)
使用javac命令编译好的程序,但是我很难用postgresql类路径运行它.我在与文件相同的目录中有"postgresql-9.0-801.jdbc4.jar",我尝试了以下内容,但是没有使用它们
java -classpath ./postgresql-9.0-801.jdbc4.jar Test
java -classpath postgresql-9.0-801.jdbc4.jar Test
java -classpath "postgresql-9.0-801.jdbc4.jar" Test
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
问候!
什么是简单的等效C代码,克服像__功能_mm_store_ps,_mm_add_ps等等,请通过与等价的C代码的例子指定任何功能.
为什么使用这些功能?
请告诉我如何使用 javascript 获取图像文件大小(以字节为单位)。
谢谢
在开发OpenGL程序时,是否有办法从系统中进行轮询以找出可用于存储纹理的数兆字节等?
或者这些日子的标准方法是分配内存而忘记一切?
java ×2
android ×1
autocomplete ×1
c ×1
clojure ×1
delayed-job ×1
image ×1
indexing ×1
javascript ×1
memory ×1
opengl ×1
postgresql ×1
size ×1
sql ×1
sse ×1
tfs ×1
vaadin ×1
windows ×1
wpf ×1