Tag | Code Posts

Have you ever tried to reuse code by adding existing files to a project? In Visual Studio this usually works, with the file getting put into the right location, associating the editor based on the file extension. I’ve been working on a Xamarin Forms project which allows me to use XAML to create the UI and C# for the code behind. This enables me to leverage my skills and experience building Windows and Windows Phone applications on iOS and Android. The problem came when I would include an existing ...
I am tasked with dynamically injecting jQuery into each page if it is not already loaded from an Unobtrusive JavaScript Library. The normal way of injecting a script tag would be: Code Snippet var jq = document.createElement('scr... jq.src = 'https://ajax.googleapis.co... jq.onload = function () { initJQuery(); }; var h = document.getElementsByTagNa... h.appendChild(jq); However, this will never work on IE8 or IE7, because the .onload callback is never ...
I recently encountered the Ambiguous Symbol error, specifically: “error C2872: 'IMasterLoader' : ambiguous symbol” when using an interface I wrote in C# with a class built in C++. 1: namespace IMasterLoader 2: { 3: public interface IMasterLoader<T> where T : class 4: { 5: bool Load(T master, ref string strError); 6: } 7: } Code producing the error: 1: // LmCellSectorLog.h 2: #pragma once 3: using namespace System; 4: using namespace System::Collections::Generic; 5: using namespace System::Data; ...
Thank you to everyone who came out to the Chicago Architects Group presentation last night. It seemed like the weather has a way of keeping a large portion of the people who registered from making the meeting. There was some lively networking going on before and after the meeting. I enjoyed the questions that people had during the presentation. It helped to bring out some of the challenges with dealing with the OOXML and ODF standards from an architecture perspective. I have posted the Slides and ...
My presentation on leveraging Open XML was a great experience and the attendees were very gracious. I was pleasantly surprised to have a full room. There was even one person sitting on the floor. You can check out some pictures here. I have posted my slides and code. If anyone has any feedback or questions feel free to contact me. del.icio.us Tags: Chicago Code Camp,OOXML SDK 2.0,Office Open XML,slides,code ...
Here’s another email from the internal mailing list of Injazat .NET Ninjas (Ninjazat, AKA as we call ourselves), that I’m sharing with blog readers as well. Just a place holder, until I move one of my 18 (just discovered the number now – terrifying!) drafts in my Windows Live Writer into a published post, or delete them all! Subject: [Learning] Some very interesting videos Some videos from NDC 2009 event (Norwegian Developers Conference 2009) - about software design and related issues: · NDC Video ...
I mashed together a variety of random web resources on how to make a decent pre tag for code and the output looks like this (ignore how incredibly bad this code is... I was testing SVN and making sporadic changes... Steve McConnell would strangle me): Module Module1 Sub Main() Console.BackgroundColor = ConsoleColor.DarkBlue Console.ForegroundColor = ConsoleColor.White Console.Clear() My.User.InitializeWithWindo... Dim sw As New Stopwatch() sw.Start() Dim username As String = My.User.IsInRole(Applicatio... ...
Recently, I started developing new applications around the Umbraco Content Management System. I use the term around very lightly, because Umbraco really doesn't require any constraints on your code (like DNN, Rainbow and virtually every other .Net based CMS that I have used), other than the need to develop in user controls instead of aspx pages - which makes perfect sense given the idea of a CMS. It has worked flawlessly and is easily the best .net based CMS system around from a developer AND designer ...
This code snippet will return a generic list of DateTime containing the dates between a starting date and ending date: private List<DateTime> GetDateRange(DateTime StartingDate, DateTime EndingDate) { if (StartingDate > EndingDate) { return null; } List<DateTime> rv = new List<DateTime>(); DateTime tmpDate = StartingDate; do { rv.Add(tmpDate); tmpDate = tmpDate.AddDays(1); } while (tmpDate <= EndingDate); return rv; } To view this code in action, copy and paste the following ...
Because I always forget the syntax for this, here is my personal bookmark for the code to get version information of the current application: DateTime fileDate = new System.IO.FileInfo(Applicat... string fileVersion = System.Diagnostics.FileVers... Technorati tags: .NET, Version information, code ...
According to the RSS specification, the pubDate element (when the item was published) must be formatted like this : Mon, 28 May 1979 19:45:32 GMT I've posted an article with C# / VB.NET functions that will accept a DateTime object and return a string properly formatted to meet the pubDate specification. Technorati tags: RSS, pubDate, Code, .NET ...