exception

System.StackOverflow Exception while Parsing through Directory Structure

懵懂的女人 提交于 2019-12-24 18:35:04
问题 What im trying to achieve is,Get the list of all files in a specific drive or Folder Structure by parsing through the Files.I'm also trying to handle the Unauthorized Exception which occures in case of protected files.The Code works fine in most drives and folders but in some cases like the Windows Drive(C:),A System.StackOverflow EXception is thrown.What could be the problem?Is there a better way to do it? static void WalkDirectoryTree(System.IO.DirectoryInfo root) { System.IO.FileInfo[]

Save MetaFile to Stream and back again

拥有回忆 提交于 2019-12-24 18:16:52
问题 I need to store a MetaFile into a Stream and create a new Metafile with the same stream. I have the following code but it throws an excetpion: string tempPath = Path.GetTempFileName(); MyMetaFile.Save(tempPath); var stream = new MemoryStream(File.ReadAllBytes(tempPath)); File.Delete(tempPath); var newMetafile = new Metafile(stream); // here the exception The exception message says: ExternalException: A generic error occured in GDI+ . I tried also to use the method Image.Save(stream,

According to a knowledgeable author within the C++ community, the code shown below should not compile. Is he wrong?

微笑、不失礼 提交于 2019-12-24 17:52:46
问题 According to Herb Sutter the code below wouldn't compile. See this site http://www.gotw.ca/gotw/066.htm from where I've extracted the following text, regarding function-try-blocks : Toward Some Morals Incidentally, this also means that the only (repeat only) possible use for a constructor function-try-block is to translate an exception thrown from a base or member subobject. That's Moral #1. Next, Moral #2 says that destructor function-try-blocks are entirely usele-- "--But wait!" I hear

FATAL EXCEPTION: main / android.view.InflateException

寵の児 提交于 2019-12-24 17:52:45
问题 im trying to create a ViewPager for my app. Im new to android developing so first im trying a sample to look how it works from this site. When i try to run it in the emulator it force closes. I dont know why i get the error, i checked the code lot of times and there is no difference. So as the code is the same as in the link above i only provide the logcat. 01-30 04:07:40.059: E/AndroidRuntime(3013): FATAL EXCEPTION: main 01-30 04:07:40.059: E/AndroidRuntime(3013): java.lang.RuntimeException:

According to a knowledgeable author within the C++ community, the code shown below should not compile. Is he wrong?

这一生的挚爱 提交于 2019-12-24 17:51:04
问题 According to Herb Sutter the code below wouldn't compile. See this site http://www.gotw.ca/gotw/066.htm from where I've extracted the following text, regarding function-try-blocks : Toward Some Morals Incidentally, this also means that the only (repeat only) possible use for a constructor function-try-block is to translate an exception thrown from a base or member subobject. That's Moral #1. Next, Moral #2 says that destructor function-try-blocks are entirely usele-- "--But wait!" I hear

Why is the std::exception destructor not noexcept [duplicate]

早过忘川 提交于 2019-12-24 17:15:04
问题 This question already has an answer here : C++11 Exception's destructor allows to throw now? (1 answer) Closed last year . The destructor of the the C++11 std::exception base class is not noexcept , and thus may (in theory) throw an exception, which consequent relaxed permission for all its derived classes (including std::bad_alloc and std::runtime_error ). The destructor of the C++98 std::exception however had a throw() exception specification, indicating it was not permitted to throw

How can a Python context manager try to execute code?

こ雲淡風輕ζ 提交于 2019-12-24 17:09:13
问题 I'm trying to write a small context manager that'll try to execute some code repeatedly until the code works or until a specified number of tries has been made. I have attempted to write this but am encountering a difficulty with having the context manager handle problems when yielding: Exception RuntimeError: 'generator ignored GeneratorExit' How should I code this? import contextlib import random def main(): with nolube(): print(1 / random.randint(0, 1)) @contextlib.contextmanager def

Python - How to avoid error (Exceptions) in Pandas while still getting data ?

帅比萌擦擦* 提交于 2019-12-24 16:42:59
问题 I'm currently using Pandas to get options data from yahoo. It works fine until there is a stock that does not have options, at which point the program crashes. I attempted to create exceptions and just have it pass but without luck. How can I have the program identify stocks with no options and just skip? Thanks. The error I get is this: RemoteDataError: Data not available Here's the code (I used a stock with no options to test--> 'GHC'): from pandas_datareader.data import Options import

ARM interrupts and context saving

被刻印的时光 ゝ 提交于 2019-12-24 16:19:21
问题 I am trying to understand how interrupts work in an ARM architecture(ARM7TDMI to be specific). I know that there are seven exceptions (Reset,Data Abort, FIQ, IRQ, Pre-fetch abort, SWI and Undefined instruction) and they execute in particular modes(Supervisor, Abort, FIQ, IRQ, Abort, Supervisor and Undefined respectively). I have the following questions. 1. When the I and F bits in CPSR(status register) are set to 1 to disable external and fast interrupt, does the other 5 exceptions are also

Cells.Formula=“=CONCATENATE(…)” Exception 0x800A03EC

こ雲淡風輕ζ 提交于 2019-12-24 16:18:13
问题 I'm writing a VB.NET application that generates an Excel file. My intention here is to write a particular formula that uses CONCATENATE in a cell. Now, the following line of code fires the above exception: 0) tSheet.Cells(tIncRow + ItemIndex * PixelIndex + PixelIndex, 2).Formula = "=CONCATENATE(" & Pixels(PixelIndex) & ";Batches!J3)" The following row does NOT raise the exception. (It's simply the row above without the = at the beginning. The fact that it doesn't raise the exception means