有谁知道.NET应用程序的通用计算机或/和应用程序诊断工具?
例如,应用程序无法在客户的计算机上启动.他可以运行诊断工具,它可以执行一些简单的检查:
从未见过针对.NET特定应用程序的类似内容.
我有一个错误对话框(如下所示).
我在ContentControl中显示Report对象,我已经为其定义了一个Template simpleErrorTemplate 模板.
窗口上有一个CheckBox,我想用来将模板更改为详细的ErrorErrorTemplate.实现这一目标的最佳方法是什么?
<Window x:Class="Core.ErrorDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Window.Resources>
<ControlTemplate x:Key="simpleErrorTemplate">
<TextBox Margin="10,10,10,5" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding Message}" />
</ControlTemplate>
<ControlTemplate x:Key="detailedErrorTemplate">
<TextBox Margin="10,10,10,5" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding Message}" />
<TextBox Margin="10,10,10,5" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding Details}" />
<TextBox Margin="10,10,10,5" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Text="{Binding StackTrace}" />
</ControlTemplate>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<ContentControl Grid.Row="0" Template="{StaticResource simpleErrorTemplate}" DataContext="{Binding Report}"/>
<CheckBox Margin="10,0,0,0" Grid.Row="1" x:Name="ChkShowDetails">Show Details</CheckBox>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud) char** argv
和之间有什么区别char* argv[]
?在int main(int argc, char** argv)
和int main(int argc, char* argv[])
?
它们是一样的吗?特别是第一部分没有[]
.
这是我部署到Jetty的servlet的代码:
public class StreamServlet extends HttpServlet
{
public void doGet( HttpServletRequest request,
HttpServletResponse response ) throws ServletException, IOException
{
response.setContentType( "text/xml; charset=UTF-8" );
response.setCharacterEncoding( "UTF-8" );
InputStream is = this.getServletContext().getResourceAsStream( "A.xml" );
BufferedReader reader = new BufferedReader(
new InputStreamReader( is, Charset.forName("UTF-8") ) );
String line = "";
try
{
while( (line = reader.readLine()) != null ) {
getServletContext().log( line );
writer.println( line );
writer.flush();
Thread.sleep( 1500 ); // for testing
}
}
catch (InterruptedException e)
{
getServletContext().log("exception",e);
}
}
} …
Run Code Online (Sandbox Code Playgroud) 我们有一个SSL配置的网站,托管WCF服务.服务的绑定具有crossDomainScriptAccessEnabled="true"
和使用JSON序列化通信.
当我们从http请求此服务时,它返回JSONP,但是当使用HTTPS请求它时,它只返回JSON.我需要以任何一种方式使用JSONP,请帮忙.
目前的配置是这样的:
<webHttpBinding>
<binding name="webHttpBindingWithJsonP" crossDomainScriptAccessEnabled="true" />
</webHttpBinding>
<behaviors>
<serviceBehaviors>
<behavior name="JsonServiceBehaviors">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
<endpointBehaviors><behavior name="webHttpBehavior">
<webHttp />
</behavior></endpointBehaviors>
</behaviors>
<services>
<service name="Backend.CIService" behaviorConfiguration="JsonServiceBehaviors">
<endpoint address="" binding="webHttpBinding"
bindingConfiguration="webHttpBindingWithJsonP" contract="Backend.ICIService"
behaviorConfiguration="webHttpBehavior"/>
</service></services>
Run Code Online (Sandbox Code Playgroud) 我正在使用以下代码来获取tinymce的内容.
tinymce_content=tinyMCE.get('txt_area_id').getContent();
updated_content=tinymce_content+"<img src="sample.jpg">";
Run Code Online (Sandbox Code Playgroud)
通过使用上面的代码,我在tinymce内容中插入图像.
问题:如何在tinymce内的光标位置插入图像(即)如何预测光标位置并分割内容以在获取的内容之间插入图像.
提前致谢
奇怪的是,我一直在使用电子邮件帐户来存储食谱。
我想将所有消息导出为 XML 格式或类似格式,这样我就可以在 Wordpress 博客或类似内容上轻松重现。或者简单地打印出所有的食谱,但有一些格式。
Gmail 为标签提供 RSS 提要,并导出到外部电子邮件客户端,我还发现了一种叫做备份粘液的东西,它允许我将所有邮件导出为 MIME 格式的 .eml 文件。
任何人都对使用这种东西有所了解。从本质上讲,这似乎是一个非常琐碎的问题,但实际上这是我无法访问此类个人数据的问题,我应该能够将其转移到其他地方并轻松呈现给我自己。
我知道实例变量是在dealloc
(如下所示)中释放的,但是当它被调用时呢?应用程序关闭时是否释放所有实例变量,或者是否有可接受的方式让它们在不需要时单独解除分配?
- (void)dealloc {
[fred release];
[wilma release];
[barney release];
[betty release];
[super dealloc];
}
Run Code Online (Sandbox Code Playgroud) 我在mechanize doc网站上做了一个例子,我想用nokogiri解析结果.
我的问题是当执行以下行时:
doc = Nokogiri::HTML(search_results, 'UTF-8' )
Run Code Online (Sandbox Code Playgroud)
发生以下错误:
C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4.1-x86-mingw32/lib/nokogiri/html/document.rb:71:in `parse': undefined method `name' for "UTF-8":String (NoMethodError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.4.1-x86-mingw32/lib/nokogiri/html.rb:13:in `HTML'
from mechanize_test.rb:16:in `<main>'
Run Code Online (Sandbox Code Playgroud)
我在windows vista机器上安装了ruby 1.9
机械化返回的结果是非拉丁语(utf8)
代码示例如下.
# encoding: UTF-8
require 'rubygems'
require 'mechanize'
require 'nokogiri'
agent = Mechanize.new
agent.user_agent_alias = 'Mac Safari'
page = agent.get("http://www.google.com/")
search_form = page.form_with(:name => "f")
search_form.field_with(:name => "q").value = "invitations"
search_results = agent.submit(search_form)
puts search_results.body
doc = Nokogiri::HTML(search_results, 'UTF-8')
Run Code Online (Sandbox Code Playgroud) 我想用一系列变量格式化输出字符串.当我使用字符串数组时,这按预期工作:
String[] myArray = new String[3];
// fill array with strings
System.out.printf("1: %s \n2: %s \n3: %s\n", myArray);
Run Code Online (Sandbox Code Playgroud)
我想用它来打印模拟骰子投掷的结果,所以我使用了一个int数组.但是,这不起作用:
int[] myArray = new int[3];
// fill array with numbers
System.out.printf("1: %d \n2: %d \n3: %d\n", myArray);
Exception in thread "main" java.util.IllegalFormatConversionException: d != [I
Run Code Online (Sandbox Code Playgroud)
当然,我可以myArray[0]
为每个元素使用等等,但这似乎并不优雅.
为什么会这样,我怎样才能达到预期的效果呢?