diagnostics

Why does the second for loop always execute faster than the first one?

南楼画角 提交于 2019-11-30 04:55:29
问题 I was trying to figure out if a for loop was faster than a foreach loop and was using the System.Diagnostics classes to time the task. While running the test I noticed that which ever loop I put first always executes slower then the last one. Can someone please tell me why this is happening? My code is below: using System; using System.Diagnostics; namespace cool { class Program { static void Main(string[] args) { int[] x = new int[] { 3, 6, 9, 12 }; int[] y = new int[] { 3, 6, 9, 12 };

Accessing Error log in shiny-server deployed on AWS instance

对着背影说爱祢 提交于 2019-11-29 20:51:42
问题 I have a shiny app that runs fine on my local machine in RStudio. I have launched an AWS EC2 Ubuntu instance and installed R and shiny-server on it. When I access the app via browser, the app crashes at a (seemingly) arbitrary point. Where can I access the R console log in order to be able to debug the code? There is no file in /var/log/shiny-server. Furthermore, the console in the browser simply states: The application unexpectedly exited. Diagnostic information is private. Please ask your

FXML / FXMLLoader error diagnostic tool(s) sought

送分小仙女□ 提交于 2019-11-29 11:21:42
overview Hi, here's an outline use-case. I have a seemingly valid FXML file developed in JavaFX Scene Builder . It is by now a non-trivial chunk of XML and there are runtime load errors somewhere in the FXML file. Scene Builder works fine with the Preview option. I have a ' simple .fxml' file I use to verify that the controller is working as intended, that is same controls and events but without the extra FXML layouts. And I have and I am doing the cut-out-code and test loop to identify the XML with the problem. So I will get to the bottom of this at some point. At present there are no errors

Get-Content and show control characters such as `r - visualize control characters in strings

醉酒当歌 提交于 2019-11-29 07:27:37
What flag can we pass to Get-Content to display control characters such as \r\n or \n ? What I am trying to do, is to determine whether the line endings of a file are in the Unix or Dos style. I have tried simply running Get-Content , which doesn't show any line ending. I have also tried using Vim with set list , which just shows the $ no matter what the line ending is. I would like to do this with PowerShell, because that would be mighty useful. One way is to use Get-Content's -Encoding parameter e.g.: Get-Content foo.txt -Encoding byte | % {"0x{0:X2}" -f $_} If you have the PowerShell

how to use #pragma clang diagnostics

两盒软妹~` 提交于 2019-11-29 06:42:47
问题 I know that #pragma clang diagnostics can be used for ignoring some warnings generated by clang. But I don't know how to use this correctly. For example, for an unused variable warning we can avoid warning by #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-variable" int number; #pragma clang diagnostic pop But I don't know how to get correct parameter for #pragma clang diagnostic ignored ("-Wunused-variable" here) Is there any way to fing this kind of warning name for

Visual Studio 2015 diagnostic tools no longer working

青春壹個敷衍的年華 提交于 2019-11-29 06:13:02
问题 I have Visual Studio 2015 Community Edition Update 3 running on Windows 7 SP1 64 bit, which I use to develop C# applications. I love the diagnostic tools during debugging to spot performance problems early on. However, they stopped working for me sometime in the last month or so (possibly related to installing Update 3, although I have no information to back that up). I see the error message "CPU Profiling while debugging is not available on this version of Windows. To see CPU usage details,

Getting from ProcessThread to a managed thread

こ雲淡風輕ζ 提交于 2019-11-29 02:06:55
Periodically we get a hang on shut down of a Windows service in a production environment that we just cannot reproduce. It can be months before it happens again. I'm putting in some diagnostics to try and help with the issue, one thing I'm looking at is adding an event to the system thread pool for 60 seconds after we initiate shut down of the application. Our application should shutdown cleanly within 10 seconds maximium. In this event I would like to trace out the remaining running threads of the process to the event log. I can get the running threads using System.Diagnostics.Process

Overriding System.Diagnostics.Trace.WriteLine to log to a file

偶尔善良 提交于 2019-11-28 18:26:52
This may be more of an OOP concept question, but here's what I'd like to do. I have an application that outputs debug information using System.Diagnostics.Trace.WriteLine so it can be viewed with DebugView. I'd like to override/extend (not sure of the proper terminology) this method to log the text to a file instead, or maybe in addition to the Trace output. This would allow me to write a new WriteLine method for my app, and I could leave all my other System.Diagnostics.Trace.WriteLine statements unchanged throughout the rest of the application. So how would I go about changing the behavior of

ASP.NET MVC why does my app keep restarting?

限于喜欢 提交于 2019-11-28 16:02:15
问题 I have an ASP.NET MVC website that gets about 6500 hits a day, on a shared hosting platform at Server Intellect. I keep seeing app restarts in the logs and I cannot figure out why. I've read Scott Gu's article here: http://weblogs.asp.net/scottgu/archive/2005/12/14/433194.aspx and implemented the technique, and here's what shows up in my log: Application Shutdown: _shutDownMessage=HostingEnvironment initiated shutdown HostingEnvironment caused shutdown _shutDownStack=at System.Environment

log4net versus TraceSource [closed]

两盒软妹~` 提交于 2019-11-28 15:25:00
In this thread many people have indicated that they use log4net. I am a fan of TraceSources and would like to know why log4net is used. Here is why I like trace sources: Pluggable listeners - XML, TextFile, Console, EventLog, roll your own Customisable trace switches (error, warning, info, verbose, start, end, custom) Customisable configuration The Logging Application Block is just a big set of TraceListeners Correlation of activities/scopes (e.g., associate all logs within an ASP.NET request with a given customer The Service Trace Viewer allows you to visualize events against these activities