我想使用Pipeline在我的SCM中跟踪我的Jenkin Jobs.(源控制经理).
有没有办法可以将我现有的作业导出并导出到有效的Jenkins文件,可以通过管道读取?
我正在使用的主要插件是我需要导出的是Github Pull Request Builder,测试结果记者,代码覆盖率记者,以及松弛通知后期构建任务.
我的主要问题是如何将我的Jenkins设置导出到上面链接中提到的Jenkins文件中,这样我就不必手动编写它们了.
我在这样的ScrollViewer中创建了一个Rectangle
<ScrollViewer ManipulationMode="Control" x:Name="songScrollViewer" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Height="270" VerticalAlignment="Center" Width="728" Canvas.Top="20" d:LayoutOverrides="HorizontalMargin" >
<Rectangle x:Name="musicBG" Fill="#FF0692FD"/>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
在使用应用程序期间,MusicBg的大小会发生变化,有时会变为大约3,000像素宽.
musicBG.Width = _songLength*PixelsPerSecond
Run Code Online (Sandbox Code Playgroud)
但是,在滚动scrollViewer时,它允许我将矩形一直滚动到屏幕上.
例如,当我移动矩形时,这行代码给出了以下值,只要我想移动它.
if (songScrollViewer.HorizontalOffset > songScrollViewer.ScrollableWidth)
Run Code Online (Sandbox Code Playgroud)
HorizontalOffset的值为~1200,ScrollableWidth的值约为~2900.
如何才能正确完成此操作,以便矩形不会完全滚动屏幕?
我希望大约1200的HorizontalOffset只将矩形推到它的目的地的一半,而不是让它开始离开屏幕.
回答:
经过很多挫折之后,我能够通过使用Canvas而不是Border或Rectangle来解决这个问题.如果有人能够解释为什么会出现这个问题,并且如果处理器密集程度较低的控件比canvas更好,我会给予积分.
编辑:截屏:
坏代码:
<ScrollViewer ManipulationMode="Control" x:Name="songScrollViewer" Width="720" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Height="270" VerticalAlignment="Top" Canvas.Top="20" HorizontalAlignment="Left" >
<Border x:Name="musicBG" Background="#FF0692FD" VerticalAlignment="Top" HorizontalAlignment="Left" Height="270" />
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
坏代码坏图片:

良好的工作代码:
<ScrollViewer ManipulationMode="Control" x:Name="songScrollViewer" Width="720" HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Disabled" Height="270" VerticalAlignment="Top" Canvas.Top="20" HorizontalAlignment="Left" >
<Canvas x:Name="musicBG" Background ="#FF0692FD" Height="270" >
<Border Background="#FF0692FD" VerticalAlignment="Top" HorizontalAlignment="Left" Height="270" />
</Canvas>
</ScrollViewer>
Run Code Online (Sandbox Code Playgroud)
好滚动:注意它在右下角显示170秒而不是在坏滚动中的较小数量的118秒.

基于上一个问题,我询问IDE支持多种语言的开发,在一些答案中提到了Eclipse和基于Eclipse的IDE.如果我要使用这些工具,它们之间会有冲突,还是可以顺利地并排运行?是否也可以运行不同的Eclipse实例并在每个实例中安装单独的插件?
当 ListBox 开始滚动时是否会触发事件?
我目前有以下代码来允许从列表框中无缝拖放。
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" Margin="-5" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate >
<DataTemplate>
<Image ManipulationStarted="ListImage_ManipulationStarted" Tag="{Binding selfReference}" x:Name="ListImage" Margin="2.5" Stretch="Fill" Source="{Binding thumbnailURL}" Height="64" Width="64"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud)
然后在代码中
private void ListImage_ManipulationStarted(object sender, ManipulationStartedEventArgs e)
{
if (dImage == null)
{
SoundEffectModel selectedModel = (sender as Image).Tag as SoundEffectModel;
int newIndex = listBoxSource.Items.IndexOf(selectedModel);
if (newIndex != -1)
{
listBoxSource.SelectedIndex = newIndex;
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我复制列表框中的所选项目,并将其直接放置在所选项目的当前位置上。一切正常。
但是,如果用户开始滚动列表框而不是在应用程序周围拖动项目,则复制的图像位于列表框的顶部并且看起来不专业。只要用户抬起手指,重复的项目就会被删除,因为我可以检测到操作完成事件,并意识到该项目位于“错误的地方”。
有没有办法在滚动开始时删除项目而不是等待操作完成事件?
我在一个用户输入邮寄地址的网站上有一个简单的表格.
我有一个服务可以验证这个地址并返回各种响应,包括Success,Suspect或Invalid,以及返回该地址的完整和最完整的邮政编码.如果响应是"成功",那么我将它保存到数据库.如果响应是"可疑",那么我将更新zip字段并要求他们确认.如果回复是"无效",那么我将返回一条错误消息,要求他们亲自与我们联系.
我正在尝试设置我的rails创建操作,以便它调用我的服务(例如http:/addresssValidator.com),我想通知用户他们是否有有效地址,并更新zip使用建议的邮政编码.
然而,在rails中寻找地址验证似乎只给了我在rails中使用内置错误和验证系统的API,而不是如何将我自己的自定义结果返回到表单.
我怎样才能做到这一点?
以下是我的代码:
def create
@valid = validate_address
@address = Address.new(address_params)
if @valid
if @address.save
redirect_to "/survey/success"
else
p @address.errors
respond_to do |format|
format.json {render json: @address.errors}
format.html {render "/survey/failure"}
end
end
else
##//Display errors
end
end
def validate_address
@api_key = "my_api_key"
HTTParty.post("http://addressValidator.com",
{
:body => [
"StreetAddress" => params[:address][:address_line_2] + " " + params[:address][:address_line_1],
"City" => params[:address][:city],
"PostalCode" => params[:address][:zip],
"State" => params[:address][:state],
"CountryCode" => params[:address][:country],
"Locale" => "en" ].to_json,
:APIKey => @api_key ,
:headers => …Run Code Online (Sandbox Code Playgroud)