我有以下查询:
let p1 = pageViews | where url has "xxx";
p1
| join kind=inner (pageViews
| where url !has "xxx")
on session_Id
| project timestamp1, session_Id1, url1, client_CountryOrRegion1, client_StateOrProvince1, client_City1, user_Id1
Run Code Online (Sandbox Code Playgroud)
它确实获取来自某个提供商的用户,然后查看他们将访问哪些 URL。
我现在正在尝试了解我从该提供商那里获得了多少用户。
我可以这样做distinct session_Id,count但我想做的是添加两列,第一列用于特定的 session_id,然后在它更改时增加它,另一列用于增加发出的请求数。
IE
我试过:
let p1 = pageViews | where url has "project-management";
p1
| join kind=inner (pageViews
| where url !has "project-management")
on session_Id
| project timestamp1, session_Id1, url1, client_CountryOrRegion1, client_StateOrProvince1, client_City1, user_Id1
| extend Rank=row_number(1)
Run Code Online (Sandbox Code Playgroud)
但它给了我
无法在当前上下文中调用函数“row_number”。详细信息:行集必须序列化
编辑:
我找到了一种方法来做到这一点,但我不确定它是否是最好的方法.
在WindsorContainer初始化中,首先注册viewmodel:
container.Register(Component.For<CentrosViewModel>().LifeStyle.Transient);
Run Code Online (Sandbox Code Playgroud)
后来我注册了View
container.Register(Component.For<CentrosAdminView>().LifeStyle.Transient.DependsOn(Property.ForKey("DataContext")
.Eq(ViewModelLocator.Centrosviewmodel)));
Run Code Online (Sandbox Code Playgroud)
财产的定义ViewModelLocator.Centrosviewmodel是:
public static CentrosModel Centrosviewmodel
{
get
{
return App.container.Resolve<CentrosViewModel>();
}
}
Run Code Online (Sandbox Code Playgroud)
结束编辑
我正在尝试使用Castle Windsor和Mvvm Toolkit(galasoft)创建一个Wpf应用程序,但我认为我的问题与任何MVVM工具包都是一样的.
使用MVVM,您必须将View的DataContext设置为ViewModel.通常,这是在视图声明中通过类似的方式完成的
DataContext={Binding MyViewModelInstanceName,Source={StaticResource Locator}}
Run Code Online (Sandbox Code Playgroud)
资源定位器在App.xaml中定义如下:
<Application.Resources>
<!--Global View Model Locator-->
<vm:ViewModelLocator x:Key="Locator" />
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
如果我在App.xaml中建立StartupURI到我的视图,那一切都是正确的.但是,如果我将StartupUri留空并尝试使用以下语法通过城堡获取我的视图实例:
container.Resolve<CentrosAdminView>().Show();
Run Code Online (Sandbox Code Playgroud)
我得到例外: "Cannot Find Resource with Name '{Locator}'
我认为,直接运行时的Initial DataContext与通过Castle Windsor运行时不同,这就是它无法找到资源的原因.
我的两个问题是:
我留下了我的城堡配置.任何帮助将非常感激.
我的Windsor配置如下所示:
<castle>
<properties>
<!-- SQL Server settings -->
<connectionString>Server=192.168.69.69;Database=GIOFACTMVVM;user id=sa;password=22336655</connectionString>
<nhibernateDriver>NHibernate.Driver.SqlClientDriver</nhibernateDriver>
<nhibernateDialect>NHibernate.Dialect.MsSql2005Dialect</nhibernateDialect>
</properties>
<facilities>
<facility id="nhibernatefacility"
type="Repository.Infrastructure.ContextualNHibernateFacility, Repository">
<factory id="sessionFactory1">
<settings> …Run Code Online (Sandbox Code Playgroud) 我正在使用 Xamarin Forms 并尝试实现一个加载叠加层,该叠加层将显示文本,显示旋转的东西并禁用按钮。
由于加载时需要禁用按钮,我正在尝试使用 InverseBoolConverter
它在 iOS 上工作正常(给出警告,但我太酷了,不在乎),Android 却给出错误,
Error XLS0505 Type 'Helpers:InverseBoolConverter' is used like a markup extension but does not derive from MarkupExtension.
并且构建机制不够酷,无法构建它,所以我遇到了问题。
XAML:
xmlns:Helpers="clr-namespace:xxx.MobileApp.Converters"
....
<AbsoluteLayout VerticalOptions="Fill">
<Grid AbsoluteLayout.LayoutFlags="All" AbsoluteLayout.LayoutBounds="0,0,1,1" BackgroundColor="White">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ScrollView Grid.Row="1">
<StackLayout Orientation="Vertical" Padding="30,-80,30,24" Spacing="10">
<Image x:Name="previewImage" Source="{Binding PreviewImage}" IsVisible="false" />
<Grid VerticalOptions="CenterAndExpand">
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Button Padding="20"
Margin="0,0,0,5"
Text=""
FontSize="40"
VerticalOptions="EndAndExpand"
Grid.Row="1"
IsEnabled="{Binding IsLoading, Converter={Helpers:InverseBoolConverter}}"
Command="{Binding OpenCameraCommand}"
Style="{StaticResource GrayButtonWhiteText}"
FontFamily="{StaticResource FontAwesomeSolid}"/>
<Button …Run Code Online (Sandbox Code Playgroud) 我如何在 MVC 中的 html 标签上设置(不做可怕的黑客攻击)lang 属性
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
</html>
Run Code Online (Sandbox Code Playgroud)
在 Forms 3.5 中,这可以通过添加runat='server'到 html 标签然后设置值来完成。
我找不到这样做的“首选”方式。
我打算将它与css:lang选择器一起使用
我有一张根据多个标准对某些费用进行汇总的表
例如,效用按以下方式求和
=SUMPRODUCT(sumif(A:A,{"*water*","*intern*","*rent*"},C:C))
我对许多不同的费用有类似的总和,现在的问题是我正在尝试计算“其他费用”的总和,其中我会添加所有不是我之前使用过的关键字的内容...我尝试在中使用否定以下方式
=SUMPRODUCT(sumif(A:A,{"<>*Vanduo*","<>*int*","<>*nuoma*"},C:C))(此处排除值的列表并不完整,这只是一个示例)
我得到的是每次为每个关键字添加的所有内容,我的意思是我的总费用约为 11k,但是使用上面的公式后我得到的约为 33k,这意味着它每次都为每个关键字添加了所有内容......
如何执行sumif sumproduct(或其他方式)排除关键字,但只执行一次而不是每个关键字?
PS我已经解决了这个问题,方法是在列sum中包含所有内容C,然后减去sumproduct sumifs我拥有的所有内容,但是我想将此值与带有否定关键字的值进行比较以检查错误。
asp.net-mvc ×1
c# ×1
castle ×1
converters ×1
excel ×1
formulas ×1
html ×1
kql ×1
lang ×1
mvvm ×1
row-number ×1
sumifs ×1
wpf ×1
xamarin ×1
xaml ×1