I am always forgetting the format for using DATEADD and DATEPART functions to get just part of a SQL Server datetime (e.g. just the date), so I am posting it here so I’ll always know where to find it. declare @date datetime set @date = getdate() select @date, dateadd(day, datediff(day, 0, @date), 0)...
I'll give a sample in TSQL: Here is the TSQL statement for getting a Case object that was Xml serialized: DECLARE @xmlCase XMLSET @xmlCase = '<case xsi="<a href=">http://www.w3.org/2001/XMLSchema-instance</a>"><id>3b98cf5a-6faa-dd11-9299-001e0b8014eb</id><court> <id>00000000-0000-0000-0000-000000000000</id> <courtregionid>00000000-0000-0000-0000-000000000000</courtregionid> </court><createdon>2008-11-07T13:54:44.727+02:00</createdon><assignedon...
Lets follow each other! Add me up: http://twitter.com/steffi87 and leave me your twitter link here for me to add you :-) Lets keep in touch and update everyone on what we're up to...
Recently I wrote a cheat sheet for pinvoking in .NET. Shortly after I got a question in comments about how to deal with variable arguments, when it's more, then one parameter. Also what to do if those arguments are heterogeneous? Let's say, that we have following method in C: int VarSum(int nargs, ...){ va_list argp; va_start( argp, nargs ); int sum = 0; for( int i = 0 ; i < nargs; i++ ) { int arg = va_arg( argp, int ); sum += arg; } va_end( argp ); return sum; } We can expose this method to C#...
It seams that Microsoft is making an attempt to integrate with OpenID. With the announcement that “Windows Live ID commits to support of OpenID” I thought a little investigation would be in order. You need to setup a new Live ID on the Live-INT service, you can use any email, but make sure that you do not use your production password! Go to https://login.live-INT.com/ and use the sign-up button to set up a Windows Live ID test account in the INT environment. Go to https://login.live-int.com/beta/ManageOpenID.srf...
One of the things that I've missed during my tenure here at Microsoft is speaking at some of the independent national conferences such as VSLive. But if you look through the speaker's list at VSLive Dallas you'll find a fellow named Josh Holmes... Woot! More on my blog at Speaking at VSLive! Dallas 2008...
In AJAX based applications its common that user might end up breaking your AJAX calls by clicking on numerous places in very short interval of time. Let us assume there is a page where there are several of hyperlinks which make WebService calls and do some stuffs on callback. If user clicks on five hyperlinks being impatient or may be just for fun, there will be five different WebService calls made. All of those calls had the same parameters or UI state while they were invoked. But on completion...
During a recent trip to Redmond, I was interviewed by Ron Jacobs for his Endpoint.TV series. I had just been shown a bunch of new things, was full of excitement, and we had a great chat about models, clouds, workflow... all my current hot-buttons :) http://channel9.msdn.com/shows/Endpoint/endpointtv-WCF-and-WF-40-First-Look-with-Brian-Loesgen/ Enjoy! Technorati Tags: Oslo,Cloud Computing,WF,Workflow...
Ok I had to do it. This is a lot of fun and can be used to pass some time. Check out ElfYourself.com, and Elf Yourself :) Send your own ElfYourself eCards...
When you are writing automated tests for your application, it is important that the tests do not rely on the file system or external services. The only problem is that when you write applications using WCF, you are writing code that relies on external services. It is very tempting to create service references in your test DLL and test against them, but please refrain. There is a better way, I promise! This series will focus on testing every part of your application -- including round-trip functional...
We had out November Bartlesville .NET User Group Meeting on 11/14/2008. It was an amazing meeting! We had 55 people in attendance. There were 48 developers and 7 recruiters. This was an amazing turnout. I was actually a bit nervous going into the meeting as only 25 people had RSVP'd. However, I knew with the reminders and the marketing I put out the weeks before the meeting that we would have a great turnout. And we did!! It was an amazing presentation by Raymond Lewallen on Behavior Driven Development....
Being a user group leader (Bartlesville .NET User Group) I get a lot of messages for recruiters looking for jobs. Given the current market situation I like to pass these on. This one looks pretty interesting. If you are interested give Darbi a call and let him know I sent you: Know anyone (maybe you) who might be interested in the following position? It is located in Oklahoma City, Oklahoma. It is a direct hire position with a great company. If you are interested or know someone who is, send me a...
Today has been awesome! More of what we learned yesterday, plus more. We got more in depth into certain patterns and have had a huge helping of BDD all day long. The format has been that JP has written the specs and we get the tests to pass. The format looks like it will start to shift to JP doing less and less code and us doing more and more of it. Three Project Solution So one thing I immediately picked up on is the 3 project solution. One of the projects holds all of the automation and automated...
Manning Publications Co. has some great books. Ever since I first heard that MVC was coming to ASP.NET I was extremely excited. I have always preferred the MVC pattern over the MVP pattern that ASP.NET used. Most of the information on MVC for ASP.NET is limited or not as in depth as I would like. I have created multiple MVC applications just by using Reflector to learn more about the runtimes. However, being a book junky, and one that really enjoys the early access program at Manning Publications...
I received the following email the other day: Jason, We would like to extend our thanks for your participation in the INETA Community Champion program and your commitment to the developer community. You faced some challenging competition yet your accomplishments speak for themselves. The Community Champion team is thrilled to inform you that you are one of our top ten winners for Q3 2008. Congratulations Jason! INETA will be announcing the winners this week in our November INETA Newsletter as well...
I recently updated my web hosting from MaximumASP to Mosso. This was primarily because MaximumASP does not allow MySQL on their virtual dedicated servers, and I cannot afford a full dedicated server. MaximumASP always provided great service, and I still use them for my websites that requires solutions such as Windows Sharepoint Services, or other packages that must be installed via Remote Desktop. However, for the majority of my sites I have moved them on to Mosso and I will not look back. Mosso...
Another thing that took me far too long to find today... there's a lot of links to Steve Dunn's tool, including the CodePlex version, which hasn't been updated since 2006. And, since it doesn't have an installer or the DLLs readily available, you'll waste a lot of time looking for that too. You might consider trying this tool. Looks pretty good to me so far. And, yes, it supports a few languages. And line numbers. And highlighting. Public Class ThisRocks Public Function URL As String Return "http://www.amergerzic.com/post/WLWSourceCodePlugin.aspx"...
I had a case today where I needed -- well, wanted -- to implement a generic class that was a little... unusual. Essentially, I'm working on a queuing mechanism based on Joe Duffy's BlockingBoundedQueue(Of T). Mind you, unlike Joe's sample, mine is written in VB.NET. ;) Taking it a bit further, I created a wrapper that specifies the number of producers and consumers of queued objects, as well as the queue capacity. Since I'm going to be turning this over to a bunch of developers to play with, I also...
I probably would not have posted this if the problem only existed on my XP workstation, but when I had the same problem yesterday on my Vista laptop and had to dig the same post up again to find out the solution, I decided I needed to mention it. After the Silverlight Toolkit was released, there was a post about adding the tools to the Toolbox. I re-blogged it in case anyone needed it, but I figured I didn't ... I mean I've been around Visual Studio since it was "Visual C++" Beta, so what's the big...
In this issue: Justin Angel, Shemesh, Albert Eyal, Steve, Ruurd Boeke, Mike Snow, Mehdi Slaoui Andaloussi, Gerard Leblanc, and Jesse Liberty. Also: Steve Smith has opened up a couple new 'feeds' sites that are of note: Azure Feeds and Silverlight Feeds. He has others that you can find info about on these sites but the main idea is to go to Silverlight Feeds and submit your material. I'm mentioning this in good faith that you will also submit to Silverlight Cream of course :) ... yet another source...
In a recent post, Deepak describes how to generate enums using Linq to Sql and SqlMetal. 1. Generate dbml using SqlMetal. 2. Find reference columns in the dbml that will be used as enums in code. Change their type to the enum name. 3. Generate code using SqlMetal. I find this pretty interesting, but there would need to be some kind of conventions or configuration to denote which tables will be used as enumerations in the code. I think the way to tackle this is to create a custom msbuild task that...
I started developing a new BizTalk application today which must call an existing web service. Unfortunately I didn't have access to the web service from my test environment so I had to create a test stub. The web service method I needed accepted a string and returned an object containing an int and a bool. My first step was to examine the wsdl of the existing web service to get a good idea of the type my stub should be returning. Because the input / output parameters were simple it was only ten minutes...
I have a biztalk map which uses a custom XSLT file rather than the graphical mapper. This map makes use of methods held in a custom dll, accessing via a custom extension XML file. I created this map a while ago, came back to it today (on a new vm) and found that I was unable to run a successful test - right click the btm in solution explorer and hit 'test map'. On trying this I was presented with a lengthy error message - the important bit being: Value cannot be null. Parameter name: extension My...
If you try and implement if then else logic in XSLT in the same way that you would in a procedural language then you'll probably end up tying yourself in knots. I had some XSLT to write today where I simply needed to check the existance of an attribute in the source document. If it existed then I would execute and addition against the value else I would substitue for a zero. I had initially approached this with something like: <xsl:choose> <xsl:when test="referenceToElemen/@attribute">...
Had an error today when attempting to import a BizTalk MSI through the Admin Console. It was complaining that a particular adapter had not been configured to work with a particular host. Indeed this was true, however what puzzled me was that there was no refernce to this host in the binding file which had been added to the MSI. After a fair amount of head scratching I tracked back to the orchestration that contained the logical port which matched to the physical port (SOAP) that was mentioned in...
Had to configure a send port today to post an XML message to a website secured over HTTPS. The send was failing, with the following being written to the even log: "The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel." This got me thinking that we must be missing the public key for the site but I was able to browse to it from Internet Explorer and could confirm that the key could be found in the expected certificates stores on the client (my)...
This entry is in the hope that I don't fall over this problem again. It's really very straight-forward but has cost me half an hour more than once. I need to create a new SQL receive port today, to receive from a new database and run under a new BizTalk host instance. Step I took: 1. I created a new SQL Server account and granted permissions required to execute the stored procedure that the BizTalk receive location would execute 2. I created a new windows account for the new BizTalk host instance...
I started work on a solution new to me this morning. The solution was currently in production and working fine. I had opened it up because enhancements were required to consume new web methods from a third party. After getting the source files from the source control repository I had the usual problem of missing references to sort out. I then noticed that the solution contained a web service project with two set of web references; one pointing to the live url of the 3rd party and another pointing...
Very simple answer: The Name: Azure… no one at Microsoft can agree as to how to say Azure...
Merry Christmas All!!! Try ElfYourself.com Technorati Tags: Christmas,Elf Yourself,JibJab...
At PDC 2008, there was a booth for Windows Sensors & Location Platform (more here). I was lucky enough to snag one of the free development kits. I’m running the Windows 7 build from the PDC, and it is very stable. I haven’t any problems with it so far. The main reason for me to use Windows 7 for for this API. Setting up the dev kit was really easy. I posted my setup experience on the forums here. If you are having trouble installing, maybe this thread can help. I just stumbled across this today:...
I needed to schedule a task to run every day at 9:00 p.m. in the night. I had an addition al requirement that the task be scheduled only if the FileSystemwatcher alerts us of new files being available for processing. Thus the files could be recieved anytime during the day, but despite that the task should be schduled to run exactly at 9:00 p.m. in the night. So I used the following code to schedule a task(using System.Threading.Timer and TimeSpan classes) DateTime d = DateTime.Now; timer = new Timer(new...
Besides programming I am working on a personal project -- writing a novel. This is a project I started in 1994 and dropped shortly after due to other things in my life at the time. I have recently picked it back up. I have always enjoyed writing and the exercise has been strangely cathartic. Basically the rough draft is around 75,000 words, slightly less than half done. I'm a little worried about getting everything into 200,000 words but I will burn that bridge when I get to it. I don't know the...
When troubleshooting calls made via the BizTalk SOAP adapter I often find myself wanting to check the data that was posted to the web service. Adding the following to a test asmx page does the trick: HttpContext.Current.Request.SaveAs("D:\\log_folder\Request_" + Guid.NewGuid().ToString() + ".txt", true); Don't forget to grant access to the log_folder for the id that the web service runs under...
I saw "big" news today that Google released a search app for the iPhone that lets a user search using their voice as input. Wow - I'm impressed. That's pretty groundbreaking. Those of us using Windows Mobile Live Search have had this feature for some time...sorry Google/iPhone zealots! FWIW, I'm not really bashing Google - they do their core function (search) very well. I just don't get all the swooning over Google/iPhone...
In working through an issue with workflow I stumbled across an interesting 'feature' of workflow and MOSS. Essentially I have a "Project Sites" root web where I am creating child sites via a workflow: Project Sites Child Site 1 List 1 List 2 In these child sites I am creating some lists and setting alerts on them based upon things that happen in the workflow. In attempting to create an alert on a list, I received a "List does not exist" error. In stepping through the code and inspecting all the objects...
This code snippet extends the functionality found in prop code snippet. It will populate the backing field in the property, check for equality in the setter and call PropertyChanged. It assumes you have a base class that handles the implementation of INotifyPropertyChanged. When the snippet is called, it will generate code that looks like this: private int myVar; public int MyProperty { get { return myVar; } set { if (!myVar.Equals(value)) { myVar = value; base.OnPropertyChanged("MyProperty"); }...
I hope everyone is looking forward to the new Xbox live experience that will be going Live tomorrow! Hopefully we are passed the days of the ring of death from the update, unless you have a hacked box :) Although I am not really interested in the Avatar piece, I think it will be well worth it. The update process is a little different this time, so you are not surprised there is a video detailing the process. I never made it into the Preview program this time around, but watch this space for my Avatar...
Just before I add lots of files and folders to my PDC attendee's freebie 160GB USB disk I thougth I'd list out the contents as sort of like an audit. PDC 2008 160GB USB Disk file directory listing Autorun.inf starthere.cmd StartHere.html Developer\BluePrints\InsideMicrosoftBlueprints.xps Developer\BluePrints\IntroducingMicrosoftBlueprints.xps Developer\dotNetFramework\dotNetFx35setup.exe Developer\dotNetFramework\dotNetFX20\ASPNET.msp Developer\dotNetFramework\dotNetFX20\ASPNET_64.msp Developer\dotNetFramework\dotNetFX20\clr.msp...
Nice article on Unit Test Patterns by Marc Clifton: http://www.codeproject.com/KB/architecture/autp5.aspx Patterns he has listed: · Pass/Fail Patterns · Data Driven Test Patterns · Data Transaction Patterns · Collection Management Patterns · Performance Patterns · Process Patterns · Simulation Patterns · Multithreading Patterns · Stress-Test Patterns · Presentation Layer Patterns...
Well, that's me got passed the 100,000 Visits milestone. I guess it is seams bigger than it is, but as the next big one would be a million I am chuffed to get this far :) -- Site Summary --- Visits Total ...................... 101,421 Average per Day ................ 319 Average Visit Length .......... 1:10 This Week .................... 2,231 Page Views Total ...................... 134,216 Average per Day ................ 410 Average per Visit .............. 1.3 This Week .................... 2,873...
Ok, so I lied a little. It is not that cheap, but 30% off an upgrade from a team edition to full Team Suit is nothing to be sniffed at, it could be as much as £1000 off! If your team is using any component edition of Visual Studio Team System 2008 (Development Edition, Test Edition, Architecture Edition, or Database Edition), now’s the time to get more out of your development solution. Step up to the complete Visual Studio Team System 2008 Team Suite, and save 30%. That’s a huge savings to give your...
It is quite a time ago that I have posted something here at geekswithblogs.net. Since I am currently working with VMWare, I will be strengthened to this topic in my blog...
I hate it when Netbeans cannot do the clean and build. I hate it when it says I have errors, I close Netbeans and opening it again, and the errors are gone - especially when I have wasted tons of hours trying to solve those errors >_<...
I finally decided to write a post about attending PDC. There are so many great posts out there about PDC that do a great job of describing the overall experience. Bill Wagner has a great post on his blog, and so does Rick Strahl. The overall experience was really great and the quality of the sessions were very professional and the presenters did an excellent job in delivering the most information in the alloted time.There are still a bunch of sessions that I wish I could have personally attended...
I needed an attribute to decorate methods/controllers to protect them from being accessed by users that are not logged in. If I were using a .net provider for authentication I could use the [Authorize] attribute that is provided in the MVC framework. However, in this case I chose to create my own security. This means that I need to also create my own [Authorize] attribute (as I love it’s simplicity!). Finding the way to do this is not that straight forward. So here is the custom attribute. Code Snippet0:...
I needed an attribute to decorate methods/controllers to protect them from being accessed by users that are not logged in. If I were using a .net provider for authentication I could use the [Authorize] attribute that is provided in the MVC framework. However, in this case I chose to create my own security. This means that I need to also create my own [Authorize] attribute (as I love it’s simplicity!). Finding the way to do this is not that straight forward. So here is the custom attribute. Code Snippet0:...
If Babel Fish hasn't let me down, that title should read, "Welcome, honored visitors from China!" But if it doesn't, I couldn't tell you. (UPDATE: John Workman and a Chinese friend have provided a better translation. Thanks!) Ever since I added Google Analytics stats to the Ulterior Motive Lounge archive, fully two-thirds of my visitors there have come from China. And tonight, someone found my Geeks with Blogs site via this referral string: http://google.cn/search?q=ulterior+motive+lounge Yep, that's...
Today I learned I have a lot to learn! Patterns, Delegates, Lambdas, PSake, Extension Methods, etc, etc, etc. Photo credit to Hikako. So far we have went through patterns and principles. Ones that come to mind are the Strategy Pattern, Static Gateway Pattern, Decorators, and Specification Pattern. We also got into SRP (single responsibility principle), OCP (open closed principle), Composition over Inheritance, BDD (behavior driven design), DDD (domain driven design), and then we talked a little about...
I am not sure about how you guys feel about your IDE look & feel. First few years it was alright for me. However the more I used Visual Studio, the