<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7041745156199549192</id><updated>2012-01-22T05:40:16.727-08:00</updated><category term='linux'/><category term='asp'/><category term='wcf'/><category term='flash'/><category term='xml'/><category term='media'/><category term='javascript'/><category term='java'/><category term='php'/><category term='ajax'/><category term='latex'/><category term='programming'/><category term='WP7'/><category term='IIS'/><category term='kde'/><category term='gnome'/><category term='wi-fi'/><category term='C#'/><category term='css'/><category term='sql'/><category term='spring'/><category term='html'/><category term='.net'/><category term='network'/><category term='mozilla'/><category term='ubuntu'/><category term='testing'/><category term='Master&apos;s Thesis'/><category term='opera'/><title type='text'>Filip's Technical Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>96</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7927687014058822048</id><published>2012-01-19T05:19:00.000-08:00</published><updated>2012-01-20T04:27:50.085-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='WP7'/><title type='text'>How I didn't get a Windows Phone 7 for free</title><content type='html'>Some time ago &lt;a href="http://www.codeguru.pl" title="Codeguru homepage"&gt;Codeguru.pl&lt;/a&gt; (polish portal for developers, staying in very close relations with Microsoft) announced a competition called &lt;a href="http://www.codeguru.pl/static/WP7" title="Geek Club rules"&gt;Geek Club&lt;/a&gt;. The basic rule was quite simple: write 5 apps for Windows Phone and get an actaul device for free. There were 2 additional requirements:&lt;ol&gt;&lt;li&gt;In order to be accepted by Codeguru the app needs to be published on Marketplace first&lt;/li&gt;&lt;li&gt;The app needs to make use of at least 2 listed features (like GPS, SQL CE data storage etc)&lt;/li&gt;&lt;/ol&gt;At first I didn't think about participating, mainly because of 3 reasons:&lt;ul&gt;&lt;li&gt;Unless you're a student, you have to pay 100$ to be able to publish apps to Marketplace&lt;/li&gt;&lt;li&gt;Didn't really believe in WP7 (low market share, pessimistic prognosis)&lt;li&gt;Writing 5 good apps seemed to be a lot of effort, especially that I don't know silverlight&lt;/li&gt;&lt;/ul&gt;However, after &lt;a href="http://maciejgrabek.com/" title="Maciej Grabek homepage"&gt;Maciej Grabek&lt;/a&gt; gave us a presentation on Windows Phone development and showed how easy it is I decided to give it a try. Also, I started to hear more &amp; more positive opinions abut WP7 from my colleagues. The turning point was when I learned that the apps don't have to be good at all! :) They don't need to do anything useful or even funny, as long as they fulfill the 2 requirements presented above. This means I could treat the whole challenge as a good learning experience rather than a serious app development project. I didn't have to care much about functionality, like I normally would when working an application. Instead, I could focused on technical details, so it was rather a technology evaluation project.&lt;br /&gt;&lt;br /&gt;Having said all that about good learning opportunity etc. I must admit I was still hoping to get that free phone :) But I didn't... I submitted my 5 apps (even 6 just in case) at the end of last year, but till now only 2 got checked by Codeguru team and since yesterday there are no more phones (the pool was limited). Apparently there was much more apps submitted than Codeguru team could tests. &lt;br /&gt;&lt;br /&gt;Anyway, I'm still glad I took part in that competition. Here are most important benefits:&lt;ul&gt;&lt;li&gt;I've learned fundamentals of WP7 development, Silverlight basics, app lifecycle &amp; Marketplace submission process&lt;/li&gt;&lt;li&gt;I know how to make use of basic features: touch screen interface interaction, GPS, Accelerometer, Microphone, Internal Storage (SQL CE), playing sounds, Bing Maps, ...&lt;/li&gt;&lt;li&gt;Got convinced that WP7 platform is actually quite nice and userfriendly&lt;/li&gt;&lt;li&gt;I can exchange the points I've earned for my apps (or will earn once Codeguru finally tests them) for other prizes like free Microsoft exams, Office Suite etc.&lt;/li&gt;&lt;li&gt;I had lots of fun :)&lt;/li&gt;&lt;/ul&gt;Now for the bad part:&lt;ul&gt;&lt;li&gt;The competition lacked transparency. Theoretically the apps to be tested by Codeguru team were put into a FIFO queue. However, there were multiple complains from developers saying that they are waiting for any response for a long time while others, who submitted their apps later, already know their results. The submission process did not leave any trace of your submission (no confirmation email, just generic message on a website) and there was no tracking system. As result people didn't know what was happening with their apps.&lt;/li&gt;&lt;li&gt;Too little testers - since I'm still waiting for my apps to be tested I assume they have not enough resources and the they didn't expect such high interest&lt;/li&gt;&lt;li&gt;Because of the competition rules the Marketplace was flooded with crappy, useless apps that were created just to get the phone (including some of my apps I must admit)&lt;/li&gt;&lt;/ul&gt;To summarize: I think we should still be grateful to Codeguru that they organized this and offered us a very motivating way to learn. Many of participants would have never learned how easy WP7 development is if there were no competition like this. However, next time they organize a similar contest they should focus on transparency and provide enough resources to manage, what they created. After all, they represent Microsoft.&lt;br /&gt;&lt;br /&gt;PS. The other interesting fact I've learned is that the more stupid your app is, the more downloads you'll get :D &lt;br /&gt;&lt;br /&gt;PS2. All my apps created for that competition are available on my &lt;a href="http://www.windowsphone.com/en-US/publishers/Feel%20Soft" title="My Marketplace apps"&gt;Marketplace site&lt;/a&gt;. Guess which one is the most popular?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7927687014058822048?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7927687014058822048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7927687014058822048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7927687014058822048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7927687014058822048'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2012/01/how-i-didnt-get-windows-7-phone-for.html' title='How I didn&apos;t get a Windows Phone 7 for free'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8074557412210719273</id><published>2012-01-10T03:42:00.001-08:00</published><updated>2012-01-10T04:44:24.895-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Install PECL_HTTP on CentOS</title><content type='html'>In order to use handy &lt;a href="http://www.php.net/manual/en/intro.http.php" title="Http extension"&gt;HTTP extension&lt;/a&gt; in your PHP code you need to use install it first, as it doesn't come with PHP core installation.&lt;br /&gt;&lt;br /&gt;Below are the steps to install it on &lt;a href="http://www.centos.org/" title="CentOS homepage"&gt;CentOS&lt;/a&gt;:&lt;ol&gt;&lt;li&gt;Install &lt;a href="http://pear.php.net/" title="Pear homepage"&gt;PHP Pear&lt;/a&gt; if not installed yet:&lt;pre class=brush: bash"&gt;yum install php-pear&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Install GCC if not installed yet:&lt;pre class=brush: bash"&gt;yum install gcc&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Install cURL if not installed yet:&lt;pre class=brush: bash"&gt;yum install curl-devel&lt;/pre&gt;Otherwise you'll get the following message while installing PECL_HTTP:&lt;br /&gt;&lt;i&gt;configure: error: could not find curl/curl.h&lt;/i&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start the main installation:&lt;pre class=brush: bash"&gt;/usr/bin/pecl install pecl_http&lt;/pre&gt;You can use default values when answering installation questions&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add the following line to /etc/php.ini file:&lt;pre class=brush: bash"&gt;extension=http.so&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Restart your apache server so the extension can be loaded:&lt;pre class=brush: bash"&gt;httpd -k restart&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;You should now be able to use it. hope I saved you some time :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8074557412210719273?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8074557412210719273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8074557412210719273' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8074557412210719273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8074557412210719273'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2012/01/install-peclhttp-on-centos.html' title='Install PECL_HTTP on CentOS'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5547257460632448382</id><published>2012-01-07T03:06:00.001-08:00</published><updated>2012-01-07T05:04:35.810-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='WP7'/><title type='text'>WP7 location services policy check</title><content type='html'>Lately I've been playing with Windows Phone 7 app development. I submitted several free apps to Marketplace and had no troubles getting the apps certified and published. Not until I created an app that uses Location Services. The app failed to pass the certification stage with the following comment:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Your application failed the Marketplace prohibited application policy check. Please review the above policy, notes below (if applicable), update and re-submit your application.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;To be honest, up to that moment I haven't been paying enough attention to certification requirements. After I received that notification I dived into the details and realized that the policy for application that use location information is quite strict. This can be easily justified by privacy protection etc.&lt;h2&gt;How to pass location services policy check?&lt;/h2&gt;Knowing that my application is missing something I decided to fix it. I started with a lecture of &lt;a href="http://msdn.microsoft.com/en-us/library/hh184841(v=VS.92).aspx" title="Windows Phone Application Policy"&gt;Microsoft official Application Policy description&lt;/a&gt;. I really recommend you familiarize yourself with those rules before you start any WP7 app development. &lt;br /&gt;&lt;br /&gt;The requirements regarding location policy I didn't fulfill are covered in Section 2.7. Once you read those you have a theoretical understanding of what you need to do. However, how does it look like in practice? I wasn't able to find a full example of an application that did pass the certification. Instead, I only found some general advices that I followed. &lt;br /&gt;&lt;br /&gt;Below are 3 changes that I introduced to my app to make it pass the certification process&lt;ol&gt;&lt;li&gt;&lt;strong&gt;Notification message&lt;/strong&gt;&lt;br /&gt;Add a notification message on application start that will inform the user that your app is using location services. Give the user a choice to not allow that. The sample C# code for that could look like this:&lt;pre class="brush: csharp"&gt;// Check if 'allow' setting already set&lt;br /&gt;bool? allow = null;&lt;br /&gt;if (PhoneApplicationService.Current.State.ContainsKey("allow"))&lt;br /&gt;{&lt;br /&gt;   allow = (bool)PhoneApplicationService.Current.State["allow"];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (allow == null)&lt;br /&gt;{&lt;br /&gt;   // 'allow' setting not set yet (i.e. it is first page load)&lt;br /&gt;   // Display the confirmation question&lt;br /&gt;   var result = MessageBox.Show(&lt;br /&gt;                  "This application uses your location. Do you wish " +&lt;br /&gt;                  "to give it permission to use your location?",&lt;br /&gt;                  "User Location Data",&lt;br /&gt;                  MessageBoxButton.OKCancel);&lt;br /&gt;&lt;br /&gt;   // Save answer so you can access it on other pages &lt;br /&gt;   allow = (result == MessageBoxResult.OK);&lt;br /&gt;   PhoneApplicationService.Current.State["allow"] = allow;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if (allow)&lt;br /&gt;{&lt;br /&gt;   // Initiate your app normally&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;   // Display message about limited functionality of your app&lt;br /&gt;   // Disable elements that can cause usage of location services&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Additional setting&lt;/strong&gt;&lt;br /&gt;Add an additional setting item to your app that will allow the user to turn access to location services on and off. If your app doesn't have settings page yet you need to create one. The setting can use a simple checkbox. It should also reuse the state information we saved on application start. XAML code for that could be as simple as that:&lt;pre class="brush: xml"&gt;&lt;CheckBox Name="ckbAllow" Click="CheckBox_Click"&gt;&lt;/CheckBox&gt;&lt;/pre&gt; and your code behind:&lt;pre class="brush: csharp"&gt;private void Page_Loaded(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;   // Set checkbox value on page load&lt;br /&gt;   bool allow = false;&lt;br /&gt;   if (PhoneApplicationService.Current.State.ContainsKey("allow"))&lt;br /&gt;   {&lt;br /&gt;      allow = (bool)PhoneApplicationService.Current.State["allow"];&lt;br /&gt;   }&lt;br /&gt;   ckbAllow.IsChecked = allow;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private void CheckBox_Click(object sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;   // change the saved value when checkbox is clicked&lt;br /&gt;   PhoneApplicationService.Current.State["allow"] =&lt;br /&gt;                               ((CheckBox)sender).IsChecked.Value;&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Policy page&lt;/strong&gt;&lt;br /&gt;The last thing left to do is to create an additional page that describes to the user what the app exactly does with the location information it gathers. Inform the user if you save it or send it somewhere etc. The policy page can be linked from the main app page or available via application menu. The latter could be implemented like that: &lt;pre class="brush: csharp"&gt;// Main page constructor&lt;br /&gt;public MainPage()&lt;br /&gt;{&lt;br /&gt;   InitializeComponent();&lt;br /&gt;   &lt;br /&gt;   // Add an Application Menu Bar&lt;br /&gt;   ApplicationBar = new ApplicationBar();&lt;br /&gt;   ApplicationBar.IsMenuEnabled = true;&lt;br /&gt;   ApplicationBar.IsVisible = true;&lt;br /&gt;   ApplicationBar.Opacity = 1.0;&lt;br /&gt;&lt;br /&gt;   // Add Policy menu item&lt;br /&gt;   ApplicationBarMenuItem policyItem = &lt;br /&gt;              new ApplicationBarMenuItem("location services policy");&lt;br /&gt;   policyItem.Click += new EventHandler(policy_Click);&lt;br /&gt;   ApplicationBar.MenuItems.Add(policyItem);&lt;br /&gt;&lt;br /&gt;   // Add other menu items e.g. Settings  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void policy_Click(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   // Show the policy page called Policy.xaml&lt;br /&gt;   this.NavigationService.Navigate(&lt;br /&gt;                           new Uri("/Policy.xaml", UriKind.Relative));&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;That's it. The 3 changes above worked for me and my app passed the certification process. Good luck with your apps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5547257460632448382?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5547257460632448382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5547257460632448382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5547257460632448382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5547257460632448382'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2012/01/wp7-location-services-policy-check.html' title='WP7 location services policy check'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-426227549206915714</id><published>2011-11-29T00:14:00.001-08:00</published><updated>2011-12-14T08:35:14.821-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Easymock - create partial mocks</title><content type='html'>&lt;a href="http://easymock.org" title="EasyMock homepage" title="_blank"&gt;EasyMock&lt;/a&gt; is a very useful tool allowing to mock all objects that the tested unit of code depends on. This is of course assuming you write your code in the way that allows that e.g. using dependency injection pattern.&lt;br /&gt;&lt;br /&gt;It is also possible to mock only a part of the object e.g. single method and leave original implementation for the remaining part. Such object is called a 'partial mock'. &lt;br /&gt;&lt;br /&gt;The following Java code presents how to create such partial mock:&lt;pre class="brush: java"&gt;package com.blogspot.fczaja.samples&lt;br /&gt;&lt;br /&gt;import org.easymock.EasyMock;&lt;br /&gt;import org.junit.Test;&lt;br /&gt;&lt;br /&gt;public class PartialMockTests&lt;br /&gt;{&lt;br /&gt;   class PartialMock&lt;br /&gt;   {&lt;br /&gt;      void foo()&lt;br /&gt;      {&lt;br /&gt;         // Code inside foo() will not be invoked while testing&lt;br /&gt;         System.out.println("foo");&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      void boo()&lt;br /&gt;      {&lt;br /&gt;         // Code inside boo should be invoked&lt;br /&gt;         System.out.println("boo");&lt;br /&gt;         foo();&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   @Test&lt;br /&gt;   public void testPartialMock()&lt;br /&gt;   {&lt;br /&gt;      PartialMock partialMock = EasyMock&lt;br /&gt;         .createMockBuilder(PartialMock.class) //create builder first&lt;br /&gt;         .addMockedMethod("foo") // tell EasyMock to mock foo() method&lt;br /&gt;         .createMock();          // create the partial mock object&lt;br /&gt;&lt;br /&gt;      // tell EasyMock to expect call to mocked foo()&lt;br /&gt;      partialMock.foo();&lt;br /&gt;      EasyMock.expectLastCall().once();&lt;br /&gt;      EasyMock.replay(partialMock);&lt;br /&gt;      &lt;br /&gt;      partialMock.boo(); // call boo() (not mocked)&lt;br /&gt;      &lt;br /&gt;      EasyMock.verify(partialMock);&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;When executing our test the method foo() of the object will be mocked and method boo() will be invoked normally. The console output of that test would be:&lt;br /&gt;boo&lt;br /&gt;&lt;br /&gt;I'm using this technique when I want to test a single method, that calls other methods in the same class. I can mock all other methods so they behave like methods form other mocked objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-426227549206915714?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/426227549206915714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=426227549206915714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/426227549206915714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/426227549206915714'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/11/easymock-create-partial-mocks.html' title='Easymock - create partial mocks'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8348392068926469918</id><published>2011-11-04T06:30:00.000-07:00</published><updated>2011-11-04T06:51:57.493-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>The data set DataSet1 is a shared dataset. SQL Server 2008 Reporting Services does not support shared data sets</title><content type='html'>I was working on a SSRS project using Sql Server 2008 but decided to upgrade to R2 version, so I can share commonly used datasets across all reports. After the upgrade I converted my SSRS project to the new version and converted existing datasets to shared. When I try to build the project I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;strong&gt;The data set, DataSet1, is a shared dataset. SQL Server 2008 Reporting Services does not support shared data sets&lt;/strong&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Hmm, did the upgrade or conversion fail?&lt;br /&gt;&lt;br /&gt;&lt;strong style="font-size: 110%"&gt;Solution&lt;/strong&gt;&lt;br /&gt;It came out you need to update one of the project settings called: &lt;b&gt;TargetServerVersion&lt;/b&gt;. To do that right click your SSRS project, select Properties and search for that setting: &lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-o6-J5rnezUY/TrPs-iuKTjI/AAAAAAAAAUg/h-tGADcvyOU/s1600/ssrs1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 270px;" src="http://2.bp.blogspot.com/-o6-J5rnezUY/TrPs-iuKTjI/AAAAAAAAAUg/h-tGADcvyOU/s400/ssrs1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5671136915006049842" /&gt;&lt;/a&gt;&lt;br /&gt;The correct value to be set is "Sql Server 2008 R2".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8348392068926469918?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8348392068926469918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8348392068926469918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8348392068926469918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8348392068926469918'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/11/data-set-dataset1-is-shared-dataset-sql.html' title='The data set DataSet1 is a shared dataset. SQL Server 2008 Reporting Services does not support shared data sets'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-o6-J5rnezUY/TrPs-iuKTjI/AAAAAAAAAUg/h-tGADcvyOU/s72-c/ssrs1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3538455277424689522</id><published>2011-09-19T02:16:00.002-07:00</published><updated>2011-09-19T10:49:19.596-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>REST with SpringMVC - Passing params in request body</title><content type='html'>&lt;br&gt;&lt;br&gt;&lt;br /&gt;Lately I was trying to pass parameters to a SpringMVC REST service. In order to do that I used @RequestParameter annotation in a method implementing my service.&lt;br /&gt;&lt;br /&gt;Sample service method for updating user email could look as follows:&lt;pre class="brush: java; highlight: [4]"&gt;@RequestMapping(method=RequestMethod.POST, value="/user/{username}")&lt;br /&gt;public String updateUser(HttpServletResponse response,&lt;br /&gt;                         @PathVariable("username") String username,&lt;br /&gt;                         @RequestParameter("email") String email)&lt;br /&gt;{&lt;br /&gt;     // UPDATE USER EMAIL HERE&lt;br /&gt;}&lt;/pre&gt;As you can see expected request parameter is defined as method parameter and annotated with @RequestParameter specifying the parameter name. Originally it seemed that this approach only works when parameters are passed as URL params but doesn't when params are passed in request body i.e. the following HTTP request would work:&lt;pre class="brush: bash; highlight: [1]"&gt;POST http://&lt;service-url&gt;/user/&lt;username&gt;?email=test%40example.com HTTP/1.1&lt;br /&gt;Host: &lt;service-host&gt;&lt;br /&gt;(...)&lt;/pre&gt;whereas the following would not: &lt;pre class="brush: bash; highlight: [5]"&gt;POST http://&lt;service-url&gt;/user/&lt;username&gt; HTTP/1.1&lt;br /&gt;Host: &lt;service-host&gt;&lt;br /&gt;(...)&lt;br /&gt;&lt;br /&gt;email=test%40example.com&lt;/pre&gt;&lt;br /&gt;When I start googling for this issue I found several opinions stating that this is a known bug and suggesting some workarounds e.g. using @RequestBody annotation and manually extracting parameter values from the body string. &lt;br /&gt;&lt;br /&gt;However, the issue disappears if you specify the content type as one of the request headers: &lt;pre class="brush: bash; "&gt;Content-Type: application/x-www-form-urlencoded&lt;/pre&gt;After I added this to my http request both url and body params are captured with @RequestParameter annotation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3538455277424689522?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3538455277424689522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3538455277424689522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3538455277424689522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3538455277424689522'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/09/rest-with-springmvc-passing-params-in.html' title='REST with SpringMVC - Passing params in request body'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4438421589756780169</id><published>2011-09-19T02:16:00.001-07:00</published><updated>2011-09-19T13:55:10.771-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Cross-domain Single Sign On with OpenAM</title><content type='html'>&lt;a href="http://forgerock.com/openam.html" target="_blank" title="OpenAM at ForgeRock"&gt;OpenAM&lt;/a&gt; is an open-source solution for access management i.e. authentication, authorization and more. It's maintained by ForgeRock, which took over the project after Sun abandoned it. When led by Sun it was called OpenSSO. &lt;br /&gt;&lt;br /&gt;I was recently responsible for installation &amp; configuration of OpenAM. We use it at one of the project to provide cross-domain Single Sign On (CDSSO). At first it seemed to be a complex but relatively straightforward task but as it came out later on, it can give you a serious headache when you try to achieve smth different than default. &lt;br /&gt;&lt;br /&gt;Below is the short summary of pros &amp; cons:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Pros:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;It's a quite mature solution that is built upon its ancestor OpenSSO&lt;/li&gt;&lt;li&gt;Experienced users can benefit from its reach configuration options&lt;/li&gt;&lt;li&gt;Built-in support for multiple user data stores (LDAP, db, ...).&lt;/li&gt;&lt;li&gt;Out-of-the-box support for SAML2 protocol&lt;/li&gt;&lt;li&gt;Portability (100% java)&lt;/li&gt;&lt;li&gt;Built-in support for multi-instance configuration (for Load Balancing)&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Cons:&lt;/strong&gt;&lt;ul&gt;&lt;li&gt;&lt;u&gt;Very poor documentation&lt;/u&gt; - most of the information about the product installation and configuration is available at the Wiki page in form of short, informal articles. Most of the useful information you find on the old OpenSSO specification pages hosted by Sun so you can never be sure if that info is still relevant with the latest version of OpenAM.&lt;/li&gt;&lt;li&gt;&lt;u&gt;No community&lt;/u&gt; - there is actually no real community of people using that solution. This means there is no fora you can search for advise. There is only an oldschool mailing list with very limited usability&lt;/li&gt;&lt;li&gt;&lt;u&gt;Not that flexible&lt;/u&gt; - although quite complex configuration is available sometimes I felt limited, especially when trying to implement smth different than defualt e.g. custom login screens.&lt;/li&gt;&lt;/ul&gt;As you have probably noticed I got a bit frustrated about the "Cons" and described them in much more details than "Pros" ;) I'm not saying it's a bad product but it certainly requires a lot of experience &amp; knowledge of its features. The most painful part is the lack of decent documentation. We even got ourselves &lt;a href="https://www.packtpub.com/openam-snapshot-9-for-securing-your-web-applications/book" target="_blank" title="Book about OpenAM"&gt;this Book&lt;/a&gt; but it covers only basic topics. &lt;br /&gt;&lt;br /&gt;Be aware that doing anything different than default may require some custom tweaks or not even be possible. If you plan to implement something that is not described in basic tutorials consider other solution first.&lt;br /&gt;&lt;br /&gt;Here are some links to useful resources:&lt;ol&gt;&lt;li&gt;&lt;a href="https://wikis.forgerock.org/confluence/display/openam/Home" target="blank" title="OpenAM wiki page"&gt;OpenAM wiki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://developers.sun.com/identity/reference/techart/app-integration.html" target="_blank" title="Integrating Applications With OpenSSO"&gt;Different deployment options&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://developers.sun.com/identity/reference/techart/troubleshooting.html" target="_blank" title="When something doesn't work"&gt;Troubleshooting OpenAM (recommended!)&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4438421589756780169?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4438421589756780169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4438421589756780169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4438421589756780169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4438421589756780169'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/09/cross-domain-single-sign-on-with-openam.html' title='Cross-domain Single Sign On with OpenAM'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6878376949429779546</id><published>2011-09-13T09:21:00.000-07:00</published><updated>2011-09-13T09:24:44.813-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>STS - Waiting for changelog lock...</title><content type='html'>&lt;strong&gt;Problem&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;When starting TC server that comes with SpringSource Tool Suite (STS) I'm getting the following message and the serer doesn't start: &lt;br /&gt;&lt;i&gt;"Waiting for changelog lock..."&lt;/i&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Solution&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;Delete folder:&lt;br /&gt; $TCSERVER_HOME/spring-insight-instance/insight/data&lt;br /&gt;and retry. That's it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6878376949429779546?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6878376949429779546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6878376949429779546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6878376949429779546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6878376949429779546'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/09/sts-waiting-for-changelog-lock.html' title='STS - Waiting for changelog lock...'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6767932787284661470</id><published>2011-08-12T13:43:00.000-07:00</published><updated>2011-08-19T04:38:38.064-07:00</updated><title type='text'>DziennikLotow.pl</title><content type='html'>This one is mainly for my Polish readers: &lt;br /&gt;&lt;br /&gt;Z wielką przyjemnością pragnę poinformować o powstaniu nowego, darmowego narzędzia do zarządzania swoimi lotami online.&lt;br /&gt;Serwis &lt;a href="http://www.dzienniklotow.pl" title="Internetowy Dziennik Lotów"&gt;Dziennik Lotów&lt;/a&gt; umożliwia tworzenie historii swoich lotów, generowanie interaktywnej mapy połączeń i wiele innych!&lt;br /&gt;&lt;br /&gt;Główne funckjonalności serwisu&lt;ul&gt;&lt;li&gt;Intuicyjne zarządzanie lotami: dodawanie, import, edycja, kasowanie&lt;/li&gt;&lt;li&gt;Interaktywna mapa lotów&lt;/li&gt;&lt;li&gt;Intuicyjny interfajs do szybkiego zapisywania lub importu lotów&lt;/li&gt;&lt;li&gt;Wyczerpujące statystyki zilustrowane wykresami&lt;/li&gt;&lt;li&gt;Baza danych ponad 10000 lotnisk!&lt;/li&gt;&lt;li&gt;Integracja z serwisem Facebook&lt;/li&gt;&lt;li&gt;Wszystko za darmo!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Mamy nadzieję, że nasz serwis zostanie mile przyjęty przez społeczność pasażerów i podróżników.&lt;br /&gt;&lt;br /&gt;Konstruktywne komentarze mile widziane!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6767932787284661470?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6767932787284661470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6767932787284661470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6767932787284661470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6767932787284661470'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/08/dzienniklotowpl.html' title='DziennikLotow.pl'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5286700134613289179</id><published>2011-07-12T03:08:00.000-07:00</published><updated>2011-07-12T05:53:28.908-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP: How to send a POST request with parameters</title><content type='html'>&amp;nbsp;&lt;br/&gt;&lt;br /&gt;The following piece of PHP code shows how to send a POST request to a website passing some requests parameters. It may be useful if you needed to process the page that is normally requested using POST method e.g. form submission result page. &lt;br /&gt;&lt;br /&gt;The request is similar to what your browser would send if you populated a form using POST method on a webpage.&lt;pre class="brush: php"&gt;// Create map with request parameters&lt;br /&gt;$params = array ('surname' =&gt; 'Filip', 'lastname' =&gt; 'Czaja');&lt;br /&gt;&lt;br /&gt;// Build Http query using params&lt;br /&gt;$query = http_build_query ($params);&lt;br /&gt;&lt;br /&gt;// Create Http context details&lt;br /&gt;$contextData = array ( &lt;br /&gt;                'method' =&gt; 'POST',&lt;br /&gt;                'header' =&gt; "Connection: close\r\n".&lt;br /&gt;                            "Content-Length: ".strlen($query)."\r\n",&lt;br /&gt;                'content'=&gt; $query );&lt;br /&gt;&lt;br /&gt;// Create context resource for our request&lt;br /&gt;$context = stream_context_create (array ( 'http' =&gt; $contextData ));&lt;br /&gt;&lt;br /&gt;// Read page rendered as result of your POST request&lt;br /&gt;$result =  file_get_contents (&lt;br /&gt;                  'http://www.sample-post-page.com',  // page url&lt;br /&gt;                  false,&lt;br /&gt;                  $context);&lt;br /&gt;&lt;br /&gt;// Server response is now stored in $result variable so you can process it&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5286700134613289179?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5286700134613289179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5286700134613289179' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5286700134613289179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5286700134613289179'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/07/php-how-to-send-post-request-with.html' title='PHP: How to send a POST request with parameters'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5781068480030552096</id><published>2011-07-11T05:14:00.001-07:00</published><updated>2011-07-12T03:18:38.336-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><title type='text'>Error starting Tc server in STS 2.7</title><content type='html'>So I started learning Spring MVC by example using the &lt;a href="http://blog.springsource.com/2010/07/22/spring-mvc-3-showcase/" target="_blank"&gt;Spring MVC Showcase&lt;/a&gt;. I downloaded STS and cloned the GIT repo to get the local copy of the code. I loaded the Maven project and built it successfully. &lt;br /&gt;&lt;br /&gt;When I tried to start the VMware vFabric tc Server Developer Edition 2.5 I got the following exception:&lt;pre class="brush: bash"&gt;Publishing the configuration...&lt;br /&gt;Error copying file to C:/Program Files/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/backup\catalina.policy: C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\catalina.policy (The system cannot find the path specified)&lt;br /&gt;C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\catalina.policy (The system cannot find the path specified)&lt;br /&gt;Error copying file to C:/Program Files/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/backup\catalina.properties: C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\catalina.properties (The system cannot find the path specified)&lt;br /&gt;C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\catalina.properties (The system cannot find the path specified)&lt;br /&gt;Error copying file to C:/Program Files/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/backup\context.xml: C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\context.xml (The system cannot find the path specified)&lt;br /&gt;C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\context.xml (The system cannot find the path specified)&lt;br /&gt;Error copying file to C:/Program Files/springsource/vfabric-tc-server-developer-2.5.0.RELEASE/spring-insight-instance/backup\jmxremote.access: C:\Program Files\springsource\vfabric-tc-server-developer-2.5.0.RELEASE\spring-insight-instance\conf\jmxremote.access (The system cannot find the path specified)&lt;br /&gt;&lt;br /&gt;(...)&lt;/pre&gt;&lt;h2&gt;Solution&lt;/h2&gt;I'm running 64-bit version of STS on Windows 7. By default programs don't use the Admin account. It was enough to run the STS as Admin (Right click on shortcut -&gt; "Run as Administrator").&lt;br /&gt;That's it! Simple, isn't it? :)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5781068480030552096?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5781068480030552096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5781068480030552096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5781068480030552096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5781068480030552096'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/07/error-starting-tc-server-in-sts-27.html' title='Error starting Tc server in STS 2.7'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4390224880833139778</id><published>2011-07-11T05:12:00.000-07:00</published><updated>2011-07-11T05:33:21.900-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Getting started with Spring MVC and Hibernate</title><content type='html'>Soon I'll be joining a new project using mainly Spring MVC + Hibernate. Since I've never used those technologies and know only their general purpose I need to do some reading.&lt;br /&gt;&lt;br /&gt;Here are the links that were recommended to me:&lt;ul&gt;&lt;li&gt;Spring&lt;ul&gt;&lt;li&gt;&lt;a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/" title="Spring Framework Reference Documentation" target="_blank"&gt;Full Reference Documentation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Spring MVC&lt;ul&gt;&lt;li&gt;&lt;a href="http://blog.springsource.com/2010/07/22/spring-mvc-3-showcase/" title="Spring MVC 3 Showcase by Keith Donald"&gt;Spring MVC 3 Showcase&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://krams915.blogspot.com/2010/12/spring-3-mvc-using-modelattribute-in.html" title="Spring 3 MVC: Using @ModelAttribute in Your JSPs" target="_blank"&gt;Spring MVC + JSP&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Hibernate&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/" title="Hibernate Reference Documentation" target="_blank"&gt;Hibernate Core Reference&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://viralpatel.net/blogs/2010/11/spring3-mvc-hibernate-maven-tutorial-eclipse-example.html" title="Create Spring 3 MVC Hibernate 3 Example using Maven in Eclipse" target="_blank"&gt;Integration of Spring MVC with Hibernate&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;Would you recommend any others?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4390224880833139778?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4390224880833139778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4390224880833139778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4390224880833139778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4390224880833139778'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/07/getting-started-with-spring-mvc-and.html' title='Getting started with Spring MVC and Hibernate'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3508548354421233465</id><published>2011-07-07T12:10:00.000-07:00</published><updated>2011-07-14T14:35:05.994-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>CodeIgniter: Resetting form validation</title><content type='html'>&amp;nbsp;&lt;br&gt;&lt;br /&gt;In one of my php projects I'm using CodeIgniter and its &lt;a href="http://codeigniter.com/user_guide/libraries/form_validation.html" target="_blank"&gt;Form Validation&lt;/a&gt; library. I have validation rules defined in a config file located at:&lt;br /&gt;&lt;br /&gt;system\application\config\form_validation.php&lt;br /&gt;&lt;br /&gt;Sample rules definition for action "item/add" could look as follows:&lt;pre class="brush: php"&gt;$config = array(&lt;br /&gt;   'item/add' =&gt; array(&lt;br /&gt;         array(&lt;br /&gt;            'field' =&gt; 'name',&lt;br /&gt;            'label' =&gt; 'lang:name',&lt;br /&gt;            'rules' =&gt; 'trim|xss_clean|required|max_length[50]'&lt;br /&gt;         ),&lt;br /&gt;         array(&lt;br /&gt;            'field' =&gt; 'type',&lt;br /&gt;            'label' =&gt; 'lang:type',&lt;br /&gt;            'rules' =&gt; 'trim|xss_clean|required|callback_type_check'&lt;br /&gt;         )&lt;br /&gt;   ),&lt;br /&gt;(...)&lt;/pre&gt;As you can see I'm using both built-int and custom rules (callback_type_check). &lt;br /&gt;&lt;br /&gt;This works fine with my 'Add Item' form. &lt;br /&gt;&lt;br /&gt;However, I wanted to reuse the validation logic at other place, where the user can provide multiple items to add at once in a file where each row represents a single item. So I read line by line from the file and want to validate each line. To do that I reset values in $_POST array and perform validation:&lt;pre class="brush:php"&gt;$_POST["name"] = $nameReadFromFile;&lt;br /&gt;$_POST["type"] = $typeReadFromFile;&lt;br /&gt;if ($this-&gt;form_validation-&gt;run('item/add') == FALSE) {&lt;br /&gt;   // handle validation error for current item&lt;br /&gt;}&lt;/pre&gt; The problem is that when validation fails for one item then the error is persisted and all following invocations will fail as well, even if items are valid.&lt;br /&gt;&lt;br /&gt;So, I added a reset function to my controller that resets Form Validation library:&lt;pre class="brush: php"&gt;function _reset_validation()&lt;br /&gt;{&lt;br /&gt;   // Store current rules&lt;br /&gt;   $rules = $this-&gt;form_validation-&gt;_config_rules;&lt;br /&gt; &lt;br /&gt;   // Create new validation object      &lt;br /&gt;   $this-&gt;form_validation = new CI_Form_validation();&lt;br /&gt;&lt;br /&gt;   // Reset rules&lt;br /&gt;   $this-&gt;form_validation-&gt;_config_rules = $rules;&lt;br /&gt;}&lt;/pre&gt;The function simply remembers the rules that were loaded from config file when validation object was created, creates a new  validation object and resets the rules. I call it after each row is validated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3508548354421233465?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3508548354421233465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3508548354421233465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3508548354421233465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3508548354421233465'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/07/codeigniter-resetting-form-validation.html' title='CodeIgniter: Resetting form validation'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3728702491164181955</id><published>2011-06-21T07:22:00.001-07:00</published><updated>2011-07-03T03:13:20.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Asp.Net: Handle empty list in Repeater</title><content type='html'>&lt;br&gt;&lt;br&gt;Repeater in Asp.Net Webforms is a commonly used user control for presenting lists data. It's quite handy but it lacks support for empty lists. &lt;br /&gt;&lt;br /&gt;Below is a simple workaround:&lt;br /&gt;&lt;pre class="brush: html; highlight: [17]"&gt;&lt;asp:Repeater ID="RptrMyList" runat="server"&gt;&lt;br /&gt;   &lt;HeaderTemplate&gt;&lt;br /&gt;      &lt;!-- List header goes here e.g. opening html tag for a table--&gt;&lt;br /&gt;   &lt;/HeaderTemplate&gt;&lt;br /&gt;   &lt;ItemTemplate&gt;&lt;br /&gt;      &lt;!-- Each list item will be displayed using this template --&gt;&lt;br /&gt;   &lt;/ItemTemplate&gt;&lt;br /&gt;   &lt;FooterTemplate&gt;&lt;br /&gt;      &lt;!-- &lt;br /&gt;           List footer goes here e.g. closing html tag for a table&lt;br /&gt;           In addition, we will add here a label to be displayed&lt;br /&gt;           if the list is empty&lt;br /&gt;      --&gt;&lt;br /&gt;      &amp;lt;asp:Label ID="lblEmptyList"&lt;br /&gt;                 runat="server"&lt;br /&gt;                 Text="The list is empty" &lt;br /&gt;                 Visible='&lt;%#bool.Parse((RptrMyList.Items.Count==0).ToString())%&gt;'&amp;gt;&lt;br /&gt;      &amp;lt;/asp:Label&amp;gt;&lt;br /&gt;   &lt;/FooterTemplate&gt;&lt;br /&gt;&lt;/asp:Repeater&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3728702491164181955?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3728702491164181955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3728702491164181955' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3728702491164181955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3728702491164181955'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/aspnet-handle-empty-list-in-repeater.html' title='Asp.Net: Handle empty list in Repeater'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7825373521499133139</id><published>2011-06-16T09:16:00.000-07:00</published><updated>2011-06-28T05:57:00.492-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='wcf'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Asynchronous calls to WCF service from Asp.Net</title><content type='html'>One of the functionalities I'm currently working on is document upload. After the document is uploaded to the server via web interface (Asp.Net Webforms) it is passed to a WCF web service which processes it and returns the response. For the whole time the user interface is locked and the end user waits for upload confirmation. &lt;br /&gt;&lt;br /&gt;This typical synchronous scenario may be very frustrating for the users because they are blocked until the operation completes. The bigger the file to process the worse it gets.&lt;br /&gt;&lt;br /&gt;We decided to change that so an asynchronous upload is used: Once the file is sent to the server the confirmation is immediately displayed to user. The confirmation states only that the upload process was successfully started and the user can continue working with the web app while the file is processed. &lt;br /&gt;&lt;br /&gt;In such scenario you'll also need to display upload results at some stage. There are many possible options for displaying the final operation results (e.g. ajax calls combined with some popups, additional tab etc.). This part is not covered in this post.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Implementation:&lt;/h4&gt;Because the file is processed by a web service I wanted to use a WCF mechanism for asynchronous service calls. The mechanism is quite easy to use. When you generate the service proxy using Visual Studio select to "Generate asynchronous operations" (under "Advanced" options). This will add additional "&lt;OperationName&gt;Async" method for each operation and &lt;OperationName&gt;Completed event. All you need to do is set the handler for Completed event and call the &lt;OpeartionName&gt;Async method using generated client e.g.&lt;br /&gt;&lt;pre class="brush: csharp"&gt;client.UploadDocumentCompleted +=&lt;br /&gt;      new EventHandler&amp;lt;UploadDocumentCompletedEventArgs&amp;gt;(UploadDocumentCallback);&lt;br /&gt;client.UploadDocumentAsync(fileToUpload);&lt;/pre&gt;&lt;br /&gt;In order to make this work on your Aspx page you'll need to add Async="True" to you page directive (see my &lt;a href="http://fczaja.blogspot.com/2011/06/asynchronous-operations-are-not-allowed.html" title="Asynchronous operations are not allowed in this context" target="_blank"&gt;other post&lt;/a&gt; for details).&lt;br /&gt;&lt;br /&gt;Some useful links on how to call a WCF service asynchronously:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms730059.aspx" title="MSDN: How to call WCF Service Operations Asynchronously" target="_blank"&gt;MSDN example on how to call a WCF service asynchronously&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=237" target="_blank" title="Making Asynchronous Calls to WCF Services from ASP.NET"&gt;Async service call from Asp.Net (includes async proxy generation)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h4&gt;Problem:&lt;/h4&gt;So I implemented my async service call in code behind of my Aspx page and then it came out it's no good in my case. I was expecting that after the upload operation of the target WCF service is called my page will return response to the user and the UI will not be blocked anymore. It came out that although the service was called asynchronously the page still waits until the operation completes before sending response to the user.&lt;br /&gt;&lt;br /&gt;I started to search for the reason of such behaviour and stumbled upon &lt;a href="http://msdn.microsoft.com/en-au/magazine/cc163725.aspx" title="MSDN: Asynchronous Pages in ASP.NET 2.0" target="_blank"&gt;this article&lt;/a&gt;. It explains the concept of asynchronous service call from Asp.net pages. It works different than I expected: the async operation must complete before Page's PreRenderComplete event so the page waits for the service call results. It still allows you to boost performance (e.g. by releasing threads to the pool) but not in the way I needed.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Workaround  - starting threads manually:&lt;/h4&gt;Because the async service proxy didn't solve my problem I decided to implement a workaround. When I need to call the upload operation of the service I create a new thread and call the service within that thread. Since the service is called in a new thread the Page doesn't wait for the service operation to complete. &lt;br /&gt;&lt;br /&gt;Sample class for the upload thread:&lt;br /&gt;&lt;pre class="brush: csharp; highlight: [8]"&gt;public class UploadThread&lt;br /&gt;{&lt;br /&gt;    private byte[] _byteArray;&lt;br /&gt;&lt;br /&gt;    public UploadThread(byte[] byteArray)&lt;br /&gt;    {&lt;br /&gt;        _byteArray = byteArray;&lt;br /&gt;        ThreadPool.QueueUserWorkItem(this.Run);&lt;br /&gt;    }&lt;br /&gt;  &lt;br /&gt;    protected void Run(object obj)&lt;br /&gt;    {&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            MyServiceClient client = new MyServiceClient();&lt;br /&gt;            client.UploadDocument(_byteArray);&lt;br /&gt;            client.Close();&lt;br /&gt;        } &lt;br /&gt;        catch (Exception e)&lt;br /&gt;        {&lt;br /&gt;            // Handle exception here&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;You pass the doc content in the constructor and it starts a new thread that invokes the "Run" method. That method calls the service (synchronously in my case). To be more exact the thread that processes this task is taken from the ThreadPool (see line 8).&lt;br /&gt;&lt;br /&gt;To start the thread simply call the following code from the code behind your aspx page:&lt;br /&gt;&lt;pre class="brush: csharp"&gt;new UploadThread(fileToUpload);&lt;/pre&gt; where fileUplaod is an array of bytes representing the doc content.&lt;br /&gt;&lt;br /&gt;One thing to note here is that the new thread will not have direct access to HttpContext of the page. If you needed this in your thread simply pass it in constructor.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Further enhancements:&lt;/h4&gt;Thinking about further enhancements I decided to configure the service operation to be One Way. It means that after the client calls the service it doesn't wait for the service response. This will cause that the upload thread will be released to the pool earlier.&lt;br /&gt;&lt;pre class="brush: csharp"&gt;[OperationContract(IsOneWay = true)]&lt;br /&gt;void UploadDocument(byte[] byteArray);&lt;/pre&gt;&lt;br /&gt;An additional performance enhancement may be using streams instead of byte arrays when passing documents to WCF service. I couldn't implement this in my case because of other limitations but you can find a nice example of this &lt;a href="http://kjellsj.blogspot.com/2007/02/wcf-streaming-upload-files-over-http.html" target="_blank" title="WCF Streaming: Upload files over HTTP"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7825373521499133139?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7825373521499133139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7825373521499133139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7825373521499133139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7825373521499133139'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/asynchronous-calls-to-wcf-service-from.html' title='Asynchronous calls to WCF service from Asp.Net'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5947947946721767749</id><published>2011-06-15T09:07:00.000-07:00</published><updated>2011-06-20T05:57:00.193-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='wcf'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>WCF: How to increase request size limit</title><content type='html'>When you generate a new WCF web service using Visual Studio it will use "wsHttpBinding" with its default configuration. Default endpoint configuration generated for a new web service looks like that:&lt;br /&gt;&lt;pre class="brush: xml"&gt;&amp;lt;endpoint&lt;br /&gt;    address=""&lt;br /&gt;    binding="wsHttpBinding"&lt;br /&gt;    contract="Your.Namespace.IService1" /&amp;gt;&lt;/pre&gt;&lt;br /&gt;This will work well in most cases at development stage. However, before deploying the web service you should consider changing the default settings according to your needs (e.g. change security settings).&lt;br /&gt;&lt;br /&gt;The problem you may often get already at development stage is the following error thrown when you send large amount of data to your service (e.g. a large file):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;font-weight:bold;"&gt;The remote server returned an unexpected response: (400) Bad Request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The request fails because it's size exceeds the limit allowed by your service. The default request size limit is 65536 bytes (i.e. 64KB). In order to change this limit you need to use custom binding configuration. The following example sets the request size limit to 50MB (i.e. 52428800 bytes) using custom binding configuration:&lt;br /&gt;&lt;pre class="brush: xml; highlight: [4, 8, 9, 10, 11];"&gt;&amp;lt;endpoint&lt;br /&gt;    address=""&lt;br /&gt;    binding="wsHttpBinding"&lt;br /&gt;    bindingConfiguration="myCustomConf"&lt;br /&gt;    contract="Your.Namespace.IService1" /&amp;gt;&lt;br /&gt;&amp;lt;bindings&amp;gt;&lt;br /&gt;    &amp;lt;wsHttpBinding&amp;gt;&lt;br /&gt;       &amp;lt;binding name="myCustomConf"&lt;br /&gt;                maxReceivedMessageSize="52428800" &lt;br /&gt;                maxBufferPoolSize="52428800" &amp;gt;&lt;br /&gt;          &lt;readerQuotas maxArrayLength="52428800" /&gt;&lt;br /&gt;          (...)    &lt;br /&gt;       &amp;lt;/binding&amp;gt;&lt;br /&gt;    &amp;lt;/wsHttpBinding&amp;gt;&lt;br /&gt;&amp;lt;/bindings&amp;gt;&lt;/pre&gt;&lt;br /&gt;In example above I used custom binding configuration named 'myCustomConf'. You can read more about wsHttpBinding properties &lt;a href="http://msdn.microsoft.com/en-us/library/ms731299.aspx" title="wsHttpBinding specification" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The code above cares about configuration of your WCF service. However, you'll most likely need to increase the request size limit for Asp.NET runtime as well:&lt;br /&gt;&lt;pre class="brush: xml; highlight: [2];"&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;    &amp;lt;httpRuntime maxRequestLength="51200" /&amp;gt;&lt;br /&gt;    (...)&lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/pre&gt;&lt;br /&gt;Note that Asp.Net maximal request size is set in KB whereas WCF configuration uses bytes! So, in order to allow requests of size 50MB you'll need to set value of 51200KB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5947947946721767749?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5947947946721767749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5947947946721767749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5947947946721767749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5947947946721767749'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/wcf-how-to-increase-allowed-request.html' title='WCF: How to increase request size limit'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2626049358304675807</id><published>2011-06-09T14:10:00.001-07:00</published><updated>2011-06-10T09:16:20.488-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Convert Excel date into timestamp</title><content type='html'>Excel stores dates internally as number of days since January 1, 1900. &lt;br /&gt;For example: &lt;span style="font-style:italic;"&gt;"June 9th, 2011 10:30 AM"&lt;/span&gt; would be stored as "&lt;span style="font-style:italic;"&gt;40703.4375&lt;/span&gt;".&lt;br /&gt;40703 is the number of full days since 01/01/1900 and 0.4375 represents the time (10.5/24 = 0.4375).&lt;br /&gt;&lt;br /&gt;When you process dates read from an Excel spreadsheet (e.g. using &lt;a href="http://phpexcel.codeplex.com/" title="PHPExcel homepage" target="_blank"&gt;PHPExcel&lt;/a&gt;) you often want to convert them into a UNIX timestamp i.e. a number of seconds elapsed since midnight of January 1, 1970 UTC.&lt;br /&gt;&lt;br /&gt;Here is a PHP code to do that:&lt;br /&gt;&lt;pre class="brush: php"&gt;&lt;br /&gt;// Numbers of days between January 1, 1900 and 1970 (including 19 leap years)&lt;br /&gt;define("MIN_DATES_DIFF", 25569);&lt;br /&gt; &lt;br /&gt;// Numbers of second in a day:&lt;br /&gt;define("SEC_IN_DAY", 86400);   &lt;br /&gt;&lt;br /&gt;function excel2timestamp($excelDate)&lt;br /&gt;{&lt;br /&gt;   if ($excelDate &lt;= MIN_DATES_DIFF)&lt;br /&gt;      return 0;&lt;br /&gt;&lt;br /&gt;   return  ($excelDate - MIN_DATES_DIFF) * SEC_IN_DAY;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Although the code above is written in PHP the function should be very similar in any other language e.g. C# or java. If the provided date is earlier than 1/1/1970 then the minimal timestamp value will be returned.&lt;br /&gt;&lt;br /&gt;&lt;h2 style="font-size: 120%"&gt;Alternative solution:&lt;/h2&gt;If you provide the Excel spreadsheet that you later on read from in your app you could add a hidden cell that would calculate the timestamp for you, within the spreadsheet. &lt;br /&gt;Assuming that B2 is the cell that stores your date the formula for calculating timestamp would be:&lt;br /&gt;&lt;pre class="brush: bash"&gt;=(B2-DATE(1970,1,1))*86400&lt;/pre&gt;Now you only need to read the calculated value from the hidden cell.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2626049358304675807?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2626049358304675807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2626049358304675807' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2626049358304675807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2626049358304675807'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/convert-excel-date-into-timestamp.html' title='Convert Excel date into timestamp'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4840567008278064396</id><published>2011-06-08T04:03:00.000-07:00</published><updated>2011-06-10T01:36:41.195-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Localized error messages</title><content type='html'>If you are not a native English speaker it is very likely that you're using a localized operating system. I'm currently working on Windows 7 Enterprise with system language set to Polish.  &lt;br /&gt;&lt;br /&gt;The disadvantage of this is that when I develop any .net code on my machine and an error occurs the error message I'm getting is localized. This is supposed to help me understand the error cause but it's actually doing the exact opposite. After an error message is translated into Polish it's usually totally meaningless to me. This is mainly because most of documentation is written in English and many technical terms are simply hard for direct translation.  &lt;br /&gt;&lt;br /&gt;Also, when I search the web for the error message I got there are obviously much more results for the English version.&lt;br /&gt;&lt;br /&gt;Another downside is that I can't directly share the error message with my foreign team mates as they wouldn't understand it.&lt;br /&gt;&lt;br /&gt;Lately I discovered a web page that can unlocalize the message for me: &lt;a href="http://www.unlocalize.com" title="Unlocalize page" target="_blank"&gt;www.unlocalize.com&lt;/a&gt;. It allows you to search for the message or browse the catalog. It also offers some browser plugins for faster unlocalization.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4840567008278064396?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4840567008278064396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4840567008278064396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4840567008278064396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4840567008278064396'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/localized-error-messages.html' title='Localized error messages'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-1044783009205896508</id><published>2011-06-08T04:02:00.000-07:00</published><updated>2011-06-20T05:57:21.389-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='wcf'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Asynchronous operations are not allowed in this context</title><content type='html'>While calling a WCF service asynchronously from 'Code Behind' of my .Aspx page I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Asynchronous operations are not allowed in this context. Page starting an asynchronous operation has to have the Async attribute set to true and an asynchronous operation can only be started on a page prior to PreRenderComplete event.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2 style="font-size: 120%"&gt;Solution:&lt;/h2&gt;&lt;br /&gt;Add &lt;strong&gt;Async="true"&lt;/strong&gt; to you Page directive i.e.&lt;br /&gt;&lt;code&gt;&amp;lt;%@ Page Language="C#" &lt;b&gt;Async="true"&lt;/b&gt; ...&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can read more about Async attribute &lt;a href="http://msdn.microsoft.com/en-us/library/ydy4x04a.aspx" target="_blank" title="Page directive attributes"&gt;HERE&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;BTW. The original error message was in Polish as I use localized operating system:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Operacje asynchroniczne nie są dozwolone w tym kontekście. Strona rozpoczynająca operację asynchroniczną musi mieć atrybut Async o wartości True. Operację asynchroniczną można uruchomić na stronie tylko przed zdarzeniem PreRenderComplete.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I translated it using the tool descriebd in my &lt;a href="http://fczaja.blogspot.com/2011/06/localized-error-messages.html" title="Localized error messages"&gt;next post&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-1044783009205896508?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/1044783009205896508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=1044783009205896508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1044783009205896508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1044783009205896508'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/06/asynchronous-operations-are-not-allowed.html' title='Asynchronous operations are not allowed in this context'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-9050999834858885708</id><published>2011-05-25T23:50:00.001-07:00</published><updated>2011-05-26T00:28:39.206-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database.</title><content type='html'>I got the following error when trying to use SQL Server Reporting Services manager:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;i&gt;The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database. You must either restore a backup key or delete all encrypted content. (rsReportServerDisabled) Get Online Help&lt;br /&gt;Bad Data. (Exception from HRESULT: 0x80090005)&lt;/i&gt;&lt;/strong&gt;&lt;br /&gt;&lt;h1 style="font-size: 120%;"&gt;Solution:&lt;/h1&gt;You will need to reset your encryption keys. To do that:&lt;ol&gt;&lt;li&gt;Open Reporting Services Configuration Manager and select 'Encryption keys' tab&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click 'Delete' in 'Delete Encrypted Keys' section:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/--JZ7VKwKu5g/Td4AYR_6DQI/AAAAAAAAATA/rv8sbBmWnVI/s1600/blog_rs.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 270px;" src="http://4.bp.blogspot.com/--JZ7VKwKu5g/Td4AYR_6DQI/AAAAAAAAATA/rv8sbBmWnVI/s320/blog_rs.png" border="0" alt="SQL Server Reporting Services Configratuin Manager" id="BLOGGER_PHOTO_ID_5610922602898525442" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You will need to reset all connection strings and db credentials for all your data sources&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-9050999834858885708?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/9050999834858885708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=9050999834858885708' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/9050999834858885708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/9050999834858885708'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/05/report-server-cannot-decrypt-symmetric.html' title='The report server cannot decrypt the symmetric key that is used to access sensitive or encrypted data in a report server database.'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--JZ7VKwKu5g/Td4AYR_6DQI/AAAAAAAAATA/rv8sbBmWnVI/s72-c/blog_rs.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-293359173058975790</id><published>2011-04-08T00:00:00.000-07:00</published><updated>2011-04-21T14:08:17.496-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Dynamic parameter set for a stored procedure</title><content type='html'>Lately I was trying to figure out the best way to pass dynamic number of parameters to a stored procedure. The stored procedure was supposed to do a simple SELECT using parameters provided. The problem was that the set of parameters could change dynamically, depending on app configuration.&lt;br /&gt;&lt;br /&gt;There are several ways to achieve that. My first choice was to use a single parameter that would contain all serialized search terms. The terms would be extracted from that param within my stored procedure. Then, I would build the query dynamically using those terms:&lt;br /&gt;&lt;pre class="brush: sql"&gt;(...)&lt;br /&gt;BEGIN&lt;br /&gt;IF @forename IS NOT NULL&lt;br /&gt;BEGIN&lt;br /&gt; SET @sqlQuery = @ sqlQuery + ' AND forename LIKE ''' + @forename +'%''';&lt;br /&gt;END&lt;br /&gt;END&lt;br /&gt;BEGIN&lt;br /&gt;IF @surname IS NOT NULL&lt;br /&gt;BEGIN&lt;br /&gt; SET @ sqlQuery = sqlQuery + ' AND surname LIKE ''' + @surname +'%''';&lt;br /&gt;END&lt;br /&gt;END&lt;br /&gt;(...)&lt;br /&gt;&lt;/pre&gt;The problem with that approach is that building dynamic sql is generally slow. I was advised to try out an alternative solution: pass all possible search terms as separate parameters and use a static query with null checks:&lt;br /&gt;&lt;pre class="brush: sql"&gt;(...)&lt;br /&gt;AND  (@forename IS NULL OR forename LIKE @forename+'%')&lt;br /&gt;AND  (@surname IS NULL OR surname LIKE @surname+'%')&lt;br /&gt;(...)&lt;br /&gt;&lt;/pre&gt;I wasn't sure which one is better, especially in the case when there are many possible search terms. The first approach uses only specified terms but it takes time to build the query. In second approach the query is static but there are multiple null checks which also takes time (the more possible criteria there is, the worse it gets).&lt;br /&gt;&lt;br /&gt;I did some benchmarking using Sql Server 2008 and a table with 1000 records. It came out that the approach with dynamic sql was slightly faster. I ran my tests around 10 times for each params set and then calculated the average duration (not counting values that were far from avg).&lt;br /&gt;&lt;br /&gt;Example: Below are the results when 2 params were set. Depending on the param values different results number was returned:&lt;br /&gt;&lt;table style="width: 80%; text-align: center; position: relative; top: -40px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Dynamic SQL [ms]&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;b&gt;Static SQL [ms]&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Params returning around 250 results&lt;/b&gt;&lt;/td&gt;&lt;td&gt;217&lt;/td&gt;&lt;td&gt;241&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;td&gt;&lt;b&gt;Params returning around 15 results&lt;/b&gt;&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;24&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;For other combination of params (e.g. 3 other params returning similar number of results) the duration differences were similar. This shows that from performance perspective dynamic sql is better than the second approach, especially if you have many possible search criteria.&lt;br /&gt;&lt;br /&gt;For now i didn't come up with a better approach. Any suggestions?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-293359173058975790?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/293359173058975790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=293359173058975790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/293359173058975790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/293359173058975790'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/04/dynamic-parameter-set-for-stored.html' title='Dynamic parameter set for a stored procedure'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6904214375330791530</id><published>2011-03-14T08:35:00.001-07:00</published><updated>2011-03-17T05:05:53.499-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>SSRS - dataset element as parameter</title><content type='html'>Recently I worked on a SSRS (SQL Server Reporting Services) report that used 2 datasets, each using a different data source (see picture below). The dataset "DataSet2" was using a store procedure to retrieve the desired info. The problem was that as the parameter for this stored procedure I needed to use the value of the field "Field1" from dataset "DataSet1".&lt;br /&gt;&lt;br /&gt;When trying to compile such report I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;i&gt;The expression used for the parameter ‘@param1’ in the dataset ‘@param1’ refers to a field.  Fields cannot be used in query parameter expressions.&lt;/i&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;;width: 376px; height: 108px;" src="http://2.bp.blogspot.com/-bcEdqmwNBYo/TYH2Saw5aRI/AAAAAAAAASA/CC7yvays4CQ/s400/ssrs.png" border="0" alt="2 SSRS datasets with different datasources" id="BLOGGER_PHOTO_ID_5585015809198614802" /&gt;&lt;br /&gt;It came out that such construction is not allowed. I'm guessing it's because you cannot define the order in which the dataset are evaluated. &lt;br /&gt;&lt;br /&gt;To achieve such dependency you need to use a sub-report:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create a new report that will be used as subreport&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Move the dataset "DataSet2" to your new report&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Move all the report content that depends on "DataSet2" to your new report&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Add your new report to the original one as subreport (&lt;a href="http://msdn.microsoft.com/en-us/library/ms160348.aspx" target="_blank" title="How to: Add a Subreport and Parameters (Reporting Services)"&gt;see how&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Define new subreport parameter that will be using value of the "Field1" from "DataSet1"&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Adjust the "DataSet2" in your subreport to use the new subreport param&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6904214375330791530?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6904214375330791530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6904214375330791530' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6904214375330791530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6904214375330791530'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/03/ssrs-dataset-element-as-parameter.html' title='SSRS - dataset element as parameter'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-bcEdqmwNBYo/TYH2Saw5aRI/AAAAAAAAASA/CC7yvays4CQ/s72-c/ssrs.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2893050157514292791</id><published>2011-02-09T04:15:00.000-08:00</published><updated>2011-02-09T04:37:04.315-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Redirect to different domain in .htaccess</title><content type='html'>If you own several domains pointing to the same page and would like to enforce users to always use the same domain you can use apache mod_rewrite by editing .htaccess file. Let's say you own&lt;ul&gt;&lt;li&gt;http://mypage.com&lt;/li&gt;&lt;li&gt;http://my-page.com&lt;/li&gt;&lt;li&gt;http://www.mypage.com&lt;/li&gt;&lt;li&gt;http://www.my-page.com&lt;/li&gt;&lt;/ul&gt; but you want that everybody uses only the http://mypage.com.&lt;br /&gt;Here is how your .htaccess file could look like: &lt;pre class="brush: bash"&gt;RewriteEngine On&lt;br /&gt;rewritecond %{http_host} ^my-page\.com [nc,OR]&lt;br /&gt;rewritecond %{http_host} ^www\.my-page\.com [nc,OR]&lt;br /&gt;rewritecond %{http_host} ^www\.mypage\.com [nc]&lt;br /&gt;rewriterule ^(.*)$ http://mypage.com/$1 [r=301,nc]&lt;/pre&gt;&lt;br /&gt;This may be useful if you want that your page is always associated with the same, unique address.&lt;br /&gt;This mechanism is commonly used by webpage owners who don't want other people to earn on popularity of their pages and still their traffic. They simply buy similar domains (like in our example) and redirect them all to their main domain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2893050157514292791?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2893050157514292791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2893050157514292791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2893050157514292791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2893050157514292791'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/02/redirect-to-different-domain-in.html' title='Redirect to different domain in .htaccess'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-105420269627105146</id><published>2011-02-02T07:55:00.000-08:00</published><updated>2011-02-02T08:13:01.360-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>.NET Reflector not free anymore</title><content type='html'>For those of you who use RedGate's &lt;a href="http://www.red-gate.com/products/dotnet-development/reflector/" title=".NET Reflector homepage"&gt;.NET Reflector&lt;/a&gt; I have a sad news. I just received an email stating that they are changing their policy and .NET reflector won't be a free tool anymore :( &lt;br /&gt;Starting from version 7 it will cost you 35$ for a &lt;a href="http://www.oit.umd.edu/slic/faqs/q22.html" title="What is a Perpetual License?"&gt;perpetual license&lt;/a&gt;. Apparently they can afford working on this for free. You can read more on this decision &lt;a href="http://www.red-gate.com/products/dotnet-development/reflector/announcement-faq?utm_source=simpletalk&amp;utm_medium=email-specialmailing&amp;utm_content=ReflectorFAQ-20110202" "FAQs for the new policy of charging for .NET Reflector"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is .NET Reflector?&lt;/b&gt;&lt;br /&gt;For those of you who doesn't know the tool - it's a very good class browser, analyzer and decompiler for .NET. I use it quite often to decompile dlls if I need to check what's actually in there.&lt;br /&gt;&lt;br /&gt;Can you recommend a similar free tool?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-105420269627105146?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/105420269627105146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=105420269627105146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/105420269627105146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/105420269627105146'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/02/net-reflector-not-free-anymore.html' title='.NET Reflector not free anymore'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3868222772124299399</id><published>2011-01-30T11:59:00.000-08:00</published><updated>2011-02-02T09:29:38.525-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>JQueryUI tabs covering custom menu</title><content type='html'>On one of the websites I've been recently working on I have a custom expandable menu using javascript. On the same page I use &lt;a href="http://jqueryui.com/demos/tabs/" title="JQueryUI tabs demo"&gt;JQueryUI tabs&lt;/a&gt;. The menu is placed directly over the tabs container and its items are implemented as list elements (&amp;lt;LI&amp;gt; tags) styled appropriately. The problem was that when menu was expanded some menu items were covered by the tabs so it looked like that:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;width: 400px; height: 166px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/TUiW0kME84I/AAAAAAAAARs/nAYuE8Yg8w4/s400/jqueryuitabs.png" border="0" alt="Menu items covered by JQueryUI tabs" id="BLOGGER_PHOTO_ID_5568866769055314818" /&gt;&lt;br /&gt;Defining high z-index value for the elements that were covered by the tabs i.e. for the list items didn't help. While searching for correct solution I saw multiple complains about very similar behavior so I decided to post my solution.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;If you encounter a similar problem the solution is quite simple - set the high &lt;a href="http://www.w3schools.com/Css/pr_pos_z-index.asp" title="Z-index css property"&gt;z-index&lt;/a&gt; value not for the menu items but for their &lt;b&gt;parent container&lt;/b&gt;! In my case it was the entire Custom Menu div. If it doesn't work with the direct parent work you way up in HTML DOM to find the right one.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3868222772124299399?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3868222772124299399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3868222772124299399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3868222772124299399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3868222772124299399'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/01/jqueryui-tabs-covering-custom-menu.html' title='JQueryUI tabs covering custom menu'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/TUiW0kME84I/AAAAAAAAARs/nAYuE8Yg8w4/s72-c/jqueryuitabs.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3493046997179254762</id><published>2011-01-26T15:41:00.000-08:00</published><updated>2011-02-06T03:26:27.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>UI Test Automation Best Practices</title><content type='html'>&lt;style&gt;h4 { font-size: 1.3em !important; font-weight: bold  !important}&lt;/style&gt;&lt;br /&gt;Below are some important rules that I learned while working on UI Test Automation tasks that can make your tests more reliable and efficient. They may be especially useful if you are working on a data-driven test with many iterations and its execution time may be very long.&lt;br /&gt;&lt;h4&gt;1. Test scenarios and data ordering&lt;/h4&gt;If you was ever involved in testing you should be familiar with the concept of test scenarios. Each good UI test (automated or not) bases on a scenario. A test scenario should cover all possible situations that need to be tested. In case of test automation performance of the tests depends on how well the scenario is designed. Avoid performing the same operations (logging off/and on, criteria selection etc.) is the key challenge. This usually requires adding some additional logic but the amount of execution time saved is worth it. When working on a scenario for a data-driven test it is also necessary to define the order of the test data to ensure maximum efficiency.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;a name="CascadingDDLExample"&gt;&lt;/a&gt;You need to test a form with 2 cascading drop down lists (i.e. content of the 2nd list depends on the values of the first one). The first list contains countries and the dependant list displays cities in those countries. The form submission should only succeed for 1 specific city for a current user. Here is how your sample test data could look like:&lt;br /&gt;&lt;br /&gt;&lt;table style="text-align: center;"&gt;&lt;thead&gt;&lt;tr&gt;&lt;th width="100px"&gt;user&lt;/th&gt;&lt;th width="100px"&gt;password&lt;/th&gt;&lt;th width="100px"&gt;Country&lt;/th&gt;&lt;th width="100px"&gt;City&lt;/th&gt;&lt;th width="100px"&gt;Success&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;John&lt;/td&gt;&lt;td&gt;bigmacXXL&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;New York&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hans&lt;/td&gt;&lt;td&gt;Bratwurst&lt;/td&gt;&lt;td&gt;Germany&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hans&lt;/td&gt;&lt;td&gt;Bratwurst&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;New York&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;John&lt;/td&gt;&lt;td&gt;bigmacXXL&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;Los Angeles&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hans&lt;/td&gt;&lt;td&gt;Bratwurst&lt;/td&gt;&lt;td&gt;USA&lt;/td&gt;&lt;td&gt;Los Angeles&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;John&lt;/td&gt;&lt;td&gt;bigmacXXL&lt;/td&gt;&lt;td&gt;Germany&lt;/td&gt;&lt;td&gt;Berlin&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;John&lt;/td&gt;&lt;td&gt;bigmacXXL&lt;/td&gt;&lt;td&gt;Germany&lt;/td&gt;&lt;td&gt;Munich&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Hans&lt;/td&gt;&lt;td&gt;Bratwurst&lt;/td&gt;&lt;td&gt;Germany&lt;/td&gt;&lt;td&gt;Munich&lt;/td&gt;&lt;td&gt;0&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;A very basic test would log-in the user, set current combination of country-city, check the result and log off the user. Some optimizations to consider here:&lt;ol&gt;&lt;li&gt;Move the log-off step to the beginning. Perform log-off and log-in only if current user differs from the one from previous test. To ensure maximum efficiency order the data set by username.&lt;/li&gt;&lt;li&gt;Before selecting a country ensure it's not already selected. Also, add additional ordering (by country) to ensure minimum reloads of city ddl.&lt;/li&gt;&lt;li&gt;If a successful city selection redirects to another screen and a failed selection simply display an error message on the same screen consider ordering the test data set by test result so the successful submission happens at the very end of the tests for current city for current user. This can minimize to  number of screen redirections.&lt;/li&gt;&lt;li&gt;...&lt;/li&gt;&lt;/ol&gt;&lt;h4&gt;2. Timeouts&lt;/h4&gt;When searching for an element of waiting for something to happen you need to define timeout values. This is to ensure that your test ends in a reasonable time even if something goes wrong. If a single iteration reaches any of the timeouts it should be mark as failed and test should continue with the next iteration.&lt;br /&gt;&lt;br /&gt;Timeouts values are usually hard to define at the beginning. They depend on many factors like: application type, machine performance, bandwidth etc. Timeouts are usually adjusted after couple first runs on a bigger data-set. &lt;br /&gt;&lt;br /&gt;The default timeout values that you can use when designing your test should be a bit higher than a required minimum. If you see after the first test run that too many iterations failed because of the timeouts increase them slightly and re-run the test. The perfect situation is when 100% tests pass and the whole run doesn't take too long. This may be hard to achieve if the tested app and testing environment are not stable enough.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;3. Check for existence rather than not existence&lt;/h4&gt;Whenever you are thinking about adding a test step that would check if an element doesn't exist consider finding an alternative existence check.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;You want to check that after a button is clicked on a web page the invoked action completes successfully. You can either verify non-existence of an error message or existence of a success confirmation. Both checks require answering some tricky timeout questions (e.g. how long would you wait for the message to appear?). However, verifying non-existence has a serious performance issue - each successful test run would wait for the whole allowed time limit whereas existence check would complete immediately  after success confirmation appears.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;&lt;a name="LocateElements"&gt;&lt;/a&gt;4. Locate elements wisely&lt;/h4&gt;When you create a test there are several ways to locate an element that you need to perform an action on. Some older tools allows you only to move a mouse to a location defined by coordinates e.g. move mouse 100px left anf 50px down from the edge of the screen or browser window. This is not reliable as the coordinates depend on screen resolution, browser window size etc. Current testing tools allow you to locate the desired element using different approaches.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;If you're testing a web page you can identify an element in HTML DOM by tag name or using its attributes (like id, name etc). You can do the same with apps that use XAML (like Silverlight). I don't have experience with testing regular desktop apps but I'm quite sure there is a way to avoid coordinates.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;5. Avoid often locating&lt;/h4&gt;This one is related to the previous point. Even if you use an reliable method to find an element in GUI don't forget about efficiency. Always try to optimize your search for an element to save some precious time. If possible, try to keep in memory the elements that you often interact with to avoid multiple locations of the same element.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Let's reuse the example with cascading drop down lists described &lt;a href="#CascadingDDLExample" title="Go back to example"&gt;above&lt;/a&gt;. You can locate the first one using any reliable technique (e.g. HTML DOM search). The second one will probably be its sibling or they share a parent indirectly. Us this to locate the 2nd DDL rather than searching through entire DOM again. Once you have them in memory execute actions and checks on them without any additional locating necessary.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;6. Avoid pauses&lt;/h4&gt;Fixed length pauses will always affect the performance of your test. A tester may think about using a pause when a test step needs to wait for something to happen before it can execute. An alternative to a pause is a "wait-step". Wait-step waits for a condition to be fulfilled. The advantage of this approach is it will only take as much time as required. Also, it may be more reliable because it may wait longer than you would specify a pause for if something takes longer than usual.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;The tested UI contains an animation that normally takes around 2 seconds, but under some circumstances (e.g. slow machine, low bandwidth) can take a bit longer. When using pauses you'd probably define a 3 seconds long one to have some reserve. This would cause each test run to run 1 second longer than required (under normal circumstances). Also, if animation is unusually slow and 3 second is not enough the following test step may fail.&lt;br /&gt;&lt;br /&gt;You can eliminate those threats by using a wait-step instead. The challenge here is to define an appropriate condition. Let's say our animation ends with displaying an image on the screen. As a test condition you could use image visibility i.e. wait until image is visible.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;7. Hooks in tested apps&lt;/h4&gt;It's a commonly accepted practice to include in the application that is being tested some "hooks" for UI tests. Hooks are pieces of code that help invoking some actions by the testing framework. In theory, none of the hooks should be required to complete the tests. An UI test should do exactly the same what an end user would do e.g. move the moue cursor over the button and click it instead of invoking button's click action in code. In practice, there may be some circumstances when using hooks is justified.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;I've been recently working on UI tests for Silverlight app. One of the screens contained a world map for region selection. The regions were not separate GUI elements so it was hard to select an appropriate one with my UI test. The application itself was recognizing which part of the map was clicked basing on some twisted pixel colour logic. With no hooks available I would have to record the mouse click for each region available using coordinates, which is not good at all (see &lt;a href="#LocateElements"&gt;'Locate elements wisely' point&lt;/a&gt;). In addition, defining a new region in app would require adding new coordinates to test.&lt;br /&gt;&lt;br /&gt;Instead, I asked developers to include an additional method in code that would allow me appropriate selection using a region name. My testing framework supports executing public method on Silverlight objects. This was just 2 lines of code and didn't introduce any threat. The method was actually doing what a mouse click on a region would cause. Also, the region selection wasn't really in scope of my UI tests but just a step required to move to the screen that needed to be tested. &lt;br /&gt;&lt;br /&gt;&lt;h4&gt;8. Dynamic URLs&lt;/h4&gt;If you are working on a web application tests it is useful to make the url of the tested app configurable. This would allow testing different builds (dev, system-test, live, etc) with the same test script. If your test is data-driven you can specify url in data source as you would do with any other test data.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;9. Recovery&lt;/h4&gt;If your tests take a long time to complete (e.g. data-driven tests with many iterations) it's a good practice to implement a recovery mechanism. Remember that it is always possible that the tested app or browser window closes unexpectedly. You don't want to find out that the tests you left running for the whole night stopped after 1h because the app crashed. If your testing framework allows that you can check at the beginning of each iteration if the tested app/webpage is available and restart it if required.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;10. Logging&lt;/h4&gt;Log the results of your tests so you can easily identify reasons for any failures. If you are designing a data driven test it is very useful to have a test summary at the end. Another useful practice is taking browser or desktop screenshots on failure. The screenshots can tell you what went wrong much faster than a complex exception info.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;Example:&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;In the summary part of my data-driven UI tests I always print comma-separated list of IDs of failed tests. After such test completes I can easily copy-paste the ids into my sql query that retrieves test-data and easily re-run only failed test.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;11. Success-oriented tests&lt;/h4&gt;If you are creating a test that will be executed multiple times using different data remember that for a healthy application and test dataset it should have a high pass rate. As a "pass rate" I mean the percentage of passed iteration/runs. Very often, when working with incomplete target application or test data at the beginning my tests have a low pass rate and take very long time to complete. I'm tempted then to update the test so it performs faster under current circumstances. Rather than doing that you should focus on correcting your test dataset or making appropriate developers improve the target app (e.g. by fixing bugs). Of course introducing tweaks to your test is justified if they will also improve performance in case of complete target app and test dataset.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;12. Further Reading&lt;/h4&gt;If you're interested in UI Test Automation you can also see my other posts:&lt;ul&gt;&lt;li&gt;&lt;a href="http://fczaja.blogspot.com/2011/01/what-is-ui-test-atomation-about.html"&gt;What is UI Test Automation about?&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://fczaja.blogspot.com/2011/01/ui-tests-automation-for-silverlight.html" &gt;UI Test Automation tool for Silverlight&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3493046997179254762?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3493046997179254762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3493046997179254762' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3493046997179254762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3493046997179254762'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/01/ui-test-automation-best-practices.html' title='UI Test Automation Best Practices'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-485425843191447950</id><published>2011-01-22T05:03:00.000-08:00</published><updated>2011-01-22T05:54:09.010-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>What is UI Test Automation about?</title><content type='html'>In my &lt;a href="http://fczaja.blogspot.com/2011/01/ui-tests-automation-for-silverlight.html" target="_new" title="UI Tests Automation for Silverlight"&gt;last post&lt;/a&gt; I reviewed a tool for UI Test Automation for Silverlight. For those of you who have never worked on UI tests automation before I decided to explain what it's actually about.&lt;br /&gt;&lt;br /&gt;The goal is to create a set of tests that would simulate user interactions with the interface. It's not only about manual actions like mouse click but also about visual verification of the expected result. Example: if a tester clicks a button and visually checks that it caused a message to appear you'd need to create at least 2 steps for that (covering the click and the message check).&lt;br /&gt;&lt;br /&gt;The tool I described earlier this week offers an intuitive test recorder that integrates with Internet Explorer. It simply follows user interactions with the webpage and records each manual action as a graphical step. The visual verifications steps need to be added manually. This part requires more caution as it may be crucial for test results. A human would immediately spot an error message appearing on the screen. An automated test will only mark this test as failed if it contains appropriate verification step. Obviously the richer the app is the tricker it gets. A lot of visual effects (animation, popups, drag&amp;drops) can cause you a serious headache ;)&lt;br /&gt;&lt;br /&gt;Having a recorder available makes creation of basic tests much easier. Recorded actions are presented as graphical steps in your test project. They can be reordered, reused or combined with other elements (e.g. with if/else logic). More advanced tools offer data binding of the steps without writing any code. Example: let's say your test fills a form and submits it. While recording you provided some data but would like to retest the scenario using different data sets. If you data-bind the test you'll be able to re-run it automatically for each dataset available in source. Available data sources differ between tools but most popular ones are database, excel spreadsheets and xml files.&lt;br /&gt;&lt;br /&gt;Although recorder and graphical steps make it easier to start with basic test I found myself creating most of the tests in code. It is possible to convert each graphical step into a coded step as well. This give you more control over the test. Some functionality is usually only available via code because it is almost impossible to implement all the possibilities offered by a programming language in a graphical tool. I can't imagine creating a complex test relying only on options offered by graphical steps. This may be a serious problem for testers with no programming experience.&lt;br /&gt;&lt;br /&gt;In my next post I'll try to provide some tips &amp; tricks that I learned while working on UI Test Automation.&lt;br /&gt;&lt;br /&gt;PS. The provided examples are usually related to web applications. This is because I mainly work  on such apps. However, all the rules mentioned above also apply to desktop applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-485425843191447950?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/485425843191447950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=485425843191447950' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/485425843191447950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/485425843191447950'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/01/what-is-ui-test-atomation-about.html' title='What is UI Test Automation about?'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-569634272881083485</id><published>2011-01-19T13:27:00.000-08:00</published><updated>2011-01-22T04:13:46.175-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>UI Tests Automation for Silverlight</title><content type='html'>I'm currently working on a UI test automation task for Silverlight interface. There are not many tools available for that so we decided to evaluate the most popular one i.e. &lt;a href="http://www.telerik.com/automated-testing-tools.aspx" title="WebUI Test Studio homepage" target="_new"&gt;Telerik's WebUI Test Studio&lt;/a&gt;. I chose Developer Edition as it easily integrates with Visual Studio. For testers, managers etc there is also a standalone version available.&lt;br /&gt;&lt;br /&gt;After a few days of playing with it I can already say it's quite powerful. Once you get familiar with it and learn a few tricks you can easily develop complex UI tests that would save your team a lot of time. Below is a short summary of its pros &amp; cons:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Pros:&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Supports Silverlight testing&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Intuitive test recorder&lt;/li&gt;&lt;br /&gt;&lt;li&gt;For basic tests no coding required (also including logic: if/else, loops)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Integrated data access (spreadsheets, csv, database, ...) for data driven tests&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Multiple video tutorials available&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Full integration with Telerik's RAD controls&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Strong community&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Fast support&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;b&gt;Cons:&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Documentation doesn't cover the entire functionality&lt;/li&gt;&lt;br /&gt;&lt;li&gt;More complex tests require more coding than recording&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Support for Silverlight available but yet limited (some additional coding required e.g. when veryfing the content of a ComboBox)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Dev &amp; QA Editions differ slightly in available functionality (although I'm not sure that's really a con)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;All in all, I would recommend it. I don't think there is really an alternative on the market. Is there?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-569634272881083485?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/569634272881083485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=569634272881083485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/569634272881083485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/569634272881083485'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2011/01/ui-tests-automation-for-silverlight.html' title='UI Tests Automation for Silverlight'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6692031845241639719</id><published>2010-11-04T02:25:00.000-07:00</published><updated>2010-11-16T14:26:29.646-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Visual Studio: Adding and using resource files</title><content type='html'>Sometimes you may want to include some existing files in your Visual Studio Project as project resources e.g. some text files that you would like to read from. This makes much easier to read their content from your code without manually working with streams etc. You can do that by following a few simple steps:&lt;ol&gt;&lt;li&gt;&lt;b&gt;Open Resource editor&lt;/b&gt;&lt;br /&gt;To do that right click on your project and choose "Properties" option. When the properties screen opens choose "Resources" tab: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7so4C0dWMLE/TOMBVjRAWaI/AAAAAAAAAQo/PB2z3h0Vd1E/s1600/1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 168px;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/TOMBVjRAWaI/AAAAAAAAAQo/PB2z3h0Vd1E/s400/1.png" border="0" alt="Visual Studio: Project Reources Tab" id="BLOGGER_PHOTO_ID_5540273436351289762" /&gt;&lt;/a&gt;If you haven't defined any resources before you'll be asked if you'd like to create a default Resource file for that project: &lt;span style="font-style:italic;"&gt;"This project does not contain a default resource file. Click here to create one"&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Creat resource file&lt;/b&gt;&lt;br /&gt;When you confirm to do that the default resource file is created (see file marked on picture below) you can now choose to add a new file as resource: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7so4C0dWMLE/TOMBzAjssJI/AAAAAAAAAQw/5Ap-lgM2ol0/s1600/2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 186px;" src="http://2.bp.blogspot.com/_7so4C0dWMLE/TOMBzAjssJI/AAAAAAAAAQw/5Ap-lgM2ol0/s400/2.png" border="0" alt="Visual Studio: Adding file as resource" id="BLOGGER_PHOTO_ID_5540273942430527634" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Add file as resource&lt;/b&gt;&lt;br /&gt;After you select the file it's available as resource. In my sample project I selected text file "test.txt". It also appeared in solution explorer (marked with red): &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7so4C0dWMLE/TOMCOC7mIyI/AAAAAAAAAQ4/wXJ0kKEt_LM/s1600/3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 175px;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/TOMCOC7mIyI/AAAAAAAAAQ4/wXJ0kKEt_LM/s400/3.png" border="0" alt="Visual Studio: File declared as resource" id="BLOGGER_PHOTO_ID_5540274406924100386" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Access file content from code&lt;/b&gt;&lt;br /&gt;After you save all the changes you made to resources you can access the file content from your code simply by using its name: &lt;pre class="brush: csharp"&gt;using SampleProject.Properties;&lt;br /&gt;...&lt;br /&gt;string fileContent = Resources.test;&lt;/pre&gt;&lt;br /&gt;You have to admit it's much easier then manually opening and reading from files.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6692031845241639719?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6692031845241639719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6692031845241639719' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6692031845241639719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6692031845241639719'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/11/visual-studio-adding-and-using-resource.html' title='Visual Studio: Adding and using resource files'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/TOMBVjRAWaI/AAAAAAAAAQo/PB2z3h0Vd1E/s72-c/1.png' height='72' width='72'/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-726925775758892655</id><published>2010-10-18T07:35:00.000-07:00</published><updated>2010-10-19T06:58:45.618-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>The report server has encountered a configuration error. (rsServerConfigurationError)</title><content type='html'>After installing Sql Server 2008  with Reporting Services on Windows XP I needed to do some initial configuration to make it work locally:&lt;ol&gt;&lt;li&gt;&lt;b&gt;Open Configuration Manager&lt;/b&gt;&lt;br/&gt;Go to: Microsoft Sql Server 2008 &gt; Configuration Tools &gt; Reporting Services Configuration Manager&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Configure Web Service Url&lt;/b&gt;&lt;br/&gt;I used the default values suggested by configuration manager. To do that simply choose 'Apply'. Result: &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7so4C0dWMLE/TL1Fam0rZEI/AAAAAAAAAPc/htn8eSvRq28/s1600/rs-wsurl.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 209px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/TL1Fam0rZEI/AAAAAAAAAPc/htn8eSvRq28/s400/rs-wsurl.png" border="0" alt="Reporting Services Configuration Manager - Web Service Url" id="BLOGGER_PHOTO_ID_5529652240881247298" /&gt;&lt;/a&gt; &lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Configure Report Manager Url&lt;/b&gt;&lt;br/&gt;Again, I used the default values:&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7so4C0dWMLE/TL1F_1FqplI/AAAAAAAAAPk/Sf5bMvG6XgQ/s1600/rs-rmurl.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 203px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/TL1F_1FqplI/AAAAAAAAAPk/Sf5bMvG6XgQ/s400/rs-rmurl.png" border="0" alt="Reporting Services Configuration Manager - Report Manager Url" id="BLOGGER_PHOTO_ID_5529652880365758034" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;After doing that I tried to to access: http://localhost/Reports&lt;br/&gt;In my case I got displayed the following error:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;The report server has encountered a configuration error. (rsServerConfigurationError)&lt;/span&gt;&lt;/span&gt;. &lt;br /&gt;To get rid of this I needed to perform to 2 extra steps: &lt;ol&gt;&lt;li&gt;&lt;b&gt;Define database to use&lt;/b&gt;&lt;br/&gt;I created a new database for Reporting Services using the same configuration manager: &lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7so4C0dWMLE/TL1HqtF5ROI/AAAAAAAAAPs/FrkrzJgDUgQ/s1600/rs-db.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 219px;" src="http://3.bp.blogspot.com/_7so4C0dWMLE/TL1HqtF5ROI/AAAAAAAAAPs/FrkrzJgDUgQ/s400/rs-db.png" border="0" alt="Reporting Services Configuration Manager - Database" id="BLOGGER_PHOTO_ID_5529654716465235170" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Set folder security&lt;/b&gt;&lt;br/&gt;Now check which account is used by reporting services: &lt;br /&gt;&lt;br/&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7so4C0dWMLE/TL1KlRs1wYI/AAAAAAAAAP8/sRFEKTX2x6c/s1600/rs-account.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 231px;" src="http://2.bp.blogspot.com/_7so4C0dWMLE/TL1KlRs1wYI/AAAAAAAAAP8/sRFEKTX2x6c/s400/rs-account.png" border="0" alt="Reporting Services Configuration Manager - Account" id="BLOGGER_PHOTO_ID_5529657921747927426" /&gt;&lt;/a&gt;...and grant access for that user to the Reporting Services installation folder. In my case it is:&lt;br/&gt;C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services&lt;/li&gt;&lt;/ol&gt;After doing that I can access my Report Manager with no problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-726925775758892655?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/726925775758892655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=726925775758892655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/726925775758892655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/726925775758892655'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/10/report-server-has-encountered.html' title='The report server has encountered a configuration error. (rsServerConfigurationError)'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/TL1Fam0rZEI/AAAAAAAAAPc/htn8eSvRq28/s72-c/rs-wsurl.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-416461608703509336</id><published>2010-10-06T00:30:00.001-07:00</published><updated>2011-06-20T05:57:58.436-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='wcf'/><title type='text'>WCF Endpoint ABC</title><content type='html'>AS you probably know WCF stands for Windows Communication Foundation. If you want to make your WCF service accessible by clients you need to define at least one endpoint that would be used for communication. Each endpoint definition needs to answer 3 basic questions:&lt;ol&gt;&lt;li&gt;Where?&lt;/li&gt;&lt;li&gt;What?&lt;/li&gt;&lt;li&gt;How?&lt;/li&gt;&lt;/ol&gt;To properly answer these 3 questions you need to specify so called "&lt;b&gt;Endpoint ABC&lt;/b&gt;":&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;A - Address (Where?)&lt;/b&gt;&lt;br /&gt;This is the network address of your service saying where to find it. WCF support several address types/protocols. E.g. if you are creating a regular SOAP web service you would use an HTTP or HTTPS address. The type of the address depends directly on the binding type (see next definition).&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;B - Binding (How?)&lt;/b&gt;&lt;br /&gt;Binding defines how clients can communicate with our service. It specifies the transport protocol that should be used (HTTP, TCP, ...), &lt;a href="http://msdn.microsoft.com/en-us/library/ms730294.aspx" title="WCF Web Services Protocols" target="_blank"&gt;web service protocol&lt;/a&gt;, encoding, security settins etc.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;C - Contract (What?)&lt;/b&gt;&lt;br /&gt;Contract defines what functionality your service exposes. This is simply the interface that your WCF service implements.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;In practice this could look as follows (SOAP web service endpoint):&lt;pre class="brush: xml"&gt;&lt;endpoint name="myEndpoint"                            address="http://myservername/myservice" binding="wsHttpBinding" contract="MyNamespace.IMyservice" &gt;&lt;/endpoint&gt;&lt;/pre&gt;Simple as ABC, isn't it? :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-416461608703509336?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/416461608703509336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=416461608703509336' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/416461608703509336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/416461608703509336'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/10/wcf-endpoint-abc.html' title='WCF Endpoint ABC'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-1585743120701787470</id><published>2010-09-24T05:32:00.000-07:00</published><updated>2010-09-24T06:05:55.128-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><title type='text'>Javascript parseInt() gotcha</title><content type='html'>Recently I was working on JS code that should convert strings (2 chars) into numbers from range 0-9 as presented below:&lt;br /&gt;&lt;br /&gt;'00' =&gt; 0&lt;br /&gt;'01' =&gt; 1&lt;br /&gt;'02' =&gt; 2&lt;br /&gt;'03' =&gt; 3&lt;br /&gt;'04' =&gt; 4&lt;br /&gt;'05' =&gt; 5&lt;br /&gt;'06' =&gt; 6&lt;br /&gt;'07' =&gt; 7&lt;br /&gt;'08' =&gt; 8&lt;br /&gt;'09' =&gt; 9&lt;br /&gt;&lt;br /&gt;I used &lt;b&gt;parseInt()&lt;/b&gt; function to achieve that. I was surprised to discover that the variables values where a bit different than I expected:&lt;pre class="brush: js; highlight: [9, 10];"&gt;var i = parseInt('00'); // i = 0&lt;br /&gt;i = parseInt('01'); // i = 1&lt;br /&gt;i = parseInt('02'); // i = 2&lt;br /&gt;i = parseInt('03'); // i = 3&lt;br /&gt;i = parseInt('04'); // i = 4&lt;br /&gt;i = parseInt('05'); // i = 5&lt;br /&gt;i = parseInt('06'); // i = 6&lt;br /&gt;i = parseInt('07'); // i = 7&lt;br /&gt;i = parseInt('08'); // i = 0&lt;br /&gt;i = parseInt('09'); // i = 0&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;br /&gt;As you can see parseInt('08') and parseInt('09') returned 0. This is because this function treats strings beginning with '0' as octal numbers and strings beginning with '0x' as hexadecimal numbers. To fix that you can provide the radix to use as a second parameter (optional):&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: js;"&gt;var i = parseInt('00', 10); // i = 0&lt;br /&gt;i = parseInt('01', 10); // i = 1&lt;br /&gt;i = parseInt('02', 10); // i = 2&lt;br /&gt;i = parseInt('03', 10); // i = 3&lt;br /&gt;i = parseInt('04', 10); // i = 4&lt;br /&gt;i = parseInt('05', 10); // i = 5&lt;br /&gt;i = parseInt('06', 10); // i = 6&lt;br /&gt;i = parseInt('07', 10); // i = 7&lt;br /&gt;i = parseInt('08', 10); // i = 8&lt;br /&gt;i = parseInt('09', 10); // i = 9&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-1585743120701787470?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/1585743120701787470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=1585743120701787470' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1585743120701787470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1585743120701787470'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/09/javascript-parseint-gotcha.html' title='Javascript parseInt() gotcha'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-164235992916533620</id><published>2010-08-30T03:51:00.000-07:00</published><updated>2010-09-08T02:01:12.036-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><title type='text'>Multilingual database design approaches</title><content type='html'>A while ago I needed to create a database that would support storing data in multiple languages e.g. translated product descriptions for customer from different countries. When I started wondering how to reflect this in database schema it came out the answer is not straightforward. While searching Web for the one-and-only best practice i stumbled upon many opinions and approaches. Here are some most popular ones:&lt;ol&gt;&lt;li&gt;&lt;br /&gt;&lt;b&gt;Additional columns&lt;/b&gt;&lt;br/&gt;This is the simplest one, it's basically about creating an additional column for each text that needs to be translated e.g.&lt;pre class="brush: sql"&gt;CREATE TABLE app_product (&lt;br /&gt;  Id Int IDENTITY NOT NULL,&lt;br /&gt;  Description_en Text,&lt;br /&gt;  Description_pl Text,&lt;br /&gt;  PRIMARY KEY (Id)&lt;br /&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Advantages:&lt;/u&gt;&lt;br /&gt;+ simplicity&lt;br /&gt;+ easy querying (no joins required)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Disadvantages:&lt;/u&gt;&lt;br /&gt;- adding new language support requires schema changes for each table with multilingual content&lt;br /&gt;- if not all translations are required (e.g. at some places default language should always be used) it may cause redundant data or empty db fields.&lt;br /&gt;- hard to maintain&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Single translations table&lt;/b&gt;&lt;br/&gt;&lt;br /&gt;Approach with single translation table seems to be the cleanest one from database structure perspective. You store all texts that need to be translated in a single translation table:&lt;br /&gt;&lt;pre class="brush: sql"&gt;CREATE TABLE ref_language (&lt;br /&gt;  Code Char(2)NOT NULL,&lt;br /&gt;  Name Varchar(20) NOT NULL,&lt;br /&gt;  PRIMARY KEY (Code)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE app_translation (&lt;br /&gt; Id Int IDENTITY NOT NULL,&lt;br /&gt; PRIMARY KEY (Id)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE app_translation_entry (&lt;br /&gt; TranslationId Int NOT NULL,&lt;br /&gt; LanguageCode Char(2) NOT NULL,&lt;br /&gt; Text Text NOT NULL,&lt;br /&gt; FOREIGN KEY (TranslationId) REFERENCES app_translation(Id),&lt;br /&gt; FOREIGN KEY (LanguageCode) REFERENCES ref_language(Code)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE app_product (&lt;br /&gt; Id Int IDENTITY NOT NULL,&lt;br /&gt; Description Int NOT NULL,&lt;br /&gt;        PRIMARY KEY (Id),&lt;br /&gt; FOREIGN KEY (Description) REFERENCES app_translation(Id)&lt;br /&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Advantages:&lt;/u&gt;&lt;br /&gt;+ adding new languages doesn't require schema changes&lt;br /&gt;+ seems like clean, relational approach&lt;br /&gt;+ all translations in one place (some may say it's a disadvantage because less readable/maintainable)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Disadvantages:&lt;/u&gt;&lt;br /&gt;- complex querying (multiple joins required to retrieve correct product description)&lt;br /&gt;- overcomplicated&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;b&gt;Additional translation table for each table with multilingual content&lt;/b&gt;&lt;br/&gt;&lt;br /&gt;For each table that stores information that may need to be translated an additional table is created. The original table stores only language insensitive data and the new one all translated info:&lt;pre class="brush: sql"&gt;CREATE TABLE ref_language (&lt;br /&gt;  Code Char(2)NOT NULL,&lt;br /&gt;  Name Varchar(20) NOT NULL,&lt;br /&gt;  PRIMARY KEY (Code)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE app_product (&lt;br /&gt; Id Int IDENTITY NOT NULL,&lt;br /&gt; PRIMARY KEY (Id)&lt;br /&gt;);&lt;br /&gt;&lt;br /&gt;CREATE TABLE app_product_translation (&lt;br /&gt; ProductId Int NOT NULL,&lt;br /&gt; LanguageCode Char(2) NOT NULL,&lt;br /&gt; Description Text NOT NULL,&lt;br /&gt; FOREIGN KEY (ProductId) REFERENCES app_product(Id),&lt;br /&gt; FOREIGN KEY (LanguageCode) REFERENCES ref_language(Code)&lt;br /&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Advantages:&lt;/u&gt;&lt;br /&gt;+ adding new languages doesn't require schema changes&lt;br /&gt;+ relatively simple querying (1 join required)&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Disadvantages:&lt;/u&gt;&lt;br /&gt;- may double the amount of tables&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;The 3 examples presented above give us an idea how different approaches may be used here. These are of course not all possible options, just the most popular ones. You can always modify them e.g. by introducing some additional views that would save you writing complex joins direct from your code. &lt;br /&gt;The solution you choose depends mostly on your project requirements. If you need simplicity and are sure that the number of supported languages is small and fixed you could go with option 1. If you require bit more flexibility and can afford a simple join when querying for multilingual data option 3 would be a possible solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-164235992916533620?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/164235992916533620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=164235992916533620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/164235992916533620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/164235992916533620'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/08/multilanguage-database-design.html' title='Multilingual database design approaches'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6524031944243121279</id><published>2010-08-27T02:24:00.000-07:00</published><updated>2010-08-27T11:07:38.691-07:00</updated><title type='text'>Using custom fonts on your website</title><content type='html'>Sometimes you want to make your website look better by changing fonts of some elements e.g. headings. When you set element's font you should choose one of so-called 'web safe fonts'. Web safe fonts are the ones that are by default installed on most of the computers, regardless operating system e.g. Arial, Verdana, Times New Roman etc. To increase the chances that the content of your website is displayed to each visitor using fonts you chose you can specify more than one font in your CSS:&lt;pre class="brush: css"&gt;&lt;br /&gt;.someclass {&lt;br /&gt;  font-family: Arial, Verdana;&lt;br /&gt;}&lt;/pre&gt;In this case if the first font is not installed on client's machine the next one will be used.&lt;br /&gt;&lt;br /&gt;&lt;b style="font-size: 120%"&gt;Custom fonts&lt;/b&gt;&lt;br /&gt;In some cases you may need to use a custom font that is most likely not installed on most of the client machines. Common example for such situation is when you receive a design from your client who insists you implement their website exactly like it was designed.&lt;br /&gt;&lt;br /&gt;One of possible solutions would be using graphics for all page elements that were designed to use custom fonts. Disadvantages of this approach are: &lt;ul&gt;&lt;li&gt;This is not SEO friendly&lt;/li&gt;&lt;li&gt;Not suitable for dynamic text&lt;/li&gt;&lt;/ul&gt;The other option is to place the the font file on your webserver and using CSS point the browser to the font location:&lt;pre class="brush: css"&gt;&lt;br /&gt;@font-face {&lt;br /&gt;  font-family: custom_font; &lt;br /&gt; &lt;br /&gt;  /* for IE */&lt;br /&gt;  src: url(fonts/custom_font.eot);   &lt;br /&gt;&lt;br /&gt;  /* non-IE */&lt;br /&gt;  src: local("Unique font name"), url(fonts/custom_font.ttf) format("truetype");  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* now you can use your custom font like any other */&lt;br /&gt;.someclass {&lt;br /&gt;  font-family: custom_font;&lt;br /&gt;}&lt;/pre&gt;Please not that browser needs to download the font first so it may slow down initial loading of your page. For IE you'll need the .eot version of the font. You can convert your ttf font into eot using this &lt;a href="http://www.kirsle.net/wizards/ttf2eot.cgi" title="Free TTF to EOT converter" taarget="_blank"&gt;free converter&lt;/a&gt;. Each browser should only download one of the files.&lt;br /&gt;&lt;br /&gt;If possible always try to use web safe fonts which can also produce great results.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6524031944243121279?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6524031944243121279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6524031944243121279' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6524031944243121279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6524031944243121279'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/08/using-custom-fonts-on-your-website.html' title='Using custom fonts on your website'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6215052538904664758</id><published>2010-06-29T07:26:00.001-07:00</published><updated>2010-07-26T04:49:11.709-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>PowerShell in Windows 7</title><content type='html'>In my current project we are using &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx" title="Windows PowerShell" target="_blank"&gt;PowerShell&lt;/a&gt; in our build &amp;amp; deployment scripts. It's a useful tool offering a greatly extended set of commands comparing to regular cmd. On Windows XP I needed to install this manually but in Windows 7 PowerShell comes with the system.&lt;br /&gt;&lt;br /&gt;Recently I changed my machine and system (XP -&amp;gt; W7) and discovered that the scripts don't work anymore. The reason for that was the insufficient execution policy set in PowerShell by default. I changed it to the one previously used on my old machine and... no effect!&lt;br /&gt;&lt;br /&gt;I started to think that the problem may not be caused by execution policy (although the error message was quite obvious) but then I found out there are actually 2 PowerShell versions installed: 64 a 32 bit. You can find them under "Windows PowerShell" folder in Accessories:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 238px; height: 97px;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/TE1105HhR-I/AAAAAAAAAPM/z99HTJBM1Gs/s400/powershell.png" border="0" alt="2 versions of PowerShell in Windows 7" id="BLOGGER_PHOTO_ID_5498180271635253218" /&gt;&lt;br /&gt;&lt;br /&gt;Changing execution policy for both versions solved my problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6215052538904664758?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6215052538904664758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6215052538904664758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6215052538904664758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6215052538904664758'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/06/powershell-in-windows-7.html' title='PowerShell in Windows 7'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/TE1105HhR-I/AAAAAAAAAPM/z99HTJBM1Gs/s72-c/powershell.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-1055917986820008162</id><published>2010-06-25T01:22:00.000-07:00</published><updated>2010-06-27T03:15:00.486-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Mysql foreign keys don't work</title><content type='html'>Recently I've been working on a small PHP+MySql project. I designed a database schema that contains multiple tables, some of them with &lt;b&gt;FOREIGN KEY&lt;/b&gt; constraint defined. After my model was ready I exported it to SQL format and created the actual database from the script. I was very surprised discovering that the defined foreign keys constraints don't work i.e. I could add any data to the constrained columns regardless the content of referenced table.&lt;br /&gt;&lt;br /&gt;&lt;b style="font-size: 120%;"&gt;Solution:&lt;/b&gt;&lt;br /&gt;It came out that the problem was caused by the default ENGINE used by my MySql database i.e. MyISAM. Foreign key constraint is not implemented in its current version (&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-foreign-keys.html" target="blank" title="Mysql foreign key constraint"&gt;read more here&lt;/a&gt;). To enable the FOREIGN KEY constraint I decided to use &lt;b&gt;InnoDb ENGINE&lt;/b&gt;. I forced that by adding engine selection for each table:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: sql; highlight: 6;"&gt;&lt;br /&gt;CREATE  TABLE IF NOT EXISTS `my_table` (&lt;br /&gt;  `id` INT NOT NULL ,&lt;br /&gt;  `other_table_id` INT NOT NULL ,&lt;br /&gt;  PRIMARY KEY (`id`) ,&lt;br /&gt;  FOREIGN KEY (`other_table_id` ) REFERENCES `other_table` (`id`)&lt;br /&gt;) ENGINE = InnoDB;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-1055917986820008162?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/1055917986820008162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=1055917986820008162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1055917986820008162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1055917986820008162'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/06/mysql-foreign-keys-dont-work.html' title='Mysql foreign keys don&apos;t work'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7595799407025247947</id><published>2010-04-12T03:25:00.000-07:00</published><updated>2010-04-12T05:49:22.399-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Is tag a branch?</title><content type='html'>I've been working with version control software for couple years now. At the beginning it was CVS, now it's mainly SVN. I thought I had a  good general understanding of such terms as branch, revision or tag.&lt;br /&gt;&lt;br /&gt;Recently I was very surprised when I was asked to commit my changes into a TAG. &lt;br /&gt;So I asked:&lt;br /&gt;- You mean branch?&lt;br /&gt;- No, Tag!&lt;br /&gt;- ???&lt;br /&gt;&lt;br /&gt;I always thought that a tag is just a 'marker' that marks a point in a branch and it doesn't branch the code. So what does committing to a tag actually mean? How to commit something to a tag without affecting the branch it was created for? &lt;br /&gt;&lt;br /&gt;The answer for those questions can be found in &lt;a href="http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html" target="_blank" title="TortoiseSVN documentation: Branching / Tagging"&gt;TortoiseSVN documentation&lt;/a&gt; explaining what tags and branches actually are from technical perspective:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;em&gt;Tags are typically used to create a static snapshot of the project at a particular stage. As such they not normally used for development - that's what branches are for, which is the reason we recommended the /trunk /branches /tags repository structure in the first place. Working on a tag revision is not a good idea, but because your local files are not write protected there is nothing to stop you doing this by mistake. However, if you try to commit to a path in the repository which contains /tags/, TortoiseSVN will warn you.&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;Although Tortoise actually allows you to commit into a tag you should never do that! It actually branches the code and makes the code repository messy! After such operations there are actual branches under tags structure. I can't imagine what merging such branched tag with its original branch would actually mean?&lt;br /&gt;&lt;br /&gt;But what if you need to add changes to the tagged release (a.g. patches)? Here is the proper way to solve such problem:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;em&gt;It may be that you need to make further changes to a release which you have already tagged. The correct way to handle this is to create a new branch from the tag first and commit the branch. Do your Changes on this branch and then create a new tag from this new branch, e.g. Version_1.0.1.&lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;Now when I understand the problem better I'm just wondering why TortoiseSVN (other tools probably too) allows such operation (with warning). Are there any situations where it would be necessary?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7595799407025247947?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7595799407025247947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7595799407025247947' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7595799407025247947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7595799407025247947'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/04/is-tag-branch.html' title='Is tag a branch?'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4259607035608076519</id><published>2010-04-01T02:16:00.000-07:00</published><updated>2010-04-01T05:57:29.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Line numbers in stack trace</title><content type='html'>When a .net application fails and an exception is thrown you may want to find the reason for such behavior. To identify the code that caused the exception you can examine the stack trace included in your exception. However, the stack trace may not contain line number, which makes the failing code harder to find, especially if you have a lot of code in single methods (not recommended).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;To ensure that line numbers are included in stack trace you need to deploy .pdb files together with your dll-s. &lt;a href="http://msdn.microsoft.com/en-us/library/ms241903.aspx" target="_blank" alt="PDB files description"&gt;Program database (pdb)&lt;/a&gt; files are created when you build your app in Debug mode. You need to copy them to the same directory where dll-s are placed. &lt;br /&gt;&lt;br /&gt;Tip: GAC dll-s are stored under folder structure described &lt;a href="http://fczaja.blogspot.com/2008/12/how-to-get-assembyl-file-from-gac.html" target="_blank" alt="Previous post: How to get assembly file from GAC?"&gt;here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4259607035608076519?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4259607035608076519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4259607035608076519' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4259607035608076519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4259607035608076519'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/04/line-numbers-in-stack-trace.html' title='Line numbers in stack trace'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-1737917890250922457</id><published>2010-02-15T05:14:00.000-08:00</published><updated>2010-02-15T05:15:12.622-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Microsoft Second Shot returns</title><content type='html'>Those of you who are thinking about getting Microsoft certification may be interested in special offer called Second Shot. It allows you to take a free resit if you happen to fail the exam. Could it be any easier?&lt;br /&gt;&lt;br /&gt;The offer is available from January 13, 2010 and it ends on June 30, 2010 so it may be an additional motivation for you.&lt;br /&gt;&lt;br /&gt;More details here: &lt;a href="http://www.prometric.com/microsoft/ss_mcp.htm"&gt;http://www.prometric.com/microsoft/ss_mcp.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-1737917890250922457?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/1737917890250922457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=1737917890250922457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1737917890250922457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1737917890250922457'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/02/microsoft-second-shot-returns.html' title='Microsoft Second Shot returns'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5897405844644289332</id><published>2010-01-12T06:22:00.000-08:00</published><updated>2010-01-12T06:23:11.609-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>CSS trick for IE</title><content type='html'>I've just learned a very simple CSS trick that allows you assigning different attribute values if the page is rendered by IE. All you need to do is use '&lt;strong&gt;#&lt;/strong&gt;' and '&lt;strong&gt;_&lt;/strong&gt;' prefixes:&lt;br /&gt;&lt;pre class="brush: css"&gt;&lt;br /&gt;.myTestClass{&lt;br /&gt;   width: 5px;  /* value used by all other browsers */&lt;br /&gt;   #width: 7px; /* value used by IE */&lt;br /&gt;   _width: 9px; /* value used by IE6 and older */&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I don't think it's a part of the CSS official specification but it works ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5897405844644289332?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5897405844644289332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5897405844644289332' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5897405844644289332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5897405844644289332'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2010/01/css-trick-for-ie.html' title='CSS trick for IE'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8197703447412106046</id><published>2009-12-01T07:48:00.000-08:00</published><updated>2009-12-01T08:02:40.314-08:00</updated><title type='text'>Expression Web SuperPreview</title><content type='html'>Recently I've discovered a relatively new product from Microsoft for web development (Asp.Net or PHP) called Expression Web. The product itself looks more or less like Visual Studio with less options available ;)&lt;br /&gt;&lt;br /&gt;The functionality that caught my eye was SuperPreview option. It allows developers to render the pages your working on using chosen browser engine within your development area. Available are all popular versions of IE and any other browser installed on your machine. It actually uses the real IE6 engine instead of any emulators. It also allows you to display the same page on multiple layers, each rendered using different engine. This allows you to find the differences much quicker.&lt;br /&gt;&lt;br /&gt;You can read about this cool option &lt;a href="http://expression.microsoft.com/en-us/dd565874.aspx" target="_blank" title="Article about SuperPreview"&gt;in this article&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;There is also a separate version of SuperPreview which doesn't require Expression Web but it only supports IE. You can &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677&amp;amp;displaylang=en" target="_blank" title="SuperPreview for IE download page"&gt;download it from here&lt;/a&gt;. Here is how my blog looks like when IE6 &amp;amp; IE8 overlay:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_7so4C0dWMLE/SxU977L2oNI/AAAAAAAAANg/QpWW8M34hoo/s1600/sp2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 322px; height: 400px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/SxU977L2oNI/AAAAAAAAANg/QpWW8M34hoo/s400/sp2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5410298627064504530" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;PS. I just wish that SuperPreview functionality was available in VS2010. The Expression Web seems as a new product only from marketing perspective. Its designer/developer area offers exactly the same options as in VS (code/design/split views), except the SuperPreview of course. Since VS already supports ASP.NET development, it would be logical to simply add PHP support to it instead of releasing a new product. When I asked tech guys from Microsoft they couldn't really explain this, which I think proves they think the same :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8197703447412106046?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8197703447412106046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8197703447412106046' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8197703447412106046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8197703447412106046'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/12/expression-web-superpreview.html' title='Expression Web SuperPreview'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/SxU977L2oNI/AAAAAAAAANg/QpWW8M34hoo/s72-c/sp2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7250438710554771610</id><published>2009-11-30T02:05:00.000-08:00</published><updated>2009-11-30T02:09:11.162-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP on Windows</title><content type='html'>According to Microsoft 70% of PHP developers are working on Windows, although the majority of PHP services are hosted on Linux (in my case this was actually true so maybe they are right about that). This leads to situation where most of the apps are being developed in an environment different than they are deployed to. This is obviously not the best way to that. &lt;br /&gt;&lt;br /&gt;Microsoft claims there are 2 main reasons for that:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Installation process&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;Although there are many packages available for one-click installation of all necessary PHP components on Windows (e.g. &lt;a href="http://www.wampserver.com/en/" target="_blank" title="WampServer homepage"&gt;WAMP&lt;/a&gt;) they are all configured to work with &lt;a href="http://httpd.apache.org/" target="_blank" title="Apache HTTP Server project homepage"&gt;Apache&lt;/a&gt; server. Although IIS is recommended server to be used for PHP on Windows (to get most of what the system offers), developers are afraid of configuring/using it with their apps.&lt;br /&gt;&lt;br /&gt;Microsoft decided to change it by introducing &lt;a href="http://www.microsoft.com/web/downloads/platform.aspx" title="Web Platform Installer description and download"&gt;Web Platform Installer&lt;/a&gt;. This free tool will download, install and configure all components required to run web applications on your machine for you (both Asp.net and PHP). It also offers installation of popular OpenSource scripts/engines (e.g. for blogs, galleries, etc.)  so you can start development faster.&lt;br /&gt;&lt;br /&gt;This seems to be a step in a good direction and makes configuration of PHP and IIS easy like never before.  However, there are still some some weak points in my opinion:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Developer is limited to one version of PHP (what if you need to install older version?)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The installer supports mainly Microsoft technologies e.g. drivers/extensions for MsSql. I haven't seen any option for installation of MySql extensions.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Some very popular php apps are missing e.g. phpBB (probably MS promotes an equivalent supported by them)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt; &lt;br /&gt;&lt;li&gt;&lt;strong&gt;Performance&lt;/strong&gt;&lt;/li&gt;&lt;br /&gt;This one is actually more important than installation. Microsoft admits that PHP did not performed well on older versions of IIS. However, together with introduction of IIS7 most of the performance issues should have been resolved. The key aspects for improving performance are:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Microsoft contributed to creation process of PHP build for Windows e.g. rewritten parts of the code to make better use of the system&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Implementation of &lt;a href="http://www.fastcgi.com" target="_blank" title="FastCGI homepage"&gt;FastCGI&lt;/a&gt; for Windows (can by installed with Web Platform Installer)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.iis.net/expand/WinCacheForPHP" target="_blank" title="Windows Cache Extension for PHP : The Official Microsoft IIS Site"&gt;Windows Cache Extensions&lt;/a&gt; for accelerating PHP&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Ability to work in a cloud (thanks to &lt;a href="http://www.microsoft.com/windowsazure/" target="_blank" title="Windows Azure Platform"&gt;Windows Azure&lt;/a&gt;)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;I asked the speaker about any reliable benchmarks comparing performance of PHP in Windows vs. Linux environment that would prove that it is worth considering deployment of my PHP apps to Windows. Unfortunately this strongly depends on the app itself so there is no simple answer to that question.&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;Soo, who's convinced?&lt;br /&gt;&lt;br /&gt;BTW. When I asked the Microsoft guy about examples of large, commercial PHP applications deployed on Windows and performing well he answered that there are some but he's not allowed to name them ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7250438710554771610?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7250438710554771610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7250438710554771610' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7250438710554771610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7250438710554771610'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/11/php-on-windows.html' title='PHP on Windows'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7153812614242382521</id><published>2009-11-17T08:59:00.000-08:00</published><updated>2009-11-18T00:45:35.744-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Code comments generators</title><content type='html'>Writing comments for your code is not the most interesting part of development. I admit that sometimes it's hard to follow company/project guidelines for code comments in a restrictive way, mostly because the lack of time (I know that's a pure excuse).&lt;br /&gt;&lt;br /&gt;Some time ago somebody recommended me to use &lt;a href="http://submain.com/products/ghostdoc.aspx" target="_blank" title="GhostDoc tool for generating comments in Visual Studio"&gt;GhostDoc&lt;/a&gt;, which would take care of that for me. Tried it today - simple Shift+Ctrl+D combination and your code is fully commented. Some of the generated comments were even quite descriptive. After quick investigation I found out that all the descriptive comments were copied from base classes (e.g. when method overrides the one in the base class, implements interface member etc). For the new members the comments were generated basing on their names.  &lt;br /&gt;&lt;br /&gt;In my opinion this could be a handy tool if used correctly i.e. only for generating draft versions that would be corrected/extended manually. However, there is a great danger that most of generated comments would be left unchanged (especially if time is limited). Although it would cause all possible &lt;a href="http://code.msdn.microsoft.com/sourceanalysis" target="_blank" title="StyleCop homepage"&gt;StyleCop&lt;/a&gt; rules to pass it would still affect the code quality. I will uninstall it right now because I don't want to be tempted when a deadline is close ;) We don't really need comments that don't introduce any new knowledge.  &lt;br /&gt;&lt;br /&gt;I'm wondering if there are any positive aspects of using them that I didn't think of? Are there any developers who admit that they're using them and can give some examples proving that this can be very useful?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7153812614242382521?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7153812614242382521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7153812614242382521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7153812614242382521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7153812614242382521'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/11/code-comments-generators.html' title='Code comments generators'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6561712649580913018</id><published>2009-10-30T04:34:00.000-07:00</published><updated>2009-11-02T01:50:58.851-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Asp.Net: Validating data type using CompareValidator</title><content type='html'>CompareValidator, as the name says, is mainly used to compare value of specified control against value of another control, constant, etc. You can specify the operator that can be used in comparison so you are not limited to checking equality. The following example demonstrates simple comparison of int values (max &amp;gt; min):&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&lt;br /&gt;Min: &amp;lt;asp:TextBox ID="TextBox1" runat="server"/&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;Max: &amp;lt;asp:TextBox ID="TextBox2" runat="server"/&amp;gt;&lt;br /&gt;     &amp;lt;asp:CompareValidator&lt;br /&gt;            ID="CompareValidator1"&lt;br /&gt;            runat="server" &lt;br /&gt;            ControlToCompare="TextBox1"&lt;br /&gt;            ControlToValidate="TextBox2" &lt;br /&gt;            ErrorMessage="Max must be greater than Min"&lt;br /&gt;            Operator="GreaterThan" &lt;br /&gt;            Type="Integer"&amp;gt;&lt;br /&gt;     &amp;lt;/asp:CompareValidator&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;     &amp;lt;asp:Button ID="Button1" runat="server" Text="Submit" /&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which results in:&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;width: 392px; height: 86px;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/Su6mQCZz5rI/AAAAAAAAAMQ/45Kij_SWo1Y/s400/comp1.png" border="0" alt="Results of comparison against different control" id="BLOGGER_PHOTO_ID_5399435797717051058" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 120%"&gt;&lt;b&gt;Validating data type&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Except the basic functionality CompareValidator supports validation of data types. Except the regular operators (Equal, GreaterThan, GreaterThanEqual, LessThan &amp; LessThanEqual) CompareValidator supports an additional one called &lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;"DataTypeCheck"&lt;/span&gt;&lt;/span&gt;. It can be used to validate the type of provided value against the type specified in validator. The supported types are: String, Integer, Double, Currency &amp; Date. The validator mainly checks the format of the provided value. In case of Date type it also checks the range (e.g. to ensure that 31st of April is not valid). I like this feature, especially that I've already seen a quite complex custom validator written to do exact this task. Example:&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&lt;br /&gt;Date: &amp;lt;asp:TextBox ID="TextBox1" runat="server" /&amp;gt;&lt;br /&gt;      &amp;lt;asp:CompareValidator &lt;br /&gt;               ID="CompareValidator1"&lt;br /&gt;               runat="server"&lt;br /&gt;               ControlToValidate="TextBox1"&lt;br /&gt;               ErrorMessage="Invalid date"&lt;br /&gt;               Type="Date"&lt;br /&gt;               Operator="DataTypeCheck"/&amp;gt;&lt;br /&gt;      &amp;lt;asp:Button runat="server" Text="Submit"/&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Which results in:&lt;img style="display:block; margin:0px auto 10px; text-align:center;width: 287px; height: 64px;" src="http://2.bp.blogspot.com/_7so4C0dWMLE/Su6mQDGhkOI/AAAAAAAAAMY/b9CJzfMKCWk/s400/comp2.PNG" border="0" alt="Invalid date provided" id="BLOGGER_PHOTO_ID_5399435797904593122" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 120%"&gt;&lt;b&gt;Using right format&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;When validating the type Asp.Net uses the current Page Culture. If you'd like only to accept inputs in specified format you can set the Page Culture property manually. The same date "11.30.2009" will be validated differently for UK and US Cultures (in UK "DD.MM.YYYY" is used, in US it's "MM.DD.YYYY"):&lt;br /&gt;&lt;br /&gt;UK:&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;%@ Page ... Culture="en-GB"%&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;width: 287px; height: 64px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/Su6mQdWL1BI/AAAAAAAAAMg/LCORdzNo12M/s400/en-uk.PNG" border="0" alt="Date invalid for Culture en-GB" id="BLOGGER_PHOTO_ID_5399435804949599250" /&gt;&lt;br /&gt;&lt;br /&gt;US:&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;%@ Page ... Culture="en-US"%&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:width: 202px; height: 64px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/Su6mQmtqaBI/AAAAAAAAAMo/Ov-WudZZc6Y/s400/en-us.PNG" border="0" alt="Date valid for Culture en-US" id="BLOGGER_PHOTO_ID_5399435807463991314" /&gt;&lt;br /&gt;&lt;br /&gt;You can also set the page Culture from your code by overriding InitializeCulture() method:&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;&lt;br /&gt;protected override void InitializeCulture()&lt;br /&gt;{&lt;br /&gt;    Culture = "en-US";&lt;br /&gt;    Thread.CurrentThread.CurrentCulture =&lt;br /&gt;                     CultureInfo.CreateSpecificCulture("en-US");            &lt;br /&gt;            &lt;br /&gt;    base.InitializeCulture();&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6561712649580913018?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6561712649580913018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6561712649580913018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6561712649580913018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6561712649580913018'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/10/aspnet-validating-data-type-using.html' title='Asp.Net: Validating data type using CompareValidator'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/Su6mQCZz5rI/AAAAAAAAAMQ/45Kij_SWo1Y/s72-c/comp1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6633857978570137872</id><published>2009-10-19T05:14:00.001-07:00</published><updated>2009-10-19T05:42:30.816-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM</title><content type='html'>I've deployed a WCF service to IIS with security mode set to "Message":&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&lt;binding ... &gt;&lt;br /&gt;   &lt;security mode="Message"&gt;&lt;br /&gt;      &lt;message ... /&gt;&lt;br /&gt;   &lt;/security&gt;&lt;br /&gt;&lt;/binding&gt;&lt;/pre&gt;&lt;br /&gt;When I tried to called it from my client app I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I googled out that this is caused by security settings of the service virtual directory. I configured it to use Integrated Windows Authentication rather than allowing Anonymous access. I did so because I wanted to restrict the access to my service.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;It came out that using Anonymous Access in this particular case (WCF service in Message security mode) doesn't mean that anyone is allowed to use the service. The authentication is performed by WCF rather than IIS, but it still takes place. &lt;br /&gt;&lt;br /&gt;Answer found &lt;a href="http://social.msdn.microsoft.com/forums/en-US/wcf/thread/267a5412-7e2e-48d0-b628-5039cd07e6e1/" target="_blank" title="Why to use Anonymous Access for WCF services in Message security mode"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6633857978570137872?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6633857978570137872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6633857978570137872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6633857978570137872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6633857978570137872'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/10/http-request-is-unauthorized-with.html' title='The HTTP request is unauthorized with client authentication scheme &apos;Anonymous&apos;. The authentication header received from the server was &apos;Negotiate,NTLM'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-525215325022427776</id><published>2009-07-28T02:43:00.000-07:00</published><updated>2009-08-02T02:39:20.553-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>ASP.NET: How to trigger the client-side validation manually</title><content type='html'>By default the client-side validation is triggered when submitting forms using buttons. However, sometimes you may want to trigger client-side validation on your ASP page manually from custom Javascript. You can achieve that by calling Javascript validation functions provided by the ASP.Net framework directly from your custom code.&lt;br /&gt;&lt;br /&gt;The following page source example displays a &lt;code&gt;TextBox&lt;/code&gt; and its validation controls (&lt;code&gt;RequiredFieldValidator &amp; ValidationSummary&lt;/code&gt;). The validation controls have the same &lt;code&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.basevalidator.validationgroup.aspx" title="ValidationGroup property info by MSDN" target="_blank"&gt;ValidationGroup&lt;/a&gt;&lt;/code&gt; defined, which allows us to validate different page elements independently. The page displays also a &lt;code&gt;DIV&lt;/code&gt; element that will cause the Validation action when clicked:&lt;pre class="brush: html;"&gt;&amp;lt;!-- Validation Summary --&amp;gt;&lt;br /&gt;&amp;lt;asp:ValidationSummary ID="ValidationSummary1" runat="server"&lt;br /&gt;            HeaderText="Validation errors:" ValidationGroup="Group1"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- TextBox and its validator --&amp;gt;&lt;br /&gt;Name: &amp;lt;asp:TextBox ID="TextBox1" runat="server" /&amp;gt;&lt;br /&gt;&amp;lt;asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" &lt;br /&gt;            ErrorMessage="Name is required" Text="*"&lt;br /&gt;            ControlToValidate="TextBox1" ValidationGroup="Group1"&amp;gt; /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Div that causes client-side validation when clicked --&amp;gt;&lt;br /&gt;&amp;lt;div onclick="Validate();" &amp;gt;Validate Form&amp;lt;/div&amp;gt;&lt;/pre&gt;&lt;br /&gt;The code above should should produce smth like that when validation is triggered:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 236px; height: 118px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/SnTK_eIhS9I/AAAAAAAAALo/100oGVpI-Is/s400/validation.GIF" border="0" alt="Validation form" id="BLOGGER_PHOTO_ID_5365136247874472914" /&gt;&lt;br /&gt;Now let's take a look at the custom JS code that triggers the validation. There are couple ways to do that:&lt;ul&gt;&lt;li&gt;Easy way - works for all validators from the same ValidationGroup:&lt;pre class="brush: js;"&gt;function Validate()&lt;br /&gt;{&lt;br /&gt;    // If no group name provided the whole page gets validated&lt;br /&gt;    Page_ClientValidate('Group1');&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;If you want to validate only specific validators:&lt;pre class="brush: js;"&gt;function Validate()&lt;br /&gt;{&lt;br /&gt;    // Get the specific validator element&lt;br /&gt;    var validator = document.getElementById('RequiredFieldValidator1');&lt;br /&gt;&lt;br /&gt;    // Validate chosen validator&lt;br /&gt;    ValidatorValidate(validator);&lt;br /&gt;&lt;br /&gt;    // Update validation summary for chosen validation group&lt;br /&gt;    ValidatorUpdateIsValid();&lt;br /&gt;    ValidationSummaryOnSubmit(validationGroup);    &lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Useful links:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa479045.aspx" title="ASP.NET Validation in Depth" target="_blank"&gt;ASP.NET Validation in Depth (by MSDN)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://codeclimber.net.nz/archive/2008/05/14/how-to-manage-asp.net-validation-from-javascript-with-jquery.aspx" title="Example on how to manage validation with jQuery" target="_blank"&gt;Example on how to manage validation with jQuery&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-525215325022427776?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/525215325022427776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=525215325022427776' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/525215325022427776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/525215325022427776'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/07/aspnet-how-to-trigger-client-side.html' title='ASP.NET: How to trigger the client-side validation manually'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/SnTK_eIhS9I/AAAAAAAAALo/100oGVpI-Is/s72-c/validation.GIF' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8370287422428958003</id><published>2009-07-03T04:00:00.000-07:00</published><updated>2009-07-15T01:59:26.704-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>C# - Array to Dictionary</title><content type='html'>Recently I needed to convert an Array of &lt;code&gt;DictionaryEntry&amp;lt;object,object&amp;gt;&lt;/code&gt; items into a &lt;code&gt;Dictionary&amp;lt;string,string&amp;gt;&lt;/code&gt; object. Here is simple code using &lt;a href="http://msdn.microsoft.com/en-us/netframework/aa904594.aspx" target="_blank" title="Language Integrated Query"&gt;LINQ&lt;/a&gt; and &lt;code&gt;ToDictionary&lt;/code&gt; method for doing that with 1 command:&lt;pre class="brush: csharp;"&gt;DictionaryEntry&amp;lt;object,object&amp;gt;[] props = GetSomeProperties();&lt;br /&gt;Dictionary&amp;lt;string,string&amp;gt; dict = &lt;br /&gt;   props.ToDictionary(de =&gt; (de.Key != null)   ? de.Key.ToString() :&lt;br /&gt;                                                 string.Empty);&lt;br /&gt;                      de =&gt; (de.Value != null) ? de.Value.ToString() :&lt;br /&gt;                                                 string.Empty);&lt;/pre&gt;&lt;br /&gt;Isn't that simple? :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8370287422428958003?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8370287422428958003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8370287422428958003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8370287422428958003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8370287422428958003'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/07/c-array-to-dictionary.html' title='C# - Array to Dictionary'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7790222850725959006</id><published>2009-06-26T03:05:00.001-07:00</published><updated>2009-10-08T05:26:34.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>Windows could not start the IIS Admin Service on Local Computer</title><content type='html'>Sometime when starting IIS I'm getting the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Windows could not start the IIS Admin Service on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code -2147417831.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Event log is not much help:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;The IIS Admin Service service terminated with service-specific error 2147549465 (0x80010119).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Kill the inetinfo.exe process and start IIS again - that's it :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7790222850725959006?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7790222850725959006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7790222850725959006' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7790222850725959006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7790222850725959006'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/06/windows-could-not-start-iis-admin.html' title='Windows could not start the IIS Admin Service on Local Computer'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8633773301194274495</id><published>2009-06-18T04:16:00.001-07:00</published><updated>2009-07-14T14:26:36.526-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Handling exceptions from multiple UpdatePanels</title><content type='html'>In one of my previous posts I've already mentioned how to handle exceptions that occur within UpdatePanel on client side (&lt;a href="http://fczaja.blogspot.com/2009/02/handle-exception-in-updatepanel.html" target="_blank" title="Handling exceptions in UpdatePanel &amp; UpdatePanelAnimationExtender"&gt;see post&lt;/a&gt;). However, this did not cover server side error handling nor multiple UpdatePanels on one page.&lt;br /&gt;&lt;br /&gt;Sometimes you may want to have on your ASP page multiple update panels or a large one containing multiple controls. The problem is that when an error occurs on update action you may find hard to localize the actual control that generated the error causing event. This may be required in some situations e.g. to display error message next to the control responsible for the exception.&lt;br /&gt;&lt;br /&gt;Let's take a look at some code. Here is a sample ASP page with a ScriptManager and 2 UpdatePanels. Each of the panels contains a button and a label for displaying errors:&lt;pre class="brush: xml;"&gt;&amp;lt;asp:ScriptManager ID="ScriptManager1" runat="server" &lt;br /&gt;            onasyncpostbackerror="ScriptManager1_AsyncPostBackError"&amp;gt;&lt;br /&gt;&amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- First Update Panel --&amp;gt;&lt;br /&gt;&amp;lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&amp;gt;&lt;br /&gt; &amp;lt;ContentTemplate&amp;gt;&lt;br /&gt;  &amp;lt;asp:Button ID="B1" runat="server" Text="B1" onclick="B1_Click" /&amp;gt;&lt;br /&gt;  &amp;lt;asp:Label ID="Label1" runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt; &amp;lt;/ContentTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:UpdatePanel&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Second Update Panel --&amp;gt;&lt;br /&gt;&amp;lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&amp;gt;&lt;br /&gt; &amp;lt;ContentTemplate&amp;gt;&lt;br /&gt;  &amp;lt;asp:Button ID="B2" runat="server" Text="B2" onclick="B2_Click" /&amp;gt;&lt;br /&gt;  &amp;lt;asp:Label ID="Label2" runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt; &amp;lt;/ContentTemplate&amp;gt;&lt;br /&gt;&amp;lt;/asp:UpdatePanel&amp;gt;&lt;/pre&gt;As you can see the ScriptManager has an error handler defined (line 2) and both buttons have click handlers assigned. The error labels are empty on entry.&lt;br /&gt;Here is Code Behind for that page:&lt;pre class="brush: csharp;"&gt;  protected void B1_Click(object sender, EventArgs e)&lt;br /&gt;  {&lt;br /&gt;    throw new Exception("Exception from Button1");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void B2_Click(object sender, EventArgs e)&lt;br /&gt;  {&lt;br /&gt;    throw new Exception("Exception from Button2");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  protected void ScriptManager1_AsyncPostBackError(&lt;br /&gt;                      object sender, AsyncPostBackErrorEventArgs e)&lt;br /&gt;  {&lt;br /&gt;    // Do smth with the error e.g log it&lt;br /&gt;  }&lt;/pre&gt;Clicking on any of the buttons will cause an Exception. The exception message varies for each button. In my example the error handler for script manager does nothing but you can do whatever you need with the caught error e.g. log it.&lt;br /&gt;&lt;br /&gt;Now, let's handle the error on client side. The following code will register client side error handler, which will display a message from the thrown exception next to appropriate button:&lt;pre class="brush: js;"&gt;// Register EndRequest handler for ScriptManager&lt;br /&gt;  Sys.WebForms.PageRequestManager.getInstance().&lt;br /&gt;                                    add_endRequest(EndRequestHandler);&lt;br /&gt;&lt;br /&gt;  function EndRequestHandler(sender, args)&lt;br /&gt;  {&lt;br /&gt;    // If there is an unhandled error&lt;br /&gt;    if (args.get_error() != undefined)&lt;br /&gt;    {&lt;br /&gt;      // Get id of the control that fired the error-causing action&lt;br /&gt;      var senderControlId = sender._postBackSettings.sourceElement.id;&lt;br /&gt;            &lt;br /&gt;      // Get Label next to the source control&lt;br /&gt;      var errorLabel = document.getElementById(senderControlId).&lt;br /&gt;                                              nextSibling.nextSibling;&lt;br /&gt;            &lt;br /&gt;      // Set error message in appropriate control.&lt;br /&gt;      // You may want to remove the user-unfriendly part of the&lt;br /&gt;      // message that was added by Script Manager&lt;br /&gt;      errorLabel.innerHTML = &lt;br /&gt;        args.get_error().message.replace&lt;br /&gt;        ('Sys.WebForms.PageRequestManagerServerErrorException: ', '');&lt;br /&gt;&lt;br /&gt;      // Mark the error as handled&lt;br /&gt;      args.set_errorHandled(true);&lt;br /&gt;    }&lt;br /&gt;  }&lt;/pre&gt;&lt;br /&gt;That's it. To make it work just place the JS code on your ASP page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8633773301194274495?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8633773301194274495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8633773301194274495' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8633773301194274495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8633773301194274495'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/06/handling-exceptions-from-multiple.html' title='Handling exceptions from multiple UpdatePanels'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-916483034433450372</id><published>2009-06-11T05:28:00.000-07:00</published><updated>2009-12-20T13:18:06.162-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Centering Adsense Ads on blogger pages</title><content type='html'>Recently I decided to add &lt;a href="https://www.google.com/adsense/" target="_blank"&gt;Adsense&lt;/a&gt; ads on my blogger page to earn zillions of $$$$. Blogger dashboard offers easy to use Adsense integration (Monetize tab). It helps you to create Adsense account and automatically places the ads on your blog page. The problem is that it doesn't offer much control over the way the ads are displayed, soe you can't e.g. center your ad, align it in to the right etc. To achieve that you'll need to create the ad manually through the Adsense page (see &lt;a href="https://www.google.com/adsense/support/?sourceid=aso&amp;subid=ww-ww-et-asui&amp;medium=link" target="_blank"&gt;Adsense help&lt;/a&gt;) and then paste the code into your blogger template:&lt;ol&gt;&lt;li&gt;From blogger dashboard got to: &lt;span style="font-weight:bold;"&gt;&amp;nbsp;Layout &gt; Edit Html&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Check the "Expand Widget Templates" checkbox to see the detailed view of your template&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Find the place in the template where you'd like to place the ad.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create a &lt;code&gt;&lt;b&gt;div&lt;/b&gt;&lt;/code&gt; element that would store your ad and style it as much as you want (center it, add padding, etc.)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Paste the code generated by Adsense into the &lt;code&gt;&lt;b&gt;div&lt;/b&gt;&lt;/code&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Change the following characters in the generated Adsense code:&lt;ul&gt;&lt;br /&gt;&lt;li&gt;   &lt;b&gt;&amp;lt;&lt;/b&gt;   change to   &lt;b&gt;&amp;amp;lt;&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;   &lt;b&gt;&amp;gt;&lt;/b&gt;   change to   &lt;b&gt;&amp;amp;lt;&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;   &lt;b&gt;&amp;quot;&lt;/b&gt;   change to   &lt;b&gt;&amp;amp;quot;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;so the code for your Ad looks somehow like this (changed lines: 1, 2, 3, 5 &amp; 8):&lt;pre class="brush: js; auto-links: false;"&gt;&amp;lt;script type='text/javascript'&amp;gt;&amp;amp;lt;!--&lt;br /&gt;google_ad_client = &amp;amp;quot;pub-5***************&amp;amp;quot;;&lt;br /&gt;google_ad_host = &amp;amp;quot;pub-1***************&amp;amp;quot;;&lt;br /&gt;/* name of your ad */&lt;br /&gt;google_ad_slot = &amp;amp;quot;7*********&amp;amp;quot;;&lt;br /&gt;google_ad_width = 160;&lt;br /&gt;google_ad_height = 600;&lt;br /&gt;//--&amp;amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script src='http://some_google_linkto_js_file'&lt;br /&gt;        type='text/javascript'&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;It is &lt;b&gt;important&lt;/b&gt; that you do this, otherwise you'll get a JS error '&lt;span style="font-weight:bold; font-style:italic;"&gt;pub is undefined&lt;/span&gt;' (or something similar) on the page and the ad will not be displayed.&lt;/li&gt;&lt;/ol&gt;Solution and automatic converter found  &lt;a href="http://www.hacktrix.com/adsense-code-converter-for-blogger-blogs" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-916483034433450372?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/916483034433450372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/916483034433450372'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/06/centering-adsense-ads-on-blogger-pages.html' title='Centering Adsense Ads on blogger pages'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8268883112009687541</id><published>2009-05-29T03:12:00.001-07:00</published><updated>2009-06-16T13:46:36.383-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>JS: Display tooltip over page element</title><content type='html'>To display a tooltip over a page element:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Create hidden tooltip element:&lt;br /&gt;&lt;pre class="brush: js;"&gt;&lt;div id="tooltip" style="position: absolute; display: none"&gt;&lt;br /&gt;   Some tooltip info&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Create JS scripts for showing/hiding tooltip:&lt;br /&gt;&lt;pre class="brush: js;"&gt;function show()&lt;br /&gt;{&lt;br /&gt;var tooltip = document.getElementById('tooltip');&lt;br /&gt;tooltip.style.top = event.clientY;&lt;br /&gt;tooltip.style.left = event.clientX + 10;&lt;br /&gt;tooltip.style.display = 'block';&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function hide(){&lt;br /&gt;var tooltip = document.getElementById('tooltip');&lt;br /&gt;tooltip.style.display = 'none';&lt;br /&gt;}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Set Javascript events for the chosen page element:&lt;br /&gt;&lt;pre class="brush: html;"&gt;&lt;div onmouseover="show();" onmouseout="hide();"&gt;&lt;br /&gt;   Element content&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;Tested on IE7.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8268883112009687541?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8268883112009687541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8268883112009687541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8268883112009687541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8268883112009687541'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/05/js-display-tooltip-over-page-element.html' title='JS: Display tooltip over page element'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7333155134445331494</id><published>2009-05-04T08:08:00.000-07:00</published><updated>2010-09-27T05:47:47.269-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.</title><content type='html'>A piece of code that I've been working on lately started to throw exceptions when calling a web service using a generated client. The log file contained only the exception message:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;"The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state."&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Most of the suggestions found in Web blamed the invalid code, giving examples similar to the following one:&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;&lt;br /&gt;using (MyWebServiceClient service = new MyWebServiceClient())&lt;br /&gt;{&lt;br /&gt;   service.DoSomeOperation();&lt;br /&gt;   service.Close();&lt;br /&gt;   service.DoAnotherOperation();&lt;br /&gt;}&lt;/pre&gt;Since I was sure this was not the case I had to discover the real exception reason by myself.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold; font-size: 120%;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The using statement in the form presented above will mask any errors coming from the web service client and throw the "faulted state" exception instead, which may be irrelevant to the actual problem. To find out the real issue you can examine the InnerException property of the exception thrown (e.g. by logging it or debugging your app). &lt;br /&gt;&lt;br /&gt;Alternatively you can add an additional try/catch to ensure that the real exception is thrown by your application rather than the "faulted state" one:&lt;pre class="brush: csharp;"&gt;&lt;br /&gt;try &lt;br /&gt;{&lt;br /&gt;   MyWebServiceClient service = new MyWebServiceClient()      &lt;br /&gt;   service.DoSomeOperation();&lt;br /&gt;   service.Close();&lt;br /&gt;}&lt;br /&gt;catch (CommunicationException e)&lt;br /&gt;{&lt;br /&gt;   service.Abort();&lt;br /&gt;}&lt;br /&gt;catch (TimeoutException e)&lt;br /&gt;{&lt;br /&gt;   service.Abort();&lt;br /&gt;}&lt;br /&gt;catch (Exception e)&lt;br /&gt;{&lt;br /&gt;   service.Abort();&lt;br /&gt;   throw;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;You can read more about the reason for the "faulted state" exception &lt;a href="http://msdn.microsoft.com/en-us/library/aa355056.aspx" target="_blank" title="Avoiding Problems with the Using Statement"&gt;on MSDN page&lt;/a&gt; (Thanks to Carl for the link).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7333155134445331494?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7333155134445331494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7333155134445331494' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7333155134445331494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7333155134445331494'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/05/communication-object.html' title='The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4423959789219174052</id><published>2009-04-14T02:51:00.000-07:00</published><updated>2009-04-14T03:04:41.315-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Join the Java Black Belt community</title><content type='html'>I'm recently working mainly on .NET projects but would like to stay on top of Java technology stack as well. That's why I've just joined the &lt;a href="http://www.javablackbelt.com" target="_blank"&gt;Java Black Belt&lt;/a&gt; community.&lt;br /&gt;It offers many free java exams created by community users. In order to get the black belt you need to contribute to the portal so the amount of testing material is still growing. &lt;br /&gt;It's a great way to refresh your java knowledge. I hope that this belt-system will keep me motivated so I not only prove my current skills but also learn something new. &lt;br /&gt;After I get to the certain level (let's say the blue belt) I'll update my blogger profile to display the belt icon so you can see my progress directly from this page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4423959789219174052?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4423959789219174052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4423959789219174052' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4423959789219174052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4423959789219174052'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/04/join-java-black-belt-community.html' title='Join the Java Black Belt community'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7816709634701672991</id><published>2009-03-24T03:05:00.000-07:00</published><updated>2009-03-24T03:40:38.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Debugging .NET applications</title><content type='html'>Recently I attended &lt;a href="http://c2c.org.pl/" target="_blank"&gt;C2C conference&lt;/a&gt; in Warsaw. I signed up for the .NET track. The session I was really looking forward to was “Hardcore Production Debugging” by Ingo Rammer. I hoped to learn something that I could use right away in my every day work. Remote debugging may be very painful and it is not easy to find the best approach. I was keen to learn about new easy-to-use tools that would make my life much easier. Unfortunately, the word “Hardcore” in session’s title was there for a reason…&lt;br /&gt;&lt;br /&gt;The biggest part of the session was dedicated to WinDBG tool. Its interface is very poor and user-unfriendly. However, Ingo demonstrated that once you learn how to use it, it can be very helpful in finding the reason for application failures.&lt;br /&gt;&lt;br /&gt;At first Ingo simulated situation where the developer has access to production machine (with no Visual Studio installed) where they can run WinDBG. Once he started this tool he attached it to the process of sample application that was throwing unhandled exceptions. With a few commands he was able to find out the exception message and the reason for failure. With the same tool Ingo was able to find out the reason for unexpected application exit by attaching breakpoint at the end of app’s process.&lt;br /&gt;&lt;br /&gt;Ingo showed us also that remote debugging can be achieved with the WinDBG installed on developers machine and its console version – CDB – on client’s machine. After you configure the port for CDB you can access it from outside using WinDBG (option “Connect to remote session”).&lt;br /&gt;&lt;br /&gt;Next, Ingo explained what to do when WinDBG and CDB are also not available on the production machine. He proved that we can find the same error as in the first part by studying the memory dump created for that application. To get the memory dump we can ask the client to create it manually using a simple program (Adplus) or OS built-in functionality (only on Vista) immediately after the error occurs. Then, all we need to do is load the dump into WinDBG (option “Open crush dump”) on the developer’s machine and examine it using the same commands as in the first case. &lt;br /&gt;&lt;br /&gt;Finally, Ingo presented simple program GFlags for Windows registry keys modifications that would allow launching CMD/WinDBG immediately after specified process is started and attaching the debugger to this process. This can be handy when an error does not occur regularly and it’s not easy to reproduce. He warned us that you have to be very careful when using that tool and change system’s default settings only if you’re absolutely sure what you’re doing. Registry modifications can cause a lot of damage to your OS if the are not done correctly.&lt;br /&gt;&lt;br /&gt;To sum up - the pase of presentation was high so it was not possible to learn all the commands that Ingo was using. The goal of this session was to show to the audience what is possible if we use the presented tools and that it doesn't require much work once you learn how to use them. &lt;br /&gt;&lt;br /&gt;The session itself came out to be the highlight of the conference. Mixture of Ingo’s knowledge and charm proved to be the formula for perfect presentation. I just wish Ingo had some more time so we could study the examples more carefully. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Some WinDBG commands used by Ingo:&lt;/span&gt;&lt;br /&gt;&lt;pre class="brush: bash; toolbar: false; gutter: false"&gt;&lt;br /&gt;.hh         Debugger Help&lt;br /&gt;sxe clr     Break on all CLR Exceptions&lt;br /&gt;sxi clr     Ignore CLR Exceptions&lt;br /&gt;sxn clr     Notify on CLR Exception&lt;br /&gt; &lt;br /&gt;.loadby sos mscorwks   &lt;br /&gt;            Loads SOS Debugging Extension; &lt;br /&gt;            Enables use of following options:&lt;br /&gt;&lt;br /&gt;  !help            &lt;br /&gt;  !printexception (!pe)&lt;br /&gt;  !clrstack&lt;br /&gt;  &lt;br /&gt;  ~            list threads&lt;br /&gt;  !threads     list managed code threads&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Some Useful links:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank"&gt;All presented debugg tools for Windows &lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thinktecture.com/staff/ingo" target="_blank"&gt;Ingo's page at Thinktecture&lt;/a&gt;&lt;br /&gt;Tess Fernandez blog &lt;a href="http://blogs.msdn.com/tess/" target="_blank"&gt;“If broken it is, fix it you should”&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ingo also recommended book "Debugging .NET" by John Robins.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7816709634701672991?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7816709634701672991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7816709634701672991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7816709634701672991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7816709634701672991'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/03/recently-i-attended-c2c-conference-in.html' title='Debugging .NET applications'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8826692979894926586</id><published>2009-03-04T05:01:00.000-08:00</published><updated>2009-03-04T13:02:14.249-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Syntax highlighter toolbar covers first code line</title><content type='html'>As mentioned in my &lt;a href="http://fczaja.blogspot.com/2009/03/code-snippets-on-blogger.html"&gt;previous post&lt;/a&gt; I'm using &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank"&gt;Syntax Highlighter&lt;/a&gt; now to display code snippets. Appart slow loading it's working fine and it's doing its job. The only thing that was annoying to me was that the highlighter's toolbar was covering part of the first code line if it was too long:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 49px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/Sa7ofCq86DI/AAAAAAAAAFk/TE0y5fAJdcQ/s400/old.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5309436630707005490" /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Solution is quite simple: I decided to lift it up a bit by overwritting toolbar's style:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: css;"&gt;&lt;style&gt;&lt;br /&gt;.syntaxhighlighter .toolbar &lt;br /&gt;{&lt;br /&gt;   top: -33px !important;&lt;br /&gt;}&lt;br /&gt;&lt;/style&gt;&lt;/pre&gt;Place this style definition anywhere in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; and the result should be similar to that:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 60px;" src="http://2.bp.blogspot.com/_7so4C0dWMLE/Sa7qmzuulCI/AAAAAAAAAFs/hiKEndDV9b0/s400/new.PNG" border="0" alt=""id="BLOGGER_PHOTO_ID_5309438963158520866" /&gt;To be honest, I would like the toolbar to be displayed below the code snippet, aligned to the bottom border but this would require bit more styling. Let me know if you achieve that!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8826692979894926586?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8826692979894926586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8826692979894926586' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8826692979894926586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8826692979894926586'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/03/syntax-highlighter-toolbar-covers-first.html' title='Syntax highlighter toolbar covers first code line'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/Sa7ofCq86DI/AAAAAAAAAFk/TE0y5fAJdcQ/s72-c/old.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4731178553113681354</id><published>2009-03-02T03:12:00.001-08:00</published><updated>2009-03-04T13:03:15.683-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Code snippets on blogger</title><content type='html'>I decided to adjust the way I display code snippets on my blog. The old way of displaying wasn't very good and required some additional formatting. I've found a perfect solution for that: &lt;a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank"&gt;Syntax Highlighter&lt;/a&gt;. This allows you to easily display code snippets in a nice and accessible way. The code is colorised according to its type: e.g.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Xml:&lt;/span&gt;&lt;pre class="brush: xml;"&gt;&lt;br /&gt;&lt;root&gt;&lt;br /&gt;  &lt;child id="child1"&gt;sample&lt;/child&gt;&lt;br /&gt;&lt;/root&gt;&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-weight:bold;"&gt;Java:&lt;/span&gt;&lt;pre class="brush: java; bloggerMode: true;"&gt;class HelloWorld&lt;br /&gt;{  &lt;br /&gt;   public static void main(String args[])&lt;br /&gt;   {&lt;br /&gt;      System.out.println("Hello World!");&lt;br /&gt;   }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;The usage is really simple. In addition all required CSS an JavaScript files are available online so you can refer them from your blogger page! Can't wait to submit some more code ;)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;Quick Note:&lt;/span&gt;&lt;/span&gt; When using this on blogger you'll need to turn the bloggerMode on. You can do it in JS:&lt;pre class="brush: js"&gt;SyntaxHighlighter.config.bloggerMode = true;&lt;/pre&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4731178553113681354?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4731178553113681354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4731178553113681354' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4731178553113681354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4731178553113681354'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/03/code-snippets-on-blogger.html' title='Code snippets on blogger'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2823611434060551914</id><published>2009-03-01T06:38:00.000-08:00</published><updated>2009-06-13T01:10:11.958-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP: Redirection fails after moving to new server</title><content type='html'>Recently one of my old php apps was moved to different server.&lt;br /&gt;After the move it came out that some pages didn't work as expected i.e. some redirections were failing. The redirections were implemented using &lt;a href="http://php.net/header" target="_blank"&gt;header&lt;/a&gt; function e.g.&lt;br /&gt;&lt;pre class="brush: php; gutter: false; toolbar: false;"&gt;header('Location: http://www.targetpage.com/');&lt;/pre&gt;&lt;br /&gt;When I checked the php logs I found common error "&lt;span style="font-style:italic;"&gt;Headers already sent&lt;/span&gt;". Don't want to explain here what does it mean - there's plenty of answers &lt;a href="http://www.google.com/search?q=%22headers+already+sent%22" target="_blank"&gt;here&lt;/a&gt; ;) The only thing that made me wonder was why it was working on the old server. When I compared the php.ini files from both servers I found out that the new one was configured not to useoutput buffering. The temporary fix was enabling this by setting in php.ini:&lt;br /&gt;&lt;pre class="brush: bash; gutter: false;  toolbar: false;"&gt;output_buffer=On&lt;/pre&gt;&lt;br /&gt;This is not the cleanest solution and may affect application's performance but works immediately. The long-term solution is to ensure that your app is not sending any output before calling the &lt;code&gt;header&lt;/code&gt; method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2823611434060551914?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2823611434060551914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2823611434060551914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2823611434060551914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2823611434060551914'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/03/php-redirection-outputbuffer-z-phpini.html' title='PHP: Redirection fails after moving to new server'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8626312227807808857</id><published>2009-02-20T02:55:00.000-08:00</published><updated>2009-06-13T01:12:02.658-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>MsBuild: How to copy/delete all files from subfolders</title><content type='html'>Copying entire folder content (with subfolders) using standard MsBuild is not as straightforward as I'd imagine this to be. The only solution I've found uses recursion. Following example &lt;b&gt;copies&lt;/b&gt; all files from &lt;code&gt;source&lt;/code&gt; to &lt;code&gt;dest&lt;/code&gt; folder:&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&lt;PropertyGroup&gt;&lt;br /&gt;  &lt;SourceDir&gt;C:\source&lt;/SourceDir&gt;&lt;br /&gt;  &lt;DestinationDir&gt;C:\dest&lt;/DestinationDir&gt;&lt;br /&gt;&lt;/PropertyGroup&gt;&lt;br /&gt;&lt;ItemGroup&gt;&lt;br /&gt;  &amp;lt;AllFolderFiles Include="$(SourceDir)\**\*.*" /&gt;&lt;br /&gt;&lt;/ItemGroup&gt;&lt;br /&gt;&amp;lt;Copy SourceFiles="@(AllFolderFiles)"&lt;br /&gt;  DestinationFiles="@(AllFolderFiles -&gt; $(DestinationDir)\&lt;br /&gt;  %(RecursiveDir)%(Filename)%(Extension)')" /&gt;&lt;/pre&gt;&lt;br /&gt;You can also use recursion to &lt;b&gt;delete&lt;/b&gt; all files in folder and its subfolders:&lt;pre class="brush: xml;"&gt;&lt;PropertyGroup&gt;&lt;br /&gt;  &lt;ToDelete&gt;C:\source&lt;/ToDelete&gt;&lt;br /&gt;&lt;/PropertyGroup&gt;&lt;br /&gt;&lt;ItemGroup&gt;&lt;br /&gt;  &amp;lt;FilesToDelete Include="$(ToDelete)\**\*.*" /&amp;gt;&lt;br /&gt;&lt;/ItemGroup&gt;&lt;br /&gt;&amp;lt;Delete Files="@(FilesToDelete)" /&amp;gt;&lt;/pre&gt;&lt;br /&gt;Anybody knows easier solution?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8626312227807808857?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8626312227807808857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8626312227807808857' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8626312227807808857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8626312227807808857'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/msbuild-how-to-copydelete-all-files.html' title='MsBuild: How to copy/delete all files from subfolders'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2356325354793282406</id><published>2009-02-19T05:00:00.001-08:00</published><updated>2009-06-06T08:25:17.343-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Automatic webapp to IIS deployment using MsBuild</title><content type='html'>Sometimes, when buidling/deploying your projects standard &lt;a href="http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx" target="_blank"&gt;MsBuild&lt;/a&gt; tasks are not enough. I've found a very handy &lt;a href="http://www.codeplex.com/sdctasks" target="_blank"&gt;SDC tasks library&lt;/a&gt; which allows you to do much more from your build script. &lt;br /&gt;&lt;br /&gt;The following example demonstrates creation of application pool and website using this AppPool on IIS. Normally this would need to be done manually. Thanks to SDC we can automate the whole process to eliminate possible errors that can occure during manual deployment.&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;!-- Use SDC tasks --&amp;gt;&lt;br /&gt;&amp;lt;UsingTask AssemblyFile="Microsoft.Sdc.Tasks.dll" /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Define website folder --&amp;gt;&lt;br /&gt;&amp;lt;PropertyGroup&amp;gt;&lt;br /&gt;  &amp;lt;WebSiteDestDir&amp;gt;&lt;br /&gt;       C:\Inetpub\wwwroot_mywebsite&lt;br /&gt;  &amp;lt;/WebSiteDestDir&amp;gt;&lt;br /&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Main task --&amp;gt;&lt;br /&gt;&amp;lt;Target Name="Deploy_Webapp"&amp;gt;&lt;br /&gt;  &amp;lt;CallTarget Targets="CleanIIS" /&amp;gt;&lt;br /&gt;  &amp;lt;CallTarget Targets="CreateWebSite" /&amp;gt;&lt;br /&gt;  &amp;lt;CallTarget Targets="CopyContent" /&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Clean IIS: remove existing AppPool and Website --&amp;gt;&lt;br /&gt;&amp;lt;Target Name="CleanIIS"&amp;gt;&lt;br /&gt;  &amp;lt;Web.WebSite.Delete Description="myWebapp" /&amp;gt;&lt;br /&gt;  &amp;lt;Web.AppPool.Delete AppPoolName="myAppPool" /&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Create application pool --&amp;gt;&lt;br /&gt;&amp;lt;Target Name="CreateAppPool" &amp;gt;&lt;br /&gt;  &amp;lt;Message Text="Creating my AppPool" /&amp;gt;&lt;br /&gt;  &amp;lt;Web.AppPool.Create AppPoolName="myAppPool"&lt;br /&gt;                      WorkerProcesses="1"&lt;br /&gt;                      IdentityType="NetworkService"&lt;br /&gt;                      ContinueOnError="false"/&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!-- Create website --&amp;gt;&lt;br /&gt;&amp;lt;Target Name="CreateWebSite" DependsOnTargets="CreateAppPool"&amp;gt;&lt;br /&gt;  &amp;lt;Message Text="Creating WebSite" /&amp;gt;&lt;br /&gt;  &amp;lt;Web.WebSite.Create Description="myWebapp"&lt;br /&gt;                      Path="$(WebSiteDestDir)"&lt;br /&gt;                      HostName="myWebapp"&lt;br /&gt;                      AppPoolId="myAppPool"&lt;br /&gt;                      ContinueOnError="false" /&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;Target Name="CopyContent" DependsOnTargets="CreateWebSite"&amp;gt;&lt;br /&gt;  &amp;lt;!-- Copy the app content to WebSiteDestDir here --&amp;gt;&lt;br /&gt;&amp;lt;/Target&amp;gt;&lt;/pre&gt;Using this library you can also create ActiveDirectory user, virtual directories and a whole lot more!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2356325354793282406?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2356325354793282406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2356325354793282406' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2356325354793282406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2356325354793282406'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/automatic-deployment-of-webapp-on-iis.html' title='Automatic webapp to IIS deployment using MsBuild'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7871135681263341665</id><published>2009-02-11T13:44:00.000-08:00</published><updated>2009-02-12T01:24:34.805-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Losing session data on IIS</title><content type='html'>I had a problem with asp.net app losing session data. The same app was working like a charm on my local machine but after deploying to dev server it was throwing exceptions from time to time caused by missing session variables.&lt;br /&gt; &lt;br /&gt;My webapp was using default sessionState settings with mode set to 'InProc' and it was configured to use default &lt;a href="http://www.developer.com/net/asp/article.php/2245511" target="_blank"&gt;application pool&lt;/a&gt;. The problem was caused by the application pool using Web Garden with 5 worker processes. When using InProc mode the worker processes DO NOT share session data! &lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2 possible solutions:&lt;/span&gt;&lt;ol&gt;&lt;li&gt;Configure application pool to use 1 worker process: in IIS Manager right click yout application pool &gt; Properties &gt; Performance &gt; Web Garden section&lt;/li&gt;&lt;li&gt;Use different session state mode e.g. state server or sql server (set in web.config)&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7871135681263341665?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7871135681263341665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7871135681263341665' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7871135681263341665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7871135681263341665'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/losing-session-data-on-iis.html' title='Losing session data on IIS'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5700336041989974340</id><published>2009-02-10T03:06:00.001-08:00</published><updated>2009-06-06T08:28:52.148-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Defining IBatis connection string in web.config</title><content type='html'>If you are using &lt;a href="ibatis.apache.org" target="_blank"&gt;Ibatis&lt;/a&gt; you may want to move the connection string from the &lt;code&gt;SqlMap.config&lt;/code&gt; file to the &lt;code&gt;Web.config&lt;/code&gt; e.g. to enable its encryption (see &lt;a href="http://fczaja.blogspot.com/2009/02/encrypt-configuration-sections.html"&gt;previous post&lt;/a&gt;). &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Define your database connection in SqlMap.config as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: xml; "&gt;&amp;lt;database&amp;gt;&lt;br /&gt;  &amp;lt;provider name="sqlServer2.0"/&amp;gt;&lt;br /&gt;  &amp;lt;dataSource name="DB" connectionString="${dbConnStr}"/&amp;gt;&lt;br /&gt;&amp;lt;/database&amp;gt;&lt;/pre&gt;&lt;br /&gt;Define connection string in Web.config:&lt;pre class="brush: xml;"&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;connectionStrings&amp;gt;&lt;br /&gt;    &amp;lt;add name="dbConnStr" connectionString="some conn str"/&amp;gt;&lt;br /&gt;  &amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;Then, manually configure the builder when initializing the mapper:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;// Create builder&lt;br /&gt;DomSqlMapBuilder builder = new DomSqlMapBuilder();&lt;br /&gt;&lt;br /&gt;// Get connection string from web.config&lt;br /&gt;ConnectionStringSettings dbConnStr = &lt;br /&gt;                ConfigurationManager.ConnectionStrings["dbConnStr"];&lt;br /&gt;&lt;br /&gt;// Set dbConnStr property to &lt;br /&gt;// populate in sqlmap.config&lt;br /&gt;NameValueCollection properties = new NameValueCollection();&lt;br /&gt;properties.Add("dbConnStr", dbConnStr.ConnectionString);&lt;br /&gt;builder.Properties = properties;    &lt;br /&gt;&lt;br /&gt;// Create mapper&lt;br /&gt;ISqlMapper mapper = builder.Configure("SqlMap.config");&lt;/pre&gt;IBatis framework is quite handy in use but the documentation is very poor. For more advanced questions you'll need to digg through fora and blogs. I've found this tip &lt;a href="http://stackoverflow.com/questions/390595/best-way-to-retrieve-the-connection-string-for-ibatis-net-from-the-web-config" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5700336041989974340?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5700336041989974340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5700336041989974340' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5700336041989974340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5700336041989974340'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/defining-ibatis-connection-string-in.html' title='Defining IBatis connection string in web.config'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5301610798157318002</id><published>2009-02-09T00:42:00.001-08:00</published><updated>2009-06-06T15:50:55.350-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Encrypting sections in web.config</title><content type='html'>Sometimes you want to ensure that your settings (e.g. connection strings) in web.config file are encrypted so nobody except the  app iteslf can read/understand them. ASP.Net offers tool called &lt;a href="http://msdn.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx" target="_blank"&gt;aspnet_regiis&lt;/a&gt; which allows that. It can be found in the &lt;code&gt;%WINDOWSDIR%\Microsoft.Net\Framework\version&lt;/code&gt; directory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Let's say we have a web app deployed on IIS called 'MyApp'. The app uses connection string defined in web.config:&lt;pre class="brush: xml;"&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;  &amp;lt;connectionStrings&amp;gt;&lt;br /&gt;    &amp;lt;add name="myConnectionString" &lt;br /&gt;         connectionString="some connection string"/&amp;gt;&lt;br /&gt;  &amp;lt;/connectionStrings&amp;gt;&lt;br /&gt;  ...&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;/pre&gt;&lt;br /&gt;The easiest way to encrypt presented connection string is to invoke following command:&lt;pre class="brush: bash; gutter: false; toolbar: false"&gt;aspnet_regiis&lt;br /&gt;  -pe "connectionStrings" -app "/MyApp"&lt;/pre&gt;&lt;br /&gt;It is also possible to encrypt web.config providing physical path to the application folder rather than app name (e.g. if app is not deployed on IIS):&lt;br /&gt;&lt;pre  class="brush: bash; gutter: false; toolbar: false"&gt;aspnet_regiis &lt;br /&gt;-pef "connectionStrings"&lt;br /&gt;"physical path to app root folder"&lt;/pre&gt;&lt;br /&gt;The encrypted information in the web.config can still be accessed by your app without any explicit decoding. Aspnet_regiis tool can be also used to descrypt information, encrypt different sections etc. You can learn more about it &lt;a href="http://msdn.microsoft.com/en-us/library/ms998280.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Warning&lt;/span&gt;&lt;br /&gt;If the encoding succeeds but tha app cannot read the encrypted section because of following error: &lt;br /&gt;&lt;span style="font-style: italic; font-weight: bold"&gt;"Failed to decrypt using provider 'RsaProtectedConfigurationProvider'. Error message from the provider: The RSA key container could not be opened."&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;you have to add following parameter to your encryption command:&lt;pre  class="brush: bash; gutter: false; toolbar: false"&gt;aspnet_regiis &lt;br /&gt;  -pe "connectionStrings" -app "/MyApp"&lt;br /&gt;  -prov DataProtectionConfigurationProvider&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5301610798157318002?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5301610798157318002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5301610798157318002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5301610798157318002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5301610798157318002'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/encrypt-configuration-sections.html' title='Encrypting sections in web.config'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4136671941235217794</id><published>2009-02-05T07:09:00.000-08:00</published><updated>2009-06-06T15:52:24.527-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Adding tooltips to list items in DropDownList</title><content type='html'>I needed to add tooltips to the items on the standard &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx" target="_blank"&gt;DropDownList&lt;/a&gt; asp control. I'm using custom data source to retrieve the list of items rather than static list defined in html.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;Add a &lt;code&gt;ondatabound&lt;/code&gt; event handler to your DropDownList control:&lt;br /&gt;&lt;pre  class="brush: xml; highlight: [5]"&gt;&amp;lt;asp:DropDownList runat="server"&lt;br /&gt;                  DataSourceId="MyCustomDatasource"&lt;br /&gt;                  DataTextField="SomeName"&lt;br /&gt;                  DataValueField="SomeValueCode"&lt;br /&gt;                  ondatabound="ApplyOptionTitles"&lt;br /&gt;... /&amp;gt;&lt;/pre&gt;Then implement handler:&lt;pre  class="brush: csharp; gutter: false; toolbar: false;"&gt;protected void ApplyOptionTitles(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;   DropDownList ddl = sender as DropDownList;&lt;br /&gt;   if (ddl != null)&lt;br /&gt;   {&lt;br /&gt;        foreach (ListItem item in ddl.Items)&lt;br /&gt;        {&lt;br /&gt;           item.Attributes["title"] = item.Text;&lt;br /&gt;         }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;Answer found &lt;a href="http://forums.asp.net/p/903935/994720.aspx"  target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4136671941235217794?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4136671941235217794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4136671941235217794' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4136671941235217794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4136671941235217794'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/adding-tooltips-to-list-items-in.html' title='Adding tooltips to list items in DropDownList'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-675371181662149011</id><published>2009-02-04T23:18:00.000-08:00</published><updated>2009-06-13T01:28:09.692-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Handling exceptions in UpdatePanel &amp; UpdatePanelAnimationExtender</title><content type='html'>&lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/UpdatePanelAnimation/UpdatePanelAnimation.aspx" target="_blank"&gt;UpdatePanelAnimationExtender&lt;/a&gt; allows you to add eye-catching animations to your UpdatePanel indicating that update is in progress. However, it doesn't directly support error handling. &lt;br /&gt;&lt;br /&gt;The following code defines UpdatePanelAnimationExtender for UpdatePanel MyUP. The panel will fade out each time the update starts and fade in after successful update.&lt;pre class="brush: xml;"&gt;&amp;lt;cc1:UpdatePanelAnimationExtender&lt;br /&gt;   ID="MyUPAE"&lt;br /&gt;   BehaviorID="UpdateAnimation"&lt;br /&gt;   runat="server"&lt;br /&gt;   Enabled="True"&lt;br /&gt;   TargetControlID="MyUP"&amp;gt;&lt;br /&gt;     &amp;lt;Animations &amp;gt;        &lt;br /&gt;        &amp;lt;OnUpdating &amp;gt;&lt;br /&gt;            &amp;lt;Parallel duration="0"&amp;gt;&lt;br /&gt;                &amp;lt;FadeOut minimumOpacity=".5" /&amp;gt;&lt;br /&gt;            &amp;lt;/Parallel&amp;gt;                &lt;br /&gt;        &amp;lt;/OnUpdating&amp;gt;&lt;br /&gt;        &amp;lt;OnUpdated&amp;gt;&lt;br /&gt;            &amp;lt;Parallel duration="0"&amp;gt;&lt;br /&gt;                &amp;lt;FadeIn minimumOpacity=".5" /&amp;gt;&lt;br /&gt;            &amp;lt;/Parallel&amp;gt; &lt;br /&gt;        &amp;lt;/OnUpdated&amp;gt;                        &lt;br /&gt;     &amp;lt;/Animations&amp;gt;&lt;br /&gt;&amp;lt;/cc1:UpdatePanelAnimationExtender&amp;gt;&lt;br /&gt;&lt;/cc1:UpdatePanelAnimationExtender&gt;&lt;/pre&gt;If the code executed during update causes an error the browser may warn you about JS error (caused by actual server side error) but the panel will remain faded out. Browser's warning is usually hard to notice or even not displayed at all. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;The following JS code allows you handling update errors on client side. It assumes that there is a &lt;code&gt;span&lt;/code&gt; element defined on that page for displaying error messages (with &lt;code&gt;ID=ErrorMsg&lt;/code&gt;).&lt;br /&gt;&lt;pre class="brush: js;"&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&lt;br /&gt;// Create EndRequest handler for update panel&lt;br /&gt;Sys.WebForms.PageRequestManager.getInstance().&lt;br /&gt;                                    add_endRequest(EndRequestHandler);&lt;br /&gt;&lt;br /&gt;function EndRequestHandler(sender, args)&lt;br /&gt;{&lt;br /&gt;   // If there is an unhandled error&lt;br /&gt;  if (args.get_error() != undefined)&lt;br /&gt;  {&lt;br /&gt;    // create error message and display it&lt;br /&gt;    var errorLbl = $get('&lt;%=ErrorMsg.ClientID%&gt;');&lt;br /&gt;    errorLbl.innerHTML = 'An error occurred while completing update.';&lt;br /&gt;            &lt;br /&gt;    // end update panel animation&lt;br /&gt;    var upAnimation = $find('UpdateAnimation');&lt;br /&gt;    upAnimation._postBackPending = false;&lt;br /&gt;    upAnimation.get_OnUpdatingBehavior().quit();&lt;br /&gt;    upAnimation.get_OnUpdatedBehavior().play();&lt;br /&gt;                  &lt;br /&gt;    args.set_errorHandled(true);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-675371181662149011?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/675371181662149011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=675371181662149011' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/675371181662149011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/675371181662149011'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/handle-exception-in-updatepanel.html' title='Handling exceptions in UpdatePanel &amp; UpdatePanelAnimationExtender'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7472665825549556286</id><published>2009-02-02T07:33:00.000-08:00</published><updated>2009-06-13T01:30:21.189-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>"Maximum request length exceeded" error</title><content type='html'>I have an aspx page using standard &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx" target="_blank"&gt;FileUpload&lt;/a&gt; control. When I tried to upload a file bigger than 4MB the page was not displayed or the following error message appeared: "&lt;span style="font-style:italic;"&gt;Maximum request length exceeded&lt;/span&gt;". This is caused by maximal allowed size of request accepted by the server. Since the uploaded file is sent in request's body the whole request is even bigger than the file itself. &lt;br /&gt;&lt;br /&gt;I've seen some solutions using &lt;code&gt;Application_Error&lt;/code&gt; handler defined in Global.asax. This approach is quite straightforward and seems to be a way to go but unfortunately it didn't work for me - the page was still not displayed and the error was not handled.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;First, set the size of request accepted by the server to maximum (1GB) in web.config. Then, define a custom &lt;a href="http://msdn.microsoft.com/en-us/library/aa719858(VS.71).aspx" target="_blank"&gt;HttpModule&lt;/a&gt; that would check request's length (also in web.config):&lt;br /&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;  &amp;lt;httpRuntime maxRequestLength="102400" /&amp;gt;&lt;br /&gt;  &amp;lt;httpModules&amp;gt;&lt;br /&gt;    &amp;lt;add name="RequestLengthCheck" &lt;br /&gt;         type="MyNamespace.RequestCheckModule, MyLibraryName" /&amp;gt;    &lt;br /&gt;    &amp;lt;/httpModules&amp;gt;    &lt;br /&gt;&amp;lt;/system.web&amp;gt;&lt;/pre&gt;Now you have to implement the HttpModule that would check request's size and redirect to an error page if it's too big:&lt;pre class="brush: csharp;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Web;&lt;br /&gt;&lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;  public class RequestCheckModule : IHttpModule&lt;br /&gt;  {&lt;br /&gt;    public void Init(HttpApplication app)&lt;br /&gt;    {&lt;br /&gt;      app.BeginRequest += new EventHandler(app_BeginRequest);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    void app_BeginRequest(object sender, EventArgs e)&lt;br /&gt;    {&lt;br /&gt;      HttpContext context = (HttpApplication)sender).Context;&lt;br /&gt;&lt;br /&gt;      if (context.Request.ContentLength &gt; 4096000)&lt;br /&gt;      {&lt;br /&gt;      IServiceProvider prov = (IServiceProvider)context;&lt;br /&gt;      HttpWorkerRequest wr = &lt;br /&gt;          (HttpWorkerRequest)prov.GetService(typeof(HttpWorkerRequest));&lt;br /&gt;&lt;br /&gt;      // Check if body contains data&lt;br /&gt;      if (wr.HasEntityBody())&lt;br /&gt;      {&lt;br /&gt;        // get the total body length&lt;br /&gt;        int reqLength = wr.GetTotalEntityBodyLength();&lt;br /&gt;        // Get the initial bytes loaded&lt;br /&gt;        int initBytes = wr.GetPreloadedEntityBody().Length;&lt;br /&gt;          &lt;br /&gt;        if (!wr.IsEntireEntityBodyIsPreloaded())&lt;br /&gt;        {&lt;br /&gt;          byte[] buffer = new byte[512000];&lt;br /&gt;          // Set the received bytes to initial&lt;br /&gt;          // byted before start reading&lt;br /&gt;          int recBytes = initialBytes;&lt;br /&gt;          while (reqLength - recBytes &gt;= initBytes)&lt;br /&gt;          {&lt;br /&gt;            // Read another set of bytes&lt;br /&gt;            initBytes = wr.ReadEntityBody(buffer, buffer.Length);&lt;br /&gt;            // Update the received bytes&lt;br /&gt;            recBytes += initBytes;&lt;br /&gt;          }&lt;br /&gt;          wr.ReadEntityBody(buffer, reqLength-recBytes);&lt;br /&gt;          }&lt;br /&gt;        }&lt;br /&gt;        // Redirect the user to an error page.&lt;br /&gt;        context.Response.Redirect("Error.aspx");&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;        &lt;br /&gt;    public void Dispose()&lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;I've found this piece of code &lt;a href="http://dotnetslackers.com/Community/blogs/haissam/archive/2008/09/25/redirect-to-error-page-when-maximum-request-length-is-exceeded-fileupload.aspx" target="_blank"&gt;here&lt;/a&gt;. It works perfect. The only thing I don't understand is why the whole request needs to be read for this to work? I've tried to make the redirection right after &lt;code&gt;wr.GetTotalEntityBodyLength();&lt;/code&gt; but it didn't work. Anybody knows why?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7472665825549556286?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7472665825549556286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7472665825549556286' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7472665825549556286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7472665825549556286'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/maximum-request-length-exceeded-error.html' title='&quot;Maximum request length exceeded&quot; error'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4875560610981857501</id><published>2009-02-02T02:45:00.000-08:00</published><updated>2009-06-06T16:03:09.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='css'/><title type='text'>Disable all page elements with transparent div</title><content type='html'>Sometimes you want to disable all page elements at one time. There are many ways to achieve that. I'm using an additional div displayed on the top layer of the page. It covers the whole page content and makes clicking elements on lower layers impossible. The div can be totally transparent so the user still sees the content of the lower layers.&lt;br /&gt;&lt;br /&gt;First, you need to place the additional div on your page, right behind the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag:&lt;pre class="brush: xml;"&gt;...&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;   &amp;lt;div id="disablingDiv" &amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;Then, you need to create appropriate style for that div. This element needs to be displayed on the top layer:&lt;pre class="brush: css;"&gt;&lt;br /&gt;#disablingDiv&lt;br /&gt;{&lt;br /&gt;    /* Do not display it on entry */&lt;br /&gt;    display: none; &lt;br /&gt;&lt;br /&gt;    /* Display it on the layer with index 1001.&lt;br /&gt;       Make sure this is the highest z-index value&lt;br /&gt;       used by layers on that page */&lt;br /&gt;    z-index:1001;&lt;br /&gt;    &lt;br /&gt;    /* make it cover the whole screen */&lt;br /&gt;    position: absolute; &lt;br /&gt;    top: 0%; &lt;br /&gt;    left: 0%; &lt;br /&gt;    width: 100%; &lt;br /&gt;    height: 100%; &lt;br /&gt;&lt;br /&gt;    /* make it white but fully transparent */&lt;br /&gt;    background-color: white; &lt;br /&gt;    opacity:.00; &lt;br /&gt;    filter: alpha(opacity=00); &lt;br /&gt;}&lt;/pre&gt;Now it is ready to use but not displayed. If you want to enable the div (to disable all underlaying page elements) just invoke the following JS code:&lt;pre class="brush: js;"&gt;&lt;br /&gt;document.getElementById('disablingDiv').style.display='block';&lt;br /&gt;&lt;/pre&gt;To disable it again:&lt;pre class="brush: js;"&gt;   document.getElementById('disablingDiv').style.display='none';&lt;br /&gt;&lt;/pre&gt;You can also play with background color and opacity to create different effects. The div itself can contain some additional elements e.g. button allowing enabling, pictures, etc. &lt;br /&gt;I've created this simple style basing on more complex example of lightbox described &lt;a href="http://www.ivirtuaforums.com/screw-javascript-use-css-to-create-a-lightbox-effect-t10777" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4875560610981857501?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4875560610981857501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4875560610981857501' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4875560610981857501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4875560610981857501'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/02/disable-all-page-elements-with.html' title='Disable all page elements with transparent div'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-293515889459171301</id><published>2009-01-29T12:22:00.000-08:00</published><updated>2009-01-29T12:32:04.078-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Free Java training courses</title><content type='html'>At &lt;a href="http://www.sun.com/training/glassfish_login.html" target="_blank"&gt;http://www.sun.com/training/glassfish_login.html&lt;/a&gt; you can find 6 free 90-days trial courses on follwiong topics:&lt;ol&gt;&lt;br /&gt;&lt;li&gt;GlassFish Application Server: Introduction (WMT-SAS-1536)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Designing Java Web Services (WJ-4112-EE5)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Adding Quality of Service and .NET Interoperability to Web Services (WMT-SAS-1543)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Creating Reliable and Secure Interoperable Web Services (WMT-SAS-2544)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Creating Transactional Web Services (WMT-SAS-2545)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Working With the Web Services Policy (WMT-SAS-2546)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;Sounds interesting to me - you better check that out before the promotion ends!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-293515889459171301?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/293515889459171301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=293515889459171301' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/293515889459171301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/293515889459171301'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/01/free-java-training-courses.html' title='Free Java training courses'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2994736228221711874</id><published>2009-01-22T08:14:00.000-08:00</published><updated>2009-06-07T01:10:19.596-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>DropDownList with OptGroup support</title><content type='html'>Strangely guys from Microsoft did not implement (forgot???) support for &lt;code&gt;optgroup&lt;/code&gt; tag in their standard DropDownList asp control so it's not possible to group items on the list. &lt;br /&gt;&lt;br /&gt;Most of the workarounds found in Web suggest use of Control Adapter, like &lt;a href="http://www.codeproject.com/KB/custom-controls/DropDownListOptionGroup.aspx" target="_blank"&gt;this one&lt;/a&gt;. However, there are couple things I don't like in this solution:&lt;ul&gt;&lt;li&gt;Doesn't work correctly when DataSource, AutoPostBack or OnSelectedIndexChanged attributes are set&lt;/li&gt;&lt;li&gt;Overrides regular regular behaviour &amp; rendering of DropDownList items&lt;/li&gt;&lt;li&gt;Works for all DropDownList controls on the page (cannot be switched off for some lists)&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;Instead, I propose to create our own custom control that extends the standard DropDownList class. We need to override the method RenderContents inherited by DropDownList from &lt;code&gt;System.Web.UI.WebControls.ListControl&lt;/code&gt;. When overriding it is very useful to base on original implementation so the default behaviour is preserved. To get the original RenderContents method's code you can use &lt;a href="http://www.red-gate.com/products/reflector/" target="_blank"&gt;.NET Reflector&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_7so4C0dWMLE/SZV9bNFKCNI/AAAAAAAAAE8/shC6q2yzhC4/s1600-h/reflector.bmp"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 326px;" src="http://2.bp.blogspot.com/_7so4C0dWMLE/SZV9bNFKCNI/AAAAAAAAAE8/shC6q2yzhC4/s400/reflector.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5302282042619857106" /&gt;&lt;/a&gt;&lt;br /&gt;So, your custom list control needs to look as follows:&lt;pre class="brush: csharp;"&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;  public class MyList : System.Web.UI.WebControls.DropDownList&lt;br /&gt;  {&lt;br /&gt;    protected override void RenderContents(&lt;br /&gt;                            System.Web.UI.HtmlTextWriter writer)&lt;br /&gt;    {&lt;br /&gt;      // Custom implementation goes here        &lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;}&lt;/pre&gt;Once you create your custom DropDownList you can use it on a page just like any other control. You only need to register it explicitly using following directive:&lt;pre class="brush: xml;"&gt;&amp;lt;%@ Register assembly="MyAssembly"&lt;br /&gt;             namespace="MyNamespace"&lt;br /&gt;             tagprefix="ma" %&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;ma:MyList ... /&amp;gt;&lt;/pre&gt;&lt;br /&gt;Advantages of this appraoch:&lt;ul&gt;&lt;li&gt;Original behaviour is preserved.&lt;/li&gt;&lt;li&gt;You can use custom control only if you need grouping without affecting the rest of drop-downs on page&lt;/li&gt;&lt;li&gt;You can implement several custom drop downs with different customizations&lt;/li&gt;&lt;li&gt;Should work with AutoPostBack &amp; OnSelectedIndexChanged&lt;/li&gt;&lt;/ul&gt;I've found sample implementation using this approach &lt;a href="http://www.norimek.com/blog/post/2008/06/Implementing-OptGroup-In-A-DropDownList-Control.aspx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://www.norimek.com/blog/post/2008/06/Implementing-OptGroup-In-A-DropDownList-Control.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2994736228221711874?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2994736228221711874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2994736228221711874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2994736228221711874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2994736228221711874'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/01/dropdownlist-with-optgroup-support.html' title='DropDownList with OptGroup support'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_7so4C0dWMLE/SZV9bNFKCNI/AAAAAAAAAE8/shC6q2yzhC4/s72-c/reflector.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7878346971152499805</id><published>2009-01-17T03:52:00.000-08:00</published><updated>2009-03-09T05:03:23.912-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Width of FileUpload control in Firefox</title><content type='html'>I'm using standard ASP.NET FileUpload control and had some troubles changing its width. For almost all browsers the regular &lt;code&gt;width&lt;/code&gt; attribute does the job (as expected). However, for some strange reasons it is completely ignored by FF.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;To change the width of FileUpload control in FF you have to use &lt;code&gt;size&lt;/code&gt; attribute instead. Example:&lt;br /&gt;&lt;pre class="brush: xml; toolbar: false; gutter: false;"&gt;&amp;lt;asp:FileUpload ... size="50" /&amp;gt;&lt;/pre&gt;The units used by &lt;code&gt;size&lt;/code&gt; attribute are characters. Remember to use both &lt;code&gt;size&lt;/code&gt; (for FF) and &lt;code&gt;width&lt;/code&gt; (for all other browsers) to make the change visible for all users. Sometimes it may be tricky to make this field have the same width on all browsers. &lt;br /&gt;&lt;br /&gt;I'm not sure why Mozilla did it this way but I don't like it at all. Any Ideas? &lt;br /&gt;&lt;br /&gt;I found solution &lt;a href="http://archive.devwebpro.com/devwebpro-39-20080118FirefoxtheFileUploadControlinASPNET.html" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7878346971152499805?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7878346971152499805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7878346971152499805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7878346971152499805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7878346971152499805'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2009/01/width-of-fileupload-control-in-firefox.html' title='Width of FileUpload control in Firefox'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7793913883808180089</id><published>2008-12-30T01:13:00.001-08:00</published><updated>2009-01-27T06:15:13.256-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>JS error "Sys is not defined" caused by HttpModule</title><content type='html'>&lt;p&gt;I have an ASP.NET application that makes use of &lt;a href="http://www.asp.net/ajax/ajaxcontroltoolkit/" target="_blank"&gt;Ajax Control Toolkit&lt;/a&gt;. Everything was working fine until I decided to implement authentication on application level using HttpModules. It's basically about authenticating each request to your application with one piece of code - before each request is processed the code defined in appropriate HttpModule is executed. You can read more on that &lt;a href="http://www.15seconds.com/Issue/020417.htm" target="_blank"&gt;here&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc301362.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt;&lt;p&gt;After I've configured my application to use the custom authentication HttpModule all controls from Ajax Control Toolkit (ACT) stopped working. Instead, I was getting JavaScript error &lt;em&gt;"Sys is not defined"&lt;/em&gt;. The cause of that was the authentication module, which was checking URL parameters to grant access to requested resources. &lt;/p&gt;&lt;p&gt;I've discovered that ACT was dynamically loading additional .resx files from the server. The dynamic requests (sort of Ajax calls) didn't contain appropriate parameters so they were rejected.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I've added additional &lt;em&gt;if&lt;/em&gt; clause to my authentication code that was allowing all requests to .axd files to pass, regardless parameters. I could do that since none of the files created by me was in that format and I didn't have to care about authentication when such files are requested. Of course, I'm open for suggestions how to resolve this in cleaner way.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7793913883808180089?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7793913883808180089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7793913883808180089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7793913883808180089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7793913883808180089'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/12/js-error-sys-is-not-defined-caused-by.html' title='JS error &quot;Sys is not defined&quot; caused by HttpModule'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3291942638446512889</id><published>2008-12-05T05:14:00.000-08:00</published><updated>2009-10-13T01:14:49.866-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><title type='text'>How to get assembly file from GAC?</title><content type='html'>The .Net application I'm currently working on uses libraries from &lt;a href="http://msdn.microsoft.com/en-us/library/yf1d93sz(VS.71).aspx" target="_blank" title="Global Assembly Cache"&gt;Global Assembly Cache (GAC)&lt;/a&gt;. To see the libraries available in GAC just navigate to &lt;b&gt;C:\windows\assembly&lt;/b&gt; with regular windows file explorer. The explorer will display the GAC content in a different way than regular files. You'll only see the list of available libraries. You can add assemblies to GAC by drag'n'drop:&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;width: 400px; height: 214px;" src="http://1.bp.blogspot.com/_7so4C0dWMLE/StQ1pfO16AI/AAAAAAAAALw/K4cpSVPcXy0/s400/assembly.PNG" border="0" alt="Global Assembly Cache" id="BLOGGER_PHOTO_ID_5391993640743987202" /&gt;However, this view will only allow you to see the current GAC content and add/update libraries. This has some limitations e.g.:&lt;ul&gt;&lt;li&gt;It won't let you get the actual library file. Sometimes you may need to do that e.g. to backup file from GAC before you replace it.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;You can't add files of different types e.g. PDB files. This could be useful if you'd like to see the line numbers in stack trace.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;...&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;You can bypass all those limitations by using different tool to access the folder content e.g. console or &lt;a href="http://www.ghisler.com/" target="_blank"&gt;Total Commander&lt;/a&gt;. Note that the libraries placed in GAC are not saved directly in c:\windows\assembly folder.  The dll-s you're looking for should be available at following path:&lt;br /&gt;&lt;pre&gt;C:\windows\assembly\GAC_MSIL\Namespace.Project\&lt;br /&gt;   &amp;lt;assembly_version_number&amp;gt;__&amp;lt;assembly_public_token_key&amp;gt;\Namespace.Project.dll&lt;/pre&gt;&lt;br&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br /&gt;We're looking for library with name = Kainos.Framework.Web, version = 1.0.0.0 and &lt;a href="http://blogs.msdn.com/kaevans/archive/2008/06/18/getting-public-key-token-of-assembly-within-visual-studio.aspx" title="Getting Public Key Token of Assembly Within Visual Studio" target="_blank"&gt;PublicTokenKey&lt;/a&gt; = 1111aaaa1111aaaa. You can find it at:&lt;pre&gt;C:\windows\assembly\GAC_MSIL\Kainos.Framework.Core\&lt;br /&gt;   1.0.0.0__1111aaaa1111aaaa\Kainos.Framework.Core.dll&lt;/pre&gt;Once you access the folder you can copy the assembly files, add pdb files, etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3291942638446512889?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3291942638446512889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3291942638446512889' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3291942638446512889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3291942638446512889'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/12/how-to-get-assembyl-file-from-gac.html' title='How to get assembly file from GAC?'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_7so4C0dWMLE/StQ1pfO16AI/AAAAAAAAALw/K4cpSVPcXy0/s72-c/assembly.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7849524895958688648</id><published>2008-11-20T00:06:00.000-08:00</published><updated>2008-11-20T00:14:55.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>IIS Error: "Unexpected Error 0x8ffe2740 Occurred"</title><content type='html'>When I try to start IIS the following error message is displayed: &lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;"Unexpected Error 0x8ffe2740 Occurred"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;This happens because some required ports are  not available. The most common application using required ports is Skype. You can conigure Skype to not use these ports:&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Open Skype&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Choose Tools &gt; Options &gt; Advanced &gt; Connections&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Uncheck &lt;span style="font-style:italic;"&gt;Use Port 80 and 443 as alternatives for incoming connections&lt;/span&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Restart Skype&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Start IIS&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7849524895958688648?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7849524895958688648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7849524895958688648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7849524895958688648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7849524895958688648'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/11/iis-error-unexpected-error-0x8ffe2740.html' title='IIS Error: &quot;Unexpected Error 0x8ffe2740 Occurred&quot;'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4125667776786142569</id><published>2008-11-01T06:54:00.001-07:00</published><updated>2008-11-18T11:15:18.467-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Error while exporting pages from SharePoint using SP Designer</title><content type='html'>While opening Sharepoint pages containing webparts using SP Designer I was getting the following error message:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;span style="font-weight:bold;"&gt;"This page cannot be edited in Sharepoint Designer. You can edit the content in the browser, or edit the corresponding page layout in Sharepoint designer."&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7so4C0dWMLE/SSGgIpAOuQI/AAAAAAAAADE/-ik3bfObgsQ/s1600-h/SPerror.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 331px; height: 112px;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/SSGgIpAOuQI/AAAAAAAAADE/-ik3bfObgsQ/s400/SPerror.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5269669109306407170" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Solution:&lt;/span&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Open you Site Structure in SharePoint Designer&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Right click on your page and select “Detach from page layout”&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This will check the file out and right click again and select open &gt; open with notepad&lt;/li&gt;&lt;br /&gt;&lt;li&gt;This will display the content you need to export. You can save it to chosen location&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4125667776786142569?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4125667776786142569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4125667776786142569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4125667776786142569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4125667776786142569'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/11/error-while-exporting-pages-from.html' title='Error while exporting pages from SharePoint using SP Designer'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/SSGgIpAOuQI/AAAAAAAAADE/-ik3bfObgsQ/s72-c/SPerror.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-1850977743739905389</id><published>2008-09-26T15:11:00.000-07:00</published><updated>2009-06-07T01:37:17.959-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Custom validaton in CSLA.NET</title><content type='html'>Recently I was assigned to a new project which bases on &lt;a href="http://www.lhotka.net/cslanet/" target=_blank &gt;CSLA.NET&lt;/a&gt; framework. One of my first tasks was to extend the validation of some business objects. Unfortunetly the Csla.Validation.CommonRules were not enough in my case since I needed to validate the value of one business object property against the value of another one. Here is sample code that checks whether Range.MaxValue is greater than Range.MinValue:&lt;pre class="brush: csharp;"&gt;public class Range : Csla.BusinessBase&amp;lt;Range&amp;gt;&lt;br /&gt;{&lt;br /&gt;   //members and properties declaration&lt;br /&gt;   private int _minValue = 0;&lt;br /&gt;   private int _maxValue = 0;&lt;br /&gt;&lt;br /&gt;   public int MaxValue { get { (...) } set { (...) } }&lt;br /&gt;   public int MinValue { get { (...) } set { (...) } }&lt;br /&gt;&lt;br /&gt;   (...) &lt;br /&gt;   &lt;br /&gt;   protected override void AddBusinessRules()&lt;br /&gt;   {&lt;br /&gt;      //Change of MaxValue will cause validation of MinValue as well&lt;br /&gt;      ValidationRules.AddDependantProperty("MaxValue", "MinValue");&lt;br /&gt;      &lt;br /&gt;      //prepare parameters for valdiation method&lt;br /&gt;      Dictionary&amp;lt;string, object&amp;gt; parameters = &lt;br /&gt;                                    new Dictionary&amp;lt;string, object&amp;gt;(1);&lt;br /&gt;      parameters.Add(CustomRules.DATE_TO_COMPARE, "MinRange");&lt;br /&gt;      DecoratedRuleArgs args = &lt;br /&gt;                    new DecoratedRuleArgs("MaxRange", parameters);&lt;br /&gt;&lt;br /&gt;      //add custom validation rule&lt;br /&gt;      ValidationRules.AddRuleRule&amp;lt;Rule&amp;gt;(&lt;br /&gt;                         CustomRules.DateGreaterThan, args);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class CustomRules &lt;br /&gt;{&lt;br /&gt;   /// &lt;summary&gt;&lt;br /&gt;   /// Checks whether the property value is DateTime and is greater than&lt;br /&gt;   /// value specified in field whose name is passed as the argument&lt;br /&gt;   /// called as defined in DATE_TO_COMPARE const.&lt;br /&gt;   /// &lt;/summary&gt;&lt;br /&gt;   /// &lt;returns&gt;&lt;br /&gt;   /// True if date is greater than the date to compare against.&lt;br /&gt;   /// &lt;/returns&gt;&lt;br /&gt;   /// &lt;exception cref="System.FormatException"&gt;&lt;br /&gt;   /// Thrown when impossible to convert any of both dates to DateTime.&lt;br /&gt;   /// &lt;/exception&gt;&lt;br /&gt;   public static bool DateGreaterThan&amp;lt;T&amp;gt;(T target, RuleArgs e)&lt;br /&gt;   {&lt;br /&gt;      DecoratedRuleArgs args = (DecoratedRuleArgs)e;&lt;br /&gt;            &lt;br /&gt;      DateTime lesserDate = &lt;br /&gt;                (DateTime)Csla.Utilities.CallByName(target,&lt;br /&gt;                          (string)args[DATE_TO_COMPARE], CallType.Get);&lt;br /&gt;      DateTime greaterDate = &lt;br /&gt;                (DateTime)Csla.Utilities.CallByName(target,&lt;br /&gt;                                          e.PropertyName, CallType.Get);&lt;br /&gt;&lt;br /&gt;      if (lesserDate &lt; greaterDate)&lt;br /&gt;      {&lt;br /&gt;         // date is valid &lt;br /&gt;         return true;&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;          // date is invalid - prepare error message&lt;br /&gt;          e.Description = e.PropertyFriendlyName + &lt;br /&gt;                          " has to be greater than " +&lt;br /&gt;                          (string)args[DATE_TO_COMPARE];&lt;br /&gt;          return false;                       &lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-1850977743739905389?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/1850977743739905389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=1850977743739905389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1850977743739905389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/1850977743739905389'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/09/custom-validaton-in-cslanet.html' title='Custom validaton in CSLA.NET'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8861615566964608121</id><published>2008-07-01T23:16:00.000-07:00</published><updated>2009-09-21T07:43:18.254-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Accessing static properties using C# reflections</title><content type='html'>Using C# reflections is quite easy. I found some good examples &lt;a href="http://my.execpc.com/~gopalan/dotnet/reflection.html"&gt;here&lt;/a&gt;. However, most of the examples available on the Web do not cover static class members. In order to access a static class member you don't need to use Activator since you don't need the class instance. Here is a simple example for accessing static property:&lt;br /&gt;&lt;pre class="brush: csharp;"&gt;//Get type of MyClass&lt;br /&gt;Type myType = Type.GetType("MyNamespace.MyClass");&lt;br /&gt;&lt;br /&gt;//Get PropertyInfo for property SomeProperty&lt;br /&gt;PropertyInfo pi = myType.GetProperty("SomeProperty");&lt;br /&gt;&lt;br /&gt;//Display property value on console. &lt;br /&gt;//Because it's static you can pass nulls for both object and index&lt;br /&gt;Console.WriteLine("Value of my property is: " +&lt;br /&gt;                                        pi.GetValue(null, null));&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8861615566964608121?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8861615566964608121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8861615566964608121' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8861615566964608121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8861615566964608121'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/07/accessing-static-properties-using-c.html' title='Accessing static properties using C# reflections'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3135987373444641183</id><published>2008-06-09T05:38:00.000-07:00</published><updated>2009-06-22T00:51:37.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>MonoRail &amp; ActiveRecord localized validation messages</title><content type='html'>I'm currently developing .NET web application using &lt;A href="http://www.castleproject.org/monorail/"&gt;MonoRail&lt;/A&gt; framework and &lt;A href="http://www.castleproject.org/activerecord/"&gt;ActiveRecord&lt;/A&gt; design pattern. One of the requirements for the project is easy localisation. In general it's pretty straightforward but I had some troubles figuring out how to localize the validation messages coming from ActiveRecord Business Objects.&lt;br /&gt;&lt;br /&gt;Here's my solution for that:&lt;OL&gt;&lt;br /&gt;&lt;LI&gt;&lt;B&gt;Create validation messages in resource file&lt;/B&gt;&lt;br /&gt;In your resource file (e.g Validation.resx) add entries for validation messages, e.g.&lt;br /&gt;&lt;br /&gt;&lt;A onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_7so4C0dWMLE/SFZELVwtteI/AAAAAAAAAAk/vUAx_1mA7Zw/s1600-h/validationMessages.png"&gt;&lt;IMG style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://3.bp.blogspot.com/_7so4C0dWMLE/SFZELVwtteI/AAAAAAAAAAk/vUAx_1mA7Zw/s400/validationMessages.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5212428580338644450" alt="Screen from VS 2008"&gt;&lt;/A&gt;&lt;br /&gt;Of course, you'll need to define those entries in resource files for all languages your application should support (e.g. in Validation.de.resx for German, Validation.es.resx for Spanish, etc.).&lt;br /&gt;&lt;br /&gt;&lt;LI&gt;&lt;B&gt;Add business objects validation attributes&lt;/B&gt;&lt;br /&gt;Let's use a sample business object representing User, which only includes name property. We have to add ActiveRecord attributes for validation e.g. ValidateNonEmpty and ValidateLength using appropriate parameters. These both attributes take the validation message as one of the arguments. Instead of giving here the actual message we can use its ID (name) from the resource file e.g. "vldNameRequired". Here is sample code of such Business Object:&lt;pre class="brush: csharp;"&gt;[ActiveRecord("User")]&lt;br /&gt;public class User : ActiveRecord&lt;br /&gt;{&lt;br /&gt;  [Property(NotNull = true, Length = 50)]&lt;br /&gt;  [ValidateNonEmpty("vldNameRequired")]&lt;br /&gt;  [ValidateLength(1, 50, "vldNameLength")]&lt;br /&gt;  public string Name { get; set; }&lt;br /&gt;}&lt;/pre&gt;For more validation attributes please refer to ActiveRecord documentation.&lt;br /&gt;&lt;br /&gt;&lt;LI&gt;&lt;B&gt;Catch validation errors&lt;/B&gt;&lt;br /&gt;Now, we have to enable validation for appropriate action. Let's say we want to validate data provided by the user while creating new account. For registering new user I've created the Register method together with appropriate data binds. Firstly we need to allow validation for that action (Validate = true). &lt;br /&gt;Catching validation errors is described in comments in code below:&lt;PRE class="brush: csharp;"&gt;(...)&lt;br /&gt;using System.Resources;&lt;br /&gt;&lt;br /&gt;public class UserController : SmartDispatcherController&lt;br /&gt;{&lt;br /&gt;  (...)&lt;br /&gt;  public void Register([DataBind("User", Validate=true)]User user)&lt;br /&gt;  {&lt;br /&gt;     // Check whether the binded object is valid by calling the &lt;br /&gt;     // HasValidationError inherited from SmartDispatcherController&lt;br /&gt;     if (HasValidationError(user))&lt;br /&gt;     {&lt;br /&gt;        // If there are validation errors we can access the error&lt;br /&gt;        // summary using GetErrorSummary method&lt;br /&gt;        ErrorSummary summary = GetErrorSummary(user);&lt;br /&gt;           &lt;br /&gt;        // Now we have to populate Flash item with localized&lt;br /&gt;        // validation messages by calling local private&lt;br /&gt;        // method GetLocalizedMessages&lt;br /&gt;        Flash["validationErrors"] = GetLocalizedMessages(summary);&lt;br /&gt;        PropertyBag["user"] = user;&lt;br /&gt;     }&lt;br /&gt;     else&lt;br /&gt;     {&lt;br /&gt;        //If there are no errors save the new user and redirect&lt;br /&gt;        //to other action&lt;br /&gt;        User.Save(user);&lt;br /&gt;        RedirectToAction('DoSomethingElse');&lt;br /&gt;     }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  /// &amp;lt;summary&amp;gt;&lt;br /&gt;  /// Translates the message IDs to actual messages&lt;br /&gt;  /// &amp;lt;/summary&amp;gt;&lt;br /&gt;  /// &amp;lt;param name="messageIDs"&amp;gt;Message IDs to translate&amp;lt;/param&amp;gt;&lt;br /&gt;  /// &amp;lt;returns&amp;gt;Array of translated messages&amp;lt;/returns&amp;gt;&lt;br /&gt;  private string[] GetLocalizedMessages(string[] messageIDs)&lt;br /&gt;  {&lt;br /&gt;     string[] messages = new string[messageIDs.Length];&lt;br /&gt;     for (int i=0;i&amp;lt;messageIDs.Length;i++)&lt;br /&gt;     {&lt;br /&gt;        // YourNamespace.Validation is the full name of your&lt;br /&gt;        // resource file with validation messages&lt;br /&gt;        messages[i] = YourNamespace.Validation.&lt;br /&gt;                          ResourceManager.GetString(messageIDs[i]);&lt;br /&gt;        if (messages[i] == null)&lt;br /&gt;        {&lt;br /&gt;            // ERR_NO_RESOURCE is constant storing ID of default&lt;br /&gt;            // error msg&lt;br /&gt;            messages[i] = Validation.ResourceManager.&lt;br /&gt;                                        GetString(ERR_NO_RESOURCE);&lt;br /&gt;        }&lt;br /&gt;     }&lt;br /&gt;     return messages;&lt;br /&gt;  }&lt;br /&gt;}&lt;/PRE&gt;&lt;LI&gt;&lt;B&gt;Display localized validation messages&lt;/B&gt;&lt;br /&gt;Now you have to display validation error messages on the page. This is the sample code that displays all validation errors coming from ActiveRecord validation (I'm using NVelocity as my view engine):&lt;PRE class="brush: xml;"&gt;&lt;br /&gt;#if($validationErrors != null &amp;&amp; $validationErrors.Length &amp;gt; 0)&lt;br /&gt;   &amp;lt;ul class="validationErrors"&amp;gt;&lt;br /&gt;   #foreach($ve in $validationErrors)&lt;br /&gt;      &amp;lt;li&amp;gt;$ve&amp;lt;/li&amp;gt;&lt;br /&gt;   #end&lt;br /&gt;   &amp;lt;/ul&amp;gt;&lt;br /&gt;#end&lt;/PRE&gt;&lt;/OL&gt;That's it. There are of course many possibilities for implementing that functionality. One of the enhancements could translate the ErrorSummary to the Dictionary&amp;lt;PropertyName, ValidationErrorMsg&amp;gt; so you can display error messages next to appropriate controls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3135987373444641183?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3135987373444641183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3135987373444641183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3135987373444641183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3135987373444641183'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/06/monorail-activerecord-localized.html' title='MonoRail &amp; ActiveRecord localized validation messages'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_7so4C0dWMLE/SFZELVwtteI/AAAAAAAAAAk/vUAx_1mA7Zw/s72-c/validationMessages.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4300403681098739607</id><published>2008-05-07T06:23:00.000-07:00</published><updated>2009-06-19T02:27:12.310-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Generating C# Web Service Skeleton from wsdl</title><content type='html'>I need to create a C#.NET web service which adheres to a specific wsdl provided by a third party. Instead of browsing the wsdl content and creating the service manually I decided to look for a tool that provides a similar functionality to wsdl2java tool. What I found is wsdl.exe.&lt;br /&gt;&lt;br /&gt;In order to generate a C# Interface for my web service I run this tool with options:&lt;br /&gt;&lt;pre class="brush: bash; toolbar: false; gutter: false;"&gt;wsdl /language:CS /serverInterface wsdl_location&lt;/pre&gt;The command above generates the file "&amp;lt;wsdl _file_name&amp;gt;Interfaces.cs" in default location. Copy generated file to your web service project and create a new class implementing interface from generated file.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example:&lt;/b&gt;&lt;br /&gt;Let's assume we used the wsdl tool and have the generated interface for our service. The interface name is IMyServiceHttpBinding and contains the signatures of 2 methods: void foo(string text) and string goo(). Sample implementation may look as follows:&lt;PRE class="brush: csharp; auto-links: false;"&gt;&lt;br /&gt;[WebService(Namespace = "http://somenamespace.com")]&lt;br /&gt;public class MyService : IMyServiceHttpBinding&lt;br /&gt;{&lt;br /&gt;   public void foo(string someText) {(...)}&lt;br /&gt;&lt;br /&gt;   public string goo() {(...)}&lt;br /&gt;}&lt;/PRE&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4300403681098739607?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4300403681098739607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4300403681098739607' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4300403681098739607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4300403681098739607'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/05/generating-c-web-service-skeleton-from.html' title='Generating C# Web Service Skeleton from wsdl'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3718416191748234040</id><published>2008-05-07T06:04:00.000-07:00</published><updated>2008-07-02T23:20:51.440-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><title type='text'>Enabling SSL in IIS 5</title><content type='html'>Currently I'm using Windows XP Pro and have IIS 5.1 installed. I tried to enable SSL for my IIS. Most of the instructions were quite complex, describing the manual generation and signing of certificates. However, I found much simpler solution which allows to enable SSL in few simple steps. &lt;br /&gt;&lt;br /&gt;Basically, all you need to do is install &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&amp;DisplayLang=en"&gt;IIS 6.0 Resource Kit&lt;/a&gt; and run the SelfSSL tool. That's it! The generated certificate is 'self-signed' so it may be suggested as untrusted by client's browser but it's completely enough for developers who need to test connections to their IIS using SSL.&lt;br /&gt;&lt;br /&gt;I found this solution &lt;a href="http://www.somacon.com/p42.php"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3718416191748234040?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3718416191748234040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3718416191748234040' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3718416191748234040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3718416191748234040'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2008/05/enabling-ssl-in-iis-5.html' title='Enabling SSL in IIS 5'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5686632892987091821</id><published>2007-05-26T02:55:00.000-07:00</published><updated>2007-05-26T03:17:03.743-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>GRUB Error 17</title><content type='html'>Ever since I've added a new partition between my windows and linux partitions I get GRUB Error 17 after installing/updating some essential linux core elements. It is happening because GRUB config file gets overridden with a default one. I don't know how to solve this problem but I do know how to recover in an easy way. I've copied the /boot/grub/menu.lst file (grub configuration) to my home directory. Every time I get Error 17 after choosing Linux in my GRUB menu I:&lt;ol&gt;&lt;li&gt;Reboot the system&lt;/li&gt;&lt;li&gt;When GRUB menu appears I select linux option and press 'e' for editing&lt;/li&gt;&lt;li&gt;I set correct parameters&lt;/li&gt;&lt;li&gt;Press 'b' for booting&lt;/li&gt;&lt;li&gt;When system loads I override /boot/grub/menu.lst with the stored one from my home folder&lt;/li&gt;&lt;/ol&gt;And that's it. I realize it is not a solution, but it works for me :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5686632892987091821?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5686632892987091821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5686632892987091821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5686632892987091821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5686632892987091821'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/05/grub-error-17.html' title='GRUB Error 17'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5994294354044184186</id><published>2007-05-24T06:45:00.000-07:00</published><updated>2007-05-31T14:43:46.281-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Master&apos;s Thesis'/><title type='text'>Master's Thesis presentation</title><content type='html'>Here is one of the presentations describing my current work. It is basically a simple digest of the theoretical part of my Master's Thesis. If you are interested in my other presentations you can take a look at my &lt;a href="http://www.slideshare.net/filipczaja" target="blank"&gt;slideshare profile&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;object type="application/x-shockwave-flash" data="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=54212&amp;doc=delivering-accessible-content-from-social-semantic-information-sources-through-adaptive-hypermedia-10241" width="425" height="348"&gt;&lt;param name="movie" value="https://s3.amazonaws.com:443/slideshare/ssplayer.swf?id=54212&amp;doc=delivering-accessible-content-from-social-semantic-information-sources-through-adaptive-hypermedia-10241" /&gt;&lt;/object&gt;&lt;br /&gt;(Presentation may not be visible in some browsers under Linux)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5994294354044184186?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5994294354044184186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5994294354044184186' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5994294354044184186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5994294354044184186'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/05/masters-thesis.html' title='Master&apos;s Thesis presentation'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-5996460913587805704</id><published>2007-05-16T16:33:00.000-07:00</published><updated>2007-05-17T01:56:43.737-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>100% CPU usage caused by atieventsd process</title><content type='html'>When I was checking yesterday the performance of my system I noticed that the system monitor shows permanent 100% CPU usage. It was quite weird because there where no other applications running. I clicked on the 'processes' tab and I found out that a process called 'atieventsd' was using all the possible CPU load. The process is related to ATI drivers. I searched through ubuntu fora I I found the solution for this problem in couple places (it seems that it affects many Ubuntu Dapper Drake users). For me worked &lt;a href="http://ubuntuforums.org/showthread.php?t=231718&amp;highlight=atieventsd" target="_blank"&gt;this one&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-5996460913587805704?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/5996460913587805704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=5996460913587805704' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5996460913587805704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/5996460913587805704'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/05/100-cpu-usage-caused-by-atieventsd.html' title='100% CPU usage caused by atieventsd process'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3031522564180572654</id><published>2007-05-02T15:02:00.000-07:00</published><updated>2009-06-17T01:12:50.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Javascript Timer object for active pages/tabs</title><content type='html'>Sometimes you want to fire an event on a webpage with a certain delay. There are couple ways to do that. Today I'm gonna present a JS Timer object, which waits a given amount of seconds after it's creation till it raises an alert. In addition out timer will work only when the page is active. If it looses a focus the timer stops. It resumes when it gains it back. Here is my code with some comments:&lt;pre class="brush: js;"&gt;var TimerJob = Class.create();&lt;br /&gt;TimerJob.prototype = {&lt;br /&gt;&lt;br /&gt; /*PeriodicalExecuter*/ pe : null,&lt;br /&gt;&lt;br /&gt; //numbers of seconds to wait&lt;br /&gt; /*int*/ sec : 600,                    &lt;br /&gt; &lt;br /&gt; //flag set after countdown finishes &lt;br /&gt; /*bool*/ finished : false,           &lt;br /&gt; &lt;br /&gt; // Initializes the timer&lt;br /&gt; initialize : function(){&lt;br /&gt;  this.pe = new PeriodicalExecuter(this.execute.bind(this),1);&lt;br /&gt;  window.onblur = this.abort.bindAsEventListener(this);&lt;br /&gt; },&lt;br /&gt; &lt;br /&gt; // Stops the timer countdown if page/tab looses focus&lt;br /&gt; // Handles window.onblur event&lt;br /&gt; abort : function(evt){&lt;br /&gt;  $('informer').innerHTML = "abort";&lt;br /&gt;  window.onblur = '';&lt;br /&gt;  window.onfocus = this.resume.bindAsEventListener(this);&lt;br /&gt;  this.pe.stop();&lt;br /&gt; },&lt;br /&gt; &lt;br /&gt; // Resumes the timer countdown when page/tab gains focus&lt;br /&gt; // Handles window.onfocus event&lt;br /&gt; resume : function(evt){  &lt;br /&gt;  if(this.finished){&lt;br /&gt;   window.onfocus = '';&lt;br /&gt;   window.onblur = ''; &lt;br /&gt;  }else{&lt;br /&gt;   this.pe = new PeriodicalExecuter(this.execute.bind(this),1);&lt;br /&gt;   window.onfocus = '';&lt;br /&gt;   window.onblur = this.abort.bindAsEventListener(this);    &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt; },&lt;br /&gt; &lt;br /&gt; // Restarts the timer countdown&lt;br /&gt; restart : function(){&lt;br /&gt;  this.pe.stop();&lt;br /&gt;  this.pe = new PeriodicalExecuter(this.execute.bind(this),1);&lt;br /&gt;  window.onblur = this.abort.bindAsEventListener(this);  &lt;br /&gt; },&lt;br /&gt; &lt;br /&gt; // Action executed by timer each second&lt;br /&gt; execute : function(_pe){&lt;br /&gt;&lt;br /&gt;  $('informer').innerHTML = this.sec;&lt;br /&gt;  this.sec--; &lt;br /&gt;  if(this.sec &lt;= 0){&lt;br /&gt;       this.pe.stop();&lt;br /&gt;                     &lt;br /&gt;       alert("It is time!!!");&lt;br /&gt;       &lt;br /&gt;       this.finished = true;&lt;br /&gt;       window.onblur = '';&lt;br /&gt;       window.onhelp = ''; &lt;br /&gt;  }&lt;br /&gt; }, &lt;br /&gt;}&lt;/pre&gt;The code above uses &lt;a href="http://www.prototypejs.org/" target="_blank"&gt;protoype.js&lt;/a&gt; library, which I already mentioned several times. Let me explain a little bit how it works. Initialize() method is a constructor, which starts the countdown. &lt;a href="http://www.prototypejs.org/api/periodicalExecuter" target="_blank"&gt;PeriodicalExecuter&lt;/a&gt; is an object from prototype.js library, which name explains everything :) Each second execute() method is invoked, which sets the number of seconds left in the page element identified by id 'informer'. Every time the page looses it focus (window.onblur) the abort() method is invoked which stops the countdown. When it gains focus back (window.focus) the resume() method is invoked. When the counter reaches 0 alert is raised and we don't care about focus or other stuff any more :)&lt;br /&gt;&lt;br /&gt;Any questions?&lt;br /&gt;&lt;br /&gt;PS. The code has been tested on Opera 9.2 and FF 1.5 (Ubuntu Dapper Drake)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3031522564180572654?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3031522564180572654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3031522564180572654' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3031522564180572654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3031522564180572654'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/05/timer-object-in-javascript.html' title='Javascript Timer object for active pages/tabs'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-370415036402879950</id><published>2007-04-25T16:27:00.001-07:00</published><updated>2007-04-30T15:47:38.531-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Object Oriented Javascript</title><content type='html'>I'm using a lot of Javascript in the project I'm currently working on. I don't really like it but it can be very useful sometimes. In order to make it easier I try to use the object oriented approach. &lt;a href="http://www.prototypejs.org/" target="_blank"&gt;Protoype.js&lt;/a&gt; library supports creating of an object oriented code by extending regular javascript objects with some additional functionality. You can find good examples at prototype's homepage but I also recommend &lt;a href="http://www.sergiopereira.com/articles/prototype.js.html" target="_blank"&gt;this tutorial&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Having some background in a "real" OOP languages I did not have many difficulties with creating OO JS code. I did have, however, some problems with understanding how it works - I'm still not 100% sure about it ;). The issue I'm talking about is related to the scope of methods. I found myself trying to access some object's properties from the body of the methods, that could work in different context. If you have the same problem I would recommend reading the description of &lt;a href="http://www.prototypejs.org/api/function/bind" target="_blank"&gt;bind() method&lt;/a&gt;, that is introduced by prototype library.&lt;br /&gt;&lt;br /&gt;It is also possible to write OO JS code without using prototype.js. There are good tutorials available &lt;a href="http://www.javascriptkit.com/javatutors/oopjs.shtml" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://www.webreference.com/js/column79/index.html" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-370415036402879950?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/370415036402879950/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=370415036402879950' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/370415036402879950'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/370415036402879950'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/ja.html' title='Object Oriented Javascript'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-3509135245420641902</id><published>2007-04-21T15:36:00.000-07:00</published><updated>2009-06-17T13:38:34.288-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Accessing CDATA section in XML DOM from Javascript</title><content type='html'>I had a hard time figuring out how to access CDATA Section in XML DOM using JavaScript. I read many different comments on that but I have not find a satisfying answer. Let's take a look at an xml example:&lt;pre class="brush: xml; auto-links: false;"&gt;&amp;lt;page&gt;&lt;br /&gt; &amp;lt;uri&gt;http://www.somepage.com/page1.html&amp;lt;/uri&gt;&lt;br /&gt; &amp;lt;content&gt;&lt;br /&gt;  &amp;lt;!--[CDATA[&lt;br /&gt;    &amp;lt;p&gt;Paragraph 1&amp;lt;/p&gt;&lt;br /&gt;    &amp;lt;p&gt;Paragraph 2 &amp;lt;a href="lnk.html"&gt;lnk&amp;lt;/a&gt;&amp;lt;/p&gt;&lt;br /&gt;   ]]--&gt;&lt;br /&gt; &amp;lt;/content&gt;&lt;br /&gt;&amp;lt;/page&gt;&lt;/pre&gt;I was trying to access the CDATA section the way I access all the text nodes:&lt;br /&gt;&lt;pre pre class="brush: js; toolbar: false; gutter: false"&gt;xmlDocument.getElementsByTagName('content')[0].firstChild.nodeValue;&lt;/pre&gt;Unfortunately it doesn't work. I was wondering what am I doing wrong. I run some tests and discovered that the &amp;lt;content&gt; node has actually 3 children (I thought it has only 1). The first and third childNodes are empty text nodes; the middle one is the CDATASection node I was trying to access. So the final code looks like this:&lt;br /&gt;&lt;pre pre class="brush: js; toolbar: false; gutter: false"&gt;xmlDocument.getElementsByTagName('content')[0].childNodes[1].nodeValue;&lt;/pre&gt;&lt;br /&gt;I'm using this for parsing a server response returned by AJAX Request (invoked using &lt;a href="http://www.prototypejs.org/"&gt;prototype.js&lt;/a&gt; library). I am not an expert here but I guess it may differ between XML DOM implamantations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-3509135245420641902?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/3509135245420641902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=3509135245420641902' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3509135245420641902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/3509135245420641902'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/accessing-cdata-section-in-xml-dom-from.html' title='Accessing CDATA section in XML DOM from Javascript'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-817422629577976314</id><published>2007-04-17T12:31:00.001-07:00</published><updated>2007-05-24T06:57:34.190-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Master&apos;s Thesis'/><title type='text'>5th Annual Conference on Teaching &amp; Learning: Learning Technologies</title><content type='html'>Here is our abstract, which recently has been approved for this conference:&lt;br /&gt;&lt;h3 style="color: black"&gt;Adapting informal sources of knowledge to e-Learning.&lt;/h3&gt;&lt;b&gt;Authors: Czaja Filip, &lt;a href="http://dobrzanski.net" target="_blank"&gt;Dobrzański Jarosław&lt;/a&gt;, &lt;a href="http://yanki.pl" target="_blank"&gt;Jankowski Jacek&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The amount of information sources and the available data is growing dramatically fast nowadays. It is very difficult time for teachers to keep up with changes (especially in information domain) and to find new and appropriate sources of information. This problem also affects e-Learning. Contemporary e-Learning systems deliver predefined, rigid courses which usually do not take into account user specific conditions, like wishing to broaden his or her knowledge in wide range of domains at the same time. Without constant maintenance, electronic courses are also getting outdated. Moreover, all of the current solutions seem to underestimate the potential of informal learning [1]. &lt;br /&gt;&lt;br /&gt;According to researches, over eighty per cent of possessed knowledge is acquired from informal sources of information like wikis, blogs and digital libraries [1]. These Web 2.0 platforms allow community collaboration, sharing knowledge and ideas. In addition, they are continuously developed to better serve users. Semantic description of available sources not only interconnects them but also allows machines to reason about their content. Consequently, artifacts can be easily accessed, browsed and harvested for further use. &lt;br /&gt;&lt;br /&gt;Following the presented idea, we introduce Didaskon [2], a framework for automated composition of a learning path for a student. The selection and workflow scheduling of learning objects is based on their description, semantically annotated specification of user profiles, anticipated knowledge after course completion and technical details of the client’s platform. User profile is described with FOAFRealm Ontology [3], a part of FOAFRealm project. It is based on FOAF metadata that provides functionality to manage identities and share resources with friends. &lt;br /&gt;&lt;br /&gt;Having in mind statistics about acquiring knowledge, we decided that Didaskon shall derive both from formal and informal sources of information. It should collect relevant data from wikis or blogs and process it so that it can be used in a form of learning objects, which enriches and improves the process of learning.&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;1. DTI 2006 - Beyond eLearning: practical insights from the USA&lt;br /&gt;2. &lt;a href="http://http://didaskon.corrib.org" target="_blank"&gt;http://didaskon.corrib.org&lt;/a&gt;&lt;br /&gt;3. &lt;a href="http://www.foafrealm.org" target="_blank"&gt;www.foafrealm.org&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-817422629577976314?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/817422629577976314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=817422629577976314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/817422629577976314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/817422629577976314'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/5th-annual-conference-on-teaching.html' title='5th Annual Conference on Teaching &amp; Learning: Learning Technologies'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6314977053049378044</id><published>2007-04-17T11:08:00.001-07:00</published><updated>2009-06-16T14:04:17.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='media'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Playing .wmv files in Ubuntu</title><content type='html'>In order to play .wmv files in Ubuntu you have to install w32codecs package:&lt;ol&gt;&lt;li&gt;Open &lt;pre class="brush: bash; gutter: false;"&gt;/etc/apt/sources.list&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Add lines:&lt;ul&gt;&lt;li&gt;Dapper Drake:&lt;br /&gt;&lt;pre class="brush: bash; gutter: false; auto-links: false;"&gt;deb http://mirror.ubuntulinux.nl dapper-seveas all&lt;br /&gt;deb-src http://mirror.ubuntulinux.nl dapper-seveas all&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Edgy:&lt;br /&gt;&lt;pre class="brush: bash; gutter: false; auto-links: false;"&gt;deb http://mirror.ubuntulinux.nl edgy-seveas all&lt;br /&gt;deb-src http://mirror.ubuntulinux.nl edgy-seveas all&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;Update list of repositories: &lt;pre class="brush: bash; gutter: false;"&gt;sudo apt-get update&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Install the package: &lt;pre class="brush: bash; gutter: false;"&gt;sudo apt-get install w32codecs&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Open your files and watch :)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Solution found &lt;a href="http://onlyubuntu.blogspot.com/2007/03/enable-dvd-playback-and-w32codecs-in.html" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://ubuntu.wordpress.com/2005/12/04/libdvdcss2-and-w32codecs-for-ubuntu/" target="_blank"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6314977053049378044?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6314977053049378044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6314977053049378044' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6314977053049378044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6314977053049378044'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/wmv.html' title='Playing .wmv files in Ubuntu'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2981522105430120577</id><published>2007-04-16T11:54:00.000-07:00</published><updated>2008-12-12T17:01:35.895-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Master&apos;s Thesis'/><title type='text'>Didn't get the iPod</title><content type='html'>Well I'm fresh after &lt;a href="http://weber.nuigalway.ie/faculty/research_day.html" target="_blank"&gt;Faculty of Engineering Research Day 2007&lt;/a&gt;. Surprisely I didn't get the iPod for the best poster. I didn't even get a digital picture frame. I actually got nothing but wine and cheese :) It cames out that not only the quality of the posters counted but also the research idea itself. Here is my one page &lt;a href="http://wiki.corrib.org/images/9/91/FRD2007_Abstract_Filip_Czaja.pdf"&gt;abstract&lt;/a&gt; explaining a little bit of my current work.&lt;br /&gt;&lt;br /&gt;Don't you think I deserve a price for this poster? :) &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7so4C0dWMLE/RiUczEh0bOI/AAAAAAAAAAU/eQ33EW16RTA/s1600-h/plakat.png" target="_blank"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_7so4C0dWMLE/RiUczEh0bOI/AAAAAAAAAAU/eQ33EW16RTA/s320/plakat.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5054477820507745506" /&gt;&lt;/a&gt;Related links:&lt;br /&gt;&lt;a href="http://weber.nuigalway.ie/faculty/research_day.html" target="_blank"&gt;Faculty of Engineering Research Day 2007&lt;/a&gt;&lt;br /&gt;&lt;a href="http://wiki.corrib.org/images/9/91/FRD2007_Abstract_Filip_Czaja.pdf"&gt;My Abstract&lt;/a&gt;&lt;br /&gt;&lt;a href="http://weber.nuigalway.ie/faculty/researchday_07_abstracts.pdf"&gt;All submitted  abstracts&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2981522105430120577?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2981522105430120577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2981522105430120577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2981522105430120577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2981522105430120577'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/didnt-get-ipod.html' title='Didn&apos;t get the iPod'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/RiUczEh0bOI/AAAAAAAAAAU/eQ33EW16RTA/s72-c/plakat.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-6282416926006088517</id><published>2007-04-09T12:02:00.000-07:00</published><updated>2009-03-10T11:01:39.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='latex'/><category scheme='http://www.blogger.com/atom/ns#' term='Master&apos;s Thesis'/><title type='text'>Tables on multiple pages with latex</title><content type='html'>It is Easter break so I have finally some time to write my Master's Thesis ("Delivering accessible information from soical semantic information sources through adaptive hypermedia" - yeah, I don't understand it either :D ). Anyway, I'm using latex with &lt;a href="http://texlipse.sourceforge.net/" target="blank"&gt;TeXclipse&lt;/a&gt;. Yesterday I tried to create my first ever table using latex. &lt;br /&gt;&lt;br /&gt;There is a latex directive "tabular", which I was trying to use. Problem with my table was that it was quite long and had to be spread on multiple pages. Tabular does not support this kind of long tables and it simply cuts the table at the end of the page. &lt;br /&gt;&lt;br /&gt;I've found example using "longtable" directive for creating tables on multiple pages but I did not have appropriate package installed. I followed this &lt;a href="http://en.wikibooks.org/wiki/LaTeX/Packages/Installing_Extra_Packages" target="blank"&gt;instruction&lt;/a&gt; and installed necessary packages. Now it is enough to declaire use of this package &lt;code&gt;\usepackage{longtable}&lt;/code&gt; and create a longtable.&lt;br /&gt;&lt;br /&gt;Package installation precedure:&lt;ol&gt;&lt;li&gt;Download set of additional packages &lt;a href="ftp://tug.ctan.org/pub/tex-archive/macros/latex/required/tools.zip"&gt;tools.zip&lt;/a&gt; from &lt;a href="http://www.ctan.org/" tagret="_blank"&gt;www.ctan.org&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Extract package's content&lt;/li&gt;&lt;li&gt;Enter folder with extracted files and run command&lt;br /&gt;&lt;code&gt;latex tools.ins&lt;/code&gt;&lt;br /&gt;to create *.sty files&lt;/li&gt;&lt;li&gt;Copy *.sty to folder with latex plugins. In my case it's &lt;br /&gt;&lt;code&gt;/usr/share/texmf-tetex/tex/latex&lt;/code&gt;.&lt;/li&gt;&lt;li&gt;Refresh latex files db by running command &lt;code&gt;texhash&lt;/code&gt;&lt;/li&gt;&lt;/ol&gt;You use the "longtable" directive very similar to tabular. Here is simple example:&lt;br /&gt;&lt;pre  class="brush: bash; toolbar: false; gutter: false"&gt;&lt;br /&gt;\begin{longtable}{c|l|p{5cm}}&lt;br /&gt;\hline&lt;br /&gt;content of cell 1 (centered) &amp; &lt;br /&gt;content of cell 2 (aligned left) &amp;&lt;br /&gt;content of cell 3 (multiplerows, 5cm width) \\&lt;br /&gt;\hline&lt;br /&gt;\end{longtable}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;PS. Longtable directive helped me with my problem but it still doesn't work as I expected. If a single cell contains a lot of text in multiple rows, so it takes more than one page to render it, it is also cut at the end of the page. I don't know how to fix it (yet :&gt;).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-6282416926006088517?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/6282416926006088517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=6282416926006088517' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6282416926006088517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/6282416926006088517'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/04/longtable-latex.html' title='Tables on multiple pages with latex'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-8393143733152965529</id><published>2007-03-26T06:04:00.000-07:00</published><updated>2009-06-17T13:36:15.214-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Task scheduling in J2SE / J2EE with Quartz</title><content type='html'>Recently I had to implement a module that would execute a given task once a day. At first I wanted to use Timer class but than I found Quartz. &lt;br /&gt;&lt;a href="http://www.opensymphony.com/quartz/" target="_blank"&gt;Quartz&lt;/a&gt; is a library for task scheduling for JAVA/J2EE. It is very easy to configure and use. Here are some features that I like:&lt;ul&gt;&lt;li&gt;works in both J2SE and J2EE&lt;/li&gt;&lt;li&gt;different jobs storing modes (memory or DB)&lt;/li&gt;&lt;li&gt;jobs can be declared in XML (no need to compile the code after changes)&lt;/li&gt;&lt;li&gt;different triggering modes (e.g. Cron like one)&lt;/li&gt;&lt;li&gt;predefined set of triggers e.g. minutely, daily etc. &lt;/li&gt;&lt;li&gt;it's for free (Apache License 2.0)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Check it out at: &lt;a href="http://www.opensymphony.com/quartz/" target="_blank"&gt;www.opensymphony.com/quartz/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-8393143733152965529?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/8393143733152965529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=8393143733152965529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8393143733152965529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/8393143733152965529'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/task-scheduling-in-j2se-j2ee-with.html' title='Task scheduling in J2SE / J2EE with Quartz'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2922098976945999512</id><published>2007-03-21T07:20:00.000-07:00</published><updated>2007-04-06T13:11:11.329-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='wi-fi'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><title type='text'>Managing Wi-Fi with kNetworkManager</title><content type='html'>I use Wi-Fi connection at work. I've also got one at home recently. I was looking for a tool for managing wireless networks. I wanted it to be easy in use and configuration, just like at Windows. I've found kNetworkManager. It seems to meet all of my expectations. &lt;br /&gt;&lt;br /&gt;I faced some problems  at the beginning - it simply didn't want to manage my networks :) I've solved the problem by removing all the lines describing network devices in &lt;br /&gt;&lt;code&gt;/etc/network/interfaces&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can find description (in polish) of installation procedure&lt;br /&gt;&lt;a href="http://forum.ubuntu.pl/viewtopic.php?t=24597" target="_blank"&gt;here&lt;/a&gt;. It also contains tips how to configure password manager so you are not ask for the network password every time you log in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2922098976945999512?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2922098976945999512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2922098976945999512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2922098976945999512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2922098976945999512'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/managing-wi-fi-with-knetworkmanager.html' title='Managing Wi-Fi with kNetworkManager'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-4187446919972058675</id><published>2007-03-13T07:14:00.000-07:00</published><updated>2009-01-17T04:13:45.926-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><category scheme='http://www.blogger.com/atom/ns#' term='gnome'/><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>Default browser in KDE</title><content type='html'>I'm an &lt;a href="http://opera.com/" target="_blank"&gt;Opera&lt;/a&gt; user, so I would like it to be my default web browser. This short note is about setting a default browser in Kubuntu in general. I experienced some problems trying to make it work.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Attempt #1&lt;/strong&gt;&lt;br /&gt;First I tried recommended method:&lt;br /&gt;&lt;code&gt;&lt;i&gt;sudo update-alternatives --config x-www-browser&lt;/i&gt;&lt;/code&gt;&lt;br /&gt;At first I thought it worked fine, but first use of &lt;a href="http://www.mozilla.com/en-US/thunderbird/" target="_blank"&gt;Thunderbird&lt;/a&gt; proved me wrong. This command works mainly for KDE applications, which thunderbird is not (it opens Firefox by default).&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Attempt #2&lt;/strong&gt;&lt;br /&gt;Ok. Let's try to find it somewhere in system settings. I found something like this:&lt;br /&gt;&lt;code&gt;&lt;i&gt;System Settings &gt; KDE Components &gt; Default Applications &gt; Web Browser&lt;/i&gt;&lt;/code&gt;&lt;br /&gt;This must be it! Oh, it's so easy! No, wait a second - it still doesn't work with Thunderbird :\&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Attempt #3&lt;/strong&gt;&lt;br /&gt;Following instructions from 'Opera help' for KDE environment I tried to associate .html and .htm files with Opera:&lt;br /&gt;In Koqueror menu bar choose:&lt;br /&gt;&lt;code&gt;&lt;i&gt;Settings &gt; Configure Konqueror &gt; File Associations &gt; text &gt; html&lt;/i&gt;&lt;/code&gt;&lt;br /&gt;You can set there the order in which the application for a given type should be chosen.&lt;br /&gt;Didn't help.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Attempt #4 (&lt;span style="color:#33cc00;"&gt;successful!!!&lt;/span&gt;)&lt;/strong&gt;&lt;br /&gt;OK, last try. I'm serious - it's now or never! I switched to Gnome for a moment and set the default browser from there:&lt;br /&gt;&lt;code&gt;&lt;i&gt;System -&gt; Preferences -&gt; Preferred Apllications&lt;/i&gt;&lt;/code&gt;&lt;br /&gt;Quick switch back to KDE and...&lt;br /&gt;Ladies &amp; Gentleman - we have a WINNER! I mean it works ;)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Useful links:&lt;br /&gt;1. &lt;a href="http://jatshergill.com/blog/2006/05/16/how-to-setup-the-default-web-browser-in-kubuntu/" target="_blank"&gt;This guy had the same problem.&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://kb.mozillazine.org/Talk:Default_browser" target="_blank"&gt;I've found solution here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-4187446919972058675?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/4187446919972058675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=4187446919972058675' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4187446919972058675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/4187446919972058675'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/default-browser.html' title='Default browser in KDE'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2738652801699561271</id><published>2007-03-12T07:13:00.001-07:00</published><updated>2007-04-26T15:26:13.850-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><category scheme='http://www.blogger.com/atom/ns#' term='media'/><title type='text'>Amarok</title><content type='html'>I love it! Only for the &lt;a href="http://amarok.kde.org"&gt;Amarok&lt;/a&gt; itself it was worth to switch to Ubuntu. It is nothing revolutionary, but its features are exactly what I need to enjoy my media collection. &lt;br /&gt;It can also deal with &lt;a href="http://last.fm"&gt;last.fm&lt;/a&gt; streams, which makes it even more useful.&lt;br /&gt;&lt;br /&gt;The coolest feature for me is possibility to control the player using the mouse scroll over the Amarok's tray icon.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;scroll up/down - volume up/down&lt;/li&gt;&lt;li&gt;ctrl + scroll up/down - previous/next song&lt;/li&gt;&lt;li&gt;scroll click - pause/play&lt;/li&gt;&lt;/ul&gt;Oh, I forgot to mention about keyboard shortcuts used for controlling the player that are working also when player's window is not active.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2738652801699561271?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2738652801699561271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2738652801699561271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2738652801699561271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2738652801699561271'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/amarok.html' title='Amarok'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2244889349587697980</id><published>2007-03-12T07:11:00.000-07:00</published><updated>2008-09-23T15:45:57.250-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>First negative impressions</title><content type='html'>&lt;div align="left"&gt;Linux sucks! ;) Ok, maybe not really, but...&lt;br /&gt;&lt;br /&gt;I spent some time on customising my Ubuntu but there are still many things I had in Windows working which I miss in Linux a lot:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Open Pandora - there is no &lt;a href="http://openpandora.googlepages.com/"&gt;Open Pandora&lt;/a&gt; player for Linux. I did not find any alternatives as well.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Mic in webcam - my Ubuntu can't handle the mic build in USB webcam (Logitech Quickcam Pro 3000). It is probably easy to set up but I'm pretty lazy :P&lt;/li&gt;&lt;li&gt;Azureus - actually &lt;a href="http://azureus.sourceforge.net/"&gt;Azureus&lt;/a&gt; is a Java torrent client, so it should be portable. But I just can't  get it working correctly on Ubuntu. I use poor &lt;a href="http://ktorrent.org"&gt;kTorrent&lt;/a&gt; instead.&lt;/li&gt;&lt;li&gt;Flash in Opera - I'm facing the same problem I experienced using Opera 8.x on Windows: Flash player doesn't work right in Opera. Banners and adds don't close when I click "X", application menus don't work etc.. It can be really annoying! I hope next versions will have this bug fixed.&lt;/li&gt;&lt;/ul&gt;I hope this list won't get much longer.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2244889349587697980?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2244889349587697980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2244889349587697980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2244889349587697980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2244889349587697980'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/first-negative-impressions.html' title='First negative impressions'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-2642238120876682773</id><published>2007-03-10T13:05:00.000-08:00</published><updated>2008-12-12T17:01:36.610-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='kde'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><category scheme='http://www.blogger.com/atom/ns#' term='gnome'/><title type='text'>KDE</title><content type='html'>Dafault display manager for Ubuntu is GNOME. My colleagues suggested me to try KDE instead. So I did. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Changing GNOME to KDE:&lt;/b&gt;&lt;ul&gt;&lt;li&gt;Download &amp; install KDE packages with all their dependencies (around 350MB) using Synaptic Package Manager.&lt;br /&gt;&lt;code&gt;&lt;i&gt;System &gt; Administration &gt; Synaptic Package Manager&lt;/i&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;Reboot the system.&lt;/li&gt;&lt;li&gt;When the login screen appears choose:&lt;br /&gt;&lt;code&gt;&lt;i&gt;Menu &gt; Session Type &gt; KDE.&lt;/i&gt;&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;That's it.&lt;br /&gt;&lt;br /&gt;After couple hours spent with KDE and some changes in default look and components configuration I can say KDE suits me, although the default style seems to be little bit to "candy" for me.&lt;br /&gt;&lt;br /&gt;My Desktop looks now like this:&lt;br /&gt;&lt;center&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_7so4C0dWMLE/RfWTkjgWuJI/AAAAAAAAAAM/uRscagdYgAc/s1600-h/Screenshot.png"&gt;&lt;img src="http://4.bp.blogspot.com/_7so4C0dWMLE/RfWTkjgWuJI/AAAAAAAAAAM/uRscagdYgAc/s320/Screenshot.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5041097614126659730" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-2642238120876682773?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/2642238120876682773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=2642238120876682773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2642238120876682773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/2642238120876682773'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/kde.html' title='KDE'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_7so4C0dWMLE/RfWTkjgWuJI/AAAAAAAAAAM/uRscagdYgAc/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-7551909588129122909</id><published>2007-03-10T09:24:00.000-08:00</published><updated>2007-04-26T15:27:55.262-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Let's get started</title><content type='html'>&lt;div align="left"&gt;I've chosen Ubuntu 6.06 Dapper Drake as my Linux distribution.  It is supposed to be a ready-to-use system, so it should be pretty simple to start with.&lt;br /&gt;&lt;br /&gt;The installation went very smooth indeed. After launching the system from bootable CD a graphical enviroment appears. Click the 'install' shortcut to start the installation process.  The process itself is very simple, it requires to set only basic parameters and click 'Next' several times. All the hard work the systems does for you.&lt;br /&gt;&lt;br /&gt;Now we are ready to go!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-7551909588129122909?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/7551909588129122909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=7551909588129122909' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7551909588129122909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/7551909588129122909'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/lets-get-started.html' title='Let&apos;s get started'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7041745156199549192.post-128268637531466106</id><published>2007-03-09T10:13:00.000-08:00</published><updated>2007-03-13T05:47:27.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Switching to Linux</title><content type='html'>&lt;div align="left"&gt;I've finally decided to join the exclusive comunity of Linux users. As much as I like Windows and the easy of use it offers I also realize that every selfrespecting software developer has to know the Linux basics.&lt;br /&gt;&lt;br /&gt;The purpouse of this blog is to gather my knowledge about technical&lt;br /&gt;issues related to Linux installation and usage. The secondary goal of this blog is to improve my english by practice.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7041745156199549192-128268637531466106?l=fczaja.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fczaja.blogspot.com/feeds/128268637531466106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7041745156199549192&amp;postID=128268637531466106' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/128268637531466106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7041745156199549192/posts/default/128268637531466106'/><link rel='alternate' type='text/html' href='http://fczaja.blogspot.com/2007/03/switching-to-linux.html' title='Switching to Linux'/><author><name>Filip Czaja</name><uri>http://www.blogger.com/profile/12289949072596625867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='http://4.bp.blogspot.com/_7so4C0dWMLE/SZNJH6gDGsI/AAAAAAAAAEk/S0b9mfbidpI/S220/avt.JPG'/></author><thr:total>0</thr:total></entry></feed>
