mvc question: how stackoverflow implemented their login page "http://stackoverflow.com/users/login" if you clicked login with empty openid, you will get the error message, and if you refreshed it is not asking for repost data again
I need to know that when I stop my timer with timer.Stop(), and then start it again with timer.Start(), should the timer start immediately, or is there half a second pause in between?
I have an object that is moving around in Windows Forms.
The movement of the object is animated inside a timer, that is called every 30 ms. The timer starts on KeyDown event, and stops on KeyUp event.
So, if I press down for example left, and then immediately after I release the left key and press another one, there's a slight pause (about half a second), before it moves in that direction.
That problem does not appear, if I hold left, the release it, and wait a little bit, and THEN press right. In such case, it would immediately move right.
It also doesn't appear if I am holding down left, and then start holding down right, while I'm still holding left. In that case, it would start moving right immediately, too.
The problem only appears, when I release the key and immediately press another one afterwards.
Hello.
I have a WinForms program, where I have a certain animated object that moves around when I press Up, Down, Left and Right. The movement of the object is animated inside a timer, that is called every 30 ms. The timer starts on KeyDown event, and stops on KeyUp event.
So, if I hold for exa...
some tips: you first start the timer, then set the direction. Since the timer might elapse before you set the direction, you might want set the direction before you start the timer
Well.. did you see in keyUp event that there's an if clause if watch > 180 ms?
Meaning, that if I only press the button momentarily (and don't hold it down), then the timer will only fire 6 times (and the k is keeping track of that), so that the character moves just a bit before it stops.
That works perfectly, so you don't have to pay attention to it.
If I don't use the timerMove.Stop() method, then there's no pause in between pressing two keys, but of course the animation still goes on, so it's like the character is auto-moving..
Guys, question. Can you think of a an API (.NET or otherwise) that you've seen where a class has nested classes in a public API? ie. a public class like LongestCommonSubstring<T>, and instead of having a separate class for the results from it, it has a nested class Result?
so you would have LongestCommonSubstring<string>.Result for a result class typed to strings.
Instead of LongestCommonSubstringResult<string>
FxCop warns about it, I just wanted to know if it was something I could ignore
why not have just one timer firing every x milliseconds and do all your logic there is a key pressed? then move. wait x ms, is a key pressed? then move again
That?
You know, you never told me how to know inside a timer, if a key is pressed.
if I have a class containing a single line from each file, but the comparison results for those two lines could be that they are equal, the line from the new file was inserted, the line from the old file was deleted, or the line from the old file was replaced with the line from the new file
I need a property holding an enum saying all of that
ie. added, deleted, replaced, or same/equal
The name of the type that will hold that property + the two lines is called TextDiffLine (for now), any suggestions what I could call the enum and/or property that would make sense?
TextDiffLineType or TextDiffLineAction seems kinda lame to me
if you had two strings, and could produce a diff between the two that said whether a range of characters was same, inserted or deleted, would a good "similarity ratio" be to calculate how many characters was the same between the two against their total length?
for instance, if half the content of the first string was equal to content in the second, that would be a similiarity of 0.5?
I'm also thinking that perhaps I should calculate the "same-ness" against their combined lengths, so that if I just insert or delete content, that would have an effect as well