Sponsored by Gluten Free Waffles and Sliced Bananas

Wednesday, April 28, 2010

Banana Peels: Casting a string or int to an Enum

10:34 AM Posted by Tyson Nero No comments
I always find myself researching how to cast to an Enum. If you're like me, here's the simple solution.

Using a string:
MyEnumType myEnum = (MyEnumType)Enum.Parse(typeof(MyEnumType), theString);

Using an int:
MyEnumType myEnum = (MyEnumType)theInt;

Wednesday, April 21, 2010

Windows 7: Chuck Norris Approved

6:56 AM Posted by Tyson Nero No comments
One may wonder... Is Windows 7 Chuck Norris approved? Through some discreet sources, Code Monkeez has learned that not only did Chuck Norris approve Windows 7, but it was actually his idea!

Tuesday, April 20, 2010

The Ultimate SQL Search Tool (Free!)

6:14 AM Posted by Tyson Nero No comments
Does your company have it's own custom SQL search stored procedure that hardly works? Are you constantly searching for database objects but don't know where to find them? Well, Red Gate® Software has the perfect tool to meet your needs: SQL Search.

This add-on hooks right into SQL Server Management Studio to dynamically search across servers, databases and objects for fragments of text. Results are listed while you type and display in a preview window for respective objects with your search terms highlighted.

If your company is not using SQL Search, they are missing out.

http://www.red-gate.com/products/SQL_Search/index.htm

Tuesday, April 6, 2010

ASP.NET MVC: Authorizing Users with the [Authorize] Filter

4:11 PM Posted by Tyson Nero No comments
MVC makes it easy to declaratively authorize users at the method and class level, and you don't even have to write any code. Implementing the logic is as simple as adding a [Authorize] attribute to your action methods or model classes.

User must be logged in:

[Authorize]
public ActionResult Create()
{
    ...
}

[AcceptVerbs(HttpVerbs.Post)]
[Authorize]
public ActionResult Create()
{
    ...
}

Use action filters to specify users and roles:

[Authorize(Users="me,you,them")]
public ActionResult Create()
{
    ...
}

[Authorize(Roles="admin")]
public ActionResult Create()
{
    ...
}

Friday, April 2, 2010

How To Study for the 70-536 Application Development Foundation Exam (And Hopefully Pass)

10:12 AM Posted by Tyson Nero No comments
Exam 70-536 - TS: Microsoft .NET Framework - Application Development Foundation is the prerequisite exam for the following MCTS certifications:
  • .NET Framework 2.0 Web Applications
  • .NET Framework 2.0 Windows Applications
  • .NET Framework 2.0 Distributed Applications
  • .NET Framework 3.5, Windows Presentation Foundation Applications
  • .NET Framework 3.5, Windows Communication Foundation Applications
  • .NET Framework 3.5, Windows Workflow Foundation Applications
  • .NET Framework 3.5, Windows Forms Applications
  • .NET Framework 3.5, ADO.NET Applications
  • .NET Framework 3.5, ASP.NET Applications
http://www.microsoft.com/learning/en/us/Exam.aspx?ID=70-536

The 70-536 covers a wide array of .NET Framework topics, many of which you may never use in real life. The amount of information covered can seem overwhelming and it will be, but Microsoft does a good job of spelling out the topics you should know. The skills measured are as follows:
  • Developing applications that use system types and collections (15 percent)
  • Implementing service processes, threading, and application domains in a .NET Framework application (11 percent)
  • Embedding configuration, diagnostic, management, and installation features into a .NET Framework application (14 percent)
  • Implementing serialization and input/output functionality in a .NET Framework application (18 percent)
  • Improving the security of .NET Framework applications by using the .NET Framework security features (20 percent)
  • Implementing interoperability, reflection, and mailing functionality in a .NET Framework application (11 percent)
  • Implementing globalization, drawing, and text manipulation functionality in a .NET Framework application (11 percent)
Here is a more detailed list:
http://www.microsoft.com/learning/en/us/Exam.aspx?ID=70-536#tab2

I recently passed the 70-536 with a score of 838 on my first attempt. Below are my recommendations for studying and taking the exam.

Studying for the exam
  1. Buy and read the Microsoft book
    MCTS Self-Paced Training Kit (Exam 70-536): Microsoft .NET Framework 2.0 Application Development Foundation
    1. Follow the test objectives laid out in the beginning of the book.
      1. It's up to you if you want to read the book front to back or in order of the objectives.
    2. Read and answer the review questions at the end of each section.
    3. Complete the code labs at the end of each section.
    4. Use the free MeasureUp exam prep software that comes with the book.
      1. You can break the exam up by test objective. As you cover a specific objective, focus the exam questions on what you have already covered.
  2. Purchase and practice reputable exam prep material
    Here are some widely used recommendations:
    1. Transcender
    2. Self Test Software
    3. MeasureUp
    4. When going through practice exams, focus on a specific objective at a time. When you are scoring 95-100% on that objective move to the next. When you are scoring well on all objectives separately, begin practicing exam questions all together. Get to the point where you are scoring nearly 100% every time.
  3. Avoid brain dumps!
    Be aware of brain dumps and non-authorized exam prep materials. If you are caught using such materials, Microsoft will permanently ban you from any future certifications: http://www.microsoft.com/learning/en/us/certification/exam-policies.aspx#bans.
  4. Watch exam prep webcasts and online videos
    1. Microsoft Learning Events
      http://www.microsoft.com/learning/en/us/community/events.aspx
    2. 70-536 Walkthrough
      Exam Coaching Session: Exam 70-536: TS: Microsoft .NET Framework – Application Development Foundation
    3. 70-536 Cram Session
      http://blogs.msdn.com/trika/archive/2008/06/12/70-536-prep-session.aspx
  5. Focus on the .NET 2.0 Framework
    The exam will favor answers that involve items newly added with the 2.0 Framework.
  6. Read the Microsoft book again!
    Now that you know what topics you need to be familiar with in detail, go back in the text and study them specifically.
  7. Take notes from the book
    1. It will be easier for you to remember a specific topic if you have written it down by hand.
    2. This will also allow you to summarize what you need to study rather than constantly referencing the book.
  8. Write down test questions and answers
    1. This will increase your memorization of what could potentially be on the exam.
    2. Having the questions and answers on paper will allow you to quickly review and study without the need to access exam software.
Taking the exam
  1. Show up early
    Use the extra time to review your notes.
  2. Take your time
    You have about 2 hrs to finish the exam but will most likely finish in less than an hour. Don't Rush!
  3. Review your answers
    Be sure to check your answers 2 or 3 times before moving to the next.
  4. Filter out answers based on differences
    Sometimes, the answers will look identical. Closely examine methods, properties, ect. to spot the differences and remove the answers that don't belong. This will increase the probability of choosing the correct answer.
  5. Answer each question
    You only get points for correct answers and will not be deducted for incorrect ones. Even if you don't know the answer, just guess.
I hope this helps any prospective 70-536 test takers. Good luck and be prepared.