If you`re using your WP7 within a WLAN like me ( is there anyone who doesn`t? 🙂 ) and think about security, you might want to add your WP7 to the MAC-Address filter in your router configuration. What first comes to mind is, where the heck am I able to find the MAC-Address of my Phone?? There is no info the phone settings or anywhere else.

So here`s the solution for that!

  • connect your phone to your WLAN
  • open up a browser and navigate to your routers configuration site (e.g. 192.168.0.1)
  • search for a tab or menupoint called status or logs
  • click on “network clients” or similar

After this steps, you should see something like this

In the above screeshot you see my actual network clients connect to my WLAN. One is my laptop and the other one should be my Windows Phone 7. To check this, just open up the command prompt and use ipconfig /all to look up the MAC-Address of the machine. So you know that the other MAC-Address in the router config is the WP7!

Est voila 🙂 now you`re able to add your WP7 device to your MAC-Address filter.

This is the start of my (hopefully) weekly WP7 developer roudnup series which aggregates information of interest to Windows Phone 7 developers. I want to share every good article, link or video which I find helpful and/or worth reading…

I kick it off with a collection of great links for WP7 development, such as step-by-step or should I say day-by-day tutorials, tipps and tricks and helpful How-Tos!

31 days of Windows Phone 7[eng] (Jeff Blankenburg)
How to capture audio from your microphone in WP7[eng] (Derik Whittaker)
A Step-By-Step Guide To Building And Deploying A Windows Phone 7 Application To Marketplace[eng] (colonizer)
Windows Phone 7 – Das portable Tor zur Welt[ger] (Tom Wendel)
WP7 Development Tips[eng] (Kevin Marshall)
Windows Phone 7 PDC Sessions (Ken Jones)

Inspired by a question in the german Windows Phone 7 msdn forum about the possibility of using generic covariance interfaces in WP7 development, I`m writing this blogpost.

Generic covariance and also contravariance for interfaces and delegates were introduced as new features in C#4.0. Also two new modifiers for type parameters came along with it –> in and out, which indicate wether the interface or delegate is co- or contravariant.

Here`s a little code-snippet:

 

While this works fine on the desktop, I figured out that one isn`t able to use this feature for windows phone 7 development!

It`s because of the .NET Compact Framework CLR, which runs on a WP7 device. While you write Silverlight or XNA applications, it`s limited to the Compact Frameworks CLR, which doesn`t support the newest C#4.0 features such as generic co- and contravariance for interfaces.

But I come to the conclusion that the lack of this feature is no big deal! 🙂 Just wanted to share this experience…

As the title suggests, this blogpost is all about setting up Git on your Windows machine and connecting it to Github.com, a great open source Git repository hosting service with social components!

There are several steps one have to follow. I present you an logical order so the whole setting-up process should work fine!

  • Download msysgit from http://code.google.com/p/msysgit/ This is the “Git for Windows” package. On the left side of the msysgit-Page choose either the netinstall- or the fullinstall-package. Download msysgit and install it on your machine. If the installprocess was successful you will see a BASH window like this below

image

Within the shell you`re able to use all Git features just by hacking in the appropriate commands.

  • After successful installing Git for Windows, head over to Github.com, create an account, if you don`t have one already and create a repository, give it a name and follow the Github instructions.
  • At some point you have to enter a public key. You can generate you a key by using the ssh-keygen command within the bash. Just type ssh-keygen –t dsa for example. A dialog like the following appears

Generating public/private rsa key pair.
Enter file in which to save the key (/Users/cordellcp3/.ssh/id_rsa): <enter>
Enter passphrase (empty for no passphrase): <enter>
Enter same passphrase again: <enter>
Your identification has been saved in /Users/cordellcp3/.ssh/id_rsa.
Your public key has been saved in /Users/cordellcp3/.ssh/id_rsa.pub.
The key fingerprint is:
50:43:77:c6:97:af:61:82:dc:ea:9b:6b:67:d4:1b:61

  • It automatically adds a new entry in your known_hosts file. Now switch to your .ssh/ folder and open your generated id_rsa.pub file and copy the complete line ssh-rsa AAAA… to the clipboard. After that head over to GitHub.com, click on “Account Settings”, choose SSH Public-Keys and past your copied content in, save it and your done!

I hope that this post is a help for someone, who wants to start using Git and Github Smiley

There are also PlugIns for Visual Studio (2008, 2010) like Git Extensions or Git Source Control Provider.

Intellisense Code Snippets

21. October 2010

Every now and then, when I`m programming at home I deeply miss some features which I`m used to at work! What comes first to my mind is R# ReSharper by JetBrains, but Id on`t have a license at home.
I often use the built-in code snippets for all kinds of tasks, which I miss at home, so today I played around with <strong>Intellisense Code Snippets</strong>! It`s really easy to write custom code snippets which faciliate your work.

So I wrote a snippet for generating public properties surrounded with regions. Here it is…

Sorry about the image. Got some issues with the code-snippet plugin in Live-Writer.

If you look at the code, it should be self explaining. Nothing too difficult there. All you have to do is to copy the *.snippet file to the appropiate folder, e.g. <em>\Program Files\Microsoft Visual Studio 10.0\VC#\Snippets\1033\Visual C#\</em>

I named my snipped “biprop.snippet”, in the code editor within VS2010 you can now simply type biprop + TAB and the code is generated for you.

In software development, one is often tempted to have method-sginatures with ten or more paramters, which isn`t good at all and will make your method difficult to understand and maintain. Some programmers use global variables to avoid passing too many parameters around, but that`s bad design and very risky, if other parts of the program overrides the same variable! Please don`t do that, that`s really a NO-GO!!

Imagine that your code looks like this:

private Boolean InitializePreloader(Int32 id, String opCode, String logFile, String mbxPos, Int32 mbxType, String info, String foo, String bar, Byte sign)
{
	//do some work...
	return true;
}

All of these parameters relate to one purpose, to initialize an object, in this case a preloader! What you can do now is to write a class for example called PreloaderSettings.cs . In this class you define all the parameters of the InitializePreloader-Method as properties! For example:

public class PreloaderSettings
{
    public Int32 Id {get; set;}
    public String OpCode { get; set; }
    public String LogFile { get; set; }
    public String MbxPos { get; set; }
    public Int32 MbxType { get; set; }
    public String Info { get; set; }
    public String Foo { get; set; }
    public String Bar { get; set; }
    public Byte Sign { get; set; }
}

After that your new method signature could look like this!

private Boolean InitializePreloader(PreloaderSettings settings)
{
    //do some work...
    return true;
}

Doesn`t that makes your code a lot cleaner, easier to maintain and to understand?!

BlogPosts[0].ToString();

9. October 2010

Hi there,

I`m starting this new blog, cause of a video of an inspiring talk by Scott Hanselman “Social Networking for Developers”! I am a Developer and feeling addressed, so here am I 😉

I must say, that I was into in this social things before. Since last year I`m on Twitter (follow me @cordellcp3) and once had a Blog when I was a student at university. But the whole blogging thing wasn`t handled right by me, but now a little more older and wiser and after watching this Video by Scott Hanselman, I have simply have to start over a blog to become, like he said, a better developer! 🙂

Btw. if you`re a Developer too, I recommend you a great podcast

(click on the pic)

which also slightly helped me to find an appropriate title for my blog, as you can imagine.

so long…