Homemade Profiteroles




Homemade Profiteroles

Originally uploaded by itto.be


Leave a Comment

links for 2008-11-17

Leave a Comment

Little goat cheeses on toast

Little goat cheeses on toast

This is what we’ve made the last time in cooking class. It tastes great and I just had to share it.

Roast some pine-tree-nuts in a dry pan. Pay close attention and toss them around very frequently, because they burn easily. When they start to smell nice and have some color, take them off the fire and let them cool down. In the meantime you can slice an apple in little ‘batonettes’ (little french fries) and slice some grapes in quarters, removing the seeds.

Take some toast bread and cut out circles slightly bigger than the goat cheese you’ve sliced. Put the goat cheese on top of the toast, drizzle some oil over it and put in an oven that’s pre-heated at 180°C until the cheese start to change color.

Put some rucola and field-lettuce on a plate, drizzle over some balsamic vinegar and some olive oil and sprinkle the apple, nuts and grapes over it. Place the toasts next to the salad and enjoy a distinct but great taste!

Tags: , , , , ,

Comments (4)

Fikke op ‘t voetbal




Fikke op ‘t voetbal

Foto’s nemen voor www.ksvderuiter.be en tussendoor even een foto van mijn petekindje. At-da-nie-koddig-is!

Leave a Comment

Snow owl




Snow owl

Leave a Comment

Embed images in a mail message using C#

I was recently writing a webapplication for one of our clients. The application is a training management tool and thus involves sending loads of e-mail. This way people get reminded that they’ll be following a training in the next days or asked to write a review about their training. To make the mail look great, we wanted it to be in HTML and contain the company logo.

A first attempt was made by just writing the html for the mail and use an ordinary image-tag with a reference to the client’s intranet (like this: <img src=”http://intranet.client.com/logo.gif”/>). However, the kick-ass intranet-security of our client wouldn’t allow this and each time the mail was opened, the user was prompted for his credentials. Very annoying! So we had to include the image in the mail as an attachment. You see it every day, but apparently the code to do this in c# isn’t that widely spread. So here’s my function to accomplish it:

/// <summary>
/// Embeds the company logo into the given mail message
/// </summary>
/// <param name="message">Message in which the logo should be embedded</param>
private static void EmbedCompanyLogo(MailMessage message)
{
   AlternateView av1 = AlternateView.CreateAlternateViewFromString(message.Body, null, System.Net.Mime.MediaTypeNames.Text.Html);
   string strImageUrl = System.Web.HttpContext.Current.Server.MapPath("~/images/logo_print.gif");
   LinkedResource logo = new LinkedResource(strImageUrl, System.Net.Mime.MediaTypeNames.Image.Jpeg);
   logo.ContentId = "companylogo";
   //To refer to this image in the html body, use <img src="cid: companylogo"/>
   av1.LinkedResources.Add(logo);
   message.AlternateViews.Add(av1);
}

As mentioned in the code comment, in your mail message you can refer to the image with a source equal to “cid:companylogo”.

If you have any thoughts, remarks or questions, the comments are open…

Tags: , , ,

Comments (4)

Schandalig!

Bulgaria’s Abandoned Children. Dat dit kan…

Luister ook naar Chris Dusauchoit

Leave a Comment

What are you wearing today?




What are you wearing today?

Originally uploaded by itto.be

Mijn bijdrage voor vandag van “What are you wearing today?”.

Wat ne mens tegenwoordig al niet uitsteekt :-)

Leave a Comment

Sofie Lemaire geht los…

Théhé, ‘t is dan nog waar ook! Vanochtend op StuBru gehoord.

Leave a Comment

Downloading Office 2007 documents from IIS 6

Today at work, I had to make a small asp.net form that enables the user to apply for a job and upload their resume. In the backoffice that I made, the admin has the possibility to view all applicants and download the files they’ve uploaded. Possible file types are .pdf, .doc and .docx. While testing this application, I had uploaded a Word file and checked via FTP that the upload including the renaming of the file and moving it to the correct folder went fine. So, as a final test, I tried to download the uploaded file via my browser, just like the admin would do when te application went live. This didn’t work at all! The server just returned a 404 Not Found error page. I tried for maybe half an hour and started to think I was going crazy. I could see the file through FTP, but could not download it. How is that possible!?

Then, after half an hour, I did what I should have done all along. I renamed the file from the Microsoft Word 2007 file extension .docx to a regular .doc and it worked instantly! After a few seconds looking in Google, I realized that IIS6.0 (which runs on our hosting provider’s server) is Secure By Design. This means that MIME types are in a white list. Everything that isn’t known to the server is hidden by default and thus returns a 404 error.

To solve this problem, you have to add a MIME type to IIS. To do this, you just follow these simple steps:

  • In the Internet Management console, you go to the properties of the web site, by right clicking onto it.
  • Under “HTTP Headers”, “Mime Types”, you add a new extension (without the leading dot) with the mime type “application/vnd.openxmlformats-officedocument.wordprocessingml.document”.

You can find a complete list of mime types for office 2007 documents on the Microsoft website.

Comments (3)