debugging
Creating breakpoint in Xcode for unrecognized selector
Setting a symbolic breakpoint for -[NSObject doesNotRecognizeSelector:] should do the trick. In Xcode 4, press cmd+6 to go to the Breakpoint Navigator, then click the +and choose “Add Symbolic Breakpoint…”. Configure.
Extract traceback info from an exception object
The answer to this question depends on the version of Python you’re using. In Python 3 It’s simple: exceptions come equipped with a __traceback__ attribute that contains the traceback. This attribute is also writable, and can be conveniently set using the with_traceback method of exceptions: raise Exception(“foo occurred”).with_traceback(tracebackobj) These features are minimally described as part … Read more
Why :sprint always prints a “_”?
Haskell is a lazy language. It doesn’t evaluate results until they are “needed”. Now, just printing a value causes all of it to be “needed”. In other words, if you type an expression in GHCi, it will try to print out the result, which causes it all to be evaluated. Usually that’s what you want. … Read more
Customize dbstop in MATLAB
If you use the editor, you can set a stop as normal, right-click on it, select “set/modify condition” and enter the condition (the stop will turn from red to yellow). From command line, you can use dbstop in file if expression dbstop in file at location if expression e.g. dbstop in myFile at 200 if … Read more
Why does the Eclipse debugger give the error “Source not found” seemingly without reason?
Eclipse doesn’t crash. You’re trying to step into a method, where eclipse doesn’t know where to find the source (*.java) files and informs you about this. Here is how to tell eclipse where to look. Go to Window -> Preferences -> Java -> Installed JREs, select the JRE you are using and click Edit. There, … Read more
Weird error message in Xcode 4.3 with LLDB
The cause of this error are incorrect build settings, as indicated by the discussion in the question post comments. This can be fixed by setting “Deployment Postprocessing” back to NO for Debug-Mode (the default value).
Debug Assertion Failed! Expression: _BLOCK_TYPE_IS_VALID [closed]
The _BLOCK_TYPE_IS_VALID assertion gets fired, when you overwrite the header of an block allocated by new. This happens when you slice objects, use dead objects, etc. You should have a look at your complete code, and try to work from the data you have in your debugger. This short code snippet contains several ‘curious’ usage … Read more
Chrome Typescript debugging references wrong ‘this’
the TypeScript this is actually _this in the JavaScript This is due to a bug in the sourcemaps. You can track it here : https://github.com/Microsoft/TypeScript/issues/2859
scipy convolve2d outputs wrong values
I think the problem is that you did not do what SciPy implemented. I won’t dwell on the details or the foundations but only provide you with a solution: Reverse the kernel. >>> import numpy as np >>> arr = np.array([[0, 0, 0], [1, 1, 2], [1, 3, 0]]) >>> kernel = np.array([[4, 1, 1], … Read more