About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Thursday, September 21, 2006

MS ASP.Net Assessment Question: Specify for browser type.

You create a Web Form. The Web Form will be viewed by both mobile and desktop browsers. You add a Label control to the page. You use the following code segment.



When mobile browsers view the page, the Label must render "Name" instead of "Enter Your First Name."

You need to ensure that the Label renders correctly.

What should you do?

A) Add the following XML segment to Ie.browser. <capability name="mobile" value="true" />
B) Use device filters to specify alternate text in the Label definition.
C) Create a new file named All.browser, and add it to the browser's directory. Specify browser capabilities in All.browser.
D)Add the following attribute to the Label. EnableTheming="True"

A - Just states that IE can handle mobile, but don't know if capability is an actual tag.
B - I would think a device filter would be easy, by just checking for WML
C - Creating a All.browser will allow for the page to specify how it is render based on the browser used by the user, but don't think it would allow small cosmetic changes.
D - EnableTheming would just use the theme for that page.

Found this on a 2004 MSDN article which would be nice to use instead:
<asp:label runat="server" text="some browser" IE:text="any IE browser"
IE5:text="the IE 5 browser" PIE:text="the Pocket PC browser" />

Wednesday, September 20, 2006

MS ASP.Net Assessment Question: Cancelling a logon event.

You create a Web Form. The Web Form allows users to log on to an application. You include a Login control named Login1. You want to be able to cancel the logon process when a user clicks the Log on button in the Login1 control.

You need to write code in one of Login1's event handlers to cancel the logon process.

What should you do?

A)Write code in the Login1_Load event handler.
B)Write code in the Login1_LoginError event handler.
C)Write code in the Login1_LoggedIn event handler.
D)Write code in the Login1_LoggingIn event handler.
E)Write code in the Login1_Authenticate event handler.


A is wrong since there is no Load event for the Login Control.
B is wrong since this only occurs when the login event throws an error.
C is wrong since the user is logged into the site and is authenticated.
D is probably the best answer since the process of logging on is still taking place and authentication has not occured yet.
E is wrong because the user would have already been authenicated by then.

MS ASP.Net Assessment Question: Store custom events in a database.

You manage a remote Web site that is experiencing random errors.

You need to implement an event tracking process that enables custom events to be stored in a database.

What should you do?

A) Log a message into a MessageQueue.
B) Implement ICallbackEventHandler.
C) Derive a class from WebBaseEvent.
D) Derive a class from EventInstance.

A, the MSMQ allows for communication over networks and allows server-side applications running within ASP.NET to use MSMQ. Storing messages into a database can be done with MSMQ.

B is wrong because ICallbackEventHandler is used for calling codebehind from a javascript function.

C the WebBaseEvent allows the monitoring of performance of an app, diagnose failing apps and/or systems and appraising significant events during the lifecycle of a the given app. Using SqlWebEventProvider as your event provider and inherit from the WebBaseEvent to customize them if you wanted.

D) is wrong. EventInstance is for 3.0, not 2.0. Allows for writing messages based on the localized language on the machine and writes the entry to the event log.

So it could be A or C (IMO), but I would take the guest of C in this case.

MS ASP.Net Assessment Question: Extract data from XML Node.

You have an application that reads the following XML document with an instance of the XmlReader class.
<bookstore>
<books>
<book genre="'reference'" id="'23'">
<title>World Atlas</title>
<author status="bestseller">
<first-name>Joe</first-name>
<last-name>Worden</last-name>
</author>
<price>8.99</price>
</book>
</books>
</bookstore>

You advance the XmlReader to the author XmlNode.
You need to extract the values of the author XmlNode and all of its children as a string.
What should you do?

A) Use the ReadInnerXml method of the XmlReader.
B) Use the ReadOuterXml method of the XmlReader.
C) Use the ReadString method of the XmlReader.
D) Use the Value property of the XmlReader

A would be wrong since it would only get the children information.
B is correct since it would give the children tags and the current start tag.
C would return a string, but only the data up to the first end tag.
D this would only return the attribute of the author in this case.

MS ASP.Net Assessment Questions: Setting cursor inside textbox on page loading.

You are developing a Web Form. The Web Form allows users to insert personal information.
You need to set the cursor inside the given name text box when the Web Form is first displayed.
What should you do?

A) Call the SetFocus method of the Page inside the text box control's Init event.
B) Set the text box control's TabIndex property to 0.
C) Call the Focus method of the text box control inside the page load event.
D) Set the text box control's Enabled attribute to True inside the form's source view.

My answer would be C, since it just makes sense to set focus to the control during the page_load event.

A is wrong (IMO): because SetFocus is not a defined method and the Page_Init only initializes the page when it is first called. The Page_Load event is then called once the request has been processed, and all of the controls are updated.

B is wrong because the TabIndex only tells what order of the controls on the page are sequentially access when the tab button is pressed.

D is wrong because setting a control to enabled only allows the user to enter information into that control.

Sunday, September 10, 2006

Kerberos

Well, I don't know much about Kerberos other then that it allows single authentication within a system. So here are some helpful websites to keep in mind:

http://www.hitmill.com/computers/kerberos.html

http://www.microsoft.com/technet/prodtechnol/windows2000serv/deploy/confeat/kerberos.mspx

http://support.microsoft.com/?id=319723

Friday, September 08, 2006

An Interview Question: Whats the difference between an EXE and DLL?

The distinction between EXE and DLL files is entirely one of semantics. They both use the exact same PE [Portable Executable] format. The only difference is a single bit that indicates if the file should be treated as an EXE or as a DLL. Even the DLL file extension is artificial. You can have DLLs with entirely different extensions—for instance .OCX controls and Control Panel applets (.CPL files) are DLLs.
-- Matt Pietrek

Thursday, September 07, 2006

VI Search Engine

Ok, this is very cool, especially using the insert and deleting of results, too bad it doesn't support ex commands so I can search within the results. Well here is the link:

http://www.visearch.com/

Lunch started out innocently enough for Snap.com colleagues Brad Haugaard, Joe Chen, Ken Yeh. While discussing Snap's very visually oriented search engine, they collectively wondered, "What about people who don't really care about pictures?"

Somebody said, "How about 'visearch'? We could combine a vi editor with a search engine."

The three mused that you could move up and down with the "j" and "k" keys. You might also delete bad listings with "dd" or insert comments into the listing with an "i".

With suggestions from Haugaard and Yeh, Chen programmed a working system over the next few weeks. Chen and Yeh are both software engineers, while Haugaard is a customer service manager.
-- from http://www.linuxplanet.com/linuxplanet/reviews/6306/1/

Thursday, August 31, 2006

Interesting Read: The Problem with Threads


http://www.computer.org/portal/site/computer/
menuitem.5d61c1d591162e4b0ef1bd108bcd45f3/index.jsp?&pName=computer_level1_article&TheCat=1005&
path=computer/homepage/0506
&file=cover.xml&xsl=article.xsl

Set Day of the Month

Ok, had to quickly write this one, to find the nth day of a month.

private System.DateTime SetDayOfMonth(System.Int32 nth, System.DayOfWeek weekday, System.Int32 month, System.Int32 year)
{
System.DateTime dath = new DateTime(year, month, 1); //set to first day of the month
//get to the first weekday looking for
while(dath.DayOfWeek != weekday)
{
dath = dath.AddDays(1);
}

if(nth > 1)
{
dath = dath.AddDays((nth - 1) * 7);
}
else
{
dath = dath.AddMonths(1);
dath = dath.Substract(TimeSpan.FromDays(1); //last day of the month
while(dath.DayOfWeek != weekday)
{
dath = dath.Subtract(TimeSpan.FromDays(1)); //cycle backwards to last
}
dath = dath.Subtract(TimeSpan.FromDays(((nth * -1) - 1) * 7));
}
return dath;
}