So, I've been busy on two seperate projects, one with asp.net concurrency and bug fixing; the other with mapping schemas in BizTalk 2004.
The concurrency problem had an interesting solution. We used the timestamp in the database to check for a change before conmitting the updates. My other bugs where as always easy and stupd mistakes.
The biztalk conversion wizard for converting BTS2002 to BTS2004 didn't want to work for me, but it did give me the information that I needed. So I have the old maps and schemas, of course they are not sane mappings. The schemas use lots of attributes and multiple nodes in the destination schemas, which made me convert alot of visual basic into C# inline code, and use xslt in complex mappings.
Interesting programming ideas, solutions, and logic that I have used to solve problems or have come across throughout my career.
About Me
- William Andrus
- 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).
Saturday, October 28, 2006
Thursday, October 05, 2006
BTS 2002 to BTS 2004 Migration: Error about a user('null')
I was having trouble using VS 2003 Migration wizard to authenicate to a remote server. Of course I had to VPN into the domain. The problem I was getting after entering the server and database name, was an error stating that I could not connect because the username was null. The VS was suppose to use my credential for the connection. Solving the problem was done by going to the Control Panel > Stored User Names and Passwords. Add a connection with my username@domain and password. This got me in.
Tuesday, October 03, 2006
Java Question:
Well, I was just browsing the Code Project's website and found this interesting. Given the following Java code:
Posted by: Dominik Reichl
Now, what are b1 and b2?
Surprisingly b1 is true, b2 is false.
Why?
Posted by: Dominik Reichl
Posted by: Dominik Reichl
Integer i = 1;
Integer j = 1;
Integer n = 1000;
Integer m = 1000;
boolean b1 = (i == j);
boolean b2 = (n == m);
Now, what are b1 and b2?
Surprisingly b1 is true, b2 is false.
Why?
Posted by: Dominik Reichl
Ok, so here's the solution why it works this way
First of all, we are using Integer wrapper classes instead of the primitive int type. When compiling, the integral values 1 and 1000 are implicitely converted to Integer objects (called auto-boxing, from int to Integer).
So, we got 4 different Integer instances, right? No!
The Java VM automatically packs "small" primitive values into identical objects (1 is small, 1000 isn't small). You can easily verify this by pasting the code above into a small testing project and fire up the debugger: i and j reference the same object, while n and m reference different objects. The == operator is comparing references, therefore b1 is true (same references) and b2 is false (different references).
Currently "small" means any integer between -128 and 127. But according to Sun this can change to [-32768, +32767] in the future. This packing trick has been introduced to solve performance problems when doing arithmetic with wrapper classes.
Wednesday, September 27, 2006
BizTalk Questions: Migrating BTS 2002 to BTS 2004
Well, I'm starting to read a article on migrating BT2002 to BT2004 and seen these questions and answers.
What is a promoted property?
What is a binding file?
Can I have multiple schemas with the same root node?
Can I add an orchestration within my migration project?
Is it possible to create an orchestration that receives a non-XML message (a binary large object (BLOB) for instance) through a pipeline with a custom disassembler and promote properties in the blob?
How do I create a dynamic send port?
Will the Migration Wizard migrate custom script functoids?
Will the Migration Wizard migrate my queue receive functions?
Will the Migration Wizard migrate my pre-processor?
Will the Migration Wizard migrate my channel routing and filter configurations?
Will the Migration Wizard migrate orchestrations?
The content in this section is provided by Ben Goeltz, Brandon Gross, and Stephen Roger of Equarius, Inc. For more information about Equarius, Inc., see http://go.microsoft.com/fwlink/?LinkId=26941, published in September 2004.
What is a promoted property?
Property promotion enables you to flag schema nodes at design time for promotion to the MessageBox at run time. In addition to any custom metadata you explicitly define by promoting properties, BizTalk Server 2004 has several pre-existing properties that it tracks by default. These pre-existing properties are not defined by instance schemas.
What is a binding file?
Binding files are shortcuts so that you can bind once using the BizTalk Explorer, export that binding, and then import it when you need to assign the binding subsequent times. For example, if you install and deploy your development environment and save a binding file, when it is time to go into production, you can script the Deployment Wizard and specify the binding file to use to create the bindings for the ports. For messaging migration, the Migration Wizard only generates one binding file for the send or receive locations in a solution.
Can I have multiple schemas with the same root node?
No. The messaging engine relies on the root node to resolve an XML instance to a schema at run time. (This is possible in BizTalk Server 2002.)
Can I add an orchestration within my migration project?
Yes, it is possible, but not recommended because you have to manually create a send/receive port to/from an orchestration, thereby complicating the migration of your messaging solution.
Is it possible to create an orchestration that receives a non-XML message (a binary large object (BLOB) for instance) through a pipeline with a custom disassembler and promote properties in the blob?
You can pass type-less [aka: un-type] messages through orchestrations by declaring them as an XmlDocument. If you want to retrieve their data, you need to pass them to a .NET object as XLANGPart/XLANGMessage and call part.RetrieveAs(typeof(Stream) ); by using part.LoadFrom( myStream ), you can also construct non-XML messages in an orchestration.
How do I create a dynamic send port?
You can create a dynamic send port either using BizTalk Explorer or within an orchestration:
BizTalk Explorer – Create the port using BizTalk Explorer, and then assign values to the transport properties in BizTalk Editor using the global property schema. You can then select the appropriate schema from references. By default, BizTalk Server 2004 references Microsoft.BizTalk GlobalPropertySchema. Values to the transport properties come from your document. You need to promote elements from your schema using the global property schema.
Orchestration – You can create dynamic ports in an orchestration, and, after you deploy it, the port is accessible from BizTalk Explorer. In the orchestration, you need to assign the address (transport) using an Expression shape.
Will the Migration Wizard migrate custom script functoids?
No. Any maps that are migrated that contain custom script functoids need to be opened and functoids re-coded.
Will the Migration Wizard migrate my queue receive functions?
Yes. BizTalk Server supports all types of receive functions including BizTalk message queuing (MSMQ) file receive. BizTalk Server supports the conventional HTTP receive function, but not the HTTP file receive function because it has no meaningful use in the product.
Will the Migration Wizard migrate my pre-processor?
No. You must update your project by manually migrating any components such as pre-processors not migrated by the Migration Wizard.
Will the Migration Wizard migrate my channel routing and filter configurations?
No, with one exception. BizTalk Server 2004 automatically migrates routing and filtering configurations for channels that use dynamic routing or filtering. Custom routing done in a channel requires that you promote the properties and create the filters.
Will the Migration Wizard migrate orchestrations?
No. The Migration Wizard only migrates the following items.
- BTS 2002 document definitions to BTS 2004 schemas
- BTS 2002 maps to BTS 2004 maps
- BTS 2002 receive functions to BTS 2004 receive locations
- BTS 2002 ports and channels to BTS 2004 ports and pipelines
- BTS 2002 port groups (distribution lists) to BTS 2004 send port groups
The content in this section is provided by Ben Goeltz, Brandon Gross, and Stephen Roger of Equarius, Inc. For more information about Equarius, Inc., see http://go.microsoft.com/fwlink/?LinkId=26941, published in September 2004.
Labels:
BizTalk 2004,
questions
Monday, September 25, 2006
MS ASP.Net Assessment Question: Comparing DataSet Tables
You are using the DataSet designer to create a DataSet. The DataSet contains two related tables. You create a table named Products. Products contains a VendorID column that is not unique. You also create a table named Vendors. Vendors contains a VendorID column that is the primary key.
You need to create a relationship between the two tables. Every value in the Product table's VendorID column must have a corresponding value in the Vendor table's VendorID column.
What should you do?
A)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Both Relation and Foreign Key Constraint.
B)Right-click the VendorID column on the Vendors table. Click Set Primary Key.
C)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.
D)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.
E)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Relation Only.
A) Product shouldn't be the parent table.
B) Won't solve the relationship problem.
C) Best answer, by setting the restraints, this could be used to enforced the relationship rules, so that it enforces rules about how updates and deletes to related tables are propagated.
D) Products shouldn't be the parent table.
E) There is no relation only contraint.
You need to create a relationship between the two tables. Every value in the Product table's VendorID column must have a corresponding value in the Vendor table's VendorID column.
What should you do?
A)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Both Relation and Foreign Key Constraint.
B)Right-click the VendorID column on the Vendors table. Click Set Primary Key.
C)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.
D)Drag a Relation object onto the designer. Set the parent table to Products. Set the child table to Vendors. Select VendorID as the column for both tables. Click Foreign Key Constraint Only.
E)Drag a Relation object onto the designer. Set the parent table to Vendors. Set the child table to Products. Select VendorID as the column for both tables. Click Relation Only.
A) Product shouldn't be the parent table.
B) Won't solve the relationship problem.
C) Best answer, by setting the restraints, this could be used to enforced the relationship rules, so that it enforces rules about how updates and deletes to related tables are propagated.
D) Products shouldn't be the parent table.
E) There is no relation only contraint.
MS ASP.Net Assessment Question: Validate Email Address
You create a Web Form that enables users to confirm their e-mail addresses.
You need to validate that users type e-mail addresses on the Web Form and that the e-mail addresses exist in a database.
What should you do?
A) Configure a RequiredFieldValidator control, a RegularExpressionValidator control, and a CustomValidator control.
B) Configure a RegularExpressionValidator control.
C) Configure a CompareValidator control.
D) Configure a RequiredFieldValidator control and a RegularExpressionValidator control.
A)Best Answer, by having the controls use for checking for populating textboxes and valid email address, then you will have to use the custom validator to check if both textboxes are also similar.
B)Wrong, since the regular expression validator doesn't check unless data has been entered into the textbox.
C)Wrong, only compares two textboxes, won't check if they are correct.
D) Wrong, would check for populate field and correct format for email, but not if two textboxes are similar.
You need to validate that users type e-mail addresses on the Web Form and that the e-mail addresses exist in a database.
What should you do?
A) Configure a RequiredFieldValidator control, a RegularExpressionValidator control, and a CustomValidator control.
B) Configure a RegularExpressionValidator control.
C) Configure a CompareValidator control.
D) Configure a RequiredFieldValidator control and a RegularExpressionValidator control.
A)Best Answer, by having the controls use for checking for populating textboxes and valid email address, then you will have to use the custom validator to check if both textboxes are also similar.
B)Wrong, since the regular expression validator doesn't check unless data has been entered into the textbox.
C)Wrong, only compares two textboxes, won't check if they are correct.
D) Wrong, would check for populate field and correct format for email, but not if two textboxes are similar.
MS ASP.Net Assessment Question: Web and Mobile pages.
You create a Web application. The Web application has 10 pages that only mobile devices access. It also has 25 pages that only standard Web browsers access.
You need to implement the Web application by using the minimum amount of custom code.
What should you do?
A) Create all Web pages from the System.Web.UI.Page base class. Create custom device adapters for ASP.NET server controls.
B) Create all Web pages from the System.Web.UI.MobileControls.MobilePage base class. Add controls from the Mobile namespace.
C) Create all Web pages from the System.Web.UI.Page base class and use a master page.
D) Create a set of pages from the System.Web.UI.Page class. Then create a set of pages from the System.Web.UI.MobileControls.MobilePage base class.
A) To much work, and don't know if it would work.
B) Easiest, would generate HTML if web pages and WML/HTML for mobile devices.
C) Wrong, most mobile devices can not display HTML, only WML.
D) Would work, but it might be take to much work compared to B.
You need to implement the Web application by using the minimum amount of custom code.
What should you do?
A) Create all Web pages from the System.Web.UI.Page base class. Create custom device adapters for ASP.NET server controls.
B) Create all Web pages from the System.Web.UI.MobileControls.MobilePage base class. Add controls from the Mobile namespace.
C) Create all Web pages from the System.Web.UI.Page base class and use a master page.
D) Create a set of pages from the System.Web.UI.Page class. Then create a set of pages from the System.Web.UI.MobileControls.MobilePage base class.
A) To much work, and don't know if it would work.
B) Easiest, would generate HTML if web pages and WML/HTML for mobile devices.
C) Wrong, most mobile devices can not display HTML, only WML.
D) Would work, but it might be take to much work compared to B.
MS ASP.Net Assessment Question: Giving permissions
You develop a Web application. The Web application accesses resources. You create a Microsoft Windows(R) account named AppUser. You grant AppUser appropriate permissions to the resources.
You need to configure the Web application so that it always runs in the context of the AppUser account.
Which code segment should you use?
A)<identity
impersonate="true"
userName="CONTOSO\AppUser"
password="pwd"/>
B)<appSettings>
<add key="userName" value="CONTOSO\AppUser"/>
<add key="password" value="pwd"/>
</appSettings>
C)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Pwd"
password="registry:HKLM\Software\AspNetProcess,Name"/>
D)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Name"
password="registry:HKLM\Software\AspNetProcess,Pwd"/>
A) This would give the user the appropriate permissions on the account.
B) This is more like a global variable that can be used throughout the asp.net pages. For example, setting the database connection information in the web.config.
C & D) Well to impersonate you will need it to be true, and these lines actually save the information to the registry. This is good for storing the user's name and password for the site.
You need to configure the Web application so that it always runs in the context of the AppUser account.
Which code segment should you use?
A)<identity
impersonate="true"
userName="CONTOSO\AppUser"
password="pwd"/>
B)<appSettings>
<add key="userName" value="CONTOSO\AppUser"/>
<add key="password" value="pwd"/>
</appSettings>
C)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Pwd"
password="registry:HKLM\Software\AspNetProcess,Name"/>
D)<identity
impersonate="false"
userName="registry:HKLM\Software\AspNetProcess,Name"
password="registry:HKLM\Software\AspNetProcess,Pwd"/>
A) This would give the user the appropriate permissions on the account.
B) This is more like a global variable that can be used throughout the asp.net pages. For example, setting the database connection information in the web.config.
C & D) Well to impersonate you will need it to be true, and these lines actually save the information to the registry. This is good for storing the user's name and password for the site.
Saturday, September 23, 2006
MS ASP.Net Assessment Question: Constant deployment of a web page.
You deploy an intranet Web application that is updated daily.
After performance testing, you decide to precompile the Web application to improve page-loading speed. Currently, the source files are deployed with the Web application for ease of maintenance.
You need to precompile the Web application by using the minimum amount of administrative effort.
What should you do?
A) Create a Web Setup project.
B) Create a batch file that uses MSBuild.exe.
C) Use the Copy Web tool.
D) Load the following URL into a Web browser.
http://localhost/mywebsitename/precompile.axd
A: The web setup project is a great solution when you want to import and deploy to a server, but there are alot of step and seems to be other simpiler, quicker ways.
B: MSBuild.exe will build the project. This would work as long as the IIS and VS.Net are on the same server.
C: The copy web tool copys a website to another location on a different server, for example. This of course doesn't precompile, and would be ok as long as there is nothing complicated in the design. However, if you think your website is going too slow, then this would not be the answer.
D: This will precompile the website and give a message if successful. This seems to be the best answer. This might not always be the best solution: http://dotnetgeek.blogspot.com/2004/10/pre-compilation-in-aspnet-v11.html
After performance testing, you decide to precompile the Web application to improve page-loading speed. Currently, the source files are deployed with the Web application for ease of maintenance.
You need to precompile the Web application by using the minimum amount of administrative effort.
What should you do?
A) Create a Web Setup project.
B) Create a batch file that uses MSBuild.exe.
C) Use the Copy Web tool.
D) Load the following URL into a Web browser.
http://localhost/mywebsitename/precompile.axd
A: The web setup project is a great solution when you want to import and deploy to a server, but there are alot of step and seems to be other simpiler, quicker ways.
B: MSBuild.exe will build the project. This would work as long as the IIS and VS.Net are on the same server.
C: The copy web tool copys a website to another location on a different server, for example. This of course doesn't precompile, and would be ok as long as there is nothing complicated in the design. However, if you think your website is going too slow, then this would not be the answer.
D: This will precompile the website and give a message if successful. This seems to be the best answer. This might not always be the best solution: http://dotnetgeek.blogspot.com/2004/10/pre-compilation-in-aspnet-v11.html
Labels:
ASP.NET 2.0,
Assessement Question,
deployment,
precompile
Friday, September 22, 2006
SQL Interview Questions: Definitions
Questions:
1) What is a SARGABLE predicate?
2) What is DAS? What is NAS? What is a SAN? Name the two main types of SAN networks. What is the common name for the device used to interface to a SAN?
3) What is a LUN? How is it used with a SAN?
4) What is a RAID? What RAID format is the recommended best practice for SQL Server, and why?
5) What is an INSTEAD-OF trigger used for?
6) What is a LOB?
Answers?:
1) Predicates that do searching, like Year > 2000.
2) Direct Attached Storage, Network Attached Storage, Storage Area Network, Fibre Channel and iSCSI, Host Bus Adapter.
3) Logical Unit Number , Each device(or LUN) on the storage area network (SAN) is "owned" by a single computer (or initiator)
4) RAID (Redundant Array of Independent Disks). A collection of disk drives that offers increased performance and fault tolerance. There are a number of different RAID levels. The three most commonly used are 0, 1, and 5. Microsoft recommends a RAID that would provide the best write performance. For each write request a RAID0 would write once, RAID1 or RAID10 would write twice, and RAID5 would write 4 times. RAID 0 is never recommended, so this leaves RAID10 as the recommended.
Here are the RAIDs:
Level 0: striping without parity (spreading out blocks of each file across multiple disks).
Level 1: disk mirroring or duplexing.
Level 2: bit-level striping with parity
Level 3: byte-level striping with dedicated parity. Same as Level 0, but also reserves one dedicated disk for error correction data. It provides good performance and some level of fault tolerance.
Level 4: block-level striping with dedicated parity
Level 5: block-level striping with distributed parity
Level 6: block-level striping with two sets of distributed parity for extra fault tolerance
Level 7: Asynchronous, cached striping with dedicated parity
5) There are 3 types of triggers: BEFORE, AFTER and INSTEAD OF. BEFORE is used to affect the row before the trigger event executes. AFTER is used to trigger actions are activiated for the affected rows. INSTEAD OF is used to triggers its action for each row in the affected row instead of using the trigger event.
6) Locator OBject.
1) What is a SARGABLE predicate?
2) What is DAS? What is NAS? What is a SAN? Name the two main types of SAN networks. What is the common name for the device used to interface to a SAN?
3) What is a LUN? How is it used with a SAN?
4) What is a RAID? What RAID format is the recommended best practice for SQL Server, and why?
5) What is an INSTEAD-OF trigger used for?
6) What is a LOB?
Answers?:
1) Predicates that do searching, like Year > 2000.
2) Direct Attached Storage, Network Attached Storage, Storage Area Network, Fibre Channel and iSCSI, Host Bus Adapter.
3) Logical Unit Number , Each device(or LUN) on the storage area network (SAN) is "owned" by a single computer (or initiator)
4) RAID (Redundant Array of Independent Disks). A collection of disk drives that offers increased performance and fault tolerance. There are a number of different RAID levels. The three most commonly used are 0, 1, and 5. Microsoft recommends a RAID that would provide the best write performance. For each write request a RAID0 would write once, RAID1 or RAID10 would write twice, and RAID5 would write 4 times. RAID 0 is never recommended, so this leaves RAID10 as the recommended.
Here are the RAIDs:
Level 0: striping without parity (spreading out blocks of each file across multiple disks).
Level 1: disk mirroring or duplexing.
Level 2: bit-level striping with parity
Level 3: byte-level striping with dedicated parity. Same as Level 0, but also reserves one dedicated disk for error correction data. It provides good performance and some level of fault tolerance.
Level 4: block-level striping with dedicated parity
Level 5: block-level striping with distributed parity
Level 6: block-level striping with two sets of distributed parity for extra fault tolerance
Level 7: Asynchronous, cached striping with dedicated parity
5) There are 3 types of triggers: BEFORE, AFTER and INSTEAD OF. BEFORE is used to affect the row before the trigger event executes. AFTER is used to trigger actions are activiated for the affected rows. INSTEAD OF is used to triggers its action for each row in the affected row instead of using the trigger event.
6) Locator OBject.
Subscribe to:
Posts (Atom)