tag:blogger.com,1999:blog-8416807644832025349.comments2016-03-03T11:26:59.889-08:00Lexical ClosuresUnknownnoreply@blogger.comBlogger30125tag:blogger.com,1999:blog-8416807644832025349.post-41033875203969061122016-03-03T11:26:59.889-08:002016-03-03T11:26:59.889-08:00Great tool! Great article! Thank you.
I'm try...Great tool! Great article! Thank you.<br /><br />I'm trying to replace the C-S-s binding for "File.SaveAll" command to C-x C-S-s. But I can't find the right way to write the last argument for fset. I've tried several guesses including [?\Ctrl-\Shift-s], but they all fail. Could you suggest a solution, please?Alexeyhttps://www.blogger.com/profile/12450509786587403398noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-72066025694848872972016-01-29T12:48:12.108-08:002016-01-29T12:48:12.108-08:00MZ-Tools 8.0 was released recently, fixing a few b...MZ-Tools 8.0 was released recently, fixing a few bugs and introducing new features - I haven't tried it but from a quick look at the download page it seems to no longer be free.<br /><br />Have you seen/tried Rubberduck? http://www.rubberduck-vba.com<br /><br />The tool has been dubbed "R# for VBA" quite a few times on Twitter already, and upcoming version 2.0 looks very, very promising. The add-in is free and open-source, under active development, created by some of the top users of Code Review Stack Exchange (http://www.codereview.stackexchange.com), and includes code inspections (and quick-fixes), rename, extract method, reorder parameters, remove parameter, and another upcoming half-dozen refactorings; unit testing, IDE-integrated Git source control, and an upcoming port/rewrite of the popular Smart Indenter add-in.<br /><br />Last release 1.4.3 has a number of known issues, but 2.0 is on its way.<br /><br />Just sayin' ;-)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-84987013014373997642013-07-23T06:53:24.602-07:002013-07-23T06:53:24.602-07:00Thanks for this, I am having to start doing a lot ...Thanks for this, I am having to start doing a lot of c# development and coming from emacs it has been painful to transition. Xkeymacs and Resharper will be godsends.<br />CheersAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-57115751387512866192011-07-10T22:49:41.225-07:002011-07-10T22:49:41.225-07:00same here. I use XKeymacs with VS 2010. way better...same here. I use XKeymacs with VS 2010. way better, becuase you can also do CTRL+n (down) which works in alot of "go to type" mini-dialogs.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-66781851415064097572010-08-19T21:31:15.748-07:002010-08-19T21:31:15.748-07:00@sneal- That link looks familiar. :-)
@brian- Wha...@sneal- That link looks familiar. :-)<br /><br />@brian- What sneal suggests is your best option.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-37373119341705088792010-08-18T06:47:43.220-07:002010-08-18T06:47:43.220-07:00Brian, you have to run a separate count query to g...Brian, you have to run a separate count query to get the total number of non-paged rows. http://stackoverflow.com/questions/54754/how-can-you-do-paging-with-nhibernateAnonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-61148921576695965322010-08-17T10:47:26.948-07:002010-08-17T10:47:26.948-07:00Yes, but how do you determine the total page numbe...Yes, but how do you determine the total page numbers? Do you divide the total records by records you want to view to get the page amount?Brian Wilkinshttps://www.blogger.com/profile/13600273886071125088noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-65713909144136482932010-07-07T23:54:31.504-07:002010-07-07T23:54:31.504-07:00I could not decide whether or not I agreed with th...I could not decide whether or not I agreed with the 2nd poster (very persuasive arguments!) so the best way to ease my mind was just removed it. :-) Seriously, yours might be the first non-spam comment I've gotten in well over a year. (I'm considering restricting comments since it seems to have gotten progressively worse as of late.)<br /><br />That's cool you been trying out these problems with Ruby. Hope you had some fun with it.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-53221726866002206752010-07-07T17:46:00.955-07:002010-07-07T17:46:00.955-07:00I strongly disagree with the second poster. ;)
A...I strongly disagree with the second poster. ;)<br /><br />About a month ago a couple of us went through a few of these problems at lunch time in Ruby, I know I found the experience very enlightening - especially when we got to the point of learning to craft the code as a Ruby-ist would.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-59166308954638091932009-10-06T06:19:48.524-07:002009-10-06T06:19:48.524-07:00I had the same issue, except in my case I want to ...I had the same issue, except in my case I want to compare two tables for equal content.<br /><br />The way I manage to do this: in my test suite setup sproc, I create two identical tables, Expected and Actual. (The transactionality of TSQLUnit will clean em up for me.) Inside the test (as part of the 'Arrange' section) I manually insert data into the Expected table.<br /><br />In this case I'm testing a UDF, so I select from the UDF into the Actual table. I then call another sproc, (effectively part of my framework), which compares the contents of Expected and Actual. This comparison is done using EXCEPT and UNION ALL clauses. This sproc is called 'AssertTablesCongruent'. This sproc calls tsu_failure directly if need be.<br /><br />(One has to use 'real' tables for Expected and Actual because you can't pass table variables to a sproc or UDF).<br /><br />Email me if you want more details.Joshua Lewishttps://www.blogger.com/profile/04212366532610960064noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-14447219986526998562009-02-02T21:51:00.000-08:002009-02-02T21:51:00.000-08:00Much agreed about using an MVC framework. Things b...Much agreed about using an MVC framework. Things become difficult whenever you try to do something that does not conform to how ASP.NET WebForms normally behaves.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-29043309059343845812009-01-31T08:58:00.000-08:002009-01-31T08:58:00.000-08:00Yeah, it's almost never a good idea to return all ...Yeah, it's almost never a good idea to return all rows without some sort of criteria and/or paging.<BR/><BR/>The whole paging thing would be very easy to create using an MVC framework, but you could also create a reusable component for that like <A HREF="http://ayende.com/Blog/archive/2007/04/08/Building-View-Components-For-MonoRail.aspx" REL="nofollow">this</A><BR/><BR/>The 1:1 DAO to domain object would be better replaced by a few aggregate roots and repositories; It sounds like you essentially have a table row gateway pattern.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-65116361573625953172009-01-20T00:30:00.000-08:002009-01-20T00:30:00.000-08:00@J.P. Hamilton-As I wrote above, when you are firs...@J.P. Hamilton-<BR/><BR/>As I wrote above, when you are first learning something new such as unit testing and TDD your initial instinct is to apply it everywhere and anywhere you can. By doing this, it typically helps you as the learner to both understand it and build a mastery of it over time.<BR/><BR/>Along those same lines, the TDD trend and movement is more about getting non-testing programmers in the habit of doing testing as part of their development process. But, in order to do that, the easier path to sell this concept to them is to just simply say <I>all</I> code should be tested versus just certain code.<BR/><BR/>It is probably better to strive for quality over quantity when it comes to writing tests (which is the potential pitfall when targeting 100% test coverage). Otherwise, you might end up spinning wasteful cycles on writing (test) code that might not provide any true benefit (direct or indirect) to delivering and maintaining your software. Worse, it could end up being costly having a negative impact as the developers are drowning in test code that needs to be written and maintained.<BR/><BR/>Once you know the insides and out of <I>how</I> to unit test in general, it takes additional time and practice to know <I>when</I> and <I>what</I> to write tests for. This can be more difficult to categorize and define because it does require more experience and skills with writing good quality code and software <I>in general</I> as you develop an eye to recognize what code screams for testing and what does not. As I mentioned, for most unable to discern when to write tests, it is easier to just test everything (or not to test at all) which is not necessarily a good thing.<BR/><BR/>As to what precisely are those situations in code that do indeed need to have tests written for, I can not provide a whole lot of concrete examples as I am still learning. However, I will offer up that any code with any form of complex conditional logic would probably always be a good candidate.<BR/><BR/>Oh yes, I'll keep on working on blogging more frequently. :-)Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-52903851013528860612009-01-19T07:26:00.000-08:002009-01-19T07:26:00.000-08:00First off, you need to blog more:) Second, I appre...First off, you need to blog more:) Second, I appreciate everything you have said about TDD. I am in a similar spot myself. I think TDD is great, but after shooting for 100% coverage and mocking the known universe, I know that it can be taken to the extreme. In fact, I think that tons of mocking could be a code smell. At a certain point, it seems to hinder my ability to refactor effectively. I am definitely searching out a more rational approach to the practice.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-4621384922118249152008-12-13T15:33:00.000-08:002008-12-13T15:33:00.000-08:00AndrewI have not been fortunate enough to work on ...Andrew<BR/><BR/>I have not been fortunate enough to work on a project using the latest in Rhino Mocks coupled with C# 3.x but I definitely would like to experience for myself some of the syntactical improvements you mention.<BR/><BR/>I do plan on taking a look at Moq (http://code.google.com/p/moq/) to see how it holds up in those same areas.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-17340269754382165542008-12-11T15:24:00.000-08:002008-12-11T15:24:00.000-08:00Ray, as you say the article is quite old but nothi...Ray, as you say the article is quite old but nothing seem to have changed in error messages by now :)<BR/><BR/>Just starting to fumble with RhinoMock - C#3 support in the latest version really makes a difference.<BR/><BR/>BTW, Expects still don't work with void methods - but lambda expressions make this problem less painful even in "old-fashioned" way of setting expectations:<BR/><BR/>Expect.Call(() => hand.TouchHotIron(iron)).Throw(new BurnException());<BR/><BR/><BR/><BR/>(just a note to someone who may have googled the article)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-53716379109574582492008-12-11T08:23:00.000-08:002008-12-11T08:23:00.000-08:00Thanks for posting this, as you just taught me som...Thanks for posting this, as you just taught me something about nested transactions. <BR/><BR/>About a month ago we were having problems with our DAL complaining about uncommitted transactions (or something to that effect). We use a lot of nested transactions, largely because we don't have a proper unit of work to manage persistence. I now suspect there might be some interactions going on between some sprocs and our DAL.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-67696427094427553352008-11-16T23:39:00.000-08:002008-11-16T23:39:00.000-08:00Good point about optimization after the fact.Good point about optimization <I>after</I> the fact.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-12027159758342548022008-11-10T09:53:00.000-08:002008-11-10T09:53:00.000-08:00You said 'Base Case', I don't think I've heard tha...You said 'Base Case', I don't think I've heard that since college.<BR/><BR/>Reminds me of a question we used to ask candidates interviewing for C++ game dev positions, which is faster iteration or recursion?<BR/><BR/>I tend to use recursion over iteration, usually because its clearer, but more often because its shorter to write. IMO, you can always come back and optimize a recursive function and make it iterative after profiling.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-89661012915861721372008-10-23T22:49:00.000-07:002008-10-23T22:49:00.000-07:00That's right. MS supporting JQuery. That is huge....That's right. MS supporting JQuery. That is huge. It really does cement JavaScript as NBL.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-16118277632471056802008-10-21T11:35:00.000-07:002008-10-21T11:35:00.000-07:00I think you're correct.MS just added support into ...I think you're correct.<BR/><BR/>MS just added support into VS 2008 for JQuery. That definately says something about JavaScript because no one really uses JavaScript without JQuery anymore.<BR/><BR/>To put it in perspective, I'm a "middle tier engineer" yet I spend half my time writing JavaScript.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-73800664106432317682008-09-26T00:55:00.000-07:002008-09-26T00:55:00.000-07:00@snealNot unlike yourself, since I originally wrot...@sneal<BR/><BR/>Not unlike yourself, since I originally wrote this I now primarily follow more the "classical" state based type testing and try to restrict mocking to external dependencies (e.g. databases, services, etc.) whenever I can.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-90720325824850069972008-09-26T00:51:00.000-07:002008-09-26T00:51:00.000-07:00@snealAdmittedly, I wrote this over a *year* ago s...@sneal<BR/><BR/>Admittedly, I wrote this over a *year* ago so it was based on whatever version Rhino Mocks was at the time. <BR/><BR/>Haven't had an opportunity lately to see if it's improved but good to know.Ray Vegahttps://www.blogger.com/profile/08881925233876970678noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-34826721025306464482008-09-24T11:51:00.000-07:002008-09-24T11:51:00.000-07:00I try to save my mock objects for the seams betwee...I try to save my mock objects for the seams between layers, even then I try to use a stub first.<BR/><BR/>If I have several classes in a particular unit test, then fine. No one said that we have to have one test class per class, your SUT may be made up of several classes. See Kent Beck and Fowler.<BR/><BR/>I guess my definition of unit tests has changed over the years.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.comtag:blogger.com,1999:blog-8416807644832025349.post-19243397661333008382008-09-24T11:39:00.000-07:002008-09-24T11:39:00.000-07:00Overall I prefer the Rhino error messages since th...Overall I prefer the Rhino error messages since they are short and concise, however I do agree:<BR/><BR/>1. Property errors should show the C# name, not the underlying .NET name. set_MyProp is a little annoying.<BR/>2. I like the consistency of Expect in NMock2, this is especially true for noobs.<BR/><BR/>I'm pretty sure your last example (string with DateTime) won't compile in RhinoMocks 3.4 since it uses generics. At one point it didn't.<BR/><BR/>RhinoMocks 3.5 syntax is much cleaner and more consistent IMO. So drop everything else and use that.Anonymoushttps://www.blogger.com/profile/12673546248813988214noreply@blogger.com