我正在使用标准选项生成数据,但我想将分页控件移动到另一个<div>sDom之外
<div class="pagination">pagination</div>
Run Code Online (Sandbox Code Playgroud)
到目前为止,我发现如何复制它看起来像:
"fnInitComplete": function(oSettings){
var $pagination = $('.dataTables_paginate').clone(true, true);
$('.navbar-inner').append($pagination);
}
Run Code Online (Sandbox Code Playgroud)
有办法吗?
我有一个简单的问题,我创建了一个单元测试类,可以说它看起来像这样:
namespace Tests
{
[TestClass]
public class ApiTest
{
private var x;
[TestMethod]
public testA()
{
some operactons
x = some value
}
[TestMethod]
public testB()
{
if(x == null)
test fail
}
}
Run Code Online (Sandbox Code Playgroud)
现在如上所述,我感兴趣的是,是否可以在测试方法 A 中设置一个值 (x) 以便它可以用于测试方法 B?
我有两列的表,它们都包含整数值,如下所示:
DocumentUpId RelatedDocId
31608768 31624333
31608768 31624334
31618133 31618117
Run Code Online (Sandbox Code Playgroud)
我试图将它们合并为一个列,如下所示:
DocumentUpId
31608768
31608768
31618133
31624333
31624334
31624334
Run Code Online (Sandbox Code Playgroud)
我试过这个:
select rel_CTE.DocumentUpId + rel_CTE.DocumentDownId as 'RelatedDocId'
into #temprelations
from RelationsCTE rel_CTE
Run Code Online (Sandbox Code Playgroud)
但它让我连接了值(在这种情况下总和),所以它可能吗?
我有一个简单的问题,但我找不到任何答案。
我正在使用 powershell 5 并且我在封闭环境中工作,无法连接到互联网,我想在我的机器上手动安装模块,基本上是任何可以下载的模块,例如 posh-ssh。
可以做到吗?让我们说在此处保存模块并安装?
我有一个看起来相当简单的问题,但似乎我有一个问题:
\n\n我有一个包含一些数据的数据网格:
\n\n <DataGrid ItemsSource="{Binding Candidates, IsAsync=True}" \n AutoGenerateColumns="False" \n EnableColumnVirtualization="True" \n EnableRowVirtualization="True"\n VirtualizingStackPanel.VirtualizationMode="Standard"\n VirtualizingStackPanel.IsVirtualizing="True"\n CanUserAddRows="false">\n\n <DataGrid.Columns>\n <DataGridTextColumn Binding="{Binding Firstname}" Header="Imi\xc4\x99" />\n <DataGridTextColumn Binding="{Binding Lastname}" Header="Nazwisko" />\n <DataGridTextColumn Binding="{Binding commendation.Name}" Header="Polecenie" />\n </DataGrid.Columns>\n</DataGrid>\nRun Code Online (Sandbox Code Playgroud)\n\n现在使用 mvvm 和命令我对它们应用一些过滤器,它看起来像:
\n\n public CatalogViewModel()\n {\n this._catalog = new CatalogContexct();\n this._candidates = this._catalog.Candidates.Include("commendation").ToList();\n\n var candidates = new ListCollectionView(this._candidates);\n\n this.Candidates = CollectionViewSource.GetDefaultView(candidates);\n\n this.FirstameCommand = new RelyCommand(FilterFirstname, param => this._canExecute);\n this.LastnameCommand = new RelyCommand(FilterLastname, param => this._canExecute);\n this.CommendationCommand = new RelyCommand(FilterCommendation, param => this._canExecute);\n }\nRun Code Online (Sandbox Code Playgroud)\n\n … 使用 Powershell 我正在使用以下命令启动一些可执行文件invoke-expression:
Invoke-Expression "c:\exec.exe"
Run Code Online (Sandbox Code Playgroud)
现在我的问题是这个 exec 显示类似“暂停并按任意键继续”的内容。
我试过:
Function Run-Tool
{
Invoke-Expression "c:\exec.exe"
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
Run Code Online (Sandbox Code Playgroud)
但没有运气。
我的问题是我可以忽略该消息某种抑制还是有办法监视输出并模拟按任意键?
我有一个侦听连接客户端的简单TCP服务器,它看起来很简单
let Listener (ip:IPAddress) (port:int32) =
async {
let listener = TcpListener(ip, port)
listener.Start()
_logger.Info(sprintf "Server binded to IP: %A - Port: %i" ip port)
let rec listenerPending (listener : TcpListener) =
async {
if not (listener.Pending()) then return! listenerPending listener // MEMMORY LEAK SOURCE
printfn "Test"
}
listenerPending listener |> Async.Start
}
Run Code Online (Sandbox Code Playgroud)
好吧,它看起来很简单,但是我有一个内存泄漏问题:当它等待连接时,它会像糖果一样吞噬RAM。
我想它与递归函数有关,但是不知道该如何稳定它。
我在尝试在f#中基于singelton创建某种调解器时遇到问题。主要原因是我需要在应用程序的一部分中注册一些操作,然后在类似于c#的另一部分中执行它,如下所示:
public class Mediator
{
private static readonly object syncRoot = new object();
private static Mediator instance;
public static Mediator Instance
{
get
{
if (instance == null)
{
lock (syncRoot)
{
if (instance == null)
{
instance = new Mediator();
}
}
}
return instance;
}
}
public event Action<string> InputLogUpdate;
public void InvokeInputLogUpdate(string msg)
{
InputLogUpdate?.Invoke(msg);
}
}
Run Code Online (Sandbox Code Playgroud)
调用看起来像:
Mediator.Instance.InvokeInputLogUpdate(msg);
Run Code Online (Sandbox Code Playgroud)
注册看起来像:
Mediator.Instance.InputLogUpdate += msg => this.DebugSection += $"{msg} \n";
Run Code Online (Sandbox Code Playgroud)
但是到目前为止,我所没有的是:
vnamespace Operation.Mediator
module Mediator =
open System
type …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Entity Framework Core UseInMemoryDatabase 编写测试,因此我的设置如下所示:
[SetUp]
public void Setup()
{
this.ContextOptions = new DbContextOptionsBuilder<GeneralContext>()
.UseInMemoryDatabase(databaseName: "DiagAc2Tests")
.Options;
}
Run Code Online (Sandbox Code Playgroud)
我不知道是否需要,但上下文如下:
public class GeneralContext : DbContext
{
public DbSet<Entities.Application> Applications { get; set; }
public GeneralContext() { }
public GeneralContext(DbContextOptions<GeneralContext> options) : base(options) { }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var config = new DatabaseConfiguration();
optionsBuilder.UseNpgsql(config.GetConnectionString());
}
}
Run Code Online (Sandbox Code Playgroud)
我在整个应用程序中使用此上下文并且它有效,所以我的测试如下所示:
public async Task CreateApplicationByService()
{
Mock<DTO.IApplication> mock = new Mock<DTO.IApplication>();
mock.SetupProperty(f => f.Name, "Application");
mock.SetupProperty(f => f.ProjectId, 666);
mock.SetupProperty(f => f.ConfigFilePath, …Run Code Online (Sandbox Code Playgroud) 嗨,我有一个问题。
我有一个简单的服务器,看起来像:
let private Listener ip port =
async {
let listener = new TcpListener(ip, port)
listener.Start()
_logger.Info(printfn "Server binded to IP: %A - Port: %i" ip port)
while listener.Pending() = false do
try
let! client = listener.AcceptTcpClientAsync() |> Async.AwaitTask
clientConnectionPool.Add(client) |> ignore
_logger.Info(printfn "Client connected: %O" client.Client.RemoteEndPoint)
with
| :? ServerListenerException as ex -> _logger.Error(printfn "Exception while starting server listener - %s" ex.Message); ()
}
Run Code Online (Sandbox Code Playgroud)
它工作正常,问题是现在我想获取客户端 Ip 地址,通常在 c# 中我会使用:
((IPEndPoint)entry.Client.RemoteEndPoint).Address
Run Code Online (Sandbox Code Playgroud)
我相信 F# 翻译成:
let clientIp : IPAddress = …Run Code Online (Sandbox Code Playgroud) f# ×3
c# ×2
powershell ×2
.net ×1
.net-core ×1
datatable ×1
jquery ×1
mvvm ×1
sql ×1
sql-server ×1
unit-testing ×1
wpf ×1