Search Results - VBForums

# Search:

Type: Posts; User: dbasnett

Page 1 of 13 1

1. ## Thread: Calculating All IP Addresses in a Range (Pretty Good Start)

by dbasnett
Replies
2
Views
159

### VS 2008Re: Calculating All IP Addresses in a Range (Pretty Good Start)

FWIW - if you are working with IPv4 addresses you can treat the ip address as a number.

''' <summary>
''' converts a Net.IPAddress to an Integer
''' </summary>
''' <param...
2. ## Thread: Random distribution in VB

by dbasnett
Replies
15
Views
282

### VS 2013Re: Random distribution in VB

Having not heard of this I had to give it a try. I created this class:

Public Class RandomSum
...

by dbasnett
Replies
11
Views
252

### VS 2012Re: Letter Combinations - Comments / Suggestions

Here is the math:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For x As Integer = 10 To 3 Step -1
...

by dbasnett
Replies
11
Views
252

### VS 2012Re: Letter Combinations - Comments / Suggestions

I posted the wrong numbers. Both return the same count. From what I can tell testing 9 letters mine might be slightly faster.

by dbasnett
Replies
11
Views
252

### VS 2012Re: Letter Combinations - Comments / Suggestions

At one point I had added list = list.distinct which was great until there were 10 letters at which point I got an OOM error.

by dbasnett
Replies
11
Views
252

### VS 2012Re: Letter Combinations - Comments / Suggestions

It started off being recursive but with 10 letters I had issues. 9 letters produces 986,400 combos in approx. 200 ms., 10 letters is 9,864,090 in 2.7 secs.

by dbasnett
Replies
11
Views
252

### VS 2012Letter Combinations - Comments / Suggestions

Given a set of letters produce all the combinations of those letters. These two functions satisfy this. I am asking for comments / suggestions / sanity check. Thanks in advance. This was done to...
8. ## Thread: Integer to Byte

by dbasnett
Replies
6
Views
146

### Re: Integer to Byte

The problem is the '1' which is being interpreted as integer. Unfortunately there is not a Type character for byte. One idea is to work with integers and only switch to bytes if absolutely needed. ...
9. ## Thread: Loosly compare string

by dbasnett
Replies
14
Views
341

### VS 2013Re: Loosly compare string

All of this depends on the specifics which you did not state. Specifics for the file name guess:

followed by three numbers
followed by _
followed by three...

by dbasnett
Replies
4
Views
149

Agreed.
11. ## Thread: How to calculate time remaining for prime factor finder?

by dbasnett
Replies
8
Views
165

### VS 2013Re: How to calculate time remaining for prime factor finder?

See my signature for a fairly fast prime number calculator.
12. ## Thread: [RESOLVED] Super Simple Countdown timer

by dbasnett
Replies
18
Views
474

### VS 2013Re: Super Simple Countdown timer

This is why I used a stopwatch. You might stop the timer from ticking but the current time keeps on going, nothing you can do about that.
13. ## Thread: Dice Simulator question

by dbasnett
Replies
7
Views
235

### VS 2013Re: Dice Simulator question

The way you have it the random numbers are likely the same. Here is a short version of what you have

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
...
14. ## Thread: [RESOLVED] Super Simple Countdown timer

by dbasnett
Replies
18
Views
474

### VS 2013Re: Super Simple Countdown timer

Take a look at this.

Public Class Form1

Dim numSecs As Integer = 10
Dim stpw As New Stopwatch
Dim countdownFrom As New TimeSpan(0, 0, numSecs)

Private Sub...
15. ## Thread: [RESOLVED] Manipulating Strings from SerialPort

by dbasnett
Replies
12
Views
288

### VS 2013Re: Manipulating Strings from SerialPort

Are you sending a newline after the 1-3 numbers? Are you sending ASCII chars representing the numbers?
16. ## Thread: stopping program when using serial port

by dbasnett
Replies
4
Views
213

### Re: stopping program when using serial port

A quick glance shows that you have a lot of things running on the UI thread and one of them, the SerialPort.ReadLine, is a blocking operation. One thing you might try is to move the...

by dbasnett
Replies
12
Views
330

### VS 2010Re: SyncLock protecting thread counter

Here is a simulation of what I think you want to do.

Public Class Form1

Private Sub GetServicesFromSingleComputer(compNM As Object)
Debug.WriteLine("S " & compNM.ToString)
...
18. ## Thread: String.Format with one decimal value only...

by dbasnett
Replies
4
Views
187

### Re: String.Format with one decimal value only...

You meant
LabelSpeedDisplay.Text = String.Format("{0:N2}", Registers(7) / 100)

by dbasnett
Replies
2
Views
147

### Re: MSDN Logon

This happens both at home and work, and I have different anti-virus software at both. Will check it though.

Doesn't explain why using the back button and then clicking again works.

by dbasnett
Replies
2
Views
147

### MSDN Logon

For at least a month I have been having an issue with MSDN. I am repeatedly asked to logon even though I am already logged in.

21. ## Thread: Help with factorial calculation :?

by dbasnett
Replies
9
Views
270

### Re: Help with factorial calculation :?

This N! = (1^2)*(2^2)*(3^2)...*(N^2) is NOT the formula for factorial. This is:

N! = 1 * 2 * 3 * ... N

5! = 1 * 2 * 3 * 4 * 5 = 120
22. ## Thread: variable for 'anyword'

by dbasnett
Replies
14
Views
228

### Re: variable for 'anyword'

To 'Dim' a variable that can hold letters with a maximum length of approximately 2 billion letters do this:

Dim anyword As String

by dbasnett
Replies
14
Views
345

### VS 2008Re: [RESOLVED] Read Text File in Reverse?

If it is OK to read the entire file then the methods presented would work. Here is an alternative that reads the file in chunks from the end. Just thrown together so it isn't tested completely, but...
24. ## Thread: How to do 16 bit Unsigned Short byte flip ?

by dbasnett
Replies
10
Views
263

### VS 2013Re: How to do 16 bit Unsigned Short byte flip ?

I was writing assembler for the Navy in the 70's also, though it wasn't my first assembler. If the Q had been about doing it in assembler...
25. ## Thread: How to do 16 bit Unsigned Short byte flip ?

by dbasnett
Replies
10
Views
263

### VS 2013Re: How to do 16 bit Unsigned Short byte flip ?

Speed comparison because I found it hard to believe that XOR would be faster:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

Debug.WriteLine("")...
26. ## Thread: How to do 16 bit Unsigned Short byte flip ?

by dbasnett
Replies
10
Views
263

### VS 2013Re: How to do 16 bit Unsigned Short byte flip ?

The flipping part will look like this

Dim b() As Byte = New Byte() {2, 0, 13, 78, 10, 20, 40, 80}

For idx As Integer = 0 To b.Length - 2 Step 2
Dim h As Byte =...
27. ## Thread: Prevent Focus on textbox in code

by dbasnett
Replies
8
Views
236

### Re: Prevent Focus on textbox in code

Create an invisible label on the form. If there are zero controls that can receive focus select the invisible label.
28. ## Thread: VB.NET Serial Port Help - Issues with open and closing then reopening and closing.

by dbasnett
Replies
22
Views
543

### Re: VB.NET Serial Port Help - Issues with open and closing then reopening and closing

The code I posted was supposed to be ran in a new project. The intent was to prove (or not prove) that the problem wasn't with opening an closing. All you should have to do is change the port name....
29. ## Thread: VB.NET Serial Port Help - Issues with open and closing then reopening and closing.

by dbasnett
Replies
22
Views
543

### Re: VB.NET Serial Port Help - Issues with open and closing then reopening and closing

In the button click handler a thread is created to open and close the port several times.
30. ## Thread: VB.NET Serial Port Help - Issues with open and closing then reopening and closing.

by dbasnett
Replies
22
Views
543

### Re: VB.NET Serial Port Help - Issues with open and closing then reopening and closing

Using the code I posted can you confirm that this happens. My suspicion is that the real code is processing an event on another thread when the close is attempted.
31. ## Thread: VB.NET Serial Port Help - Issues with open and closing then reopening and closing.

by dbasnett
Replies
22
Views
543

### Re: VB.NET Serial Port Help - Issues with open and closing then reopening and closing

My guess would be that the serial port is handling one of its events when you attempt to close it. To ascertain if the port will fail on close if there is no activity I wrote the following test:

...
32. ## Thread: [RESOLVED] How to make VB.NET Garbage Collector Example?

by dbasnett
Replies
33
Views
905

### Re: How to make VB.NET Garbage Collector Example?

A minute right. :)
33. ## Thread: [RESOLVED] Get last line in multitextbox

by dbasnett
Replies
2
Views
172

### VS 2010Re: Get last line in multitextbox

Textbox controls have a property that is the lines already, so to loop through them:

'loop all messages that aren't blank
For Each ln As String In...

by dbasnett
Replies
4
Views
222

### Re: Help Needed with a basic threading Problem

This counts words based on starting letter and shows the counts with a random color. Runs fine with the synclock, and the error is reproduced if the synclock is removed or the lock object scope is...
35. ## Thread: [RESOLVED] Convert string to hex byte

by dbasnett
Replies
2
Views
241

### VS 2013Re: Convert string to hex byte

http://msdn.microsoft.com/en-us/library/c7xhf79k%28v=vs.110%29.aspx
36. ## Thread: [RESOLVED] Picturebox to SerialPort

by dbasnett
Replies
24
Views
523

### VS 2012Re: Picturebox to SerialPort

Who is the manufacturer and what is the part number?
37. ## Thread: [RESOLVED] Picturebox to SerialPort

by dbasnett
Replies
24
Views
523

### VS 2012Re: Picturebox to SerialPort

A complete description of the LCD screens (and / or a link) would be of great help.
38. ## Thread: [RESOLVED] Picturebox to SerialPort

by dbasnett
Replies
24
Views
523

### VS 2012Re: Picturebox to SerialPort

How are your monitors connected? Normally they are NOT connected via serialports.

by dbasnett
Replies
13
Views
635

### Re: serialport datareceived pls help me(arduino to vb.net)

https://social.msdn.microsoft.com/Search/en-US?query=vb%20.net%20string.length&emptyWatermark=true&searchButtonTooltip=Search%20MSDN&ac=5
40. ## Thread: Chart impact on timer

by dbasnett
Replies
11
Views
434

### Re: Chart impact on timer

Not sure how you are acquiring data, but you shouldn't have a problem doing that at 50Hz, though using a timer isn't likely to be the best approach.

Showing the results, especially with a chart...
Results 1 to 40 of 500
Page 1 of 13 1

Featured