Scott Hanselman

ASP.NET Rolled up Goodness

March 08, 2005 Comment on this post [3] Posted in ASP.NET | Javascript | Tools
Sponsored By

Here's a copy of snazzy things from various locations, while I'm on the road.

  • ASP.NET Popup Test Web Server Control (via Larkware) - Matt Berther makes detecting if popups are disabled simpler. Maybe he can make me one that tells me if JavaScript and/or Cookies are disabled?
  • Using Inheritance with ASP.NET Pages - This great article from Dino shows more than just how to create an inheritance heirarchy of ASP.NET pages, but more importantly it shows some techniques like:
    • Trapping the Browser Refresh - When you back up while browsing, you take the risk that you might re-POST a previous request. Dino has some clever ideas on how to detect that a POST has been "replayed."
    • Entertain Users During Long Operations - At Corillian we're often dealing with slow hosts/mainframes and web browsers don't lend themselves to long or asychronous operations. Dino shows a nice generic way to present long-running operations to the user.
  • MultiViewBar Updated - Andy's MetaBuilders site is a must-visit for any ASP.NET developer. Not only does he have a focus on cross-browser compatibility but his stuff just works. And it saves time. My favorites are the DualList, the RowSelectorColumn, and the infamous OneClick.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

TechEd 2005 - I'll be there

March 05, 2005 Comment on this post [2] Posted in TechEd | ASP.NET | Speaking
Sponsored By

It's getting to be that time. TechEd is almost upon us. I'll be there, in Orlando. Time to start checking out TechEdBloggers again and their RSS feed. It's always the place for content, reviews and generally goodness (and some sillyness.)

I've got a session on Software Factories in Harry's Architecture (ARC) Track. I'll be presenting how Corillian's Code Generation-based solution (now on version 2.0) has expanded to include code generation of ASP.NET Server Controls, as well as generation of a new class of control. We use not only extensions to XSD and WSDL, but also Domain Specific Languages. It should be fun. I'll post details once I have an abstract and a session id.

UPDATE: My title will likely be: "Code Generation: Architecting a New Kind of Reuse." I proposed "Automate the Boring Sh*t with CodeGen" but that was nixed. Then it was "Contract First++: Schema-based Modeling for a large scale SOA" but that didn't fly. I said that "Software Factories" isn't a sexy name (while it is a cool concept), so I didn't want a boring name like "Architecting a Software Factory - For Real!"

Show your badges, people!

Illbethere_1 Illbethere_4

Illbethere_7 Illbethere_8

 

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Confusion in Charlotte and an Apology

March 05, 2005 Comment on this post [4] Posted in Speaking
Sponsored By

I was going to speak at Trinug on Monday, since I'll be in North Carolina already, speaking at the Corillian Technical Advisory board. Everything has moved along smoothly, topics were chosen and addresses exchanged.

Unfortunately, somewhere in the middle of an email thread ten-deep, the city changed. I'm flying into Charlotte, and Trinug meets in Raleigh. These two cities are 155 miles apart, and there's no way I could change my flights or get a rental car and still successfully speak my company's conference at 8amEST on Tuesday.

I'm just sick about this. Even though it's not an issue of fault - just a communication breakdown, these things happen - I feel like I'm letting Trinug and INETA down.

I'll be in Charlotte on Monday evening at Quiznos around 6pm if anyone wants to join me as I drown my sorrows in a vat of Diet Coke.

UPDATE: Maxim Karpov and the Charlotte Nerd Dinner crew have organized a dinner Monday and Quiznos is too small. The new details for Monday's dinner are:

Date: Monday March 06th, 2005
Time: 5:30pm – 9:30pm
Place:  Presto Bar and Grill
445 West Trade St.
Charlotte, NC 28202
704-334-7088

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

What Great .NET Developers Ought To Know (More .NET Interview Questions)

February 21, 2005 Comment on this post [54] Posted in ASP.NET | Bugs | Corillian | HttpHandler | HttpModule | Learning .NET | NUnit | ViewState | Web Services | XmlSerializer
Sponsored By
If you enjoyed this post, or this blog, please make a secure tax-deductable donation to the American Diabetes Association. Please read my personal story about life as a diabetic and donate today.

A while back, I posted a list of ASP.NET Interview Questions. Conventional wisdom was split, with about half the folks saying I was nuts and that it was a list of trivia. The others said basically "Ya, those are good. I'd probably have to look a few up." To me, that's the right response.

Certainly I wasn't trying to boil all of .NET Software Development down to a few simple "trivia" questions. However, I WAS trying to get folks thinking. I believe that really good ASP.NET (and for that matter, WinForms) is a little [read: lot] more than just draging a control onto a designer and hoping for the best. A good race driver knows his car - what it can do and what it can't.

So, here's another list...a greatly expanded list, for your consumption (with attribution). I wrote this on a plane last week on the way from Boise to Portland. I tried to take into consideration the concerns that my lists contain unreasonable trivia. I tried to make a list that was organized by section. If you've never down ASP.NET, you obviously won't know all the ASP.NET section. If you're an indenpendant consultant, you may never come upon some of these concepts. However, ever question here has come up more than once in the last 4 years of my time at Corillian. So, knowing groking these questions may not make you a good or bad developer, but it WILL save you time when problems arise. 

What Great .NET Developers Ought To Know

Everyone who writes code

  • Describe the difference between a Thread and a Process?
  • What is a Windows Service and how does its lifecycle differ from a "standard" EXE?
  • What is the maximum amount of memory any single process on Windows can address? Is this different than the maximum virtual memory for the system? How would this affect a system design?
  • What is the difference between an EXE and a DLL?
  • What is strong-typing versus weak-typing? Which is preferred? Why?
  • Corillian's product is a "Component Container." Name at least 3 component containers that ship now with the Windows Server Family.
  • What is a PID? How is it useful when troubleshooting a system?
  • How many processes can listen on a single TCP/IP port?
  • What is the GAC? What problem does it solve?

Mid-Level .NET Developer

  • Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming.
  • Describe what an Interface is and how it’s different from a Class.
  • What is Reflection?
  • What is the difference between XML Web Services using ASMX and .NET Remoting using SOAP?
  • Are the type system represented by XmlSchema and the CLS isomorphic?
  • Conceptually, what is the difference between early-binding and late-binding?
  • Is using Assembly.Load a static reference or dynamic reference?
  • When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate?
  • What is an Asssembly Qualified Name? Is it a filename? How is it different?
  • Is this valid? Assembly.Load("foo.dll");
  • How is a strongly-named assembly different from one that isn’t strongly-named?
  • Can DateTimes be null?
  • What is the JIT? What is NGEN? What are limitations and benefits of each?
  • How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization?
  • What is the difference between Finalize() and Dispose()?
  • How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization?
  • What does this useful command line do? tasklist /m "mscor*"
  • What is the difference between in-proc and out-of-proc?
  • What technology enables out-of-proc communication in .NET?
  • When you’re running a component within ASP.NET, what process is it running within on Windows XP? Windows 2000? Windows 2003?

Senior Developers/Architects

  • What’s wrong with a line like this? DateTime.Parse(myString);
  • What are PDBs? Where must they be located for debugging to work?
  • What is cyclomatic complexity and why is it important?
  • Write a standard lock() plus “double check” to create a critical section around a variable access.
  • What is FullTrust? Do GAC’ed assemblies have FullTrust?
  • What benefit does your code receive if you decorate it with attributes demanding specific Security permissions?
  • What does this do? gacutil /l | find /i "Corillian"
  • What does this do? sn -t foo.dll
  • What ports must be open for DCOM over a firewall? What is the purpose of Port 135?
  • Contrast OOP and SOA. What are tenets of each?
  • How does the XmlSerializer work? What ACL permissions does a process using it require?
  • Why is catch(Exception) almost always a bad idea?
  • What is the difference between Debug.Write and Trace.Write? When should each be used?
  • What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
  • Does JITting occur per-assembly or per-method? How does this affect the working set?
  • Contrast the use of an abstract base class against an interface?
  • What is the difference between a.Equals(b) and a == b?
  • In the context of a comparison, what is object identity versus object equivalence?
  • How would one do a deep copy in .NET?
  • Explain current thinking around IClonable.
  • What is boxing?
  • Is string a value type or a reference type?
  • What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem does it attempt to solve?
  • Why are out parameters a bad idea in .NET? Are they?
  • Can attributes be placed on specific parameters to a method? Why is this useful?

C# Component Developers

  • Juxtapose the use of override with new. What is shadowing?
  • Explain the use of virtual, sealed, override, and abstract.
  • Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
  • Explain the differences between public, protected, private and internal.
  • What benefit do you get from using a Primary Interop Assembly (PIA)?
  • By what mechanism does NUnit know what methods to test?
  • What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;}
  • What is the difference between typeof(foo) and myFoo.GetType()?
  • Explain what’s happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
  • What is this? Can this be used within a static method?

ASP.NET (UI) Developers

  • Describe how a browser-based Form POST becomes a Server-Side event like Button1_OnClick.
  • What is a PostBack?
  • What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState?
  • What is the <machinekey> element and what two ASP.NET technologies is it used for?
  • What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each?
  • What is Web Gardening? How would using it affect a design?
  • Given one ASP.NET application, how many application objects does it have on a single proc box? A dual? A dual with Web Gardening enabled? How would this affect a design?
  • Are threads reused in ASP.NET between reqeusts? Does every HttpRequest get its own thread? Should you use Thread Local storage with ASP.NET?
  • Is the [ThreadStatic] attribute useful in ASP.NET? Are there side effects? Good or bad?
  • Give an example of how using an HttpHandler could simplify an existing design that serves Check Images from an .aspx page.
  • What kinds of events can an HttpModule subscribe to? What influence can they have on an implementation? What can be done without recompiling the ASP.NET Application?
  • Describe ways to present an arbitrary endpoint (URL) and route requests to that endpoint to ASP.NET.
  • Explain how cookies work. Give an example of Cookie abuse.
  • Explain the importance of HttpRequest.ValidateInput()?
  • What kind of data is passed via HTTP Headers?
  • Juxtapose the HTTP verbs GET and POST. What is HEAD?
  • Name and describe at least a half dozen HTTP Status Codes and what they express to the requesting client.
  • How does if-not-modified-since work? How can it be programmatically implemented with ASP.NET?
    Explain <@OutputCache%> and the usage of VaryByParam, VaryByHeader.
  • How does VaryByCustom work?
  • How would one implement ASP.NET HTML output caching, caching outgoing versions of pages generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)?

Developers using XML

  • What is the purpose of XML Namespaces?
  • When is the DOM appropriate for use? When is it not? Are there size limitations?
  • What is the WS-I Basic Profile and why is it important?
  • Write a small XML document that uses a default namespace and a qualified (prefixed) namespace. Include elements from both namespace.
  • What is the one fundamental difference between Elements and Attributes?
  • What is the difference between Well-Formed XML and Valid XML?
  • How would you validate XML using .NET?
  • Why is this almost always a bad idea? When is it a good idea? myXmlDocument.SelectNodes("//mynode");
  • Describe the difference between pull-style parsers (XmlReader) and eventing-readers (Sax)
  • What is the difference between XPathDocument and XmlDocument? Describe situations where one should be used over the other.
  • What is the difference between an XML "Fragment" and an XML "Document."
  • What does it meant to say “the canonical” form of XML?
  • Why is the XML InfoSet specification different from the Xml DOM? What does the InfoSet attempt to solve?
  • Contrast DTDs versus XSDs. What are their similarities and differences? Which is preferred and why?
  • Does System.Xml support DTDs? How?
  • Can any XML Schema be represented as an object graph? Vice versa?

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

LogZipper.NET Log File Rotation

February 21, 2005 Comment on this post [0] Posted in
Sponsored By

Bill Brown is a Developer at Desert Schools Federal Credit Union. They're a very sharp group, and also a client of Corillian. Bill emailed us to share his LogZipper.NET Log Rotation application hosted at SourceForge. He's whipping out new releases with suggestions integrated pretty fast.

Here's what he told us:

I've developed a log rotation app called LogZipper.NET. It's a console application that takes a variety of command-line switches, collates log files defined by a user-specified pattern mask according to a user-specified rotation scheme, and optionally moves the archived log files to another destination folder.

Since it's entirely operated by command-line parameters, it can be scheduled using Windows Scheduler and multiple instances can exist on a server. It does a checksum on each log file that it zips and rotates so authenticity is guaranteed.

I'm all about the snazzy utilities, and I'm all about the command-line, so it's time for me to dig into this little util. Update: I see it's on Larkware.com today as well!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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