Archive

Archive for the ‘Notes’ Category

A Project Management Life Cycle–with some communication problems

Not my content (but forgive me for not remembering the source), just my animated GIFs: 1, 2, 3. Smiley

How to fix “Print to OneNote”, “OneNote cannot find a page on which to insert your printout”

2014/07/16 2 comments
  1. This error kept popping up for me on OneNote 2013, but I gather it is a classic.
  2. I should have just taken the error message seriously and literally: Could I do better than OneNote and find a page where OneNote says it cannot?
  3. First, to find out where I and OneNote are supposed to be looking for this page, go to File / Options/ Send To OneNote and check which “print to “location you have set.
  4. This one here looks obviously suspicious (and does not exist – one would wish still when this location goes out of scope this could be flagged with a more transparent warning):
  5. image
  6. Change the location :
  7. image
  8. to one that actually exists:
  9. image
  10. or better maybe, for lack of a more transparent error checking if page goes out of scope, chose one of the other,  hopefully more robust options: image

How to sort a Pivot table by a calculated field column

(Click on image for original size version, now bigger.)
excel-pivot-sort-calculated-field

How to work around flat flush-left nested lists in Windows Live Writer

  1. Windows Live Writer (2012), in WYSIWYG  mode under the “edit” tab, conveniently interprets “tab” keys, when issued within an <ol>/<ul>, as, i.e. converts them into nested lists.
  2. However, Windows Live Writer does not horizontally indent the nested lists. Rather the lists appear “flat” flush left –(restart in ) only numbering and vertical  indentation, like so: image
  3. The underlying source code feature is that <li> get immediately closed, before the nested <ol> gets even opened, as you can see here: image
  4. You can force the indented view by wrapping the <li></li> around the nested <ol></ol?, like so: image
  5. The resulting look with horizontal indentation: image
  6. Unfortunately, to make matters worse, certain work with lists in the “edit” mode make them revert back to the default “flat”view. So you often have to redo your work under the source code tab.

How to work around broken links and visible “Machine generated alternative text”issues with images from MS-OneNote in Windows Live Writer

  1. Problem: Sometimes when you use Windows Live Writer (2012) to post images copied from MS-OneNote (2010, 2013), the result (on WordPress) can get messed up, like so (post has since been fixed as described below): clip_image001
    1. The image is missing (“src=” link broken).
    2. The “alt=” text is visible instead (and you did not want to post this “alt=”text anyway. (MS-OneNote OCRs images to make the text therein searchable; this text is put into the “alt”when pasting from MS-OneNote).
  2. Root cause:
    1. Windows Live Writer converts the pasted content by
      1. removing the “alt=”Machine generated alternative text: [deleted for brevity]”
      2. creating from the pasted content thumbnail images
      3. which it links in the “src=” tag, and links the thumbnail image to the full-size original image.
    2. If something – unclear what – prevents this conversion, Unfortunately, this is not obvious from the “edit” tab view or elsewhere within Windows Live Writer. But when posted, will result in “Machine generated alternative text” from MS-OneNote in place, but even  break the image src link: image.
    3. What exactly triggers (and would allow you to force) a successful conversion within Windows Live Writer I do not know. However, there is a simple:
  3. Workaround:
  1. After pasting your images, be patient : The trick seems to be to give Windows Live Writer enough time (more apparently if you have pasted multiple images) to finish
  2. Things you can look for in Windows Live Writer to make sure the conversion is finished:
      1. edit tab: you can tell the difference by the resizing of the image on the edit tab:
        1. before: image
        2. after (= conversion finished): image
      2. source code  tab: A somewhat radical solution, but here beneficial  is that the conversion removes the imported “alt” text of the image.
        1. before: alt=”Machine generated alternative text: [deleted for brevity]” src=”$clip_image006.jpg”
        2. after: alt=”clip_image006″ src=”$clip_image006_thumb.jpg”

MS-OneDrive “Get link” incompatible with MS-Word “Always create backup copy”, use MS-OneDrive versioning instead

  1. Symptoms:
    1. If I edit my local MS-OneDrive copy with MS-Word, my collaborators lose access to the most recent copy via the link I shared with them.
    2. Worse, the new file MS-Word generates when the backup is created, won’t get automatically synched with MS-OneDrive, and no sync error seems to get flagged in Explorer.
  2. Root cause (presumably):
    1. When saving in MS-Word, I can see my focus moving to the backup fileclip_image001
    2. MS-Word, when creating a backup of the original file, actually rather creates a “fore-up”: The original file gets renamed (“Backup of…”) and the recent changes get copied into a new file.
    3. The MS-OneDrive link keeps pointing to the old file “Backup of…”, “when after (which one can see normally, if the user renames a file manually, is a desirable feature)
    4. Workaround: I managed to manually upload the files that got out off synch.
  3. Solution:
    1. Turn MS-Word backup off, it is not compatible with MS-OneDrive under File / Options /Advanced / section: Save: clip_image002
    2. Rather, rely on the MS-OneDrive versioning.

Enterprise Library Logging Sample

Using Enterprise Library (still on 5), You can declaratively configure the logger properties (including desired formatting, see Textformatter template below)) in the app.config’s appsettings:

  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
  defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">   <listeners>    <add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    source="Enterprise Library Logging" formatter="Text Formatter 2"
    log="" machineName="." traceOutputOptions="None" />    <add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    fileName="%AppData%\trpsoft\langlabemailer\trace-rolling.log"
    footer="" formatter="Text Formatter" header="" rollFileExistsBehavior="Increment"
    rollInterval="Day" rollSizeKB="1000" maxArchivedFiles="10" traceOutputOptions="None" />    <add name="Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    fileName="%AppData%\trpsoft\langlabemailer\exception.log" header=""
    footer="" formatter="Text Formatter" traceOutputOptions="None" />    <add name="Rolling Flat File Trace Listener 2" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    fileName="%AppData%\trpsoft\langlabemailer\exception-rolling.log"
    footer="" formatter="Text Formatter" header="" rollFileExistsBehavior="Increment"
    rollInterval="Hour" rollSizeKB="100" maxArchivedFiles="10" filter="All" />   </listeners>   <formatters>    <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    template="Timestamp	 {timestamp}	Message	 {message}	Category	 {category}	Priority	 {priority}	EventId	 {eventid}	Severity	 {severity}	Title	{title}	Machine	 {localMachine}	App Domain	 {localAppDomain}	ProcessId	 {localProcessId}	Process Name	 {localProcessName}	Thread Name	 {threadName}	Win32 ThreadId	{win32ThreadId}	Extended Properties	 {dictionary({key} - {value})}"
    name="Text Formatter" />    <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    template="Timestamp: {timestamp}{newline}
Message: {message}{newline}
Category: {category}{newline}
Priority: {priority}{newline}
EventId: {eventid}{newline}
Severity: {severity}{newline}
Title:{title}{newline}
Machine: {localMachine}{newline}
App Domain: {localAppDomain}{newline}
ProcessId: {localProcessId}{newline}
Process Name: {localProcessName}{newline}
Thread Name: {threadName}{newline}
Win32 ThreadId:{win32ThreadId}{newline}
Extended Properties: {dictionary({key} - {value}{newline}
)}"
    name="Text Formatter 2" />   </formatters> 
   <categorySources>    <add switchValue="All" name="General">     <listeners>      <add name="Rolling Flat File Trace Listener" />     </listeners>    </add>    <add switchValue="All" name="Exceptions">     <listeners>      <add name="Event Log Listener" />      <add name="Rolling Flat File Trace Listener 2" />     </listeners>    </add>   </categorySources>   <specialSources>    <allEvents switchValue="All" name="All Events" />    <notProcessed switchValue="All" name="Unprocessed Category" />    <errors switchValue="All" name="Logging Errors &amp; Warnings">     <listeners>      <add name="Event Log Listener" />     </listeners>    </errors>   </specialSources>  </loggingConfiguration>  <exceptionHandling>   <exceptionPolicies>    <add name="Log and Rethrow">     <exceptionTypes>      <add name="All Exceptions" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
      postHandlingAction="NotifyRethrow">       <exceptionHandlers>        <add name="Logging Exception Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        logCategory="Exceptions" eventId="100" severity="Error" title="Enterprise Library Exception Handling"
        formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
        priority="0" />       </exceptionHandlers>      </add>     </exceptionTypes>    </add>   </exceptionPolicies>  </exceptionHandling>  <appSettings> 

Import and call the logger like so:

using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;  

using Microsoft.Practices.EnterpriseLibrary.Logging;  

Logger.Write("regex:RegExRecordingFileGroup - target:" + "\t" + _filenamenoext + "\t" + strGroups); 

Which outputs: image and

image,

the  latter can be easily imported and analyzed in MS-Excel:

image

These are obviously only the simplest examples, study the Enterprise Library documentation for more customization

ScreenToGif Debugging: Object reference not set to an instance of an object (#7)

  1. Trying to contribute a tiny bit to the development of this great utility ScreenToGif:
  2. 1st version: image
    1. crashes on pressing “stop”: image
    2. the Log
    3. Title: NullPointer in the Stop function 7
      Message: Object reference not set to an instance of an object.
      Source: ScreenToGif
      TargetSite: Void Stop()
      StackTrace:    at ScreenToGif.Legacy.Stop()
      Date/Time: 7/3/2014 12:55:16 PM
      ==============================
  3. Newer version: image
    1. does not hang on “stop”
      1. after adding overlay text (great new feature!), image
        1. seems to hang on pressing “Done” with “Analizing [sic] Unchanged Pixels”
        2. crashes on pressing window close: image
        3. Maybe I was just not patient enough? for:
      2. without adding overlay pixels:
        1. seems to also take a long time (2-3minutes analyzing, without a progress bar, or any other indication that the program is still working and has not crashed – the couple of minutes “Processing” seem to go by faster, thanks to the progress bar and frame counter) for a 5fps 1073*810, about 300frames, but hey! It works:image
        2. Plus you can now open the resulting GIF file directly from the creator.
        3. Actually, when I click “Stop” (I realize  I am supposed to click “Close”), I still get a NullReferenceException (#9), probably should not: image
    2. No log has been outputted with the new version .