The Year O’clock! Goodbye 2011, New Year Resolutions for 2012

imageFor many years, people used to laugh at the World End 2012 prophecy. This year, people’s joke was that we’d be very lucky if we manage to get to the end of 2011 even!
Yeah, 2011 is such a bloody, surprising, rich, optimistic, pessimistic, and loaded year. So many events, so many famous deaths, so much fire, so much energy, and indeed, so much hope.

Seems we are lucky anyway. We’re only less than two weeks close get into 2012, Many have either started their holidays already, or just about to.
Unless you believe that year is the end of the world truly (no, not discussing it even!), that alone should make you optimistic :-)

The title “Year O’clock” is not mine, it’s my colleague, Steven Nagy. I may talk about the origin of the name later, for now, let’s say it’s a friendly internal new year’s resolutions cheer-up message.
Few days after I responded to it, I thought I’d share my response with you too, after removing some customer identifying parts and adding some context to a few parts of course.

The Year O’clock Email:

Just Three Questions

  1. Work related highlights for the year

    • Been across 4 different big clients in the same year. Really enjoyed them all
    • Speaking at Developers Developers Developers Sydney conference
    • Not feeling like “a new guy” any more (joined the company September 2010)
    • Learned a whole lot of stuff while doing work. This is great highlight although probably so common
  2. Non-work related highlights for the year

    • Moved from a furnished apartment to non-furnished (renting), same street. More stability FTW
    • My son, Adam (2 years), communicates better, learned numbers and English alphabets plus some words (mixed), developed his own, errr, decisions / opinions!
    • A lot of small improvements to my blog at the last few months. Happy about them
      Hey, that’s GuruStop ;-)
  3. New year resolutions

    • Need to build an idea of my own badly. I worked in 2 start-ups, and did freelance for friend entrepreneurs, it’s really time to own something other than my blog
    • More clients and exciting stuff at Readify is a must, should keep every year even better
    • Do more talks, think of some non-told-already topic for local user-groups in Sydney (open for suggestions)
    • More blogging
      Shout at me if there’s something specific you prefer to read here :-)
  4. How will you be spending your holidays?

    • Home
      (um. don’t count this one)

    How about you?

    Let’s keep this going. I shared my own stuff with you as I encourage you to do the same as well. Blog it, tell me about it. You know I care.
    Happy new year. Enjoy it Smile

    Notes On Using Visual Studio 11 As Primary IDE On Windows 7

    It’s been quite sometime since I first installed VS 11 (soon after dev preview came way), so, I thought I’d share my experience around using it as primary IDE (with VS 2010 solutions most of the time):

    • It works nicely with Visual Studio 2010 solutions, even big real-world ones. It doesn’t convert them but does some changes to project files which are backwards compatible (mainly minor formatting changes). Note that from the source-control point of view, those are still changes.
      • Somehow all my IIS 7.5 application pools lost their "Enable 32-bit applications" option very shortly after that. This is too coincidental with Visual Studio 11, although I’m not 100% sure if it was the reason.
        It could be hard to debug, If you start getting errors like "unable to load assembly <some path>.dll. or one of its dependencies. An attempt was made to load a program with an incorrect format.". Check for that option.
    • It works a bit faster than Visual Studio 2010. Maybe because it has fewer plug-ins, but I think if I remember bare-bones Visual Studio 2010 correctly, this Visual Studio 11 one is still (slightly) faster.
    • Not much difference in editor for C#, but nicely improved editor for JS / CSS
    • The real differently looking was the team explorer & TFS features in general – mixed feelings about it
      • Not sure I like how Pending Changes is not a separate window anyone. I have to change the Active View to Work Items to find the query I want, click it, go back to Pending Changes, and then drage the work item I want to associate with changeset
      • The changed files show in folder hierarchy. You have two completely separate hierarchies for “Included” and “Excluded” files in/from the changeset. Makes it easier to avoid “checked-in this file by mistake” errors.
      • When comparing files, finally you get coloring (nice one), one of the modes is combined view (they still have 2, and 3 pane views), which does support live editing.  It’s not just text editing experience you get in some merge tools. It’s context-aware full VS editor experience. Things like intellisence, Go To Declaration, Find Usage, Refactor, etc.. and context menu options including those added by third-party tools like TestDriven.NET are available. .
        I found myself editing files in combined-compare view a lot and it makes it great seeing exactly what I’m changing
    • Needed to make a small hack to get TestDriven.NET working.
    • Of course I miss Resharper!  <– Not anymore! See below…

    I generally recommend using it, and think it’s safe and nice if you ask Smile

    Do your laptop RAM a favour – Do NOT upgrade your touchpad driver

    Problem

    image

    Synaptics is the most common touchpad driver for laptops. However, Synaptics touchpad driver takes SO MUCH RAM, even when you uninstall the "Scrype" application that comes with most recent versions of it.

     

    The 236 MB above is just a small number. I have set the process priority to "Low" to get only this. The default priority of the process is "Above Normal". If you are like me and rarely shut down your laptop, depending more on Sleep, etc.. this is going to bite hard because it just keeps growing….

     

    Details

    Here is one interesting discussion about it:

    This forum is a gold mine for laptop owners. I might blog how it helped me in other more important issues.

    http://forum.notebookreview.com/lenovo-ibm/565124-synaptics-touchpad-enhancements-using-over-512mb-memory.html

    Form the forum I got a really nice tip:

    The leak has been reported on Lenovo Forums, and has been reproduced on their end. You can roll back to an earlier driver. 15.2.1.0 and earlier don’t seem to be affected.

    Note that I have an ASUS not Lenovo and still affected. The problem is with the recent versions themselves.

     

    Generally Speaking

    So, the common advice here is to install the latest version on our laptop manufacturer’s site, not on synaptics.com!

    This tip is not new tip, it’s written in Synaptics driver download page itself:

    IMPORTANT

    The Synaptics device driver is customized to meet the specific requirements of your device manufacturer. To ensure that you get the appropriate device driver for your system, download your Synaptics device driver from your system manufacturer’s support website.

     

    Getting To The Point

    The new important note though, is to pick a version that is earlier than 15.2.1.0, even if that version is available on your laptop manufacturer’s page.

    Visual Studio 2010 Productivity Power Tools: Copy HTML To Windows Live Writer

    Just a quick note, if you install Productivity Power Tools For Visual Studio 2010.

    It has a nice feature.. Copy code as html. The feature doesn’t add any new menu option or whatever, simply when you copy the code the usual CTRL+C or Edit -> Copy way in Visual Studio, and paste it in a text-only editor like Notepad, it’ll be treated as text normally, but if you paste it in an HTML capable editor like Microsoft Word, it’ll be paste as HTML.

    Note

    If you already know what the feature is, and have a problem with Live Writer 2011 or similar version, you can skip to the title that mentions it.

    image

    • If you wonder how  made this rectangular selection, you can do it by pressing ALT before selection and holding as you move the mouse to continue to select
    • If you wonder why, simply to avoid the spaces on the left in the pasted code

    If I paste this in notepad, nothing new!

    image

     

    But if I paste in Word 2010 (Outlook is the same)

    image

    (it can be better if play with font size and text wrapping options)

     

    Or in Visual Studio HTML Designer

    image

    Note

    If I paste in source view or any other code-editor view in Visual Studio, it WILL not paste as HTML but as normal text. This is intended, because when you do copy / paste inside Visual Studio, you want it to just work, not have to clean all generated HTML

    This is related to the way this feature works. In Windows, you can have multiple formats of copied stuff in clipboard. Text and HTML are two of these formats. So, the feature is simply adding HTML format option to the clipboard, and Visual Studio built-in functionality of course adds the text format already.

     

    Windows Live Writer

    Obviously Windows Live Writer is an HTML editor for blog posts, among other features. And I bet it is as obvious that the most common use of this Copy HTML feature is to embed in your blog posts.

    Note

    Putting code in blog posts this way has its own disadvantages and disadvantages. Those, along with whether you should use this approach or not, are beyond the scope of this post.

    The Problem

    If you try to paste the code in Windows Live Writer using CTRL+V, here is what you get:

    image

    Hmm.. This is not just text (notice font type) and not complete style.

    Let’s see the source for that…

    image

    This is quite confusing, isn’t it? Clearly it DID realize we have some HTML, but the result has nothing to do with what we we have in Visual Studio at all !!

     

    The Supposed Non Working Fix

    If you look at the official announcement of the feature. or StackOverflow question like this (before I reply to it, months after the guy marked the correct solution already), you notice it says you need to paste using CTRL + SHIFT + V, not just CTRL + V. It means "Paste Special".

    You go enthusiast to Live Writer to give it a try, you press CTRL + SHIFT + V, ALT + K. But you may encounter the same other problem as me, it doesn’t work, at all, at least in my Windows Live Writer 2011.

     

    The Solution

    Well, after looking for the the "Paste Special" feature in Windows Live Writer, it was very close to me, in the context menu (right click inside text editor)

    image

     

    When clicked, we get the dialog in the official announcement, by default it selects the 2nd option, but we should select the 3rd, "Keep Formatting"

    image

     

    And here we go…

    image

     

    Works as advertised!

     

    BONUS:

    Copy HTML Visual Studio Productivity Power Tools Feature Settings

    Let’s look at the code we got inside Windows Live Writer (it doesn’t matter which application I guess)…

    image

    As you can see, this is really ugly code, so many <span> tags with inline styles, and even <font> tags (thought no-body uses them anyway) and so on.

    You can argue this is normal in this way of adding code to blog. You can argue this is why you should ignore this way completely. I’d ask you to have this discussion in the great post Scott HAnselman wrote about this and other approach in this case, but assuming we continue with this one, let’s see what we can and what we cannot improve here…

     

    In Visual Studio, Go To Tools -> Options, from the right side tree, navigate to Productivity Power Tools -> HTML Copy:

    image

     

    The first two options are like header / footer of the code. Those are the opening and closing tags of the generated HTML code. You can change them as you like, for example, for me, I’d add <code> tag around those since I have some extra CSS applied to this tag boxing style ad want my snippets to take it.

     

    The emit spam class will not use CSS styles if you sett to true, instead, will use certain CSS classes. Do not select it unless you know what the CSS classes are and have their styles. Also, if you add those styles to the blog CSS, it won’t show in RSS readers, and if you put in each post, it just feels wrong – again choice is yours after you read Scott’s post.

     

    The emit spam style is what created us the inline CSS. This is the default and unless you care about minimizing the noise you’ll be interested in trying the previous option and disable this one.

    You’ll want to enable the two if you are testing to see what inline styles will apply to <span> tags with which CSS classes.

     

    The option to replace line-breaks (new lines) with <BR> is something you normally won’t set to true. You can see the default surrounding tags include <pre>, and <pre> tag in HTML reserves spaces and line breaks, unlike other HTML tags.

    If you keep the line breaks and the <pre> tags, the code will be displayed properly in your blog, and when someone tries to copy it to their code editor (Which understands text only, even Visual Studio source/code editor as mentioned above) the line breaks will work correctly, but if you use <BR>, the text editor will not see them (As this is HTML not text) and will render multiple lines in only one, and the poor reader will need to add the line breaks on his own.

     

    The last option is what letter or code is used for space s(Assuming even tabs will convert to spaces).By default it uses the HTML code for spaces &nbsp;. If you are keeping the <pre> tag in your generated HTML, you can replace this with normal real SPACE letter (just replace the value in text box with one press on the space-bar in your keyboard). Since I recommend keeping the <pre> tag anyway, I recommend you use spaces directly too.

     

    Caution

    I noticed that with different plugins and options to render code in blog with Windows Live Writer, it quite affects the stability of the application. You can see it easily crashing when you move between Edit/Preview/Source views.

    Windows Live Writer has a nice recovery feature that usually work (sometimes insists on offering to recover what I recovered already. but that’s fine). However, you should also save yourself a piece of mind and press CTRL + S every now and then and specially before switching views. I press it all the time like crazy every line or less!

     

    Conclusion

    BTW, this is how the code looks for me on THIS blog:

    <font face="Lucida Console"><span style="color: " class="keyword"><font style="background-color: #000000" color="#cc7832">public</font></span></font><font color="#f9f9f9"> </font><span style="color: " class="keyword"><font style="background-color: #000000" color="#cc7832">static</font></span><font color="#f9f9f9"> </font><span style="color: " class="keyword"><font style="background-color: #000000" color="#cc7832">void</font></span><font color="#f9f9f9"> <span class="identifier"><font style="background-color: #000000">RegisterRoutes</font></span>(</font><span style="color: " class="User Types"><font style="background-color: #000000" color="#ffc66d">RouteCollection</font></span><font face="Lucida Console"></font><font color="#f9f9f9"> <span class="identifier"><font style="background-color: #000000">routes</font></span>)
    {
        </font><font style="background-color: #000000"><span class="identifier">routes</span><span class="operator">.</span><span class="identifier" style="color:#f9f9f9;">IgnoreRoute</span></font>(<span style="color: " class="string"><font style="background-color: #000000" color="#a5c25c">"{resource}.axd/{*pathInfo}"</font></span><font face="Lucida Console"></font><font color="#f9f9f9">);
    
        </font><font style="background-color: #000000"><span class="identifier">routes</span><span class="operator">.</span><span class="identifier" style="color:#f9f9f9;">MapRoute</span></font>(
            <span style="color: " class="string"><font style="background-color: #000000" color="#a5c25c">"Default"</font></span><font color="#f9f9f9">, </font><span style="color: " class="comment"><font style="background-color: #000000" color="#808080">// Route name</font></span>
    <font color="#f9f9f9">        </font><span style="color: " class="string"><font style="background-color: #000000" color="#a5c25c">"{controller}/{action}/{id}"</font></span><font color="#f9f9f9">, </font><span style="color: " class="comment"><font style="background-color: #000000" color="#808080">// URL with parameters</font></span>
    <font color="#f9f9f9">        </font><span style="color: " class="keyword"><font style="background-color: #000000" color="#cc7832">new</font></span><font color="#f9f9f9"> { <span class="identifier"><font style="background-color: #000000">controller</font></span> <span class="operator"><font style="background-color: #000000">=</font></span> </font><span style="color: " class="string"><font style="background-color: #000000" color="#a5c25c">"Home"</font></span><font color="#f9f9f9">, <span class="identifier"><font style="background-color: #000000">action</font></span> <span class="operator"><font style="background-color: #000000">=</font></span> </font><span style="color: " class="string"><font style="background-color: #000000" color="#a5c25c">"Index"</font></span><font color="#f9f9f9">, <span class="identifier"><font style="background-color: #000000">id</font></span> <span class="operator"><font style="background-color: #000000">=</font></span> </font><font style="background-color: #000000"><span style="color: " class="User Types"><font color="#ffc66d">UrlParameter</font></span></font><font color="#f9f9f9"><span class="operator">.</span><span class="identifier">Optional</span></font><font color="#f9f9f9"> }
        );
    
    }
    </font>

    Of course you know how to view source in your browser Smile

     

    BTW, this was NOT the blog post I wanted to have done this week. There is another one in the works, about how easy it is to work classes and converting them to different formats like JSON.

    If you know my public Github URL, you can get the code already, if not, stay tuned till this weekend or so Winking smile

    Fix Your Computer Time – Hotfix For Egypt TimeSaving أصلح ساعة جهازك–حل مشكلة التوقيت الصيفي في ويندوز

    Egypt has finally cancelled the Time Saving setting, however, computers and other devices still think it should take place from the last Friday in April. Microsoft has released a hotfix for Windows to solve this problem

    قامت مصر أخيرا بإلغاء التوقيت الصيفي، لكن ساعة الكمبيوتر و أجهزة أخرى مازالت مضبوطة على أن التوقيت الصيفي يبدأ في أخر جمعة في شهر أبريل. مايكروسوفت أصدرت ملف إصلاح لنظام ويندوز لحل هذه المشكلة.

     

    You can download the hotix from:

    يمكنك تحميل ملف التصليح من

    http://bit.ly/lvnmrE

    Steps To Apply Fix:

    خطوات تشغيل ملف الإصلاح

     

    image

     

    In the next page, scroll down till the part in picture

    فس الصفحة التالية. أنزل بالفأرة حتى الجزء المبين في الصورة

    image

    If you don’t know your platform, go to C: drive, if you have “Program Files” folder and “Program Files(x86)” folder then your platform is x64 (yes, x64 not x86). If you have only “Program Files” folder, then your platform is x86 (default).

    إذا كنت لا تعرف خيار 64 بت x64 أم 32 بت x86 ادخل على جهاز الكمبيوتر، الدرايف أو القرص الصلب C .. إذا وجدت فولدر أو مجلد Program Files(x86) و معه Program Files إذا وجدت الاثنين اختار 64 بت x64 أما إذا وجدت فقط Program Files إذا اختار 32 بت x86

    Continue scrolling to the next part in picture

    انزل بالفأرة للجزء التالي المبين بالصورة

    image

    Click on the picture to enlarge

    اضغط على الصورة للتكبير

     

    Go to your email, look for a message with subject “Hotfix download link you requested”. Open it

    إذهب إلى بريدك الاكتبروني .. ابحث عن رسالة بعنوان Hotfix download link you requested افتحها

     

    Scroll down to see something similar to this (not 100% similar, the part to the left of the line only is similar(

    انزل بالفأرة حتى تجد جزء يشبه الصورة التالية – لاحظ أن رسالتك سيكون بها بعض الاختلافات البسيطة عن الصورة

    image

     

    Run the file you just downloaded – The file name may be different than the picture

    قم بتشغيل الملف الذي قمت بتنزيله – قد سختلف اسمه عن الصورة

    image

    Then press “Run”

    ثم اضغط كما بالصورة

    image

    Then press “Continue”

    ثم اضغط كما بالصورة

    image

    Enter any folder name you choose even if it doesn’t exits as in picture, I choose “C:Hotfix”

    أدخل اسم أي مجلد (فولدر) تختاره حتى لو لم يكن موجود .

    image

    ÷If the folder doesn’t exist, you get the next dialog, press Yes

    إذا كان المجلد (فولدر) غير موجود يظهر الشاشة التالية

    image

    Paste the password you copied from the email message in the next dialog

    قم بإدخال الكلمات التي نقلتها من الرسالة في الشاشة التالية كما هو مبين – لاحظ الكلام سيظهر على هيئة نجوم و ليس حروف عادية

    image

    Press OK

    اضغط كما بالصورة

    image

     

    Go to the folder you entered in the previous step, in my case “C:Hotfix”

    You’ll find a file similar to next picture, run it

    اذهب إلى المجلد (فولدر) الفارغ الذي اخترته في الخطوات السابقة

    ستجد ملف مشابه (و ليس مطابق) للصورة – شغله

    image

     

    Wait until you get the following dialog, then click “Yes”

    انتظر حتى يظهر لك كما بالصورة ، ثم اضغط Yes

    image

    Just wait and don’t press anything

    انتظر و لا تضغط أي شيء في الجزء التالي

    image

    Press Close. You are done Smile

    اضغط كما بالصورة – مبروك، تمت الخطوات Smile

    image

     

    Note ملحوظة

    I originally found the link via @Bashmohandes

    قمت بإيجاد الرابط عن طريق @Bashmohandes

    Visual Studio “Run As Administrator” Only From Shortcut

    Intro…

    Last week I had to re-install Windows. I haven’t done it in a while, so, had to remember all those “1 time” tips I do after reinstall. For example, downloading SQL Server Developer Edition before Visual Studio to get the full Management Studio. Another example, setting Visual Studio to pin to the Start menu, and configuring it for UAC.

    The Problem

    In the very first year of Windows 7, I used to have many problems with UAC on and always disabled it, later, things started to get better and it became my normal config to leave it on. One problem that remained is that if you have a program set to always “Run AS Administrator”, if this program has associated files (can open files with certain extensions if you click the files), you no longer can open those files directly.

    So, like many, I do pin visual studio to the Start menu

    image

    I also need to set it to “Run As Administrator” in so many times (for stuff with built-in IIS, not much is on IIS Express).

    I right click the shortcut, go to “Compatibility” tab, and check “Run this program as an administrator”.

    image

    Note that this if done with any shortcut to Visual Studio devenv.exe file, has the same effect of doing it on the EXE directly, which is making the EXE require Admin permissions whenever run.

     

    The problem is, when I do that, clicking any .CS or .SLN file doesn’t work in Visual Studio…

    image

    So, I had either the option to remember to open Visual Studio as Administrator when required (and restart it if open without Admin privileges) or I have to open files only from Start menu shortcuts and pinned shortcuts and VS File –> Open

     

    Both are bad, because it’s very common for me to work on projects when I’m confortable with having VS run as admin, and many times also I get source code from the Internet and I just want to click an SLN file in Windows Explorer or even a CS file inside zip/rar file and quickly browse the code in the solution / file.

     

    The Solution

    One thing I discovered later, is that you can actually set only a shortcut to open the EXE as administrator, so that other shortcuts and the System itself opening the EXE will not require that permission.

     

    So, how can you do that? I right click the shortcut, choose “Properties” as usual, but this time I go to another tab, “Shortcut”, then click “Advanced”, and then check the OTHER “Run as administrator” checkbox:

    image

     

    The plan is simple. I apply this to the shortcut pinned to the Start menu and the task bar, so, whenever I click any of those, I get Visual Studio running as Administrator, but, when I open a file from Windows Explorer or Zip/Rar file, I do NOT run VS as Administrator (because as mentioned above, it won’t work anyway).

     

    Disclaimer

    This is not much of a very secret trick or something, but I’m trying to get back to blogging more and more by writing anything that comes to my head like this one. You ideas are always welcome either on this one or on other topics you might want me to blog about.

     

    Regards,

    Small Tip: Using #Console2 With #PowerShell

    Lately I have been doing more stuff on the Console as getting to Ruby and messing a bit with Git and stuff.

    Generally speaking the default Windows Command Prompt is really fine for my needs, but I sure would love to see more possibilities. PowerShell was a great scripting / tooling addition but not much of “Editor” / “Environment” improvement. PowerShell ISE (integrated Scripting Environment) is really so nice and powerful, but it doesn’t feel exactly like my usual Console. I tried Console2 and was really impressed with how similar and different it is in the same time.

    Surely, it didn’t mean I have to lose PowerShell features in there!

    Get Console2

    Just grab it from http://sourceforge.net/projects/console/files/console-devel/.

    By the time of writing v 2.0 was the latest. I just went to that folder and got the latest Zip in there. Yeah. No install, just a Zip file, so, you may need to make a shortcut for it on your own and / or place it in somewhere that’s already in your Windows ENVIRONMENT variables.

    Find the Path To PowerShell

    The way I did it was go to Start menu, type in PowerShell in the search box, and right click the PowerShell icon, and choose Properties.

    image

    Then as you saw me do in many other posts, just copy the “Target” value:

    image

    Keep that value somewhere. We’ll need it.

    Configure Console2

    Now open Console2, Edit menu, “Settings…”

    image

    Then in the Settings “Console” section, set the value for “Shell” to the value you copied in previous steps.

    image

    Press OK, then the very left icon in toolbar to get new tab.

    image

    We get our PowerShell prompt as expected!

     

    Pretty easy, ha?

     

    P.S.

    I realize the default font doesn’t look too good. In Settings, you can go to “Appearance” section, Font –> Name, press the “…” button next to that (not the “Size” text box in there. It will not work). and change the font name and size in there.

    EgyGeeks Podcast 2: Joel’s Test

    About EgyGeeks Podcast

    If you don’t know what is EgyGeeks Podcast, I highly recommend checking out my first blog post about it.

     

    In brief, EgyGeeks is an usergroup of many developers (mainly Egyptian .NET geeks, but not only) that started with some online gatherings instead of usual offline ones, and now starting to add podcasts to the game (In Arabic)…

     

    Personal Blah Blah Blah Part…

    If you remember that I haven’t made it to the first “published” episode (maybe some day we decide to publish the very first secret episode, who knows!), well, I was lucky enough to make it to this one though!

     

    Podcast’s 2nd Episode: Joel’s Test

    This time the topic is Joel’s test. If I remember correctly, It was @AmrElDib’s idea. Nice one.

    Joel’s test is a set of 12 questions that try to be a general standard scale for software companies, especially to use for those considering offers for different companies and want to evaluate how professional is the work in there. They are advised to ask those question to the companies.

     

    The Discussion

    It’s very old test though, ten years or something. We thought we get to introduce the questions and see what interesting conversations might come out of these.

    By the end of the episode, we learned a great value that just jumped out when we started discussing what should be applied and what is really applied in different companies, and –what showed up as more importantly– what to do when some are not applied and you believe they really matter.

     

    Disclaimer

    As you’ll read below. We really don’t know how to manage this yet and learning it just by trial. You’ll hear so many “I think … ”, weird transitions, etc..

    We hope you’ll still find the podcast fun, and really really ask you to tell us what bothered you most to focus on improving in the next episodes.

     

    The Podcast

    The official announcement and link to the 2nd episode can be found at:

    http://www.egygeeks.net/2010/12/egygeeks-podcast-2-joels-test.html

    In a new episode of EgyGeeks podcast, we discuss Joel Spolsky’s famous 10-years-old blog post about a 12-questions test for your development environment.
    Hosts: Amr Eldib, Mohamed Meligy, and Emad Mokhtar.

    You can listen here

     

     

    Or download MP3.
    Subscribe to this podcast via RSS (for Zune and other players).
    Subscribe to this podcast for iTunes.
    Visit our Podcast page.
    Find us on Twitter @EgyGeeks

     

    Feedback … Feedback … Feedback …

    As you may realize,, we really are not sure how this podcast should go. How the podcast style should be like. What topics may interest you more than others. We need you to tell use!

    We realize that this podcast is fun, and we realize that we learn a lot from sharing ideas in any way, but still, only you can tell us how to improve this podcast to suit more people.

     

    Please leave your comments in the announcements post, here, on the Facebook group, mentioning the twitter account, any way you like. We are really waiting for some…

    Export Only Specific Revisions Changeset From SubVersion / SVN (TortoiseSVN)

    Today I was supposed to deploy some changes on company static website made by web designer. The website source is hosted using SubVersion (SVN). I thought it’ll be great if I can export just the changes he did with their folder structure and without asking him to do anything extra, and deploy that.

     

    Here are the steps using TortoiseSVN:

    1. Right Click The working, choose TortoiseSVN => Show Log
      image
    2. Since he used multiple revisions, I selected the those revisions, right clicked, and chose “Compare revisions”
      image
    3. Selected all files, right click, and choose “Export selection to…”
      image
    4. Simply choose the destination folder from the folder selection dialog that comes up, and here we go.

     

    That was very quick hint, but hopefully helpful to someone. I’m sure there must be other ways to do it also BTW, but this was the quickest to try with an empty head.

    Set Visual Studio to use your default proxy & credentials to access Extension Manager & NuGet Restore

    Update

    The instructions have been tested on Visual Studio 2010, 2012, 2013, and 2015.

    In VS 2010, extension manager is part of a nice new generation of VS plug-in system. One of the great features of it is how it can go online talk to Microsoft Visual Studio Gallery website to retrieve list of extensions there, automatically discovering updates for installed extensions, and allowing me to add new extensions directly from within Visual Studio.

    The Problem:

    However, in my company I could not take benefit of that for long time. Reason is, the company uses Blue Coat proxy, with some active directory based authentication. We cannot access the Internet unless we use that proxy, no direct connection allowed, most other proxies are also blocked (by blocking the common proxies port 8080 and many other common ports).

    Although I have the proxy set in Internet Explorer, and I have the username/password stored in my Windows Credentials store  (Start–> Run–> Control PanelAll Control Panel ItemsCredential Manager) -since my primary work laptop and user account on it are not part of the company domain-, Visual Studio did not seem to be able to use that.

    Anything that requires online communication not directly using the browser is not working. The main feature missed by this is Extensions Manager integration with the Visual Studio Gallery online.

     

    Another side effect of the problem was when running tests with TestDriven.NET test runner (running using Debugger or In-Process), as I had some tests that required connecting to online websites.

     

    The Cause

    It turns out (just by guessing and trial-error way) that the default proxy settings for .NET apps is for some reason not to use the system proxy and credentials. Visual Studio will be default ignore that proxy (and many other .NET applications will).

     

    The Solution

    Thanks God, .NET applications have a nice extensibility feature for things like this using the app.config file (if it was unmanaged application, I’d have no way to it).

     

    Troubleshooting this issue in TestDriven.NET was what inspired me to get this, as I was trying to setup the credentials in the app.config file of the test project and then in Visual Studio.

     

    So, I needed to setup the proxy settings in the Visual Studio config file., Knowing the Visual Studio IDE executable “devenv.exe”, the file I’m looking for is “devenv.exe.config”. I didn’t need to create that file (which is easy, just a standard .config file with the same name as the executable including “.exe”) because Visual Studio already has a config file with bunch of existing configuration defaults.

     

    I want to the Visual Studio 2010 shortcut in Start-> All Programs, right clicked it, then chose “Properties”.

    In the following properties Window, I clicked “Open file Location”:

    image

     

    This took me to the Visual Studio folder that has the “devenv.exe” and “devenv.exe.config” files:

    image

     

    I opened this file in Visual Studio (yes, it’s OK – the effected showed after restarting VS of course):

    The section I was looking for is under “<system.net>”. The config file already had this section to enable IPv6 (which is not enabled by default, yet another interesting default and override – I commented the override anyway later).

    image

    I modified it with this simple change:

    image

     

    The complete XML for copy-paste sake:

    <system.net>
            <defaultProxy useDefaultCredentials="true" enabled="true">
              <proxy usesystemdefault="True" />
            </defaultProxy>

    As you can see, this is very simple. It enables the proxy, tells Visual Studio to use the system (IE) oroxy, and to use the default credentials for that.

     

    This was all required to do the trick. You just need to close Visual Studio and re-run it afterwards to take effect.

     

    Hopefully this saves someone else facing a similar issue…