Salient Solutions

wrasslin ones and nones for fun and profit - Sky Sanders' Blog
Get your own ranked flair here
posts - 88, comments - 54, trackbacks - 0

March 2010 Entries

StackOverflow Ranking - feeding your ego

I see a few questions on meta.stackoverflow.com regarding user ranking. There are several existing lists but they are focused primarily on users with higher scores. So, I wrote a small applet that, each night via a trickle pull, indexes all users for the trilogy and meta down to the 100 rep mark, indexes them in order of appearance. The 100 rep cutoff seems reasonable. On StackOverflow, the vast majority of users are < 100 and pulling that data seems over the top frivolous. You may access this data in several ways INTERACTIVE: http://skysanders.net/tools/sorep/default.aspx AUTOGET: http://skysanders.net/tools/sorep/default.aspx?site=stackoverflow.com&userId=1 JSON: http://skysanders.net/tools/sorep/SEStats.ashx?site=stackoverflow.com&userId=1 Response: { "userId": 1, "userName": "Jeff Atwood", ...

posted @ Wednesday, March 24, 2010 3:24 PM | Feedback (0) |

Preventing caching of content in ASP.Net Pages and other HttpHandlers

  Sometimes I forget to squash caching on my JSON handlers and end up with odd runtime behavior, especially when using IE. You can ensure that each request actually pulls data instead of hitting the cache by adding this to the top of a handler (.ashx) or in the page_load of a .aspx. Drop 'context.' for use in page_load.   context.Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1)); context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.Cache.SetNoStore();   This is what the head of my JSON handlers typically look like: public void ProcessRequest(HttpContext context) { context.Response.ClearContent(); ...

posted @ Tuesday, March 23, 2010 2:59 AM | Feedback (0) | Filed Under [ CodeProject-Tip ]

Coerce Windows and Internet Explorer (IE) to diplay JSON text inline

  Cheeso posted and eventually answered this question on StackOverflow about how to get IE to stop popping a file download dialog when rendering JSON text. A few things I noticed about the answer that might help others follow: You need to add the registry editor version as the first line in the .reg file You might want to also include 'text/json' content type.   Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json] "CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" "Encoding"=dword:00080000 [HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json] "CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}" "encoding"=dword:00080000   Technorati tags: CodeProject-Tip

posted @ Tuesday, March 23, 2010 2:49 AM | Feedback (0) | Filed Under [ CodeProject-Tip ]

Visual Studio 2008 Productivity Tools: CodeRush/Refactor and Resharper finally play nice together

  UPDATE: I just found this - http://code.google.com/p/dxcorecommunityplugins/wiki/CR_ReSharperCompatibility Will report when testing completed. --------------------   This is how I configure CodeRush/Refactor Pro and Resharper  to enable peaceful coexistance. Even as the feature sets of CR/RF and R# are steadily converging it seems to me that each product has a definite and divergent gestalt.  While evaluation of features is a subjective matter,  having the option to use both tools concurrently, choosing the features that make sense to the individual seems to be a win/win situation. In the not-so-distant past this has been a proposition that involved much fine tuning and a bit of uncertaintly that left all but the most...

posted @ Monday, March 22, 2010 4:20 AM | Feedback (0) |

Release: 3 state FAMFAMFAM Silk icon sets: discrete images and CSS sprite palette

 I am preparing to release an online imaging toolset that includes the ability to create 3 state icon sets using discrete images as well as CSS sprite palettes, similar to the jQueryUI method, and I found myself in need of... wait for it... some 3 state icons for the app. I settled on the ubiquitous FAMFAMFAM Silk icon set and got a chance to try out the toolset and was not disappointed. First, in order to accomodate a pleasant hover state, I grew the icon canvas size from 16px to 20px. This allows for a semi-transparent black border to represent the hover...

posted @ Thursday, March 18, 2010 4:49 AM | Feedback (1) |

Why is it always this way with MS offerings: CodePlex

Codeplex fits into my workflow better than sourceforge or github, and just beats out google code. But why does codeplex have to be so severely underpowered and clumsily executed? The UI is a prima facia case against the use of update panels. Am watching a spinner for minutes - often. Although I now prefer svn, when I did use TFS scc it is PAINFULLY slow. Grr..... But I still plan to host stuff there. Stay tuned for my subtext screed. am just thiiisss close to moving the blog off my site to wordpress.com. wordpress is so purty it makes me giggle.

posted @ Wednesday, March 10, 2010 9:01 AM | Feedback (0) |

Building Mono C# compiler (MCS) in Visual Studio 2008

If you are an old hand at building Mono on Windows using cygwin, then this post will not be of interest. The target audience for this post are those who just wish to build MCS, GMCS etc in Visual Studio 2008 without the need for MCS. Building the Mono C# compiler in Visual Studio 2008 would be as simple as opening gmcs.sln in VS and building if not for the need to generate the cs-parser.cs file. Supplied in the MCS package in the latest stable, 2.6.1,  is cs-parser.jay, which is an input file for the Jay Parser Generator for C#. The C++ source and...

posted @ Tuesday, March 09, 2010 1:09 AM | Feedback (0) | Filed Under [ CodeProject-Tip ]

Request for the permission of type System.Security.Permissions.EnvironmentPermission failed.

 Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I have been working on an AppDomain sandbox and was plagued with permission failures where there should be none, namely at the constructor of a type being activated with CreateInstanceFrom, which should allow an Unrestricted permission assert in the constructor, even in a restricted AppDomain. Ultimately I set exceptions to break and drilled down into the failed permission assert and noticed Read="AutoFakeEnabled". This smelled like Typemock getting in my way and sure enough disabling Typemock resolved the issue. I am not going to quantify the lost time, it would be embarassing, but...

posted @ Monday, March 08, 2010 3:57 PM | Feedback (1) |

Multiple ASP.Net Apps with common SqlMembershipProvider and unique SqlRoleProvider/SqlProfileProvider

  After a false start, a running battle in coments and a hot steaming serving of crow, all in response to a question on StackOverflow regarding a scenario in which I think the OP could use a single SqlMembershipProvider with multiple SqlRoleProviders and SqlProfileProviders, I believe I have a solution that is not a 'hack' or 'subverts' the intended usage of the SqlProvider stack. Lets begin with a bit of shadetree philosphy: If you can re-use something that has had millions of dollars and thousands of man hours devoted to design, coding, documentation and test, you should do so. Implementing skeleton custom providers  can be accomplished...

posted @ Friday, March 05, 2010 2:29 AM | Feedback (7) |

Generic NullSafe IDataRecord Field Getter

// usage var name = GetValueOrDefault<string>(reader, "Name"); var name = reader.GetValueOrDefault<string>("Name"); var name = reader.GetValueOrDefault<string>(0); // extension public static T GetValueOrDefault<T>(this IDataRecord row, string fieldName) { int ordinal = row.GetOrdinal(fieldName); return row.GetValueOrDefault<T>(ordinal); } public static T GetValueOrDefault<T>(this IDataRecord row, int ordinal) { return (T)(row.IsDBNull(ordinal) ? default(T) : row.GetValue(ordinal)); } Technorati tags: C-Sharp, ADO.Net, CodeProject-Tip

posted @ Tuesday, March 02, 2010 12:15 PM | Feedback (0) | Filed Under [ CodeProject-Tip ]

Opera sucks.

  I just needed to say it out loud.   If you don't know what I mean then count yourself lucky that you don't know what I mean.   If you do know what I mean, then I am just saying what you are thinking every time you have to write special case code inside special case code.   fuck opera.  

posted @ Tuesday, March 02, 2010 8:01 AM | Feedback (2) |

Windows 7 x64 - No thumbnails but a file preview!?

  So I am busy complaining to myself that I have no thumbnails in explorer and all of the proper boxes are unticked. Grrrrr But hey! wait a minute---- did you know the preview pane will display text files? I am quite pleased.  But where are my thumbnails? Wait a minute... Seems it will show me all the *.inc files I want but has no idea how to display a .txt.  This is just getting too funny,

posted @ Monday, March 01, 2010 11:52 AM | Feedback (0) |

Powered by: