I installed the brand new Visual Studio 2017 and now I am seeing this warning in the Error List window:
Analyzer 'Microsoft.VisualStudio.FSharp.Editor.SimplifyNameDiagnosticAnalyzer' threw an exception of type 'System.Threading.Tasks.TaskCanceledException' with message 'A task was canceled.'.
The line of the error is 1.
The warning is generated even after I start a new project with only the following code:
let add x y = x + y
printfn "%i" (add 39999 500000)
[<EntryPoint>]
let main argv =
printfn "%A" argv
0 // return an integer exit code
The warning does not appear immediately after I run the code above. It takes a while to show on the screen.
Any ideas on what is happening?
Related
I am getting this error when running a correlation matrix with the R package ggstatsplo
ggcorrmat(data = d, type = "nonparametric", p.adjust.method = "hochberg",pch = "")
Error: 'data_to_numeric' is not an exported object from 'namespace:datawizard'
Somebody could help me.
I expected to have the script to run normally as I have used it before (around July) without any errors.
Is there anything that has changed about the ggstatsplot package?
I have got an error message with the following code: (example code from sudipta mukherjee)
#load "./packages/FsPlot.0.6.6/FsPlotBootstrap.fsx"
open FsPlot.Highcharts.Charting
// Logistic Regression
let z = [for i in -10. .. 10. -> (i,1./(1.+exp -i))]
z
|> Chart.Spline
|> Chart.WithTitle "Sigmoid Function"
|> Chart.WithName "g(z)"
When I execute the code, I have got an error message in FSI:
Loading /eUSB/sync/fsharp/packages/FsPlot.0.6.6/FsPlotBootstrap.fsx]
namespace FSI_0008
System.ComponentModel.Win32Exception: ApplicationName='/eUSB/sync/fsharp/packages/FsPlot.0.6.6/./tools/chromedriver.exe',
CommandLine='--port=53810', CurrentDirectory='', Native error= Access denied
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process p
rocess) <0x11eab6f10 + 0x006f3> in <filename unknown>:0
Stopped due to error
It seems the error is win32 related and FsPlot doesn't support OSX.
Please feel free to advise. What I should do to fix the error?
Migrated source code to XPlot (part of FsLab package), it is running smoothly.
#load "./packages/FsLab.1.0.2/FsLab.fsx"
open XPlot.GoogleCharts
// Logistic Regression
let z = [for i in -10. .. 10. -> (i,1./(1.+exp -i))]
let options =
Options
( title = "Sigmoid Function", curveType = "function",
legend = Legend(position = "bottom") )
[z]
|> Chart.Line
|> Chart.WithOptions options
|> Chart.WithLabels ["g(z)"]
Hello I am currently using IBM Spss, and I was wondering if there is a way when the code throws an exception to be able to obtain the line of code where the exception occurred? I am able to obtain the line number is there a way to access the stack of the lines that were executed and pull this information from there? Any ideas would be great Thank you in advance!
For Example:
Dim x, y, z
On Error Goto ErrorHandler
x = 30
y = 0
z = x / y 'would like to grab this code since this is where the error occurred
Exit
ErrorHandler:
debug.Log(Err.Description + _
" error occurred on line number " + _
CText(Err.LineNumber))
No, there is no way to map the line number to the actual code unless you keep your own index, allowing for macro expansion etc.
What you can do, though, is to submit the code in blocks and catch the exception for that block, which narrows down the location. In the limit, if each line is its own block, you will know exactly where the error occurred.
Given a positive number N, my print_even() function prints out all the even numbers between 1 and N:
-module(my).
-compile(export_all).
print_even(N) when N>0 -> even_helper(1, N).
even_helper(Current, N) when Current =< N ->
io:format("(Current = ~w)~n", [Current]),
case Current rem 2 of
0 -> io:format("Number: ~p~n", [Current]);
_ -> do_nothing
end,
even_helper(Current+1, N);
even_helper(Current, N) when Current > N ->
ok.
Here's some sample output:
28> my:print_even(10).
(Current = 1)
(Current = 2)
Number: 2
(Current = 3)
(Current = 4)
Number: 4
(Current = 5)
(Current = 6)
Number: 6
(Current = 7)
(Current = 8)
Number: 8
(Current = 9)
(Current = 10)
Number: 10
ok
Below is the code I'm using for a conditional break:
-module(c_test).
-compile(export_all).
c_break(Bindings) ->
case int:get_bindings('Current', Bindings) of
{value, 3} -> true;
_ -> false
end.
I set a conditional break on the following line in print_even():
case Current rem 2 of
...which according to the Erlang debugger docs should be legal. But no matter what I do, I can't get my c_break() function to execute. I expected execution to halt at the breakpoint when Current is equal to 3, but the code runs to completion, and the breakpoint is skipped. I even tried:
c_break(Bindings) ->
case int:get_bindings('Current', Bindings) of
_ -> true;
end.
But execution still won't halt at the breakpoint.
Update: I can get execution to halt if I use the following function for my conditional break:
c_break(_) ->
true.
If I change that to:
c_break(X) ->
io:format("~w~n", [X]),
true.
...then once again execution won't halt.
!##$!##$#!! It should be:
int:get_binding()
^
|
not:
int:get_bindings()
^
|
Even then, recompiling the module did not succeed in getting execution to halt. To get things to work, I had to quit the debugger: I closed all the debugger windows, then I issued the command:
82> debugger:stop().
ok
(I can't find any information for the function debugger:stop(), so I don't know if that is necessary or even does anything.)
Then I recompiled both modules:
83> c(my, [debug_info]).
{ok,my}
84> c(c_test).
{ok,c_test}
Then:
85> debugger:start().
{ok,<0.305.0>}
debugger:start() launches the Monitor window, and with the Monitor window active I chose the menu item:
Module > Interpret
...and I selected my.erl from the popup--where my.erl is the module containing the function where I want to halt execution.
Then with the Monitor window still active, I chose the menu item:
Break>Conditional Break
...and I filled in the information. You can also double click your module name displayed in the Monitor window, and then use the View Module window that opens to set breakpoints. The View Module window displays your source code, and the window also has a Break menu item, which allows you to set the various types of breakpoints. In the View Module window, you can use a shortcut for creating a Line breakpoint, i.e. a regular breakpoint: you can set a breakpoint by double clicking a line in your code.
Finally:
86> my:print_even(10).
(Current = 1)
(Current = 2)
Number: 2
(Current = 3)
Hurray!
Then I double clicked on the process listed in the Monitor window, and an Attach Process window opened. The Attach Process window shows where execution halted in your code, and it provides the means for you to step through the code.
Back in the Monitor window, if you check the checkbox On Break, then an Attach Process window will open automatically when execution halts at a breakpoint. As far as I can tell, you need to open a new Attach Process window every time you run your code.
By the way, the module name c_test and the function name c_break() can be any name. Their names are not important, for instance I changed the module name to conditional_breaks and the function name to break1().
I'm trying to write a Visual Studio Package that will attach the debugger to a named process.
I am using the following code in my package.
var info = new VsDebugTargetInfo
{
dlo = DEBUG_LAUNCH_OPERATION.DLO_AlreadyRunning,
bstrExe = strProcessName,
bstrCurDir = "c:\\",
bstrArg = "",
bstrEnv = "",
bstrOptions = null,
bstrPortName = null,
bstrMdmRegisteredName = null,
bstrRemoteMachine = "",
cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf<VsDebugTargetInfo>(),
grfLaunch = (uint)(__VSDBGLAUNCHFLAGS.DBGLAUNCH_DetachOnStop| __VSDBGLAUNCHFLAGS.DBGLAUNCH_StopDebuggingOnEnd| __VSDBGLAUNCHFLAGS.DBGLAUNCH_WaitForAttachComplete),
fSendStdoutToOutputWindow = 1,
clsidCustom = VSConstants.CLSID_ComPlusOnlyDebugEngine
};
VsShellUtilities.LaunchDebugger(ServiceProvider, info);
However I get the following, unhelpful, error:
Exception : Unable to attach. Operation not supported. Unknown error: 0x80070057.
The code is obviously doing something because if the process has not started I get this error
Exception : Unable to attach. Process 'xxxxxxxx' is not running on 'xxxxxxxx'.
The process is a managed .net 4 process and I am able to attach to it through the VS UI.
For context I am trying to replace a simple Macro I was using in VS 2010 to do the same job but that obviously can't be run in newer versions of Visual Studio.
I found a totally different piece of code, inspited by https://github.com/whut/AttachTo, worked much better to achieve the same result
foreach (Process process in (DTE)GetService(typeof(DTE)).Debugger.LocalProcesses)
if (process.Name.EndsWith(strProcessName,StringComparison.InvariantCultureIgnoreCase))
process.Attach();
I had to use 'ends with' because the process names include the full path to the running exe.