Tag | C Posts

Following my FUNdaments presentation tonight to the East Bay .NET user group on the options available to ASP.NET developers for using AJAX type methods for grabbing information/content from a server from the client side browser, the code can be found here and the presentation can be found here. Once again Beth Massi rocked on the main presentation about VB10, C# 4.0 and Visual Studio 2010. Lots of goodies to look forward to. That said it cracks me up that MSFT is adding more capabilities to facilitate ...
I am a keen believer when building applications in having a clean logical architecture with separation of concerns as much as possible – taking into account the goals of the project and the environment in which the application will be maintained. As such, when it makes sense I believe in use of MVC, MVP, MVVM etc type patterns to enable efficient development and maintenance of applications. I can testify to the worth of adopting these styles to improve the quality of products developed from my experience ...
When building applications we usually want to adopt the write once user everywhere or DRY (Don’t Repeat Yourself) goals for simpler maintenance, validation, configuration,etc etc. So for business applications the situation is usually develop a control, that can be re-used and that can have different data bound to it for the situation in which it is used. Silverlight has a fantastic mechanism – the Silverlight Property System - that manages data binding among other things. This means that the late ...
This is the final post in a four part series to demonstrate how to use the standard MSFT technologies to implement a CRUD data application in Silverlight. The steps in this post build upon those completed in part 3. The goal of this series is to show those of you who are relatively new to Silverlight how analogous building such an app in Silverlight is to say building it in ASP.NET, Win Forms or WPF. This app is built on Visual Studio 2008 SP1, SQL Server 2008, Silverlight 2.0 and the Silverlight ...
This is the third post in a series to demonstrate how to use the standard MSFT technologies to implement a CRUD data application in Silverlight. The steps in this post build upon those completed in part 2. The goal of this series is to show those of you who are relatively new to Silverlight how analogous building such an app in Silverlight is to say building it in ASP.NET, Win Forms or WPF. This app is built on Visual Studio 2008 SP1, SQL Server 2008, Silverlight 2.0 and the Silverlight Toolkit using ...
This is the second post in a series to demonstrate how to use the standard MSFT technologies to implement a CRUD data application in Silverlight. The steps in this post build upon those completed in part 1. The goal of this series is to show those of you who are relatively new to Silverlight how analogous building such an app in Silverlight is to say building it in ASP.NET, Win Forms or WPF. This app is built on Visual Studio 2008 SP1, SQL Server 2008, Silverlight 2.0 and the Silverlight Toolkit ...
This is the first post in a series to demonstrate how to use the standard MSFT technologies to implement a CRUD data application in Silverlight. This post is beginners stuff - there’s nothing advanced here. Most readers with some experience of Silverlight will learn nothing from this post, but I want to start at the beginning so those of you who are relatively new to Silverlight can see how analogous building such an app in Silverlight is to say building it in ASP.NET, Win Forms or WPF. This app ...
Clint Edmonson over at http://www.notsotrivial.net put together a collection of language specific coding standards reference documentation. This is a great starting point for your organization or a good resource to evaluate your current standards. View the article and get the goods here: http://www.notsotrivial.net... Technorati Tags: coding standards,VB.NET,C#.NET ...
Though some of you that were on the fence or have not year head about the MSDN Dev Con, are now more interested in coming out. It’s a tiny price compared to PDC and is coming to a city near you! A good group of local celebrities will be presenting along side proven Microsoft experts at the Orlando event. I will be in the attendance and around any community areas. And any social after event :) Bayer White (Jacksonville), Joe Homnick (Boca Raton), Christopher Bennage (Tallahassee), Rob Eisenberg (Tallahassee) ...
Slideshare is quickly becoming the defacto standard for sharing presentation slides, just as YouTube for videos, and Flickr for images. I recently got into the habit to share my presentations there and use the embed feature to include it in my weblog, and this was the same for the "Design Patterns Via C# 3.0" session. This morning I got this email from SlideShare Hey Mohamed_Meligy! Your slideshow Design Patterns Via C# 3.0 has been featured on the SlideShare homepage by our editorial team. Cheers, ...
Design Patterns Via C# 3.0 View SlideShare presentation or Upload your own. (tags: design patterns) Yesterday was my 2 part session about Design Patterns as part of dotNETwork 7th gathering. Thank you all guys for being there, There was so much interesting stuff about the audience. The conversation we all had even before the session starts, the interaction with all parts of the session, and the great questions. Thank you all. You can find the slides for the 2 parts combined in single downloadable ...
dotNETwork, the most active offline user group in Egypt is having its 7th gathering next Saturday, August 30, which will have two parallel tracks for the first time in the group gathering. BizTalk Introduction, and C# 3.0 Design Patterns, which I will be delivering! If I were you to attend the event, it would have been a hard choice too (unless you go simply for BizTalk) ! BizTalk beginner introduction as a topic was not delivered in public sessions before. The only BiTalk sessions I know of were ...
The Picture Frame source code can be downloaded from: Download the Picture Frame Source Code As promised here is the source code for my Picture Frame application. For a desciption of how I wrote this see Why this C/C++ programmer struggled with writing a simple C# application This application runs full screen, although I haven’t spent any time or thought into hiding the task bar since I run it without the Explorer shell. It then displays JPEG or BMP files found in the root folder of either \Storage ...
As a developer of single board computers, we at Eurotech Inc, have some single board computers lying around the office, and a few LCD panels. I thought that it might be fun to put one to use as an electronic picture frame. My goal is to hang it on the wall to show picture of some of the work that we do. This is also an opportunity to work on my C# skills. I am not an application developer, so of course I am no expert on the .NET Compact Framework or C#. I have been working with C# to maintain an ...
I was just starting to read the very first pages of the great book "Beautiful Code" (by Andy Oram, Greg Wilson) this morning as a refreshment and as an indirect result to Scott Hanselman's list of basic must-read books (although it didn't include this book - BTW, I read parts of it before, and I don't remember why I stopped), I had to write this post. To all of you guys thinking in DDD, TDD, MVC, ASP.NET, shiny AJAX and RIA (Flash/Silverlight) controls, GC, SharePoint, Rails, Python, ORMs (NHibernate, ...
Employee Info Starter Kit is a starter kit, which includes very simple user requirements, where we can create, read, update ad delete (crud) the employee info of a company. The primary purpose of this starter kit is, to provide a solid guideline with respect to building enterprise level projects, by utilizing new asp.net 2.0 and sql server 2005 features, as well as latest best coding practices. The starter kit includes several cases where we can perform multi-table joining and/or write operations. ...
There have been a couple of posts here on GWB about VB.NET vs C# stats. (It looks like the report includes VB and VB.NET together.) http://geekswithblogs.net/c... http://geekswithblogs.net/T... I write in both languages and I don't really have a preference for one or the other. The fact is the languages are equals. You can get anything done in both languages with the same amount of work. There are some differences but it mostly ...
If you've ever tried to find a way to display an ESRI ShapeFile on a Virtual Earth map, you'll have probably noticed how little information there is on the Internet about how to accomplish this apparently arduous task. As a matter of fact, I needed to do exactly this while adding some collateral features to the software Serena and I are developing for our thesis, but after some Googling, I found that there was (and there still is) almost no useful information on how to achieve integration between ...
So here is a question why would you want to add your Meta Tags via code? Kinda silly right? Cause if you were a great developer you probably have a whole list of meta tags you have created for your portfolio of web sites right? Well if you are the developer who has those templates you most likely will stop reading here and think this mikedopp character is kinda wierd or is one of those "because you can" type people. I know I am adding much too much fluff to this whole entry and spending too much ...
If you don't know by now you can reset your web applications and or web sites with a simple change to the web.config. For example you can FTP(if remote or hosted) to your server and edit the web.config by adding a space or removing a space. Basically you want the application your using editing with think something has changed since you touched the document. Save the form after this has happened and IIS will recycle the application / web site. This however can be tedious and just well feel like a ...
I spent most of yesterday trying to figure out how to make use of a NameValueCollection in a .NET configuration file. After wasting almost the entire night fighting with this problem, I thought I would let everyone know that it is possible, and easier than you might think. (By the way, this was a clear case of working too long on the problem. After a good nights sleep, I solved this in under 5 minutes.) At this point you might wonder why this was so difficult. The largest and most significant problem ...
Generics is a new feature in .NET 2.0 which allows us to create a data structure without committing to a specific data type. In the early age of .net 2.0 (i.e. .net 1.x), while using custom entity model in our application data architecture, we had to create a separate class regarding the collection for each of custom entity. The custom entity public class SystemUser { public string _Name, _Password; public SystemUser(string name, string password) { _Name = name; _Password = password; } public string ...
Authentication and authorization is the two basic part of the user-end security in asp.net web applications. After to successful authentication of a user, authorization takes the place according to which the authenticated user are allowed to access to the corresponding resources in the web application. Role based security is very basic requirements in the current trend of web applications. Mostly there are two roles involved, which are registered user and the admin users. However in a web application ...
New developers often ask me about C# delegate, as they got a bit confused about the basic concept and specially maximum of the reference contains and discussed from an advanced view. Well I think delegate is really simple, when you grab it's basic idea. So what is delegate? Basically it is similar like the old "C" age function pointer, where functions can be assigned like a variable and called in the run time based on dynamic conditions. C# delegate is the smarter version of function pointer which ...
I had some trouble today getting the actual control that hosts data in a WPF listbox. The magic class is ListBox.ItemContainerGenerator used like this:MyStateObject current = this.myListBox.SelectedItem as MyStateObject; ListBoxItem lbi = this.myListBox.ItemContaine... as ListBoxItem; lbi.Margin = new Thickness(10); Technorati tags: WPF, C#, ListBox, ItemContainerGenerator ...
For those of us that implement INotifyPropertyChanged on our state objects, the new Automatic Properties feature of Visual Studio 2008 hasn't been very useful. In fact, the snippet prop that used to create a private variable and associated public property has now been replaced by an Automatic Property. Thanks to a comment by SnYnE on this blog post, there is an easy way to get the functionality back. Simply create a new text file at:C:\users\*your user name*\Documents\Visual Studio 2008\Code Snippets\Visual ...
Today in class, I shared with my students a video that Logan and Buzz did in their XNA online Programming class located at 3dbuzz.com. The training was excellent preparation for me to be able to teach my students game programing. My students have learned how to program in C# ,the basic concepts of decision making, repetition etc. and needed to see how all of this applies to game play so the Bouncing X video was needed at this time. There are 2 class files that are created in this application. One ...
It all started with an email Mohamed Hossam (AKA, Bashmohandes) sent to SilverKey Tech. (the company I work for) local office here in Egypt, referring to the article "Foundations of Functional Programming - Part 1 - B# .NET Blog". It inspired me to send few more language links: Linklist 03022008 - Dynamic programming design patterns, Erlang/C# AMQP Client, AOP - Nauman Leghari's Blog James Kovacs' Weblog - Syntactic Sugar, Compiler Candy, and Other Sweets Charlie Calvert's Community Blog : Expression ...
This very simple extension method makes a string a fixed length. It appends whitespace to a string that is shorter than required or strips characters to a string to is longer than requested. See ScottGu blog post for a brush up (or intro) on extension methods. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ParaPlan.Extensions { public static class StringHelper { public static string ToFixedLength(this string s, int width) { string rv = s; if (s.Length ...
It's hard to believe that we started this class a month ago and we are moving along to finish the C# learning before we begin our adventure to learning XNA. Students are programming assignments utilizing the if statement. We reviewed the switch statement and how that is used as well. In addition, we covered webcast 3 overview of Game Elements that Digipen has available. This webcasts covers graphics, input, sounds and networks. My students only have time to program 2d games in XNA but I wanted to ...
The "C# 3.0 in a nutshell" book has some neat free extras that are worth mentioning for those who haven't already heard of (they have been released for long). Those are like must-have LINQ tools and helpers. The homepage of LINQKit (the major part of the extras I'm going to cover here) provides great information and short code samples about the components: LINQPad This is a snippet compiler (application to run/try small codes in separation than big VS projects, like this), that's customized for LINQ ...
Note: This is ported from my old weblog. Originally published April 07, 2005 There was a question in Microsoft Forums regarding the new modifier in C# and what's the difference between using it and using the virtual and override modifiers. I wanted to share that here as well. The new modifier is mainly used for hiding the non virtual methods. Unlike override modifier, it's used to hide all class members not only methods (i.e. variables and properties). If you create a Base class with a protected, ...
All of my students went on a field trip today to visit the Orlando Science Center and participate in workshops that instructors from the Full Sail School in Winter Park, FL put on. The Instructors were extremely knowledgeable and had a great deal of patience answering questions from teenagers. The Science Center sponsored Otronicon over the weekend and the field trips were part of it. One workshop was on 3d modeling with Maya software and the other was on designing games using FPS Creator. Students ...
One of the requests that I've received from other developers is the ability to use SCSF for developing a module without including the shell in the solution. We develop a large number of modules independently in different groups and having the shell be a part of every module was getting to be a problem. The only issue that I was getting with getting this to work was that SCSF guidance package would fail in ViewTemplateCS when I would right click on a folder and tried to add a new view to the project. ...
I've only taught my Honors Programming II Game Programming class for 3 days now and I'm evaluating my students C# skills with various beginner programs. In addition, I am introducing Gaming concepts with my students using the free online book called The Art of Computer Game Design by Chris Crawford. I am also using some the Video Gaming Webcast that Microsoft has available with Matthew Mead who is a Computer Science Instructor from Digipen Institute of Technology. The Webcasts does not cover XNA ...
This is something that is totally cool. You can use Visual Studio 2008 and a lot of the new functionality and cross compile it to .NET 2.0 and run it on the older framework. For Example, You can use Var objects, Simple Property Declarations, Property Constructors, Lambda expressions Here's an example program that can be compiled with VS 2008 to the .NET 2.0 framework static class Program { private class Client { public string Name { get; set; } public string Address { get; set; } } private static ...
I had to write a custom download component to download modules for a ClickOnce deployed application. The actual downloading is simple, the tricky part was creating the manifest and make sure that I only download files that are required. I am using an GeneraApplicationManifest MSBuild task to generate an application manifest. The documentation is very easy to follow. The generated manifest will include a Hash value. It is fairly simple to compute the same hash value manually and be able to validate ...
My application is distributed via ClickOnce and a requirement is to be able to provide endpoint overrides for multiple environments. Here's what was done to create the solution Smart Client Software Factory includes a service called EndpointCatalog. It allow for easy management of endpoints with environment overrides. Start by adding a Microsoft.Practices.SmartCl... as a reference to Infrastructure.Module. Then open ModuleController class in and register the EndpointCatalog service. ...
Performance is a one of the basic requirements in the most of the current trend of web applications. While designing software architecture, there are several technologies kept available for the designers. Among these available options, some of techniques may includes multiple solutions, combining of those can create a case, where the basic performance output can't be determined based on the common sense and/or in depth knowledge on the corresponding topics. In short, based upon different options ...
In this article we'll see how easy it is to use Virtual Earth SDK to produce a simple mashup, using web services that provide information in JSON format. Live Demo - Source Code If you are not familiar with JSON or how to integrate JSON services in ASP.NET AJAX applications, you can take a look at my 3-part series of articles on JSON and ASP.NET AJAX here. First of all, we need to create a simple .aspx page, and add a ScriptManager to it. Then, we're going to reference the Virtual Earth API in the ...
This is the third part of a series of articles on ASP.NET AJAX and JSON. If you haven't read part 1 and part 2 of this series, you are strongly advised to do so before going on to read this article. Let's take what we've seen so far on JSON and ASP.NET one step further, and discover how we can leverage the ASP.NET AJAX infastructure to make the managing of an AJAX application even sleeker. Now, let's imagine that we want to elaborate the JSON response returned from the web service before sending ...
Often, when dealing with mathematical models for hazard estimation, one has to make the most out of just a handful of experimental data, and try to extract a rule or a behavioural function. While the use of lookup charts printed on paper may sometimes be a viable option, we won’t be able to rely on it when we want to implement a software solution. When this is the case, soft-computing may look like the perfect solution; neural networks can process data, learn their trend, and elaborate new samples ...
Technorati Tags: generic range class, C# First there was Jay Bazuzi and his article and follow-up with a simple Range class. I referred to those postings when I did a generic range class for a project I had. Now Sean Hederman has posted a CodeProject article with his generic range class. Very nice ...
I wrote some code that is meant for people that want to easily implement INotifyPropertyChanged after using the "prop" code snippet. It will take code that looks like this:public int DriverID { get { return _driverID; } set { _driverID = value; } } And return it like this:public int DriverID { get { return _driverID; } set { _driverID = value; OnPropertyChanged("DriverID"); } } It also will ignore any triple slash comments and #regions. So you can copy your entire #region --Properties-- into the ...
I have an interface IEntity that all my state objects like Client, Vehicle, Route etc implement. I am creating a control with a DataGridView that will display information about a list of state objects. The control expects an IEntity object, but since IEntity only defines methods, nothing is displayed on the DGV when I bind it to List<IEntity>, even though I can see the .DataSource is properly set when I view it in the debugger. I need to cast my object back to it's original type, so it's properties ...
Chris (who I meet down at SC Code Camp 2006) left a comment on my C# connection string validation code pointing out some flaws in my code. He suggested playing with System.Data.SqlClient.SqlCo... I redid the code to take advantage of this helper class. Here is the updated version of the code. Note that I only validate Data Source, Initial Catalog, User ID and Password because that is the only thing our software uses right now.public static bool IsValidSQLConnectionString(... ...
Update - I made the code better here Here is a code snippet I use to validate SQL connection strings: /// <summary>/// Checks a connection string for validity/// </summary>/// <param name="cn">SQL Connection string to validate</param>/// <returns>True if connection is valid.</returns>/// <history>/// [Tim Hibbard] 12/03/2006 Created/// </history>public static bool IsValidSQLConnectionString(... cn){ bool RV = true; try { if (!cn.Contains("Data Source")) ...
I finally put the finishing touches on the course that I'll be teaching next school year on game programming. This will be an 18 week course for students who are experienced at programming and have taken our Honors level Programming course. I plan on using the online book The Art of Computer Game Design by Chris Crawford. The book is a short read but covers some key points such as: What is a Game? Why do People Play Games A Taxonomy of Computer Games The Computer as a Game Technology The Game Design ...
I have a couple helper methods that I use all the time during my data access layer. I figured I might as well post them and hopefully help others out. I use the code from this article to pull my field names, that way I can build code like this:public override IEntity PopulateFromOpenIDataReader... dr) { const int ID = 0; const int NAME = 1; const int COMMENT = 2; const int ADDRESS1 = 3; const int ADDRESS2 = 4; Doctor rv = new Doctor(); rv.ID = (int)DataValidation.GetValu... ID, 0); ...
Let's say I have a base class that requires inheriting classes to implement a specific interface. Is there a keyword or attribute I can put on my base class to tell inheriting classes that they must implement a specific interface? Or do I have to implement the interface in my base class, then also implement the interface in inheriting classes and override the base implementation? Basically, I want to know if there is a cleaner way of accomplishing this public interface ICar { void UnlockCar(); void ...