|
Did you try running it with the timer inverval a bit higher?
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
I set 5 ms the intervel so it fired only 63 times in 1 Seconds
In 1 Seconds
Intervell(ms)->Fired (Data)
5->63
50->15
100->9 times fired
Unless u don't give ur hundred percent whatever u r doing till there is no result of ur work...
|
|
|
|
|
Although it dosent make sense to me (as your computer is not that slow)
I do find it odd that at the lower intervals (i.e 5) the amount of fired events is way off target, but at higher intervals (i.e 100) it is close to its target.
There has to be something, somewhere, that is slowing down the amount of time it takes to execute the timer tick event.
If not, i'm dumbfounded.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Thanks for your time....
Recently i found in my search that
The Windows Forms Timer simply isn't that accurate . I know - we'd think that if it promises you millisecond intervals it could produce the goods, but fact is it doesn't.
Unless u don't give ur hundred percent whatever u r doing till there is no result of ur work...
|
|
|
|
|
Assuming your using the System.Windows.Forms.Timer (in the Toolbox), you simply would have had to read the documentation on it (click on the Timer on your form, then hit F1) to find this:
Note:
The Windows Forms Timer component is single-threaded, and is limited to an accuracy of 55 milliseconds. If you require a multithreaded timer with greater accuracy, use the Timer class in the System.Timers namespace.
In practice, your actual accuracy will vary, depending on system load, application load, and hardware capabilities.
|
|
|
|
|
I can't remember which way the Win.Forms Timer class works, but I'm pretty certain it marshalls events back onto the UI thread using Form.Invoke. That means you are limited to the speed of the windows message loop, and definitely the scheduling quanta, which is about 50ms.
There's another Timer class somewhere, but I doubt that will get down to 1ms accurately. Any other thread that takes up the CPU is going to get a whole 50ms to itself, blocking your stuff.
|
|
|
|
|
Hi
Im trying to right some code to list the files on a unix ftp server - code as per below - and, guess what - it works!
Except:
If I try to use it on an anonymous server - it works ok.
If I try to use it against a unix server - on our network which is what its for - then if the URL is ftp://servername - and i use the account fred - and freds default folder is /export/home/fred - then it lists the files in this folder.
If I want to list or download) files from another directory - say /tmp - here is no way to do this without getting "the remote server returned an error: (550) File unavailable"
ie if I make the URL ftp://servername/tmp - then I get the error - as its looking for a subfolder called /tmp in /export/home/fred...
Does anyone know a way round this ?
Thanks if you can help.
George
Private Sub List2(ByVal listUrl As String, ByRef p_dirlist As String)
Dim reader As StreamReader = Nothing
p_dirlist = ""
Try
Dim listRequest As FtpWebRequest = WebRequest.Create(listUrl)
' set the username and password !
listRequest.Credentials = New System.Net.NetworkCredential("username", "password")
' get the whole line - iw owner, size etc
'listRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails
' show just the file name
listRequest.Method = WebRequestMethods.Ftp.ListDirectory
Dim listResponse As FtpWebResponse = listRequest.GetResponse()
reader = New StreamReader(listResponse.GetResponseStream())
' read the whole lot
Dim strdirlist As String
strdirlist = reader.ReadToEnd()
MsgBox(strdirlist)
' Return the list of files in the directory
p_dirlist = strdirlist
Catch ex As UriFormatException
MsgBox(ex.Message)
Catch ex As WebException
MsgBox(ex.Message)
Finally
If reader IsNot Nothing Then
reader.Close()
End If
End Try
End Sub
|
|
|
|
|
ya..,
am also faced the same problem.
u can easily identified this bug, if u are debug u r code.
listRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails
If u debug your code the above statement returns the HTML tags instead of list directory. reader.ReadToEnd() this statment returns all the HTML code. Your strdirlist contains HTML code instead of file(s) list.
To slove this problem.
1. go to internet explorer
2. click internet options.
3. select connection tab.
4. click LANsetting button.
5. uncheck all the check boxes.
6. apply the settings, close IE
7. now run the code.
** do similar think if u use another browser.
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
How do I convert the following line of C# code to VB.Net
CheckComboBoxItem box = (CheckComboBoxItem)Items[ e.Index ];
Thank you.
|
|
|
|
|
What have you tried?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Dim box As CheckComboBoxItem = DirectCast(Items(e.Index), CheckComboBoxItem)
http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx
|
|
|
|
|
technette wrote: http://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx
It probably took you longer to register than it would have to search the forums for technette's answer. This gets asked weekly.
Any suggestions, ideas, or 'constructive criticism' are always welcome.
|
|
|
|
|
Congrats to technette for doing the OP's work for them. The OP sure didn't learn much, other than to rely on the Internet when they can't figure out how to do a simple thing like that conversion
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
yeah, it is obvious from birth that there is a web tool that converts any C# code to VB.NET
|
|
|
|
|
Yeah, it's called a brain
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Thanks. I've always wondered if anyone could find it on my personal site
How much longer until you are done with your MBA?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
He had a brain and thats why he thought of posting in a forum.
|
|
|
|
|
I'll give him credit for that
I guess I could have been nicer and pointed him to SharpDevelop's code converter. Though not perfect, it does pretty well.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Thank you Technette. You are smarter than anyone who did not criticize and helped honestly. Rewards are waiting for you. Thanks again.
|
|
|
|
|
Its becomming a common thing here
|
|
|
|
|
You need to write, in pseudo code (or a computer language you are hapy with), a procedure that takes four parameters as follows:
DictionaryFile - the file name of a text file containing four letter words
StartWord - a four letter word (that you can assume is found in the DictionaryFile file)
EndWord - a four letter word (that you can assume is found in the DictionaryFile file)
ResultFile - the file name of a text file that will contain the result
The result is the shortest list of four letter words, starting with StartWord, and ending with EndWord, with a number of intermediate words that are to be found in the DictionaryFile file where each word differs from the previous word by precisely one letter.
For example, if StartWord = Spin, EndWord = Spot and DictionaryFile file contains
Spin
Spit
Spat
Spot
Span
then ResultFile should contain
Spin
Spit
Spot
Two examples of incorrect results:
Spin, Span, Spat, Spot (invalid as it takes 3 changes rather than 2)
Spin, Spon, Spot (invalid as spon is not a word)
Hint: Your solution should deal with the case where the dictionary file contains {AAAA,ABAA, ABZA, ABZZ, AAZZ} and the start and end word are AAAA and AAZZ respectively.
|
|
|
|
|
If this is a school assignment, then no one at the codeproject will want to help you. If you have solved the problem or are having problems with the problem than you can post it here, but no one will write the entire application for you.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
I've left school, so I do not need to do school assignments. But thank you anyway.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
Steven J Jowett wrote: left school, so I do not need to do school assignments. But thank you anyway.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|