.net

Resizing image crops one pixel form right and bottom

Hi, all! I had discovered that when resizing image by using System.Drawing.Graphics class resulting image missed one pixel from right and bottom borders. This is bug somewhere in my code or .Net issue? Test code: public static void Resize(string imagePath,int width) { InterpolationMode[] interpolationModes = new InterpolationMode[]{In...

Do WPF Routed Commands solve a problem or make it worse?

From what I understand, the goal of the Command pattern is to help separate UI interaction from application logic. With properly implemented commands, a click on a "Print" menu item might result in a chain of interaction like this: (button) ---click executes command----> (command) ---calls Print() in app logic ---> (logic) This encou...

.NET Jump List

Is there a .NET library/tutorial available that will let me show me how to customize the Windows 7 Jump List for my application? ...

.net for Win95?

Hi there! During some research in the .net 3.5 symbols I've found a preprocessor directive #if WIN95_SUPPORT //... #endif This looks really strange to me! It is located in line 13861 in System.Windows.Forms.Control's Control.cs in method void WndProc(ref Message m)! Does any of you know anything about that? ...

How will Python and Ruby applications be affected by .NET?

I'm curious about how .NET will affect Python and Ruby applications. Will applications written in IronPython/IronRuby be so specific to the .NET environment, that they will essentially become platform specific? If they don't use any of the .NET features, then what is the advantage of IronPython/IronRuby over their non .NET counterpar...

Natural language parser for dates (.NET)?

I want to be able to let users enter dates (including recurring dates) using natural language (eg "next friday", "every weekday"). Much like the examples at http://todoist.com/Help/timeInsert I found this post, but it's a bit old and offered only one solution that I'm not entirely content with. I thought I'd resurrect this question and ...

How to initialize a List<T> to a given size (as opposed to capacity)?

.NET offers a generic list container who's performance is almost identical (see Performance of Arrays vs. Lists question). However they are quite different in initialization. Arrays are very easy to initialize with a default value, and by definition they already have certain size: string[] Ar = new string[10]; which allows one to sa...

Select items by tag when searching multiple tags

Hi, I'm struggling a bit here so I thought why not ask: Every entity in my system has a list of tags (a list of strings), and I want to be able to search for multiple tags at once. I have a IQueryable to work with. Every Entity has a IList called Tags and my input parameter is a IList. I simply could go through all tags and do IQuerya...

Generating SQL Server DB from XSD

Duplicate: http://stackoverflow.com/questions/263836/generating-sql-schema-from-xml In a project i am working on, i have a need to support either a strongly-typed dataset for storing the data as XML, or storing the data in sql server. Now i already have the XSD schema created and i would like to be able to create a sql server database...

Trouble with Web Service using COM object

I have a VB.NET web service that is calling a Interop COM object. When I make multiple calls to the web service at the same time, the web service processes fine until it gets to calling the first method of the COM object. At this point, it seems as though the calls to the COM object get put on a stack and they get processed on a FIFO b...

Adding line breaks to comments for Intellisense ...

Does anyone know how to insert a line break into a summary comment in order for the line break to be reflected in Intellisense documentation? To clarify, assume code documentation.. /// <summary> /// Some text documentation /// - a line break - /// Some more documentation /// </summary> public void SomeMethod() { } So when using t...

How Random is System.Guid.NewGuid()?

I know this may sounds like a pointless question, but hear me out... I basically want to know if I can trust the GUID to generate a value which will be unique 100% of the time and impossible to predict. I'm basically rolling my on login system for a website and want to know if the GUID is secure enough for session cookies. Any backgro...

How do I map a one-to-one association with NHibernate using foreign key generator?

So far the association works fine (the User class loads the appropriate UserRoles instance when present), but when creating a new User and setting its Roles property to a new instance of UserRoles, the UserRoles object is not saved. Here is my abridged User.hbm.xml: <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:...

Anti-aliasing artifacts in WPF

I have a bizarre rendering issue when I'm trying to use anti-aliased graphics in WPF. Here's a simplified version. If I use the following XAML <Window x:Class="RenderingBug.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Width="300" Heigh...

Windows design guidelines and Visual Studio

Does anyone have a good strategy for adhering to Windows Design Guidelines with Windows Forms development in Visual Studio (2008) For example just tring to adhere to font recommendations in Windows XP you have to know the system default font should be Tahoma, Verdana should be used for Title bars in floating windows and Trebuchet MS sh...

SubSonic data layer that returns POCOs instead of SubSonic's ActiveRecord objects

I want to use SubSonic (2.2) in an application I'm building because I like its simplicity and it handles any type of query I can foresee needing. At the same time, I want to keep the upper layers of my application de-coupled from the Subsonic Types. I want to return just Plain Old C# Objects and also pass in POCOs to be saved. But here'...

413 http error on image upload in iis6

I keep getting a 413 error "Entity too large" when uploading images (particular image is a 275kb PNG) with an asp.net form. I have thoroughly researched this, and changed: AspMaxRequestEntityAllowed to 1000000 as suggested here- http://www.banmanpro.com/support2/File_Upload_limits.asp UploadReadAheadSize to 1000000 as suggested here- ...

WCF Fails Under Load - MessageSecurityException

I am load testing my website. The site calls to a WCF service running on the same box using clientCredentialType="Windows". Everything works until I reach a certain load (which is not even very high), then I get the following error: System.ServiceModel.Security.MessageSecurityException: The HTTP request was forbidden with clien...

VB.net: What is static T (C#) in VB.net?

public static T GetValueOrDefault<T>(this IDataReader reader, string columnName) T returnValue = default(T); Hello, I want to implement something like this to check DBNull. I can follow the code fine but i don't quite understand what is static T is in VB.net. Can someone please explain a bit? Thank Jack ...

Which language/platform to develop desktop application based on following criteria

Hi, Faced with the challenge of a new application with which you had free reign to design, assemble a team to develop and manage: Which language/platform would you choose? Why? Background: The desktop application will control a hardware device and perform computations, analyze and display the data returned by it. Requirements: (i...