DotNetKick.com is an open-source project. Please report any bugs and let us know your great suggestions. Currently running svn revision 620 (rss)

Kick Spy!, Kick Zeitgeist and Kick Widgets

yesthatmcgurk Subscribe to this feed
yesthatmcgurk
Profile Kicked Submitted Comments Tags Friends Kicked By Friends Submitted By Friends


Comments:

The biggest failure of 2.0.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Wow... to_s. What's wrong, ToString too hard to handle? I just love CL's with obscure method names.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

For extra lulz, here's the author and submitter: http://honestillusion.com/photos/rnc/picture2650.aspx
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

"Don't use a singleton."
"Why?"
"They're pretty much the same as global variables and static classes. Use those instead."
"Well, if they're pretty much the same, then why not use a singleton?"
"..."

Also: Author notes he fixed some spelling and "grammer" problems.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Schweet. And than you, policeman!
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Nice introduction. Config sections can get complex, tho, and this article doesn't go into it that deep. But it does contain links to other, more in depth, articles.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Somebody isn't using it?
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Awesome resource for any level of .NET remoting knowledge.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

It does this synchronously? I'm in ur thread, blockin ur UI.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

No information on exactly what the addin does. I'm not gonna download and install it just to see.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Great article, even if you don't do test driven (or behavior driven) development.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Article isn't very interesting; its just a very short primer on events and event handlers.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Th Th Th Th THREEPEAT!
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

Come to think of it, I suppose I could do this:
if(o is T)
{
value = (T)o;
return true;
}
else
return false;

and avoid the catch block altogether...
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

I like to use a generic method to try and get objects out of the cache:

internal static bool TryGetCacheItem<T>(string key, ref T value)
{
// HttpContext.Current may be nulled out during execution when the worker process shuts down
HttpContext context = HttpContext.Current;
if (context == null) return false;
Cache c = context.Cache;
if (c == null) return false;
try
{
object o = c[key];
if (o == null)
return false;

value = (T)o;
return true;
}
catch (InvalidCastException)
{
return false;
}
}

My TrySet method doesn't use generics; it does perform null checking and adds some default behaviors:
internal static bool TrySetCacheItem(
string key,
object value,
CacheDependency dependency,
DateTime expiration,
TimeSpan slidingExpiration,
CacheItemPriority priority,
CacheItemRemovedCallback onRemoveCallback)
{
// sanity checks
if (string.IsNullOrEmpty(key)) return false;
if (value == null) return false;
// defaults; change as per your policy
if (expiration == null)
expiration = Cache.NoAbsoluteExpiration;
if (slidingExpiration == null)
slidingExpiration = Cache.NoSlidingExpiration;
// checks to avoid null reference exceptions
HttpContext context = HttpContext.Current;
if (context == null) return false;
Cache c = context.Cache;
if (c == null)
return false;

c.Add(key, value, dependency, expiration, slidingExpiration, priority, onRemoveCallback);
return true;
}
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago

That's why they delivered it in a VPC image. Dur.
posted by yesthatmcgurk yesthatmcgurk 1 year, 8 months ago
 

Sponsored Link: www.carlist.ie

Search:

Ads via The Lounge