小编nit*_*rog的帖子

SUM OVER PARTITION BY

我错过了什么?

此查询一遍又一遍地返回重复数据.计数对于一个完整的总计是正确的,但我期待一行,但我重复约40次.有任何想法吗?

SELECT BrandId
      ,SUM(ICount) OVER (PARTITION BY BrandId ) 
  FROM Table 
WHERE DateId  = 20130618
Run Code Online (Sandbox Code Playgroud)

我明白了吗?

BrandId ICount
2       421762
2       421762
2       421762
2       421762
2       421762
2       421762
2       421762
1       133346
1       133346
1       133346
1       133346
1       133346
1       133346
1       133346
Run Code Online (Sandbox Code Playgroud)

我错过了什么?

我无法删除分区,因为整个查询是这样的:

SELECT BrandId
       ,SUM(ICount) OVER (PARTITION BY BrandId) 
       ,TotalICount= SUM(ICount) OVER ()    
        ,SUM(ICount) OVER () / SUM(ICount) OVER (PARTITION BY BrandId)  as Percentage
FROM Table 
WHERE DateId  = 20130618
Run Code Online (Sandbox Code Playgroud)

哪个返回:

BrandId (No …
Run Code Online (Sandbox Code Playgroud)

sql t-sql sql-server

16
推荐指数
4
解决办法
20万
查看次数

鼠标悬停和鼠标移动时的wpf工具提示

我想要做的是在鼠标结束后显示工具提示.鼠标输出后,工具提示不会关闭.

只有鼠标移出才能关闭工具提示.

客户有一个要求,他们希望ToolTip无限期地保持不变直到鼠标停止发生.

附加:有没有办法只关闭鼠标输出的工具提示,而不是鼠标移动?

鼠标将覆盖的区域是一个矩形,只有当我移出矩形时,工具尖端才会关闭.

谢谢.

wpf tooltip mouseevent

14
推荐指数
2
解决办法
2万
查看次数

Hbase Schema嵌套实体

有没有人有关于如何使用嵌套实体创建Hbase表的示例?

UserName (string)
SSN  (string)
  + Books (collection)
Run Code Online (Sandbox Code Playgroud)

例如,书籍集合看起来像这样

图书

isbn
title
etc...
Run Code Online (Sandbox Code Playgroud)

我找不到一个例子是如何创建这样的表.我看到很多人都在谈论它,以及在某些情况下它是如何做到最好的做法,但我找不到一个如何在任何地方做到这一点的例子.

谢谢...

schema hadoop hbase

14
推荐指数
1
解决办法
4736
查看次数

修改C#编译的exe中的Emdeded String

我有一个问题,我需要能够有一个编译的exe(.net 3.5 c#),我将复制分发,例如在发送exe之前需要更改密钥.

每次需要新的exe时我都无法编译.这是一个瘦客户端,将用作注册过程的一部分.

是否可以向具有空值的资源文件添加条目,然后当请求进入时,另一个应用程序获取空白的默认瘦客户端,复制它,用所需数据填充空白值.

如果有,怎么样?如果没有,你有什么想法吗?我现在已经摸不着头几天了,这个限制是由于我需要工作的边界.

我的另一个想法是将值注入一个方法,我不知道我怎么会尝试这个.

谢谢.

c# executable assemblies code-injection disassembly

11
推荐指数
2
解决办法
8344
查看次数

WCF Windows服务.可以在本地连接,但不能远程连接

我花了两天时间试图解决这个问题而且我很难过.我有一个在Windows上作为服务运行的WCF服务器.客户端可以在同一台机器上连接到它,但是一旦我移动尝试连接到另一台机器上的服务我就不能.

因此,如果客户端和主机在同一台机器上,没有问题.如果主机和客户端位于不同的计算机上,则会出现异常错误.

这是奇怪的部分,我可以使用svcutil从远程机器生成app config和proxy.cs文件,但是一旦我调用该函数就会发出错误.

无法连接到net.tcp:// ipaddress:port/Service1.TCP错误代码10061.无法建立连接,因为目标计算机主动拒绝它.

如果我从同一台机器主机/客户端调用它没有错误.

有任何想法吗?

更新:

这是服务端点设置.

<system.serviceModel>
    <services>
        <service behaviorConfiguration="Service1Behavior" name="WcfServiceLibrary1.Service1">
            <endpoint address="net.tcp://192.168.1.75:8523/Service1" binding="netTcpBinding"
                contract="WcfServiceLibrary1.IService1" />
            <endpoint address="net.tcp://192.168.1.75:8523/mex" binding="mexTcpBinding"
                contract="IMetadataExchange" />
            <host>
                <baseAddresses>
                    <add baseAddress="net.tcp://192.168.1.75:8523/" />
                </baseAddresses>
            </host>
        </service>
    </services>
    <bindings>
        <netTcpBinding>
            <binding name = "TcpBindingConfiguration">
                <security mode="None"/>
            </binding>
        </netTcpBinding>
    </bindings>
    <behaviors>
        <serviceBehaviors>
            <behavior name="Service1Behavior">
                <serviceMetadata />
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

我尝试了一切.

有任何想法吗?

再次是客户端和主机在同一台机器上一切都很好,只要我把客户端放在另一台计算机上,没有骰子......

白天我从未对网络编程感到头疼...

谢谢

c# wcf wcf-client

7
推荐指数
1
解决办法
2万
查看次数

jquery datatables actionlink如何添加

我一直在寻找最近几个小时,不幸的是我似乎无法找到一个如何用动作编辑填充数据表并使用.net和MVC删除链接列的示例.

这是我到目前为止,我如何添加一个动作链接?我错过了什么?

<script type="text/javascript">
$(document).ready(function () {
    $('#myDataTable').dataTable({
        bProcessing: true,
        sAjaxSource: '@Url.Action("Index1", "Default1")'
    });

});
</script>

<div id="container">
<div id="demo">
    <table id="myDataTable">
        <thead>
            <tr>
                <th>
                    RoleId
                </th>
                <th>
                    RoleName
                </th>
                <th>
                    UserId
                </th>
                <th>
                    UserName
                </th>
            </tr>
        </thead>
        <tbody> 
        </tbody>
</table>    
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想在最后一栏中添加这个;

    <td>
        @Html.ActionLink("Edit", "Edit", new {id=item.PrimaryKey}) |
        @Html.ActionLink("Details", "Details", new { id=item.PrimaryKey }) |
        @Html.ActionLink("Delete", "Delete", new { id=item.PrimaryKey })
    </td>
Run Code Online (Sandbox Code Playgroud)

但无法弄清楚该怎么做.

jquery asp.net-mvc-3 jquery-datatables

7
推荐指数
2
解决办法
3万
查看次数

Confluence Replicator 无法重新配置连接器任务?

我过去使用过镜像制作器而不是 Replicator,并且收到错误,但现在确定从哪里开始调试它。

这是错误:

[2019-08-12 18:04:09,672] ERROR Failed to reconfigure connector's 
tasks, retrying after backoff: (org.apache.kafka.connect.runtime.distributed.DistributedHerder:958) 
org.apache.kafka.connect.errors.ConnectException: Could not obtain timely topic metadata update from source cluster
    at io.confluent.connect.replicator.TopicMonitorThreadWithZk.assignments(TopicMonitorThreadWithZk.java:138)
    at io.confluent.connect.replicator.ReplicatorSourceConnector.taskConfigs(ReplicatorSourceConnector.java:99)
    at org.apache.kafka.connect.runtime.Worker.connectorTaskConfigs(Worker.java:317)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.reconfigureConnector(DistributedHerder.java:997)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.reconfigureConnectorTasksWithRetry(DistributedHerder.java:950)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.startConnector(DistributedHerder.java:914)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder.access$1300(DistributedHerder.java:110)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder$15.call(DistributedHerder.java:924)
    at org.apache.kafka.connect.runtime.distributed.DistributedHerder$15.call(DistributedHerder.java:920)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Run Code Online (Sandbox Code Playgroud)

apache-kafka confluent-platform

6
推荐指数
0
解决办法
1237
查看次数

VS 2010报表查看器无法访问嵌套集合,任何人?

我像往常一样经历了MSDN上的所有漫步,它们毫无价值 - 非常有限.

如果我在我的类中使内部对象成为单个类,我可以显示信息,但是只要将其转换为对象列表(集合),我就会在显示中得到#Error.

这是一个更新的例子.

举个例子,我有一个Person对象,可以有一个或多个电话号码(号码列表),我找不到办法来访问电话号码.

[Serializable]
public class Person
{
    private readonly List<PhoneNumber> _numbers = new List<PhoneNumber>();

    public Person()
    {
    }

    public Person(int id, string name, string address, decimal salary)
    {
        Id = id;
        Name = name;
        Address = address;
        Salary = salary;
    }

    public void AddNumber(PhoneNumber number)
    {
        _numbers.Add(number);            
    }


    public int Id { get; set; }
    public string Name { get; set; }
    public string Address { get; set; }

    public List<PhoneNumber> PhoneNumbers { get { return …
Run Code Online (Sandbox Code Playgroud)

.net c# reportviewer list reporting-services

5
推荐指数
1
解决办法
2195
查看次数

在不使用XAML的情况下将SubItems添加到ListView

如何将子项添加到ListView?我需要动态生成所有内容,但我发现的每个示例都使用XAML.

非WPF非常简单:

ListViewItem lvi = listview.items.add(wahtever);
lvi. blah blah blah
Run Code Online (Sandbox Code Playgroud)

如何在不使用XAML的情况下在WPF中添加子项?

c# wpf listview listviewitem

4
推荐指数
2
解决办法
2万
查看次数

wpf不同颜色的面积图?

我是一个沉思MS工具包图表,无法弄清楚如何改变区域的颜色.我需要动态填充图表,这意味着我不知道区域图表将有多少部分.

这是我的代码.

var a = new AreaSeries
{
  Title = "a",
  IndependentValuePath = "Key",
  DependentValuePath = "Value",
  Background = Brushes.Plum
};
Run Code Online (Sandbox Code Playgroud)

我试图改变前景和背景,没有骰子.

mcChart.Series.Add(a);

a = new AreaSeries
{
  Title = "b",
  IndependentValuePath = "Key",
  DependentValuePath = "Value",
  Background = Brushes.Peru
};

mcChart.Series.Add(a);
Run Code Online (Sandbox Code Playgroud)

填写图表.

((AreaSeries)mcChart.Series[0]).ItemsSource = new[]
{
  new KeyValuePair<string, int>("1", 100),
  new KeyValuePair<string, int>("2", 180),
  new KeyValuePair<string, int>("3", 110),
  new KeyValuePair<string, int>("4", 95),
  new KeyValuePair<string, int>("5", 40),
  new KeyValuePair<string, int>("6", 95)
};

((AreaSeries)mcChart.Series[1]).ItemsSource = new[]
{
  new KeyValuePair<string, int>("1", 150), …
Run Code Online (Sandbox Code Playgroud)

c# wpf charts wpftoolkit area

3
推荐指数
1
解决办法
7640
查看次数

获取与枚举关联的字符串值?

我有一个枚举

public enum BookType
{
    Old = 'O',
    New = 'N',
    All = 'B'
}
Run Code Online (Sandbox Code Playgroud)

我需要做的是获取枚举中char的值.例如,如果枚举设置为:

BookType bt = BookType.New
Run Code Online (Sandbox Code Playgroud)

我需要获得新的"N"的价值

string val = (???)bt;
Run Code Online (Sandbox Code Playgroud)

我需要val = N.

做这个的最好方式是什么?如果它是一个容易的int,只需转换为int.

谢谢.

c# string enums

2
推荐指数
1
解决办法
725
查看次数

查找 MediaWiki 中不存在页面的链接

我已经搜索了几天,很难找到维基媒体的具体信息。

有谁知道会显示不存在页面的内部链接的扩展程序或报告?

我们托管一个维基,其中有用户创建了一些优秀的内容,但由于内容量很大,必须浏览每个页面才能找到尚未创建的页面的链接几乎是不可能的。

任何帮助或想法将不胜感激......

wiki mediawiki

2
推荐指数
1
解决办法
530
查看次数

wpf列表框复选框组合,真的卡住了

我试图将checkbox和listview链接在一起,然后使用绑定方法设置对象的路径,以便在列表框中设置复选框IsChecked状态.

List<Test1> datas = new List<Test1>();

var data = new Test1 {Key = 1, Value = "Hello", IsSelected= true};
    datas.Add(data);
    data = new Test1 {Key = 2, Value = "Hello2", IsSelected= false};
    datas.Add(data);
Run Code Online (Sandbox Code Playgroud)

我需要发生的是,如果选中复选框(IsSelected为true),那么我需要填充这些值,然后当我单击并取消选中GUI中的复选框时,我需要它也选择正确的侦听项目,这样我就可以转到标签属性.

下面的代码未设置复选框IsChecked.

<ListBox ItemsSource="{Binding}" Name="lstSwimLane" Width="225" Height="125" SelectionChanged="lstSwimLane_SelectionChanged">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <CheckBox IsChecked="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem}, Path=IsSelected, Mode=TwoWay}" 
                                          Checked="CheckBox_Checked" 
                                          Unchecked="CheckBox_Unchecked" />
                <TextBlock Text="{Binding Path=Value}"></TextBlock>
            </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>
Run Code Online (Sandbox Code Playgroud)

为了将复选框设置为对象中的值,我需要更改什么?我甚至尝试过INotifyChange等......

这也是对象.

public class Test1 : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;

    private bool _isChecked;

    public int Key { …
Run Code Online (Sandbox Code Playgroud)

wpf binding combobox listbox

1
推荐指数
1
解决办法
3347
查看次数