Archive

Posts Tagged ‘c#’

Getting Eclipse CDT to spell check non-source files

  1. Problem:
    1. Using Eclipse Luna CDT, with C/C++ spelling engine, to document C and C++ code in Doxygen (Eclox plugin), image
    2. Spell check works for inline Doxygen documentation. My API-level code comments in *.[ch](pp)* files gets spell-checked alright (Well…:
      1. I had  to download a decent dictionary to avoid recommendation like this one: image. I am using the aspell dictionaries from here and here.  This is before a restart/recheck:image
      2. I still do not know how to teach the C++ spell check engine that a newline does not start a new sentence: image
      3. The oft-referred to menu: Edit / Spell check does not show up for me: image
    3. However, spell check ignores my standalone *.dox files with high-level documentation.
  2. What I have tried:
    1. Telling Eclipse about the*.dox file type: image
    2. Associating *.dox files with the Doxyfile editor: image. Fail. This tool from the Eclox plugin seems to help only with the editing of the Doxygen config file. image
    3. Associating *.dox files with C/C++-editor: image Fail: has no effect.
  3. Workaround:
    1. Terrible, but since a similar question is still open on stackoverflow): If you can (*.dox requires all comments to be within c-style comments anyway), rename your *.dox files to *.dox.cpp. Terrible, but works: image
    2. A bit less terrible if you mange to store your standalone *.dox files as *.dox.cpp permanently do this if you get your Doxygen to handle these extensions.
    3. What is nice to see is that the spell-checker  recognizes Doxygen’s built-in reserved words (as opposed to my custom-defined Doxygen-commands). image
  4. Other things to try:
    1. I could not get Hunspell4Eclipse to work, despite going to considerable trouble getting the marketplace into my Eclipse installation
    2. I have not tried eSpell.

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

Paper @ IALLT 2013: Driving Tutorial Call Into The Face-To-Face Classroom, and What It Took…

…has been accepted for inclusion in the program for IALLT 2013, June 11-15 at the Pinecrest School (Fort Lauderdale, FL)/Florida International University (Boca Raton, FL) and was presented on June 14: Here are abstract and slide deck:

[office src=”https://onedrive.live.com/embed?cid=4FA3329905D7E1CE&resid=4fa3329905d7e1ce%2185931&authkey=AFswJ0h4LVABrYc&em=2&#8243; width=”650″ height=”528″ frameborder=”0″ scrolling=”no”]

Testing my Langlabemailer…

image

… to improve the integration of the digital audio lab into the university’s language teaching processes – 1000 emails at a time. Smile (Coming soon: same day delivery. More on this project will be available here: https://2013.iallt.org/session/driving-tutorial-call-face-face-classroom-and-what-it-took).

Scraping RSS of online actualités for language learning materials production

  1. The capability of RSS-news feed integration of foreign language news may be standard now in most LMS, but was not in 2002 (not even having an LMS was standard, I had to build my own while it took the university a few more years to adopt Blackboard as I had recommended in 2000): cc-calico-news-glossing.2
  2. But RSS-feed display is skin-deep and, even in extensive-reading pedagogies, not sufficient for integration into teaching and learning which requires more post-processing.
  3. At a recent Digital Humanities Unconference, I was asked how I had “scraped” (RSS-scraping was chosen since it easier than screen scraping,  for RSS is devoid of most markup, as long as it validates) into a SQL-server database. Here are some code-snippets to get you
    1. from the web glossing-rss-news--vs.net-c#
    2. into the database: sql-portal-csvs-codecc-ms-sql-server2cc-ms-sql-server3
    3. The scraped plain text in the database can form the foundation for post-processing for SLA-purposes, see e.g.  glossing for reading comprehension facilitation or question generation with the trpQuizConverter for

Source code samples

Language Lab Web Portal, University of Michigan – Dearborn

For lack of even an LMS – which in post-secondary language lab environments in the US in the “noughties” commonly has had to double as CMS and Groupware -, the lab web portal in the post title had to fulfill many functions.

While the technically most advanced features probably was full text search against both database and file system (uploaded documents) – which I could relatively easily implement thanks to MS-SQL-Server and a limited number of database tables –, I liked best the collaborative building of a bank of language learning exercises using authentic materials, i.e. interactive websites from the target culture.

A few sample illustrations of the use in both language lab and affiliated computerized classrooms you can see here:

The list below links to a series screencasts of the Language Lab Web Portal that I made for training and demonstration purposes. They show the language lab web portal software in action:

basics_intro_roles
basics_usagestatistics
Class_presentation_Fruehstuecksbueffet
content_headlines
content_search
How_to_add_a_links_assignment_in_90secs
How_To_Add_Pages_And_Modules_fast
How_to_get_Help_LinksExample
How_to_operate_the_wireless_keyboard
How_to_provide_Help_PrinterExample_short
How_to_record_streaming_media
inventorydb
ocr_to_word_fast
perl_links_moveunverified
portal_search
portal_search portal_search program search staff_tab_short userinput

Doing simple web analytics with an ASP.net DataGrid control over SQL-Server