dever

Stories submitted by dever

What should be in C#(seattlesoftware.wordpress.com)

submitted by deverdever(350) 3 years, 11 months ago

A few things I think C# could benefit from having: generic properties (for generic indexers), typedef from C, static local variables, and non-integral enums. read more...

add a comment |category: |Views: 12

tags: another

What's missing from C#(seattlesoftware.wordpress.com)

submitted by deverdever(350) 3 years, 11 months ago

In my humble opinion, it'd be nice to have a few things in C# that current don't exist: generic indexers, C's typedef, static local variables, full support for variable declarations in statements, and non-integral enums. read more...

add a comment |category: |Views: 16

tags: another

Returning null from a constructor?(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 2 months ago

If you've ever wanted to avoid an Exception being throw from an parameter passed into a constructor, and instead treat the new instance like null, here's how. read more...

add a comment |category: |Views: 2

tags: another

String-based enums aren't legal in C#?!(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 3 months ago

What's the best work-around for string-based enums in C# Static classes? Maybe, but static classes still fall short. Is there a good work-around? I don't think so. Do you agree? read more...

add a comment |category: |Views: 4

tags: another

Setting Meta Tags in ASP.NET with C# 3.0 Extensions(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 3 months ago

Having problems dynamically setting the meta tags of your ".aspx" page? Copy, paste, and enjoy. read more...

add a comment |category: |Views: 10

tags: another

Pagination widget/control(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

"Want a JavaScript that draws a paging control into a <div>? There are no frameworks (e.g. Prototype, JQuery) requried, and it’s relatively small (2.49 kb) before being compressed (1.2 kb after Packering). Here’s the source and a test page. Create a file, paste in this code, then enjoy:" read more...

add a comment |category: |Views: 42

tags: another

Argument vs. Parameter(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

"What’s the difference between an “argument” and “parameter”? They’re frequently used interchangeably. In fact, they refer to the same thing—just in different contexts. Have you ever noticed though that..." read more...

add a comment |category: |Views: 7

tags: another

Writing JavaScript-compliant JSON(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

"JSON is not only a syndication format (e.g. an alternative to XML), it is a language-independent data interchange format. As such, while JSON objects are based on the JavaScript object literal, they are not the same. In fact, JSON objects can be invalid as JavaScript objects. Therefore, JSON should be transformed to JavaScript-compliant JSON before feeding Ajax or JavaScript applications." read more...

add a comment |category: |Views: 10

tags: another

Local XMLHttpRequest Debugging(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

"A recent project has me working closely with the browser XMLHttpRequest object. Like any good little dev., I've been writing tests for various Ajax routines. These test are simple .htm files run from a local directory on my computer—they do not reside on an HTTP server. Consequently, after an XMLHttpRequest has its send() fired, no actual HTTP request is made. Instead, the browser simply accesses the file on the harddrive via I/O operations—not the HTTP protocol. During my testing experience with a local setup, I've noticed a few quirks that deserve attention. If you're a developer also debugging in a disconnected environment, you may find these notes useful." read more...

add a comment |category: |Views: 14

tags: another

Simple JavaScript key/value Query String Collection(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

"The property window.location.search will return the query string portion of the URL, including the ‘?’ delimiter. For example, it would return '?q=software&ps=10' in the example URL at piggy.com above (if there’s no query string, search is an zero-length string). The problem with search is that the key/value pairs have to be manually parsed out. A collection-like object accessible in the same manor as a hash table (e.g. var value = collection[key]) is a much more convenient and useful way of representing the query string. In lieu of such an object in window, I’ve created a very simple JavaScript snippet that represents the query string as an object. The object’s properties are the query string keys, and the properties’ values are the key values. Make your life easier and drop this puppy somewhere in your global scope. A closure is used to make it play nice with the neighbors." read more...

add a comment |category: |Views: 249

tags: another

Parse and TryParse methods should be signatures in a interface, IParse(seattlesoftware.wordpress.com)

submitted by deverdever(350) 4 years, 4 months ago

Useful as this pattern is, the Parse and TryParse method signatures are not inherited from an interface in .NET. Why isn’t there an IParse interface that defines these two methods? Who knows. The interface could have existed since the inception of .NET, but it hasn’t. And in .NET 2.0 and later, generics could be used to eliminate the boxing that is required in .NET 1.1. Here’s what the simple interface should look like, defined in the System namespace. read more...

add a comment |category: |Views: 172

tags: another