我正在使用a CellTemplateSelector有条件地在DataGrid列中显示复选标记.
调用SelectTemplate(object item, DependencyObject container)我的DataTemplateSelector类的方法,但参数项为null而不是期望的DataRowView-object.
这是XAML代码.ItemsSourceDataGrid 属性中的项目是a DataTable,适用于其他列.(我使用Visual Studio Express 2010)
...
<Window.Resources>
<DataTemplate x:Key="CheckedTemplate">
<Path Width="16" Height="16" Margin="6,0,0,0"
x:Name="CheckMark" SnapsToDevicePixels="False"
Stroke="Green" Fill="Green" StrokeThickness="1"
Data="M 12.4227,0.00012207C 12.4867,0.126587 12.5333,0.274536
12.6787,0.321411C 9.49199,3.24792 6.704,6.57336
4.69865,10.6827C 4.04399,11.08 3.47066,11.5573 2.83199,
11.9706C 2.09467,10.2198 1.692,8.13196 3.8147e-006,
7.33606C 0.500004,6.79871 1.31733,6.05994 1.93067,6.2428C
2.85999,6.51868 3.14,7.9054 3.60399,8.81604C 5.80133,
5.5387 8.53734,2.19202 12.4227,0.00012207 Z " />
</DataTemplate>
<DataTemplate x:Key="UncheckedTemplate">
</DataTemplate>
<local:CheckmarkTemplateSelector x:Key="CheckmarkTemplateSelector" CheckedTemplate="{StaticResource CheckedTemplate}" UncheckedTemplate="{StaticResource UncheckedTemplate}" />
</Window.Resources>
...
<DataGrid …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Web应用程序,它将作为全屏应用程序从iPad上的桌面图标启动.手机链接上的Apple文档建议使用此元标记:
<meta name = "format-detection" content = "telephone=no">
Run Code Online (Sandbox Code Playgroud)
但是,这似乎不起作用.是否有任何其他HTML/CSS/JavaScript机制来控制此行为?
随机注入锚标签导致了很多CSS错误.
解决方法
我发现工作的一个方法是注入特殊的空格字符,但是想要在输出上转换我的所有数据并不能让我高兴.这些角色将自己的问题带到了桌面上.这样做会因AJAX和JavaScript转换而变得更加复杂.
再现
重现步骤:
样本页面:
<!DOCTYPE html>
<html>
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name = "format-detection" content = "telephone=no">
<title>Telephone detect</title>
</head>
<body>
expected:
<a href="tel:1555555">1555555</a>
<br />
bad: 1555555
<br />
bad: 1555555
<br />
inconvenient: 1555555
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
笔记
这个问题似乎是相关的,但它缺乏细节,我不确定iPhone上的行为是否相同.这是一个Web应用程序,没有本机组件.iPad版3.2.2.
我正在尝试使用UPDATE更新表中一堆行中的列值.问题是我需要使用子查询来派生此列的值,它依赖于同一个表.这是查询:
UPDATE user_account student
SET student.student_education_facility_id = (
SELECT teacher.education_facility_id
FROM user_account teacher
WHERE teacher.user_account_id = student.teacher_id AND teacher.user_type = 'ROLE_TEACHER'
)
WHERE student.user_type = 'ROLE_STUDENT';
Run Code Online (Sandbox Code Playgroud)
通常,如果老师和学生在两个不同的表中,mysql不会抱怨.但由于他们都使用相同的表,mysql反而吐出了这个错误:
错误1093(HY000):您无法在FROM子句中为更新指定目标表'student'
有什么办法可以强制mysql进行更新吗?我100%肯定,因为更新行,所以from子句不会受到影响.
如果没有,是否有另一种方法可以编写此更新sql来实现同样的效果?
谢谢!
编辑:我想我得到了它的工作:
UPDATE user_account student
LEFT JOIN user_account teacher ON teacher.user_account_id = student.teacher_id
SET student.student_education_facility_id = teacher.education_facility_id
WHERE student.user_type = 'ROLE_STUDENT';
Run Code Online (Sandbox Code Playgroud) 仅从android doc我真的不明白ACTION_UP和ACTION_POINTER_UP之间的区别. http://developer.android.com/reference/android/view/MotionEvent.html#ACTION_DOWN
基本上我想捕获一个手指从屏幕释放时的事件(即使另一个手指仍可能触摸它)
谢谢!
我正在尝试将输入按钮与链接(类"按钮")对齐,但在Safari和Chrome中,顶部有1个像素差异,我无法弄清楚原因.

<input class="button" name="commit" type="submit" value="Enrol" />
<a href="#" class="button" id="cancel">Cancel</a>
input.button {
height: 38px;
font-size: 18px;
color: white;
font-weight: normal;
font-style: normal;
background: #4D28B2;
border: 1px solid gray;
padding: 5px;
}
a.button {
display: inline-block;
padding: 5px;
height: 24px;
font-size: 18px;
color: white;
text-decoration: none;
font-weight: normal;
font-style: normal;
text-align: left;
background-color: #4D28B2;
border: 1px solid gray;
}
Run Code Online (Sandbox Code Playgroud)
有什么问题,我该如何解决?
我有一个遗留的c ++ win32应用程序,并使用wpf windows扩展它确实有效.
但我想要做的是将WPF窗口作为主窗口,而不仅仅是任何旧窗口而是棱镜外壳窗口.
所以对于我的遗留c ++项目,我想添加一个Bootstrapper,shell窗口,MEF加载器,所有的铃声和口哨声.在那里,我想放置一些命令,在需要时打开传统的win32窗口.
现在在win32应用程序中打开WPF窗口很简单,我只需要使用
System::Windows::Forms::Integration::ElementHost::EnableModelessKeyboardInterop(mywindow);
Run Code Online (Sandbox Code Playgroud)
但是如何在WPF应用程序中打开win32窗口?win32窗口需要一个消息泵循环,但我在哪里放这个:
MSG msg;
while (GetMessage(&msg, NULL, NULL, NULL))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
Run Code Online (Sandbox Code Playgroud)
我可以为循环创建任何新线程吗?或者是否也有这样的互操作助手?
或者我的想法是疯了吗?
如您所知,PHP类具有私有,公共和受保护的关键字.我刚刚开始编写类,我想知道PHP5中类可见性的优点是什么.
当然也有缺点......
为什么C#编译器不允许你编译它:
int a;
Console.WriteLine(a);
Run Code Online (Sandbox Code Playgroud)
但是允许你编译:
MyStruct a;
Console.WriteLine(a);
Run Code Online (Sandbox Code Playgroud)
其中MyStruct定义为:
struct MyStruct
{
}
Run Code Online (Sandbox Code Playgroud)
更新:在第一个案例中错误是:
错误1使用未分配的局部变量'a'
我在Java中遇到了Future.get()的WEIRD问题.它总是返回一个InterruptedException,但奇怪的是,Exception的原因是null,所以我不能告诉谁打断了我..
它变得更糟,因为我在调用get()之前检查,而Future必须完成的工作已经完成.
以下是负责输出的代码.f是Future,而callable返回一个HashMap,其中Agent与其真正无关.对不起,如果有太多的印刷品,我只是想尽可能地提供信息.来自callable的调用方法现在很简单System.out.println("Hola soy agente"),正如您将看到的那样,打印出来,这意味着可调用函数不会导致异常
这是代码:
try
{
System.out.println(f.isDone()); //true
System.out.println(f.isCancelled()); //false
System.out.println(f.toString()); //FutureTask
newModdedAgents.putAll(f.get());
}catch(InterruptedException e)
{
System.out.println(f.isDone()); //true
System.out.println(f.isCancelled()); //false
System.err.println(e); //It is an interruptedException
System.err.println(e.getCause()); //???? null?
e.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)
和输出
Hola soy agente
true
false
java.util.concurrent.FutureTask@1c4c94e5
true
false
java.lang.InterruptedException
null
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1302)
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:248)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at com.pf.simulator.Simulation.simulateStep(Simulation.java:217)
at com.pf.gui.ButtonPanel.doWork(ButtonPanel.java:141)
at com.pf.gui.ButtonPanel$1$1.construct(ButtonPanel.java:198)
at com.pf.gui.SwingWorker$2.run(SwingWorker.java:117)
at java.lang.Thread.run(Thread.java:636)
Run Code Online (Sandbox Code Playgroud)
如果你想看到我将可调用值汇总到线程池的位置...那么这将是它的代码
for(Callable<HashMap<Integer, Agent>> c : agentCallables)
{
Future<HashMap<Integer,Agent>> future = pool.submit(c);
agentFutureSet.add(future);
}
Run Code Online (Sandbox Code Playgroud)
然后我迭代这个Set
for(Future<HashMap<Integer, Agent>> …Run Code Online (Sandbox Code Playgroud) 我一直在尝试使用以下内容在vps上安装Passenger:
我安装了宝石
gem install passenger
Run Code Online (Sandbox Code Playgroud)
当我运行passenger-install-apache2-module时,我收到以下消息,表明我缺少开发头:
然后我按照提供的说明如何安装每个:
# yum install curl-devel
Setting up Install Process
Setting up repositories
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras …Run Code Online (Sandbox Code Playgroud)