MVC Unit Testing

2010-05-16 Thread Tiang Cheng
Hi All, I would like to know what are your favourite MVC unit testing resources (articles, books, APIs)? I have a major MVC website that I playing with, and the thing that's got me stumped at the moment is a good way to unit test it... Tiang p.s. Bonus beers for any perth gurus that want to sp

Re: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread silky
On Mon, May 17, 2010 at 3:23 PM, Bill McCarthy wrote: > Yep. Make sure you are checking the new search string starts with the old > search string. If it doesn't then filter from the original data, otherwise > filter from the last filter.  And create new lists, not remove from old > ones; removal i

Re: How To do something every so often

2010-05-16 Thread Les Hughes
Bill McCarthy wrote: I'd guess that in a tight loop it would probably be slightly faster to reset the counter rather than continually get the modulus, eg: counter+=1 If (counter And &H2000) = &H2000 Then ' every 8192 counter = 0 End If By resetting you also don't need to worry about

RE: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Bill McCarthy
Yep. Make sure you are checking the new search string starts with the old search string. If it doesn't then filter from the original data, otherwise filter from the last filter. And create new lists, not remove from old ones; removal is slow and costly with array backed lists. The trick is to use

RE: How To do something every so often

2010-05-16 Thread Bill McCarthy
I'd guess that in a tight loop it would probably be slightly faster to reset the counter rather than continually get the modulus, eg: counter+=1 If (counter And &H2000) = &H2000 Then ' every 8192 counter = 0 End If By resetting you also don't need to worry about integer overflows etc.

RE: How To do something every so often

2010-05-16 Thread Dylan Tusler
Doh! Yes, in a previous life I would have used (excuse my VB) if (counter mod 1) = 0 Is that the most efficient way to go? Certainly looks the cleanest. Dylan. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Greg Ken

Re: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Winston Pang
Hi everyone, You guys are crazy! In a good way :) Thanks so much for everyone's tips and pointers, I'll look at them tonight and try them out. Cheers to everyone, Winston On Mon, May 17, 2010 at 1:18 PM, Tiang Cheng wrote: > After you’ve applied the filter function on the first keystroke,

Re: How To do something every so often

2010-05-16 Thread Greg Kennedy
Hi Dylan, The common way to do it is using the Modulus function while{ if(counter%1==0) { //do stuff } } Greg On Mon, May 17, 2010 at 1:30 PM, Dylan Tusler < dylan.tus...@sunshinecoast.qld.gov.au> wrote: > I was just writing a very simple little console app to move data f

How To do something every so often

2010-05-16 Thread Dylan Tusler
I was just writing a very simple little console app to move data from one file to another (under certain conditions) and I thought it would be beneficial if the output gave some feedback that something was happening. So, for each file, for every 10,000 lines processed, I put a "." out via Conso

RE: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Tiang Cheng
After you've applied the filter function on the first keystroke, save the result set and filter on the result set? Repeat for each keystroke. From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Winston Pang Sent: Monday, 17 May 2010 7:41 AM To: ozDotNet Subjec

Re: what can cause an OutOfMemoryException error (asp.net)

2010-05-16 Thread silky
On Mon, May 17, 2010 at 12:43 PM, June Xue wrote: > Hi Guys and Girls, > > Is it true that only memory leak can cause OutOfMemoryException errors?  Is > it possible that one application uses too much memory so that > OutOfMemoryException errors occur in the other applications in the > same applica

RE: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Ian Thomas
IntelliSense (Microsoft) is much more than a filter or sorting mechanism. Knowing that it incorporates some reflection, I took the lazy route to educating myself a little and looked on Wikipedia. And, on Silky's hint, I checked out trie data structures (interesting). It may be worth looking there

what can cause an OutOfMemoryException error (asp.net)

2010-05-16 Thread June Xue
Hi Guys and Girls, Is it true that only memory leak can cause OutOfMemoryException errors? Is it possible that one application uses too much memory so that OutOfMemoryException errors occur in the other applications in the same application pool? Thanks in advance! June

Re: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Matt Siebert
I think VS2010 uses more than just simple 'contains' logic for matching substrings. It distinguishes between upper and lower case chars to delimit substrings. For example, suppose I have a variable named "fooBar", then intellisense filters nicely when I type "foo" or "bar". "FB" kind of works bu

Re: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread silky
I believe the data structure you want is a Trie: http://en.wikipedia.org/wiki/Trie -- silky http://www.programmingbranch.com/

Re: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Winston Pang
yeah i did realise it must be a O(n^2) operation. Still trying to figure out how I can improve it. Since a contains operation will naturally be an O(n). I'm wondering if there's other forms of optimizations i can do as well. On Mon, May 17, 2010 at 10:35 AM, Mitch Wheat wrote: > Sorry, I mean

RE: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Mitch Wheat
Sorry, I meant order O(N) for the linear search. If you search degrades rapidly as the list increases, that doesn't sound like O(N) performance, but more like O(N^2). Mitch From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun...@ozdotnet.com] On Behalf Of Mitch Wheat Sent: Monday,

RE: Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Mitch Wheat
Performing a linear search is O(N^2), so it will perform poorly as the list grows, as you have observed. Either keep the list sorted and use binary search O(log N) or use some other standard data structure such as a tree. Mitch From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-boun..

Re: Adelaide CodeCampSA 24-25th July - Call for presenters, Sponsors

2010-05-16 Thread Les Hughes
Peter Griffith wrote: *cid:image001.jpg@01CAEFCE.4FF1AB60*** * * * * *Adelaide CodeCampSA 2010 – 24-25^th July –Call for Presenters, Sponsors* http://www.codecampsa.com.au 404. http://www.codecampsa.com/ -- Les Hughes l...@datarev.com.au

Filtering algorithm strategies to mimic intellisense

2010-05-16 Thread Winston Pang
Hey everyone, So I'm building a intellisense like autocomplete. I've stumbled on some perf issues because its literally just iterating over the list and re-applying a filter function on every item, based on every key stroke. The perf degrades obviously as more times is in the list. I was wonderin

Adelaide CodeCampSA 24-25th July - Call for presenters, Sponsors

2010-05-16 Thread Peter Griffith
cid:image001.jpg@01CAEFCE.4FF1AB60 Adelaide CodeCampSA 2010 - 24-25th July -Call for Presenters, Sponsors http://www.codecampsa.com.au To be held UniSA West Campus Theatre HH3-08 in the Hans Heysen building. Program being prepared, PG Peter Griffith MACS PH: 0408 832 89

RE: [OT] Toner hell

2010-05-16 Thread Greg Low (greglow.com)
Hi Greg, We do a ton of printing and have tried a lot of options. Based on our per page costs (where we estimated the total running costs), we currently love the Brother 4050CDN. The *only* way to buy spare parts for it is to buy whole printers. It’s insane but that’s how it goes. I’ve seen