Search Results

Search found 10 results on 1 pages for 'nicklarsen'.

Page 1/1 | 1 

  • Maintaining a main project line with satellite projects

    - by NickLarsen
    Some projects I work on have a main line of features, but are customizable per customer. Up until now those customizations have been implemented as preferences, but now there are 2 problems with the system... The settings page is getting out of control with features. There are probably some improvements that could be made to the settings UI, but regardless, it is quite cumbersome setting up new instances for new customers. Customers have started asking for customizations which would be more easily maintained as separate threads instead of having tons of customizations code. Optimally I am envisioning some kind of source control in which features are either in the main project line and customizations per customer are maintained in a repo per customer set up. The customizations per project would need to remain separate but if a bug is found and fixed in a particular project, I would need to percolate the fix back to the main line and into all of the other customer repos. The problem is I have never seen this done before, and before spending time trying to find source control that can accommodate this scenario and implement it, I figure it best to ask if anyone has something less complicated or knows of a source control product which can handle this with very little hair pulling.

    Read the article

  • Run application or script on Windows RDC connection

    - by NickLarsen
    I checked this thread, but it did not solve my exact problem. I need to run a script on when a connection is made across my network using windows remote desktop connection. The thread listed above works for the initial login, however, if I don't log out (which is necessary for some processes running on my network), then it wont run the script again the next time someone connects to the system using remote desktop connection. Previously we were using pcAnywhere to achieve this, however after running into some graphical issues with pcAnywhere, we have decided to move away from it to RDC. For a little more information, we need to have an email sent out anytime a connection is made to particular machines. The login name will always be the same for those systems and we do not log off when closing the connection.

    Read the article

  • IIS5 to IIS6 upgrade, and the bin folder

    - by NickLarsen
    We had a website running under IIS5 which used the bin directory as a housing for some asp pages as well as files for download and after upgrading to IIS6, we only get a 404 error when trying to access anything in that folder. We do not store any sensitive information in there, or code, and it would require a major overhaul of not only our system, but our clients' systems as well. Is there some configuration setting we are overlooking or is it just that IIS6 will no longer let you use the bin folder as just another directory?

    Read the article

  • Unexpected Html.EditorFor behavior in ASP.NET MVC 2

    - by NickLarsen
    I am getting some unexpected behavior from Html.EditorFor(). I have this controller: [HandleError] public class HomeController : Controller { [AcceptVerbs(HttpVerbs.Get)] public ActionResult Lister() { string[] values = { "Hello", "world", "!!!" }; return View(values); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Lister(string[] values) { string[] newValues = { "Some", "other", "values" }; return View(newValues); } } And this is my view which is intended to work for both of these: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<string[]>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Lister </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Lister</h2> <% using (Html.BeginForm()) { %> <% foreach (string value in Model) { %> <%= value %><br /> <% } %> <%= Html.EditorForModel() %> <input type="submit" value="Append Dashes" /> <% } %> </asp:Content> And the problem is that when the post back is made from the view, it hits the correct action, but the text boxes still show the original hello world data while the foreach loop outputs the new values. It feels like something in ASP.NET is overriding my model values from updating the text boxes and they are just displaying the same old values. I found this issue while trying to learn EditorFor with an IEnumerable.

    Read the article

  • Regex file extension filter

    - by NickLarsen
    I am trying to create a regex that will take all files that do not have a list of extensions. In particular, I am trying to filter out filenames that end in .csv I have browsed around for an hour and been unable to figure this out. I am using .NET Regex.

    Read the article

  • C# using consts in static classes

    - by NickLarsen
    I was plugging away on an open source project this past weekend when I ran into a bit of code that confused me to look up the usage in the C# specification. The code in questions is as follows: internal static class SomeStaticClass { private const int CommonlyUsedValue = 42; internal static string UseCommonlyUsedValue(...) { // some code value = CommonlyUsedValue + ...; return value.ToString(); } } I was caught off guard because this appears to be a non static field being used by a static function which some how compiled just fine in a static class! The specification states (§10.4): A constant-declaration may include a set of attributes (§17), a new modifier (§10.3.4), and a valid combination of the four access modifiers (§10.3.5). The attributes and modifiers apply to all of the members declared by the constant-declaration. Even though constants are considered static members, a constant-declaration neither requires nor allows a static modifier. It is an error for the same modifier to appear multiple times in a constant declaration. So now it makes a little more sense because constants are considered static members, but the rest of the sentence is a bit surprising to me. Why is it that a constant-declaration neither requires nor allows a static modifier? Admittedly I did not know the spec well enough for this to immediately make sense in the first place, but why was the decision made to not force constants to use the static modifier if they are considered constants? Looking at the last sentence in that paragraph, I cannot figure out if it is regarding the previous statement directly and there is some implicit static modifier on constants to begin with, or if it stands on its own as another rule for constants. Can anyone help me clear this up?

    Read the article

  • C# reflection instantiation

    - by NickLarsen
    I am currently trying to create a generic instance factory for which takes an interface as the generic parameter (enforced in the constructor) and then lets you get instantiated objects which implement that interface from all types in all loaded assemblies. The current implementation is as follows:     public class InstantiationFactory     {         protected Type Type { get; set; }         public InstantiationFactory()         {             this.Type = typeof(T);             if (!this.Type.IsInterface)             {                 // is there a more descriptive exception to throw?                 throw new ArgumentException(/* Crafty message */);             }         }         public IEnumerable GetLoadedTypes()         {             // this line of code found in other stack overflow questions             var types = AppDomain.CurrentDomain.GetAssemblies()                 .SelectMany(a = a.GetTypes())                 .Where(/* lambda to identify instantiable types which implement this interface */);             return types;         }         public IEnumerable GetImplementations(IEnumerable types)         {             var implementations = types.Where(/* lambda to identify instantiable types which implement this interface */                 .Select(x = CreateInstance(x));             return implementations;         }         public IEnumerable GetLoadedImplementations()         {             var loadedTypes = GetLoadedTypes();             var implementations = GetImplementations(loadedTypes);             return implementations;         }         private T CreateInstance(Type type)         {             T instance = default(T);             var constructor = type.GetConstructor(Type.EmptyTypes);             if (/* valid to instantiate test */)             {                 object constructed = constructor.Invoke(null);                 instance = (T)constructed;             }             return instance;         }     } It seems useful to me to have my CreateInstance(Type) function implemented as an extension method so I can reuse it later and simplify the code of my factory, but I can't figure out how to return a strongly typed value from that extension method. I realize I could just return an object:     public static class TypeExtensions     {         public object CreateInstance(this Type type)         {             var constructor = type.GetConstructor(Type.EmptyTypes);             return /* valid to instantiate test */ ? constructor.Invoke(null) : null;         }     } Is it possible to have an extension method create a signature per instance of the type it extends? My perfect code would be this, which avoids having to cast the result of the call to CreateInstance():     Type type = typeof(MyParameterlessConstructorImplementingType);     MyParameterlessConstructorImplementingType usable = type.CreateInstance();

    Read the article

  • C# Copying instance variable to local variable in functions of same class

    - by NickLarsen
    I have been looking through some code on an open source project recently and found many occurrences of this kind of code: class SomeClass { private int SomeNumber = 42; public ReturnValue UseSomeNumber(...) { int someNumberCopy = this.SomeNumber; if (someNumberCopy > ...) { // ... do some work with someNumberCopy } else { // ... do something else with someNumberCopy } } } Is there any real benefit to making a copy of the instance variable?

    Read the article

  • TicTacToe strategic reduction

    - by NickLarsen
    I decided to write a small program that solves TicTacToe in order to try out the effect of some pruning techniques on a trivial game. The full game tree using minimax to solve it only ends up with 549,946 possible games. With alpha-beta pruning, the number of states required to evaluate was reduced to 18,297. Then I applied a transposition table that brings the number down to 2,592. Now I want to see how low that number can go. The next enhancement I want to apply is a strategic reduction. The basic idea is to combine states that have equivalent strategic value. For instance, on the first move, if X plays first, there is nothing strategically different (assuming your opponent plays optimally) about choosing one corner instead of another. In the same situation, the same is true of the center of the walls of the board, and the center is also significant. By reducing to significant states only, you end up with only 3 states for evaluation on the first move instead of 9. This technique should be very useful since it prunes states near the top of the game tree. This idea came from the GameShrink method created by a group at CMU, only I am trying to avoid writing the general form, and just doing what is needed to apply the technique to TicTacToe. In order to achieve this, I modified my hash function (for the transposition table) to enumerate all strategically equivalent positions (using rotation and flipping functions), and to only return the lowest of the values for each board. Unfortunately now my program thinks X can force a win in 5 moves from an empty board when going first. After a long debugging session, it became apparent to me the program was always returning the move for the lowest strategically significant move (I store the last move in the transposition table as part of my state). Is there a better way I can go about adding this feature, or a simple method for determining the correct move applicable to the current situation with what I have already done?

    Read the article

1