Scott Hanselman

ASP.NET Wiki Beta

February 8, '08 Comments [17] Posted in ASP.NET | Learning .NET | Microsoft
Sponsored By

imageOne of my first projects when I started working here is an ASP.NET Wiki. ScottGu had the idea and my team had to make it happen. The Beta (finally!) launched today. A lot of work went into the development and seeding of this project.

The idea is that folks spend a lot of time trolling the blogs, googling live-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

Search is great, but for targeted answers you can't beat the one-two punch of search plus human  editing. I spent a long time looking for content and seeding the wiki, but there's still piles to do. Hopefully it won't be just me editing it.

What's the point:

  • To provide a targeted, categorized, human-hand-edited, and living Wiki for finding answers to ASP.NET questions.

You can leave comments on the content, there's RSS feeds, and you add your own updates and make it better. You'll also get recognition points if you're a member of the http://www.asp.net community.

image

You can get there from http://wiki.asp.net/ and it's also been added to main tab menu of http://www.asp.net. Folks are already starting to discover the site and make changes. I hope you find it helpful!

Thanks above all to my friend Ward for inventing the Wiki in the first place!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Using an IDE to write PowerShell Scripts

February 8, '08 Comments [10] Posted in PowerShell
Sponsored By

imageI was writing a PowerShell Script for the 2008 Window Scripting Games (are you in the games?) and I found writing a long complex script using only a text edit to be really tiring.

I blogged about a PowerShell IDE two years ago, but for whatever reason it didn't stick. I didn't start using it regularly and fell back to the command-line and notepad.

However, while I was writing scripts for the Games I got fed up with just the command-line. I went back to http://www.powershell.com and starting coding in the PowerShellPlus Editor. You can get it free. Schweet.

This IDE has come so far and it's a joy to use. It's got a debugger and intellisense and syntax highlighting. It's like SQL Analyzer, but for PowerShell. It's a great way to not only learn PowerShell but it's very powerful for advanced users. Seriously, go get it.

UPDATE with $50 off COUPON: From the comments: "So we have a special deal for loyal hanselman fans..For the next 2 weeks we will give $50 off our price of $129, giving you our PowerShell Suite for only $79.  However we've only set up the coupon code with google checkout, so you'll have to checkout through there. So basically add the item to your cart, and check out with Google checkout and use the coupon code: hanselman and you'll be on your way."

Related Posts

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 99 - Mac Development with Panic's Steven Frank

February 8, '08 Comments [15] Posted in Podcast
Sponsored By

stevesunchips My ninety-ninth podcast is up. Seriously, 99. That's INSANE. We've got a special guest for the 100th show next week, but this show is equally awesome.

In this episode, I sit down with Steven Frank, co-founder of the Award-Winning Mac Development shop Panic. Panic develops software like Transmit (THE Apple FTP client), Unison (The Apple NNTP client) and most recently Coda, a "one window" web development IDE.

Oddly enough, they are also the only licensed provider of Katamari swag in North America, and their shopping cart interface is bangin'.

Subscribe: Subscribe to Hanselminutes Subscribe to my Podcast in iTunes

If you have trouble downloading, or your download is slow, do try the torrent with µtorrent or another BitTorrent Downloader.

Do also remember the complete archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Telerik is our sponsor for this show.

Check out their UI Suite of controls for ASP.NET. It's very hardcore stuff. One of the things I appreciate about Telerik is their commitment to completeness. For example, they have a page about their Right-to-Left support while some vendors have zero support, or don't bother testing. They also are committed to XHTML compliance and publish their roadmap. It's nice when your controls vendor is very transparent.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Visual Studio Programmer Themes Gallery

February 7, '08 Comments [50] Posted in ASP.NET | Microsoft | Programming | Silverlight | Tools | Windows Client
Sponsored By

UPDATE: http://studiostyles.info/ for a great growing community of Visual Studio Styles and Themes. You can create, import and export themes in your browser!

Import and Export Settings Wizard More and more I find myself "skinning and themeing" my Visual Studio development environment in order to stay frosty. It's surprising how changing your theme (fonts, colors, etc.) can re-energize me when I'm having trouble with some problem or motivation.

Here's a gallery of some nice Visual Studio Themes to refresh your look.

Remember to always back up your settings so you can get back to the way things were and have no fear when you're changing your settings. Note also that some of these settings files you'll find out in the wild may (mistakenly) have Keyboard Bindings included. You'll want to selectively import just the fonts and colors that you want and avoid importing over your own custom keyboard settings.

I switched to a darker scheme a while back, as have many others. I also spent a while looking for the perfect font as have others. When you stumble on a 2005 theme that you want ot use in 2008, Tomas has an XSLT to make the transition smoother.


Oren Ellenbogen's Dark Scheme

A lot of the darker schemes like Oren's don't use a True Black, but an "off  black." His theme is very low contrast and uses muted, relaxing colors.

ide_colors_regular


Mike "Blowmage" Moore's Ruby Blue

This is a low-contrast calm schema, but operators and numbers have a little "pop" to them.

image 


Vibrant Borland by Mawi

This one bring backs good memories of writing Borland C++ with OWL and Turbovision, with a little Norton Commander thrown in for fun.

image


CodingHorror

One of the few light-colored themes, Jeff's also uses a custom font to make 0 and O stand out. Note that the white background is more of a paper-colored off-white.

image


Dave Reed's Jedi Scheme

Dave's schema uses a complete black, and a neon blue. A little intense, but much higher contrast.

image


Damien Guard's Humane

This earthy theme includes little details like smart fonts and italics.

 image


Tomas Restrepo's Themes

Tomas has done a huge amount of work in this space. You can get seven of his themes here. He's even got a tool to port color schemes from Visual Studio to SQL Management Studio.

Desert Nights

This theme uses the greatest range of colors outside of the Vibrant Ink them, and approaches, but doesn't reach, a number of primary colors.

image

Garden of Eden

Green, Kermit-green, sea-green, they are all here in this blue-green theme.

image

Ragnarok

Initially similar to many dark themes, this one uses complementary colors to provide contrast between identifiers and keywords, string literals and comments.

image

Nightingale

A more cheerful dark theme that includes italics for string literals and brighter neons for keywords.

image

Moria Alternate

This uses Deja Vu Sans Mono as it's font and uses a lot more neutrals and grays outside of the keyword space.

image


Brad Wilson Dark Visual Studio

A muted, low-contrast theme with blues and purples. Even the yellow is relaxed.

 image


Martin Plante (slimCODE)

Martin likes small text, no ClearType to take advantage of crisp LCD screens. Rather than committing to blue or black he goes for a navy-gray-blue background.

image


John Lam's Vibrant Ink Port

John's trying for a straight port of Textmate's famous Vibrant Ink. This is a sharp, bright, neo-classic theme. Note his use of Monaco.

image


Rob Conery - Textmate

This is Rob's take on Vibrant Ink, added Consolas as the font, some bolding, and lowers the contrast a smidge.

image


Post links your themes in the comments!

Related Posts

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

The Weekly Source Code 15 - Tiny Managed Operating System Edition

February 4, '08 Comments [15] Posted in Learning .NET | Microsoft | Musings | Programming | Source Code
Sponsored By

Thanks to Thijs Kroesbergen for the pointer to this week's source. He turned me on to a tiny Operating System written in C# called "Cosmos (C# Open Source Managed Operating System)". As the project says, why? Because it's fun! I wrote a Tiny Virtual OS in C# for an Operating Systems class I took while I was going to school at night.

And so, Dear Reader, I present to you fifteenth in a infinite number of posts of "The Weekly Source Code." Here's some source I was reading this week.

First, I went back and looked at some of my source code from the Tiny OS project. It was written, largely at night, in .NET 1.1. It was for a 10 week (one term) project, and I wrote it all in a weekend so as to have the rest of the term free.

It's pretty horrific to read old source. I would propose that if you can look at old code you wrote and feel good about it that you're either insane, deranged or a really good programmer. One of those three.

Do remember that this project was a tiny Virtual OS. We were given an Instruction Set for our little processor and a format for programs and the goal was to write an OS to run them.

Here's the constructor for my MemoryManager. I'm sure doing a lot of work in the constructor! One of the fun little things I did for this Tiny OS was to swap memory pages as XML Files. It was a little joke because XML was such overkill and overhead for something so nuanced as a memory manager. I figured since I was simulating an OS's behavior using something as high-level as .NET, then why shouldn't I swap fake memory to disk as XML?

I wanted the source for this Tiny Virtual OS to ready like all the psuedo-code we'd been looking at in the Operating Systems books.

Looking back, I think it'd have been cool if I'd made a WinForms host and did a graphical view of memory that would allow folks to see things like memory fragmentation. Maybe I'll do one in WPF or as an XBAP, it'd be a cool learning tool for some of the students I talk to.

public MemoryManager(uint virtualMemSizeIn)
{
	// Find a size for addressableMemory that is on a page boundary
	virtualMemSize = CPU.UtilRoundToBoundary(virtualMemSizeIn, CPU.pageSize);

	// Size of memory must be a factor of CPU.pageSize
	// This was asserted when the CPU initialized memory
	uint physicalpages = (uint)(CPU.physicalMemory.Length/CPU.pageSize);
	uint addressablepages = (uint)(virtualMemSize/CPU.pageSize);
	
	_pageTable = new ArrayList((int)addressablepages);

	// Delete all our Swap Files
	foreach (string f in Directory.GetFiles(".","*.xml"))
		File.Delete(f);

	// For all off addressable memory...
	// Make the pages in physical and the pages that aren't in physical
	for (uint i = 0;i < virtualMemSize; i+=CPU.pageSize)
	{
		// Mark the Pages that are in physical memory as "false" or "not free"
		MemoryPage p;
		if (i < CPU.physicalMemory.Length) 
		{
			p = new MemoryPage(i, true);
			freePhysicalPages[(int)(i/CPU.pageSize)] = false;
		}
		else p = new MemoryPage(i, false);

		_pageTable.Add(p);
	}
}

Now my OS a trinket, to be clear. Cosmos, on the other hands, is darned interesting. How could you create a REAL OS (meaning an actual bootable OS off of hardware, be it virtual or physical, using IL? You translate the IL to ASM, of course. Very cool and darned clever.

Cosmos includes a compiler (IL2CPU, which is part of Cosmos) that reads the input file (usually the shell) and Cosmos libraries and compiles the resulting IL to x86 code. IL2CPU has a layer for cross platform and we plan to support other processors and platforms, including x64. IL2CPU also supports certain extension methods which allow C# code to interact directly with the CPU, registers, and ports in the kernel. IL2CPU contains some inline assembler, but there are no ASM files that need to be linked in.

Currently IL2CPU first outputs raw asm files (with IL comments) and then processes them through nasm (a free assembler). Later we plan to emit directly to binary.

The scenarios that Cosmos could be used in are very interesting. Because it's easy to write to and easy to build, you could create little mini-OSes with just the features you want. You could make an OS that just does DNS, or just does some REST service. Who knows. (Yes, I know you could also do a stripped down Linux). There is also talk about getting Cosmos to work on the Wii.

The example below is from Indy.IL2CPU.Assembler.X86.Native. As you can see, IL2CPU writes out ASM.

protected override void EmitDataSectionHeader(string aGroup, StreamWriter aOutputWriter) {
    base.EmitDataSectionHeader(aGroup, aOutputWriter);
    if (aGroup == MainGroup) {
          aOutputWriter.WriteLine("section .data");
          aOutputWriter.WriteLine("_start:  ");
          aOutputWriter.WriteLine("; multiboot header ");
          aOutputWriter.WriteLine("MBFLAGS equ 0x03 ; 4KB aligned modules etc., full memory info,  ");
          aOutputWriter.WriteLine("                        ; use special header (see below) ");
          aOutputWriter.WriteLine("dd 0x1BADB002           ; multiboot signature ");
          aOutputWriter.WriteLine("dd MBFLAGS              ; 4kb page aligment for modules, supply memory info ");
          aOutputWriter.WriteLine("dd -0x1BADB002-MBFLAGS  ; checksum=-(FLAGS+0x1BADB002) ");
          aOutputWriter.WriteLine("; other data - that is the additional (optional) header which helps to load  ");
          aOutputWriter.WriteLine("; the kernel. ");
          aOutputWriter.WriteLine("; end of header ");
          aOutputWriter.WriteLine("MultiBootInfo_Memory_High dd 0");
          aOutputWriter.WriteLine("MultiBootInfo_Memory_Low dd 0");
 }

There's lots of methods like this that do the hard work. The orchestration, however, is up in Engine.cs, where assemblies are taken appear via reflection, and their methods are taken apart using the obvious (my psuedo-code):

foreach Type in Assembly
   foreach Method in Type
      ProcessMethod into ASM (via ProcessAllMethods)

Using an interesting ILReader, a useful class in and of itself. Here's a trimmed chunk from ProcessAllMethods that uses the ILReader.

At this point, we've loaded an assembly, got a type, and we're sitting on xCurrentMethod. They take the method, check for some exception handling (I've trimmed that, it's tedious) and they get an OpCode, and then using the current Assembler, they assemble that operation. Lather, rinse, repeat as necessary.

ILReader xReader = new ILReader(xCurrentMethod);
    while (xReader.Read()) {
    if (mInstructionsToSkip > 0) {
        mInstructionsToSkip--;
        continue;
    }
    ExceptionHandlingClause xCurrentHandler = null;
    ...snip...        
    xMethodInfo.CurrentHandler = xCurrentHandler;
    xOp = GetOpFromType(mMap.GetOpForOpCode(xReader.OpCode), xReader, xMethodInfo);
    if ((!xOp.SupportsMetalMode) && mAssembler.InMetalMode) {
      throw new Exception("OpCode '" + xReader.OpCode + "' not supported in Metal mode!");
    }
    xOp.Assembler = mAssembler;
    new Comment("StackItems = " + 
      mAssembler.StackContents.Count + ", 
      Top item = " + 
       (mAssembler.StackContents.Count > 0 ? mAssembler.StackContents.Peek().ToString() : "(empty)"));
       xOp.Assemble();
    }

There's not a lot of comments in the Cosmos Project, but once you get your head around what they are doing, it's a pretty amazing piece of work, and I can see why they are having so much fun.

From their site at http://www.gocosmos.org:

If you just want to play with Cosmos:

  1. Install the user kit.
  2. Join the discussion list

Other resources:

  1. Read the FAQ.
  2. Subscribe to the Cosmos Blog
  3. Documentation - Most developer documentation right now.
If you are interested in kernel development:
  1. Get source from CodePlex
  2. Read the full requirements. They are pretty basic though, and everything you need except for Windows (For development) is free.
  3. Read Getting Started

Enjoy!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.