Archive

Archive for the ‘mental-notes’ Category

POS-Tagsets. A list.

How to fix Expression Encoder not outputting to a Silverlight template

  1. This glitch has bugged me once too often, so now I am writing myself a mental note:
  2. Problem:
    1. On some projects, Expression Encoder outputs only media files, while I need a web-publishable HTML container that calls Silverlight: image.
    2. And I cannot find in the interface where to re-enable  this output option.
  3. Root cause : Something turns the display of the Template Tab off.
  4. Solution:
    1. To show the Template tab, in an existing “Transcoding Project”, go to menu: “Window”, check “Templates” :image
    2. Makes all the difference: image Smiley
    3. Now select something else but “None” which  your prior transcoding defaulted to.
    4. image
    5. Voilà: 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

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

How to bind files to PDF with eXpert PDF Creator

  1. I tried PDF Editor (mind you, old version! 6 which I still have around from a promotion – nice software, though) first, including its help.
  2. Use Batch Creator instead,
  3. uncheck “Create multiple Documents”
  4. then you will be prompted for a (new) filename for the bound files.
  5. expert-pdf-editor
  6. Then click the “save” icon  in the upper right menu.

Google etymology feature

  1. Etymology information has been added to Google end of August, still need to review this more closely (other languages supported?), but for now:
  2. Type “etymology” followed by the English word to get the Etymology (and unfold the arrow below to get additional dictionary information, including historical frequency)
  3. image
  4. Of course this feature cannot replace a historical legal dictionary, but I what I was looking for was the juxtaposition with “freeman” in English feudal history, which I would have liked to find a reference here to also
  5. Etymology does not seem to be supported if I type “Etymology Schmetterling” (or “Etymologie Schmetterling”), the feature does not come up. It does if I type “etymology butterfly", however: Is this right?! The next thing which is missing (and this reminds me too much of how our students use Google translate) is the admission of that these explanations are theories which are contentious, and should be debated: image

Corpora, Treebanks, Word-Lists. A List.