我搜索示例或示例以通过文本框过滤WPF DataGrid列元素.
同样的事情也到这个(给定的例子使用WPFToolkit ...通过微软显然放弃了...)
XAML
<Canvas>
<DataGrid Height="200" Name="dataGrid1" Width="200" Canvas.Top="23" />
<TextBox Name="textBox1" Width="120" />
</Canvas>
Run Code Online (Sandbox Code Playgroud)
CS:
public partial class MainWindow : Window
{
private List<Personne> persons;
ICollectionView cvPersonnes;
public MainWindow()
{
InitializeComponent();
persons = new List<Personne>();
persons.Add(new Personne() { Id = 1, Nom = "Jean-Michel", Prenom = "BADANHAR" });
persons.Add(new Personne() { Id = 1, Nom = "Gerard", Prenom = "DEPARDIEU" });
persons.Add(new Personne() { Id = 1, Nom = "Garfild", Prenom = "THECAT" }); …Run Code Online (Sandbox Code Playgroud) 如何使用收件人的区域设置在邮件程序中发送邮件.我有数据库中每个用户的首选语言环境.请注意,这与当前区域设置(I18n.locale)不同,只要当前用户不必是收件人即可.所以困难的是在不改变I18n.locale的情况下在不同的语言环境中使用邮件程序:
def new_follower(user, follower)
@follower = follower
@user = user
mail :to=>@user.email
end
Run Code Online (Sandbox Code Playgroud)
在mail:to => ...之前使用I18n.locale = @ user.profile.locale将解决邮件程序问题,但会改变线程其余部分的行为.
我们有一个使用WebForms .aspx文件的应用程序几乎所有东西.Latley我们一直在使用预编译的RazorViews,通过简单地在我们的项目中删除一个新的dll来获取nicley打包功能.但现在我们发现我们的预编译视图似乎与我们的VirtualPathProviders冲突.
从外部dll加载VirtualPathProviders时,应用程序尝试为所有请求加载PrecompiledApp.config(我们没有得到它).提供者加载了反射.我们在注册的同一个项目中有一些VirtualPathProviders,它们工作正常,但是当我们从外部dll注册提供程序时,HostingEnvironment.RegisterVirtualPathProvider我们遇到了这个问题.
如果我们添加文件PrecompiledApp.config,它会尝试获取_appstart.cshtml,依此类推.在通过这个例外之前我们必须拥有以下所有的所有文件:
我们最终在default.cshtml中,其余的应用程序工作.由于我们希望使用apsx文件作为默认值,因此这不是一个可接受的解决方案.我们也担心会出现更多问题,因为我们不知道为什么会这样.
我们尝试过这种加载我们的提供程序的方法,但我们仍然得到同样的错误:http: //sunali.com/2008/01/09/virtualpathprovider-in-precompiled-web-sites/
例外情况:
Could not find file 'C:\MyApp\PrecompiledApp.config'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not find file 'C:\MyApp\PrecompiledApp.config'.
Source Error:
An unhandled exception was generated during the execution of the current web request. …Run Code Online (Sandbox Code Playgroud) 任何人都可以解释原因
$sql->execute($params);
Run Code Online (Sandbox Code Playgroud)
返回FALSE,而
print $pdo->errorCode();
print_r($pdo->errorInfo());
Run Code Online (Sandbox Code Playgroud)
两者都归还SQLSTATE 00000,这意味着根据文件的成功?它是一个INSERT,实际上没有任何东西被插入到数据库中...所以,为什么我会从中获得成功消息SQLSTATE?
如果它有帮助,这是代码......
$sql = $pdo->prepare("
INSERT INTO user (
username, fname, pass, salt, email,
loc_id_home, country_id_home, region_id_home,
cont_id_home, timestamp_reg, timestamp_upd, timestamp_lastonline,
online_status, gender, birthdate
)
VALUES (
:username,:fname,:pass,:random_salt,:email,
:loc_id_home,:country_id_home,:region_id_home,
:cont_id_home,'".time()."','".time()."','".time()."',
1,:gender,:birthdate)
");
$params=array(
':username'=>$username,
':fname'=>$fname,
':pass'=>$pass,
':random_salt'=>$random_salt,
':email'=>$email,
':loc_id_home'=>$loc_id_home,
':country_id_home'=>$country,
':region_id_home'=>$region,
':cont_id_home'=>$continent,
':gender'=>$gender,
':birthdate'=>$birthdate
);
$sql->execute($params);
print $pdo->errorCode();
print_r($pdo->errorInfo());
Run Code Online (Sandbox Code Playgroud) 如何为NotificationCompat.Builder创建的通知添加声音?我在res中创建了一个原始文件夹并在那里添加了声音.那么我现在如何将其添加到通知中?这是我的通知代码
int NOTIFY_ID=100;
Intent notificationIntent = new Intent(this, Notification.class);
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.notification)
.setContentTitle("Warning")
.setContentText("Help!")
NotificationManager mgr = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mgr.notify(NOTIFY_ID, mBuilder.build());
Run Code Online (Sandbox Code Playgroud) 我有一种情况,我必须更新共享主机提供商的网站.该网站有一个CMS.使用FTP上传CMS的文件非常简单.
我还必须导入一个大的(相对于PHP脚本的限制)数据库文件(大约2-3 MB未压缩).Mysql因外部访问而关闭,因此我必须使用FTP上传文件,并启动PHP脚本进行导入.遗憾的是,我无法访问mysql命令行函数,所以我必须使用本机PHP解析和查询它.我也不能使用LOAD DATA INFILE.我也不能像phpMyAdmin一样使用任何一种交互式前端,它需要以自动化的方式运行.我也不能用mysqli_multi_query().
有没有人知道或者有一个已编码的简单解决方案,可以将这样的文件可靠地拆分成单个查询(可能有多行语句)并运行查询.我想避免自己开始摆弄它,因为我可能遇到很多问题(如何检测字段分隔符是否是数据的一部分;如何处理备忘录字段中的换行符;等等上).有必须是这个现成的解决方案.
示例HTML:
<html><body>
<form id="form1">
<input name="foo1" value="bar1" />
<!-- Other elements -->
</form>
<form id="form2">
<input name="foo2" value="bar2" />
<!-- Other elements -->
</form>
</body></html>
Run Code Online (Sandbox Code Playgroud)
测试代码:
HtmlDocument doc = new HtmlDocument();
doc.Load(@"D:\test.html");
foreach (HtmlNode node in doc.GetElementbyId("form2").SelectNodes(".//input"))
{
Console.WriteLine(node.Attributes["value"].Value);
}
Run Code Online (Sandbox Code Playgroud)
该声明doc.GetElementbyId("form2").SelectNodes(".//input")给了我一个空引用.
我做错了什么?谢谢.
Hackage上有很多软件包,一些是众所周知的(如HUnit),另一些则知之甚少(如AspectAG).我想知道你认为哪个包是一个值得更多用户的隐藏宝石.也许一个有用的数据结构,monad的帮助,网络,测试,......?
Hackage上你最喜欢的"隐藏宝石"包?
我试图使用main()函数参数创建一个通过命令行获取参数的程序.作为一个(基本的)C++程序员(即使我非常熟悉C风格的指针和数组),我几乎没有使用过char*字符串和C数组.我花了一些时间来接受main()论证并将其转换为std::string......所以问自己:为什么在C++中main()函数不会超载std::vector<std::string> argv而不是旧的char* argv[]?
对于"重载",我的意思是main()函数的共存,int main()而int main(int argc, char *argv[])不是程序员对正常函数的重载.