User Tools

Site Tools


study_questions_lucky_dip_creation

This is an old revision of the document!


Study Questions - Lucy Dip Creation

1. Copy the source of the questions and paste into Notepad++.

2. Remove the tag bit at the bottom.

3. In regular expression mode, replace

^====+.+====$

with nothing.

4. In extended mode, replace

/* --== Answer Question separator ==-- */

with

<html>\n      </td>\n    </tr>\n    <tr>\n      <td width="50%">\n</html>\n

5. In extended mode, replace

/* --== Question Answer separator ==-- */

with

\n<html>\n      </td>\n      <td width="50%">\n</html>

6. Replace the first html element with

<html>
  <table border="1" width="100%">
    <tr>
      <td width="50%">
</html>

7. Add this to end

<html>
      </td>
    </tr>
</html>

8. Select all and copy to the clipboard.

9. Goto http://tallguyracing.com/wiki/doku.php?id=playground:playground and edit.

10. Paste from the clipboard and save it.

11. Select it (including the RSS XML Feed etc buttons).

12. Open a new document in OpenOffice and paste the contents into it.

13. Set the Zoom to 73% (so that there are two pages per screen).

14. Delete all the crap at the top.

15. Load styles → Wiki Export 2, Text + Pages + Overwrite.

16. Right click table → Table… → Text Flow tab → Untick Allow row to break…

17. For each page,

17.1. Put the cursor in the last row of the page.

17.2. Click the Insert Row button lots.

17.3. Copy and paste the all the cells on the first page to the second. Note that this will overwrite the cells, so if there are not some blanks leftover, undo and go back to 17.2.

17.4. Delete the blank cells.

18. Modify the paragraph style 'Table Contents'. Change the Font colour to black.

19. Highlight the right columns of odd pages and the left columns of the even pages (inside ones if two pages are displayed at once), change the background colour to black. Also, look for numbered bullet lists in the right column of the even pages and reset the numbering.

20. Select everything and paste into the master StudyQuestions file.

Questions To Be Lucky Dipped

Lesson 1: Navigating the File System

C2L1Q1: How do you enumerate the drives in a system?

Answer: Call the DriveInfo.GetDrives method.

C2L1Q2: How do you enumerate the files in a particular directory?

Answer:

  1. Create a new DirectoryInfo object, specifying the directory in the constructor.
  2. Call the GetFiles method on the DirectoryInfo object, which returns a collection of FileInfo objects.

C2L1Q3: How would you determine the size of a particular file in the file system?

Answer:

  1. Create a new FileInfo object, specifying the path to the file in the constructor.
  2. Examine the FileInfo's Length property.

C2L1Q4: How do you copy a file?

Answer:

  1. Create a new FileInfo object, specifying the path to the source file in the constructor.
  2. Call the FileInfo's CopyTo method, specifying the path to the destination file.

C2L1Q5: What are the high level steps required to monitor a directory for changes?

Answer:

  1. Create a FileSystemWatcher object.
  2. Set the Path property.
  3. Register for the event that you are interested in.
  4. Set the EnableRaisingEvents property to true.

C2L1Q6: How do you create a DriveInfo object for a specific drive?

Answer: Create a new DriveInfo object, specifying the drive letter in the constructor.

C11L1Q5: What must an assembly have before its trust can be increased?

Answer: A strong name.

C10L2Q1: How can you programmatically signal a break to the debugger?

Answer: Call the Debugger.Break method.

C9L2Q3: Other than overriding methods and responding to events, what else needs to be done to create a custom Installer class?

Answer: Add the RunInstallerAttribute to the custom class and set the runInstaller parameter to true.

C11L2Q6: CAS declarations are only significant in what type of assemblies?

Answer: Partially trusted assemblies.

C7L1Q9: How do you prevent new threads from getting the execution context?

Answer: Call the ExecutionContext.SurpressFlow before the new thread is created and call the ExecutionContext.RestoreFlow afterwards.

C11L3Q9: What are the three security actions that are applicable to assembles and what are their equivalent security actions that are applicable to classes and methods?

Answer:

  • RequestRefuse (assembly) is equivalent to Deny (class and methods).
  • RequestOptional (assembly) is equivalent to PermitOnly (class and methods).
  • RequestMinimum (assembly) is equivalent to Demand (class and methods).

C10L2Q5: What does the DebuggerHidden attribute do?

Follow up question: How is it different from the DebuggerStepThrough attribute?

Answer: It causes the debugger to step through the code for the class, method or property it decorates, and causes the debugger to ignore any breakpoints in the code.

Follow up answer: The DebuggerStepThrough attribute will not cause debugger to ignore any breakpoints in the code.

C10L2Q6: What does the DebuggerStepThrough attribute do?

Follow up question: How is it different from the DebuggerHidden attribute?

Answer: It causes the debugger to step through the code for the class, method or property it decorates, but the debugger will still break at any breakpoints in the code.

Follow up answer: The DebuggerHidden attribute will cause debugger to ignore any breakpoints in the code.

C10L2Q7: How do you prevent the debugger from breaking inside a class, method or property, even if there is a breakpoint?

Answer: Add a DebuggerHidden attribute to the class, method or property.

C10L2Q8: How do you prevent the debugger from breaking inside a class, method or property, but still stop on any breakpoints?

Answer: Add a DebuggerStepThrough attribute to the class, method or property.

C10L2Q9: How do you add a DebuggerHidden or DebuggerStepThrough attribute to a property?

Answer: Decorate either or both of the accessor methods with the attribute.

Lesson 3: Working with Dictionaries

C4L3Q1: When iterating over a Hashtable, what order are entries returned in, by default?

Answer: The order of the hash values.

C4L3Q2: What are the five non-generic dictionary collections and what is each used for?

Answer:

  • Hashtable - Used for simple basic dictionaries.
  • SortedList - Used for dictionaries that are sorted by key.
  • ListDictionary - Used for small dictionaries.
  • HybridDictionary - Used for dictionaries of unknown or varying size.
  • OrderedDictionary - Used where direct control of the order is required.

C4L3Q3: What type of object does a non-generic dictionary collection contain?

Answer: DictionaryEntry

study_questions_lucky_dip_creation.1251166625.txt.gz · Last modified: 2017/01/01 19:54 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki