Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Thursday, July 26, 2012

Auditing ExtendedProperties

So yesterday I was coding a User Story about reporting audit information for the project I am working on.  This project basically extends the ERP application called Macola (don’t get me started). What we are building is an extended properties application and we are auditing each change to an extended property for SOX compliance.

So we are using a class called (funny enough) ExtendedProperty. We have a collection of these objects to fill our grid using a List(of ExtendedProperty).  We were auditing each save in the Save method of each individual ExtendProperty.  This created a ton of audit entries in the database. We decided to combine these into a batch audit at the collection level to mitigate the number of entries and use the xml data type in SQL Server.

So our Audit objects began to take shape and now look like this:

image

An AuditEntry has a one to many relationship to an AuditChange. And an AuditChange has a many to many relationship to AuditColumn as well as AuditKey. Each of the objects overrides the .ToString function to return xml to be stored in the database.

The metadata in AuditEntry is in separate columns in the database and AuditChange, AuditColumn and AuditKey are all stored in a single xml column.  This gives us great flexibility in what we can audit and how much space it takes up.

How this relates to an Extended Property is that each property is responsible for its own audit unless it is in a collection of changes.  So we had to change how we accessed the List(of ExtendedProperty) in the containing class. We could not have a List anymore because it became difficult to act on that list as a whole. This caused us to create an ExtendedProperties collection class that inherits from List(of ExtendedProperty). This class gives us the ability to act on the collection as a whole but still allows us the functionality of a List(of T).

The results of this audit can be returned flattened using xquery in SQL Server.  It can be a little complicated when trying to compare values (sql:parameter(“parametername”) is your friend in xquery). But it makes life easier when batching audit entries.

Cool Visual Studio 2010 feature

As an aside, while I was coding the audit classes above I discovered a GREAT feature in VS2010. First I created a file for the class, then I started coding the public properties of the class. I did not create the constructor of the class yet.  I went to a calling class and instantiated this new class and put the arguments in the call.  There appeared a blue squiggly line below the code with the little red block in the bottom right.

image

When I click on the little red block it tells me it can create the constructor in the class.

image

So I tell it to go ahead and do that by clicking on the link. Now keep in mind I had already created the public properties for this class that will expose the arguments in the constructor.  So what did Visual Studio do?  It knew which arguments to assign to the private class variables automatically and wrote the constructor for me and assigned the arguments to the variables.

Sub New(ByVal userName As String, ByVal propertyName As String, ByVal operation As String, ByVal originalValue As String, ByVal newValue As String, ByVal timeStamp As Date)

' TODO: Complete member initialization
_userName = userName
_propertyName = propertyName
_operation = operation
_originalValue = originalValue
_newValue = newValue
_timeStamp = timeStamp

End Sub



Cool!


till next time…


Technorati Tags: ,,

Friday, October 28, 2011

ASP.Net – Code Behind and the Times

In 2001 Microsoft gave us ASP.Net.  The successor to what we now call “Classic ASP”. This brought the full power of the Visual Studio IDE to web development. Allowing us to write “Code Behind” in our favorite language, either Visual Basic or C#, for WebForms development inside Visual Studio.

This was a significant improvement to Classic ASP and to the developers ability to quickly produce web applications based on Microsoft Technology.  Up till then we had to use Visual Interdev. And was that a mess or what?

While I was an engineer at FM Global back in 2001, I was on the team that adopted .Net while it was still in beta.  (I know, pretty progressive for an insurance company, huh.) We had Microsoft consultants on site what seemed to be 24/7. We were learning a completely new way to code in a completely new IDE. Visual Studio .Net was simply amazing to all of us.  We were all Visual Basic developers then and being able to code using VB in this new environment was fantastic.

A couple of years later we were building an extranet application for our clients to be able to access their insurance information on the web.  We had been programming in .Net for a while but we were still VB programmers.  We were writing procedural code in an Object Oriented world.  There were some Code Behind methods that were several hundred lines of code long and full of spaghetti.

This is when we started learning about how VB can be a fully object oriented language and about utilizing Agile development techniques to help with the quality of our code.  It all started to come together. Our designs improved because we started to design our code to be testable. Our time to build and release methods were being revamped so we could be more efficient.  We were using code generation tools. It was a time of great learning.  We made our share of mistakes but all-in-all it was good.

Why do I reflect on such times?  I was reminded about these times because I am currently working with a group that is in a very similar situation.  Folks who are mostly COBOL programmers learning ASP.Net for the first time or are early in their object oriented programming learning and none of them have any Agile exposure at all.  I am sharing my experiences with them to help them grasp some of these concepts.

While doing a code review, one finds an asp button with an OnClick event that has 300+ lines of code in it, one is reminded of these times.  I am coaching my team in the craftsmanship of Agile Software Development, Object Oriented Programming and ASP.Net. So it behooves me to try to remember where I was and remind myself that there was a time when I wrote 300+ lines of code in a single method.  Well, maybe not that much but still…

Till next time…

Tuesday, September 20, 2011

Math in Middle School and High School. How important is it?

Microsoft did a survey of College Students and parents about Science, Technology, Engineering, and Math (STEM). STEM, over the course of the next decade or 2, will be where most of the worldwide higher paying jobs will come from.  Are your Middle Schools and High Schools preparing your college bound child well enough for them to succeed in STEM?

According to the survey, the answer to the question is a big NO.  Most of the parents and college students surveyed believe they were not prepared enough in their respective secondary education institutions for what they needed in college.

Why do I think this is an important subject?  Because I believe it is true.  I am very fortunate to have a son in the 8th grade who is an honor student (He gets that from his mom.) My son, Brendan, is not a good student. He is a GREAT student. He has consistently scored the highest or one of the top 3 highest scores on his EOG (End of Grade) tests. North Carolina’s answer to “No child left behind”.  And he is consistently one of the best students in his grade.

Now, I am not one to brag. But I will now.  Brendan was invited to participate in Duke’s TIP program for seventh graders last year.  Through this program he was able to take the SATs with college bound 11th graders this past January.  He did extremely well. And now has all kinds of opportunities world wide that are available for him to participate in.

How did he get there? He was very fortunate to have math teachers who realized the simple truth that is stated in the results of Microsoft’s survey.  Math is important! In fact, in the Orange County School System, advanced math is emphasized and encouraged in the Middle Schools.  Brendan started with Algebra in 7th grade and is now taking Geometry.  (He is also taking English 1 so he will get High School credit for it.)

What does Brendan want to be when he grows up? An engineer!  He has already showed a preference for his mom’s alma-mater Purdue.  He also realizes that math is what is going to help him succeed.  (He also dreams of being a professional Goalie in the Premier League as well, oh well, so much for math.)

We as parents need to be a part of the equation (pun intended) as well. We need to encourage our kids at an early age to look at math as something fun and interesting. I remember driving Brendan to and from pre school singing our numbers to 1000 by tens. We had lots of fun.  So yeah, math is important, and fun too!

till next time…

Technorati Tags: ,,,

Friday, September 16, 2011

Windows 8 – How does it fit?

I have had a few emails from friends who have installed Windows 8 and are skeptical to say the least. With all due respect to them, I believe that Microsoft is working two angles with one OS here.

Some have said that the corporate world will not accept Windows 8 with the Metro UI. I think Microsoft knows that.  They have, after all, been the dominate OS in the business setting.  This is where they have their roots. Windows NT through Windows XP and now Windows 7.  I believe Windows 7 will be the workhorse corporate OS for many years to come just like XP was before it.  It will live as long as XP, if not longer. In fact, as I write this, my office still has users on XP.

The separation of Windows Desktop and Metro UI in Windows 8, I believe, was done on purpose.  Microsoft needed to enter the tablet world and the world of touch with a bang.  The only way into the tablet/touch world is to support ARM processors which are so prevalent in the mobile and tablet market.  They couldn’t do that with Windows 7.

Metro is their answer for the ARM processors. (Qualcomm and Texas Instruments are happy about that.) Microsoft has made it clear that they will only port a limited number of x86 apps to Metro. Though Ballmer did hint today that Office may be ported. So this indicates ARM will be Metro only.

The reason for this is simple. All those apps are power hungry. ARM processors wont give them that power while still protecting battery life.  Metro apps will be asynchronous and the apps processes will be shut down by the OS just 5 seconds or so after they are no longer in the forefront.  This does not allow for any long running process to work in the background.

But IE has both a Desktop version and a Metro version.  Or do they?  The engine is the same according to Microsoft but the UI is different.  The Desktop version supports plugins and can persist and all that client side stuff can happen.  But in the Metro version? Not so fast. No plugins. No Flash, No LastPass. This is Microsoft saying we need to move on. Many pages optimized for the mobile experience are already plugin free.

So what Microsoft is kind of doing here is the opposite of what Apple has done.  Apple supports 2 OSs. One for the iPAD/iPhone and one for their hardware like AIR.  The iPAD is the touch experience to beat. Microsoft feels they can. In NASCAR in order to succeed, teams try to always do the opposite of what their nearest completion does.  This may or may not work out for Microsoft.  This isn’t a NASCAR race.

On a side note:
Interesting that all around the web some people are praising and some people are condemning Windows 8.  What is interesting to me is that people are condemning it because it doesn’t support this, it doesn’t have that,  some comments on blogs I have been reading are like:
“I don’t see InPrivate viewing on IE10 Metro.  What’s up with that. I am throwing this in the trash! No one is going to use it.”
You have read these comments or comments with the same implication all over the web. It is comments like these that make me wonder what people are thinking.  This is a pre Alpha developer preview.  Of course it isn’t going to have all of your little favorite features yet.

Microsoft spent a lot of money this week to show us all what it has planned.  this is not even close to what will be delivered.  Have you seen the slide regarding what Microsoft didn’t show us? Here is a big picture of it.

Till next time…

Thursday, September 15, 2011

Windows Server 8 – feel the love

For those of you looking at Windows 8 as I am, there is a lot of excitement I think. There is some excitement in the background as well.  Something that could affect us all as much, if not more than Windows 8.

Windows Server 8 is here too.  No we do not have a Developer preview to download, nor any bits to play with.  [Update: Some folks got it today] But some folks were invited up to Redmond last week for some exciting demos and presentations.  Here is a description of the event by one of the attendees.

Sounds like there are some really significant enhancements and feature sets. Hyper-V seems to be one area that got a lot of love from Microsoft. A new Server Manager. But what I am most excited about is that deduplication will become part of the OS.  As some of you know I love Windows Home Server 2011.  One of the things I love about it is that it uses deduplication in its client backup process.  This saves a significant amount of space.

Well, System Admins, in the cloud, feel the love.  Microsoft seems to have put a lot of effort here.

Till next time…

Wednesday, September 14, 2011

Windows 8 – Initial Thoughts (part 2)

Interesting turn of events.  I couldn’t see any of my other PCs on the network. I know I was connected because I could get to the Internet.  So I tried adding the Windows 8 box to my Home Group but it wouldn’t let me. Windows 8 only allowed for me to create a home group not add to an existing one. Not sure why.

So I decided to try and find the Workgroup and see if I could add it to my workgroup. Me being who I am, I did not want to go to the desktop and right click on My Computer, select properties etc.… to change my work group. I tried to do it the Windows 8 way using the Metro UI.  I found Control Panel. hmmmm.

image

I couldn’t find it here. but I selected the last option which is called More Settings.  That brought me to the Windows 7 Control Panel interface and there was System.  I changed the Workgroup and then it told me to reboot. Which I did.

Ok, I think. I am ready for this to reboot.  And it does so. Quickly too, I might add. But what has it done? Now all I see is the picture of the road, the time in a BIG font, and the date. I do not know what to do. So I click here and there. Sometimes a little green bar shows on the bottom but not always.

image

Then I double click. The picture slides up out of the way and I am asked to login with my Live ID and password again. Cool. Also, I logged in to Windows Live and changed my name a little while ago and it knew it. This is Great!

image

Simple things for simple minds, I guess.

Till next time…

Technorati Tags: ,,

Windows 8 – Initial Thoughts

So I have finally installed Windows 8 on a Virtual Machine. I am pretty pleased with how things are going.  The first thing I discover is that pressing the Windows key on the keyboard goes right to the Desktop.  This is the Desktop like Windows 7 with everything exactly like this Windows’ predecessor. Or is it? I press the Windows key again and I am back to the Metro Start screen.

Then I click the Internet Explorer icon.

image

And voila, I am in IE10.  I’m thinking, this is cool.  It is a little to get used to but, cool.  I type in my blog’s address in the address box and there is my blog.  But the address bar disappears.  I have know Idea how to get it back. How can I get to other sites?  I will have to figure it out.

Oh, and pressing the Windows key again I think will bring me back to the Desktop but it doesn’t. It brings me back to the metro Start page. Then back to IE. Seems like it is acting kind of like a quick switch between the last thing you launched. (Still can’t get the address bar in IE to come back.)

So I start through the F keys. F1: does nothing. F2 does nothing. F3: brings up a search bar. Well at least Microsoft is consistent there. F4, ah, there it is. But wait, this looks like a frequently accessed page

image

I see these arrows that are very familiar. so I click the back arrow and… It brings me back to my page.  I’m guessing F5 is a refresh like every other version of IE.  Yep. Oh and there is the address bar.  But I don’t want to have to refresh every time I want to see the address bar. How about F6.  That is it! Yay! and there is a little pin icon.

image

I’ll bet it will pin the address bar for me.  Better do that before I can’t navigate again. Nope. It did pin my blog though to my favorites I guess. let me press F4 and see. Nope. I must have done something wrong. OK, I have to click Pin to Start. There it is.  I am getting better.

I will continue to play and update. Probably all night long (much to my wife’s chagrin!)

Till next time…

Technorati Tags: ,,

Installing Windows 8 Developer Preview – Second Attempt

So after not being able to continue my first attempt at installing Windows 8 Developer Preview, I have moved to a different tactic.  I am using Oracle VM Virtual Box.  I created a new virtual machine with a 40GB hard drive.  I started it up with my G: drive as the start drive.
I am immediately brought to this screen. A standard LTK (Language, Time Keyboard) screen.
image
I believe I am already way past where I got in my first attempt.  Interesting.  So I click Next.
image
I am then presented with the “Install now” screen which looks very similar to the Windows 7 install now screen. So I click Install now.  So far it is typical Microsoft Installation.
image
So remember when I said I might be further than I go before. Well, no.  I am again presented with the Licensing terms.  Interesting the difference between this screen and the one found in my first attempt.
image
So again I accept the terms and click next. I am now presented with the “Which type of installation do you want?” screen.
image
Even though Microsoft says there is currently no Upgrade path in the Developer Preview, I am asked if I want to. I am curious what will happen if I click upgrade, but I wont. So I select Custom.
image
Now I am asked where to install.  Here I only have one option which is the VHD I created when I setup the VM. As with Windows 7 install, if I click the drive options link in the bottom right corner, the additional selections become available to me.
image
I am going to just click Next from here.
image
Now the all familiar Installing Windows screen.  It got through Copying Windows files pretty quickly.  Not so much on Expanding Windows files. That took about 15 minutes.
image
A split second for installing features and updates. for Installing Features.
image
And then the reboot.
image
image
image
image
image
image
Then the restart again. I do like the new spinning dots.  easy to follow and a few different patterns.
image
Then again I am presented with the License terms. Only this time it does look more like the terms in my first attempt.  It even has the words “Make the lawyers happy by reading this carefully.”  I am not sure I like the black back ground, but my blog has a black background so I guess I am not one to speak.
image
There was a quick screen that I think had almost like an agenda of what was going to happen next.  This time the background is green.  It them went to the Personalize screen.
image
I think I will name this machine Boss-Win8-64.
image
So here I have 2 choices.  Either Express or Customize.  When given the choice I will more than likely always choose Customize.  This lets me at least see all of my options.  So here it goes.
image
Here I am going to select Yes, share and connect.  I do this because I want to see how this affects my other machines and how Windows Home Server will react to this new machine.
image
I will leave the defaults here and click Next.
image
Interesting to note the third item here. Definitely thinking of mobile apps.
image
One interesting thing to note is the magically disappearing and reappearing scroll bar. Don’t forget to use it because there are settings down there. Next.
image
Now this is something new. Logging in using your email address.  I wonder if it will recognize the fact that the email I put in already has a live ID associated with it. Probably.
image
And it did. so now I enter my password. Next
image
It logs me in. And it knows who I am. Except it doesn’t know that I prefer to be called David.
image
It took a while but now it is telling me to wait some more.
image
Personalized Settings.
image
And finally the Initial Desktop that I am used to. But wait.
image
The Desktop disappears and then went to the new Start page. No icons at first but then it showed them.
image
And here they are.
image
Al together this wasn’t more than 45 to 50 minutes installing from start to finish. I am pleased with the experience so far. We shall see what comes of it.
Now it is time to play!  Let me know what your experience was like. If it is anything like mine it was a piece of cake!
Till next time…
Technorati Tags: ,,

Installing Windows 8 Developer Preview – First Attempt

So I really wanted to get started with Windows 8 so I can move forward with investigating the new Metro UI.  If you want to do the same you can download the Windows 8 developer Preview at Microsoft’s Dev Center.

There are a couple of options that you will be presented with.

  1. Windows Developer Preview with developer tools English, 64-bit (x64)
  2. Windows Developer Preview English, 64-bit (x64)
  3. Windows Developer Preview English, 32-bit (x86)

I downloaded the Developer Preview with developer tools, 64-bit as well as the stand alone 32-bit version.  I have a 32 bit laptop that I want to install it on as well as on a separate partition on my main machine.  Beware that you will require a DL DVD burner if you intend to burn the 64-bit version with tools.  Here is what Microsoft says about it:

Note: The .iso file that contains the developer tools requires a large capacity DVD called a DVD-9, as well as a DVD burner that can handle dual-layer (DL) DVDs. Most modern burners should be able to handle this format.

I don’t have a touch screen yet, but will be looking to get one in the future to truly test Windows 8 the way it was designed to be used.  I am hoping there will be some Windows 8 phone emulators out there that I can test my mobile apps on.  I already have a few ideas.

So lets get started. first I mounted the 64-bit with tools .iso to my G: drive using UltraISO. Upon inspection of the DVD drive the folder structure looks like this:

image

This is pretty typical so I double click on the setup.exe file to see what happens.  I am first presented with this splash screen.

image
Next it shows me the Setup screen that asks if I want to Go online to get the latest and greatest. of course, I say sure and click next.  One thing to note I also leave the check mark on wanted to make the installation better.  Just doing my part.

image

Then I am told it will take a few minutes.

image
After only a couple of minutes The setup screen changes to this Checking you PC Screen.

image

Notice the navigation across the top of the screen.  It looks like there are going to be 4 parts to the install. Preparation, Compatibility, Install and Config.  It quickly shows a screen and says something about a product key.  The screen went to fast for me to get a capture of it.  It looks like this will be where future versions will ask you to input your product key.

After this page it goes to the License terms page.  I like the line “Make our lawyers happy by reading this carefully.”

image

I comply because I have a friend who is a lawyer and she would be very upset with me if I didn’t.  One thing it says is that I can use but not share any images or icons or sounds. Oops.  I guess I broke that one. I check the box and click Next.

Now I am at a screen that scares me.

image

I haven’t seen anyone else post their install experiences yet and I am not willing to lose everything.  I thought I could tell it to install on a specific partition but I guess not.  So I guess I will try again on a VM.

After clicking the Close button (X) in the upper right hand corner I am shown this dialog box.

image

So I click Yes.  To be continued….

Technorati Tags: ,,