Tag: Programming
-
Rake Breathing New Life to Building Old Projects
I’ve seen lots of examples of rake (the ruby make replacement) being used as a build tool in non-ruby projects. Many of these are still modern platforms, like .Net. For example, StructureMap builds with rake. But I’ve found that even on older platforms, the power of having a full programming language in your build tool […]
-
Passing in “this” in StructureMap
I’ve been working with StructureMap lately, and struggled when I need to pass this in. The following code is an example of resolving that issue… namespace StateMachine { public class StateRegistry : StructureMap.Configuration.DSL.Registry { public StateRegistry () { For<IState>.Use<StateA>.Named(“FirstState”); For<IState>.Use<StateB>.Named(“SecondState”); } } public interface IStateMachine { void ChangeState(IState state); } public interface IState { void […]
-
Namespace, Encapsulation in JavaScript
I’ve had several discussion recently some of the more advanced features of JavaScript, such as functions as return values, namespaces, encapsulation, etc. In order to demonstrate some of these things, I contrived a simple example of a dependency injection tool. Never mind that dependency injection is not really a relevant pattern in JavaScript or other […]
-
Function Name Instead of Lambda in Linq Functions
I did not realize that functions can fill in for predicates directly without lambda notation. To illustrate, consider the following: void Main() { var words = new List<string>() { “therapists”, “s words”, “slang”, “mustache”, “sean connery” }; var s_words = words.Where(w => w.StartsWith(“s” ,StringComparison.CurrentCultureIgnoreCase)); foreach(var word in s_words) { Console.WriteLine(word); } } It works, but […]
-
Emacs on Windows Over SSH with Putty Tools
With a little help from StackOverflow, I got emacs over ssh working on windows. This is trivial on mac/linux, but can be a challenge on windows. dired mode works too! To summarize: 1. Download putty installer with all the tools. 2. Put putty install in the path 3. Generate a key with PuttyGen 4. Copy […]