Oldschool goes HD

Oldschool goes HD

 

Finally I've found the ultimate application for my HD-TV. YAY!

Export an Outlook Folder to a Filesystem-Folder

Here is a small tool I wrote (well, rather hacked) which might come handy for some of you. Sourcecode is included so you might want to make it even fancier and do whatever comes to your mind with it.

OutlookFolderExporter 0.3 Beta

What does it do?
Export an Outlook folder containing E-Mail Messages to a physical filesystem folder. Message by message.

Requirements?

  • Outlook 2007
  • NET 2.0 Framework
  • Visual Studio 2007 (optional)


Why?
Someone asked me if I knew a tool or a way to do this. From what I understand he was about to share such messages using a Windows-Share. I know there are better ways to achieve this, provided you are using an Exchange-Server - but for some reason it did not work out for them.

Limitations?
Plenty, this is a really quick hack:

  • Supports only mail messages (no contacts, appointments etc)
  • Can export only one folder (no recursion) at a time
  • Developed and tested against Outlook 2007 (12.0) - no idea if this will even work for previous versions of Outlook. I suppose not.
  • Won't cook any coffee yet.
Obligatory Screenshot?


Usage?
You will need to know the path to your Outlook folder you would like to have exported. The root folder presumed by this applicationis the root folder of your default Outlook acccount. Beneath it you should have folders like Inbox, Contacts etc. To export all messages of the default inbox folder one would use "/Posteingang/" in the German version of Outlook. Must be something like "Inbox" for English Users I think. Another example would be "/Sent-Items/Archive" which would export the Archive folder which you have might created in the Sent-Items parent Folder.

License?
Public domain, check the "License.txt" in the sources package for further details.

History

0.3 Beta: 2008-07-02 20:40 0.3

  • Inbox->first folder restriction removed - You can export any account folder now.
  • Target directory might be created on demand.

0.2 Alpha 2008-07-02 14:00 - 0.2

  • Added an installer (otherwise we are missing some interop-libraries)
  • Repackaged, Sources will be also installed.

Download?

Live Coding Session

I'll be doing some work in java for renoise.com today. If you would like to peek across my shoulder - http://live.yahoo.com/codewut

Debug, Log and Tail on Steroids

Sometimes I do really wonder why some great tools remain silent and hidden from the public for such a long time. The guys over at codeproject featured an article about the "TraceTool". Describing it with "yet another log viewer" won't do any justice. Just head over to the article and glance over it. It's able to interface with the most common logging frameworks such as .NET's native, log4net/log4j, NT System Evenlog and plain files.

I must admit I did not try it yet. Will do next week when I'm back in the office - I don't really feel like I want to be coding this weekend. But just reading the specs and howtos on the codeproject site blew my mind. Looks like a jewel, smells like a jewel... might be one!

Code Kata

Today I stumbled over an interesting article over at http://hackszine.com/ - It's about small exercises for developers – twentyone in total. The deal is to do each exercise multiple times , just like moves in Karate (hence the name “Kata”).

So, if you are looking for some practical coding experience – go for it: http://codekata.pragprog.com/2007/01/code_kata_backg.html

Yes Firefox, I'll behave!

No Idea what the English verson might be saying, but the button in the German version basically says "I'll be careful, I promise!" LOL?

I'll be careful!I'll be careful!

Blender, Yafray and Me

Recently I decided to get used to Blender. Several years ago I've been using Alias Wavefront and 3D Studio Max at work, so I am already spoiled. But what buggs me the most, is the lack of a decent renderer. The built-in kinda sucks and the only one good looking addon renderer with good integration into blender was yafray. This one supports all the latest hype like GI or Caustics. It looks even pretty good and produces a nice natural lightning.

That did not hold be back from running into an issue which I would cosider being a bug. Here is what I've done:

Blender / Yafray SettingsBlender / Yafray Settings

  • Remove everything from your Scene but the camera
  • Add a plane which will be our floor
  • Add a ball or any other shape ontop of it
  • Add a Area-Light above it (we have no other lights)
  • Remove all Ambient-Lightning
  • Switch on Photons in the Yafray's config
  • Hit F12 - Render.

If you are lucky, you will see some kind of inversed lighting. If not, you will see only darkness. Pump up the Emit Power in the Yafray's config a bit or resize the AreaLight in the object properties window up to 100 and pump up the power to maybe 5.

Is it me not getting here something, or is it just a bug? Take a look at the picures, they look kinda cool (despite being plain wrong):

AreaLight Green OverdriveAreaLight Green Overdrive

There are more variations of this image over at the yafray gallery - If you got yourself an account on this site, you can download the original size of the image.

Update:
Ok, call me an idiot. Even the manual says more or less clearly that one should use area lights together with light emiting objects. The area light does only emit photons which are used to calculate indirect light and the color bleeding.

 

Setup Log4Net for a project in less than 2 minutes

Sometimes documentation is plain anoying. I've been using log4j since ... I don't know, maybe 5-6 years? The setup was as simple as dropping a log4j.xml into the class path and using the logger right away.

Log4Net ist not really much more complicated, but it requires a little bit more attention. Here is what you need to start logging via log4net in less than 2 minutes:

  • Grab the log4net zip over at: http://logging.apache.org/log4net/download.html
  • Copy the log4net.dll (for instance bin\net\2.0\release in the zip archive) into your project. Ignore the other zip content if you don't care.
  • Add the library reference
  • Create an App.Config file using the big xml chunk provided below
  • Call log4net.Config.XmlConfigurator.Configure(); once to initialize the log4net stack
  • Done
  1. <?xml version="1.0" encoding="utf-8" ?>
  2.  
  3. <configuration>
  4.  
  5. <configSections>
  6. <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  7. </configSections>
  8.  
  9. <log4net debug="true">
  10. <appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender,log4net" >
  11. <param name="File" value="Debug.log" />
  12. <param name="AppendToFile" value="true" />
  13. <maximumFileSize value="10MB" />
  14. <maxSizeRollBackups value="2" />
  15. <layout type="log4net.Layout.PatternLayout,log4net">
  16. <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] &lt;%X{auth}&gt; - %m%n" />
  17. </layout>
  18. </appender>
  19. <root>
  20. <priority value="ALL" />
  21. <appender-ref ref="LogFileAppender" />
  22. </root>
  23. </log4net>
  24.  
  25. </configuration>
some hints and tips to make your life easier:

Here is a pretty elegant way to obtain a logger with the category automatically set to the current class - (there is no equivalent to this in Java by the way - at least not for static fields)

  1. private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

The Logfile will be created next to the executable. Oh, and just in the case you did not know, you can use system envoronment variables in the App.config. For instance you could be foolish (or lazy if you prefer) and log directly onto the Windows system drive:

  1. <param name="File" value="${SystemDrive}\Debug.log" />

FlexCel Studio for .NET

If you are looking for a toolkit to generate Excel-Files using a pure .NET implementation of the Excel Fileformat - look no more. Head over to TMS Software and give FlexCel Studio a try.
End Of Line.

Using native SQL in nHibernate

Today I ran into a situation in a nHibernate based project where I needed to execute a very specialized query. Using HQL was rather not practical since I had to query tables which were not "directly" mapped to entities.

So, if you need execute queries behind nHibernate's back and map the results to a Bean / Object not specified in the mappings, You might come up with a solution like this:

  1. string someComplexQuery = @"select ... from ...";
  2.  
  3. IQuery sqlQuery =
  4. sessionFactory.GetCurrentSession().CreateSQLQuery(someComplexQuery).
  5. AddScalar("Id", NHibernateUtil.Int32).
  6. AddScalar("Firstname", NHibernateUtil.String).
  7. AddScalar("Lastname", NHibernateUtil.String).SetResultTransformer(
  8. Transformers.AliasToBean(typeof(Person)));
  9.  
  10. IList<Person> people = sqlQuery.List<Person>();
  11. foreach (Person person in people)
  12. {
  13. // ...
  14. }

For a good measure, here is the Person class:
  1. class Person
  2. {
  3. private long id;
  4. private string firstname;
  5. private string lastname;
  6.  
  7. public long Id
  8. {
  9. get { return id; }
  10. set { id = value; }
  11. }
  12.  
  13. public string Firstname
  14. {
  15. get { return firstname; }
  16. set { firstname = value; }
  17. }
  18.  
  19. public string Lastname
  20. {
  21. get { return lastname; }
  22. set { lastname = value; }
  23. }
  24. }

Works like a breeze, /me likes!

Syndicate content