This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<UserControl | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
x:Class="HelloWOrld.MainPage" | |
Width="640" Height="480" mc:Ignorable="d"> | |
<UserControl.Resources> | |
<Storyboard x:Name="Storyboard2"> | |
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"> | |
<EasingDoubleKeyFrame KeyTime="00:00:00" Value="-99"/> |
Booyah.ShouldJustWork : FailedSystem.InvalidOperationException : Collection was modified; enumeration operation may not execute. | |
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) | |
at System.Collections.Generic.List`1.Enumerator.MoveNextRare() | |
at System.Collections.Generic.List`1.Enumerator.MoveNext() | |
at NSubstitute.Routing.Handlers.RaiseEventHandler.Handle(ICall call) in d:\Git\NSubstitute\Source\NSubstitute\Routing\Handlers\RaiseEventHandler.cs: line 27 | |
at NSubstitute.Routing.Route.<>c__DisplayClass3.<Handle>b__0(ICallHandler x) in d:\Git\NSubstitute\Source\NSubstitute\Routing\Route.cs: line 18 | |
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x) | |
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() | |
at System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) | |
at NSubstitute.Routing.Route.Handle(ICall call) in d:\Git\NSubstitute\Source\NSubstitute\Routing\Route.cs: line 18 |
This doesn't work - it says "No match for method with name AssertWasCalled and flags Instance | NonPublic | Public | Static on type Rhino.Mocks.RhinoMocksExtensions" | |
public static void CallUsingReflection<T>(T mock, Action<T> action) | |
{ | |
RhinoAssembly.GetType("Rhino.Mocks.RhinoMocksExtensions").CallMethod(new[] { typeof(T) }, "AssertWasCalled", new object[] { mock, action }); | |
} |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Bug or am i doing something stupid? Want to pretend that the first call to menu.PrintMenu() in GetSelection never happened by clearing received calls from the sub itself. | |
[TestFixture] | |
public class NSubBug | |
{ | |
public interface IMenu | |
{ | |
void PrintMenu(); | |
string GetUserSelection(); | |
} |
gist. |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed ipsum sem, quis vestibulum tortor. Curabitur facilisis malesuada urna, in auctor eros congue a. Suspendisse consequat tellus id erat aliquam cursus. Ut gravida augue eu lectus molestie a condimentum justo dictum. Ut adipiscing dictum nulla, nec sagittis mi pellentesque in. Aenean nec rutrum mauris. Donec pharetra velit ut est euismod volutpat. Sed vel lectus elit. Sed nunc risus, aliquet sed luctus ut, dictum sit amet libero. Nulla erat risus, tempus nec porta id, ultrices vitae libero. Vestibulum tristique imperdiet neque vel commodo. Mauris sit amet leo quis nisl convallis cursus non non lacus. Fusce adipiscing turpis metus, id laoreet orci. Etiam et scelerisque nisi. Vivamus ipsum metus, pellentesque non porttitor eget, sollicitudin non velit. Quisque egestas elementum euismod. | |
Maecenas tincidunt, tortor id consectetur congue, quam velit ultricies tortor, ut vulputate erat quam a elit. Nulla facilisi. Nam mollis feugiat augue, at posuere m |
// Given a list of table rows, I want to prepend (or append) a blank checkbox which i'll use to | |
// check off as i go through the rows one by one....this should work on the netbank site. | |
// the idea is to just keep this as a bookmarklet and run it when looking at my transaction list | |
// When running the snip below chrome complains "Uncaught Error: NOT_FOUND_ERR: DOM Exception 8" | |
javascript:$('#transactionsTableBody > tr').map(function() { this.appendChild($('<td><input type="checkbox" /></td>')) }) |
var BetterNetbank = { | |
inject: function(table) { | |
if ($("#" + table).length > 0) { | |
$('#' + table + ' thead tr').prepend('<th>X</th>'); | |
$('#' + table + 'Body > tr').map(function() { | |
$(this).prepend('<td><input type="checkbox" /></td>'); | |
}); | |
} | |
} | |
} |
data List a = Elem a | List [List a] deriving (Show) | |
flatten' :: List a -> [a] | |
flatten' (Elem x) = [x] | |
flatten' (List (x:xs)) = flatten' x ++ flatten' (List xs) | |
flatten' (List []) = [] | |
data Tree a = Empty | Node a (Tree a) (Tree a) | |
deriving (Eq, Show, Read) |