Search Results - VBForums

# Search:

Type: Posts; User: dbasnett

Page 1 of 13 1

1. ## Thread: [RESOLVED] Find First and Last Day of Week

by dbasnett
Replies
5
Views
124

### VS 2010Re: Find First and Last Day of Week

Something like this (not thoroughly tested):

next Sunday, previous Saturday

Dim someDay As Date = #11/27/2014#

Dim nextSunday As Date = someDay.AddDays(7 - someDay.DayOfWeek)...
2. ## Thread: Luhn algorithm

by dbasnett
Replies
0
Views
76

### Luhn algorithm

From http://en.wikipedia.org/wiki/Luhn_algorithm, "he Luhn algorithm or Luhn formula, also known as the "modulus 10" or "mod 10" algorithm, is a simple checksum formula used to validate a variety of...
3. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

This was my original point. I am aware of one name that will have a different classification this year, so yes there would be two names that were identical, except for the effective year.
4. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

I have one table that contains the Name, the classification, and effective year for each county and city in the state. This data is nearly static. My research is that there have not been any name...
5. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

There is one population table table row per city/county name per decennial census. We have the 2000 and 2010 census data so there are two per name currently. In July of 2021 each name will have one...
6. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

For the most part the names table will rarely change. One classification changed in the last 10 years, but I take your point.

The population is for the most part from the decennial census, but if...
7. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

In the table of names I have the name, the classification, and the effective year. The population table has a key pointing to the name.
8. ## Thread: Funtion Question

by dbasnett
Replies
11
Views
204

### VS 2013Re: Funtion Question

Enum - Declares an enumeration and defines the values of its members.
Enumerator - Used to move through the members of a collection.

An Enums values and names can be Enumerated.

No
9. ## Thread: Funtion Question

by dbasnett
Replies
11
Views
204

### VS 2013Re: Funtion Question

Enumerator is different than Enum.
10. ## Thread: Form shown as "ShowDialog()" fires the FormClosing event!?

by dbasnett
Replies
11
Views
325

### Re: Form shown as "ShowDialog()" fires the FormClosing event!?

Replace frmThis.ShowDialog with this to see if it makes a difference:

Dim f As New frmThis
f.ShowDialog()

Also, what code is in the FormClosing event for "frmThis"?
11. ## Thread: Form shown as "ShowDialog()" fires the FormClosing event!?

by dbasnett
Replies
11
Views
325

### Re: Form shown as "ShowDialog()" fires the FormClosing event!?

Which it? The form doing the show dialog or the form being shown?
12. ## Thread: Funtion Question

by dbasnett
Replies
11
Views
204

### VS 2013Re: Funtion Question

I concur. Enums have the advantage because the names of the enumerated values can be used for user notification.
13. ## Thread: Funtion Question

by dbasnett
Replies
11
Views
204

### VS 2013Re: Funtion Question

If the method is intended to convey more than true or false change the return type to something with multiple values, like integer or string. Each of your if's would return a different value.
14. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

I am only working with one state, so the county names are unique.
15. ## Thread: Application not Closing on Close Window

by dbasnett
Replies
10
Views
262

### Re: Application not Closing on Close Window

What is the relationship between the forms? How is Shutdown mode in the projects properties set?
16. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

I am not aware of a County changing names, but if they do it will be rare. I may need to pull the population data from another table based on the primary key. Don't know that for sure yet.
17. ## Thread: How to make DataGridView render fast

by dbasnett
Replies
15
Views
5,469

### VS 2010Re: How to make DataGridView render fast

Another tip about speeding up DGV's...
1. turn off the auto resizing
2. set the row height manually
3. set column width manually
4. set the DefaultCellStyle of the columns
18. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Re: Advice - Duplicate Data

The name is not the primary key. This data is a list of counties and the data is their classification based on census data. County names almost never change and census data is decennial.
19. ## Thread: Advice - Duplicate Data

by dbasnett
Replies
19
Views
418

### Advice - Duplicate Data

I have a table that looks something like this:

Name, Effective Date, real data

The table has < 200 rows initially. Once the data is added it is static, has to be because it is historic.

If...
20. ## Thread: How to make DataGridView render fast

by dbasnett
Replies
15
Views
5,469

### VS 2010Re: How to make DataGridView render fast

Here is the code as an extension

Imports System.Runtime.CompilerServices

Module DGV_Extensions
<Extension()>
Public Sub DoubleBuffered(aDGV As DataGridView, Optional setting As...
21. ## Thread: Calculate Holidays

by dbasnett
Replies
2
Views
249

### Re: Holidays - USA

The Easter calculation was from the location specified. Sadly, other than y,m,d, I haven't a clue what the other variables are or what each line of code does. I do know that the whole calculates...
22. ## Thread: Calculate Recision Date

by dbasnett
Replies
12
Views
194

### VS 2012Re: Calculate Recision Date

For Holidays see:

Holidays
23. ## Thread: Calculate Holidays

by dbasnett
Replies
2
Views
249

### Calculate Holidays

A way to generate Holidays. Several are defined in the Class:

Public Class MyHolidays

Private Class DefHolidays
Property Name As String
Property...
24. ## Thread: VB.NET program to save user inputs and to retrieve it later

by dbasnett
Replies
19
Views
374

### VS 2013Re: VB.NET program to save user inputs and to retrieve it later

Is this so that the user inputs are accessible on any machine, or just the machine they are using?
25. ## Thread: How to "freeze" the screen so I can Capture it with my ScreenCapture

by dbasnett
Replies
11
Views
286

### Re: How to "freeze" the screen so I can Capture it with my ScreenCapture

Have you looked at this

http://msdn.microsoft.com/en-us/library/fw1kt6f9%28v=vs.110%29.aspx
26. ## Thread: convert dd-MM-yyyy hh:mm:ss to yyyy-MM-dd hh:mm:ss

by dbasnett
Replies
15
Views
331

### Re: convert dd-MM-yyyy hh:mm:ss to yyyy-MM-dd hh:mm:ss

There is a one topic per thread rule. If the date is in the correct format then start a new question with the current error / problem.
27. ## Thread: convert dd-MM-yyyy hh:mm:ss to yyyy-MM-dd hh:mm:ss

by dbasnett
Replies
15
Views
331

### Re: convert dd-MM-yyyy hh:mm:ss to yyyy-MM-dd hh:mm:ss

Try this:

Dim CurrentDateString As String = "11.12.2013 0:35:04"
Dim FormatOfCurrentDateString As String = "dd.MM.yyyy H:mm:ss" 'must match exactly the format of...
28. ## Thread: Need help with calculating MAC address sequences.... I appreciate the help!

by dbasnett
Replies
19
Views
328

### VS 2010Re: Need help with calculating MAC address sequences.... I appreciate the help!

The example was the range you specified, 04:00 - 17:FF. When I ran the code without showing the results it took less than 2 ms. to execute. The values are your range without the :'s.

Here is...
29. ## Thread: Need help with calculating MAC address sequences.... I appreciate the help!

by dbasnett
Replies
19
Views
328

### VS 2010Re: Need help with calculating MAC address sequences.... I appreciate the help!

An alternative that might be slightly slower than SH's solution:
'
Dim srange As Integer = &H400 '&H0 min
Dim erange As Integer = &H17FF '&HFFFFFF max

For x As...
30. ## Thread: Sending huge Data buffer to Serial Port

by dbasnett
Replies
3
Views
163

### VS 2008Re: Sending huge Data buffer to Serial Port

Sending the entire 255 bytes at 9600 baud should not be an issue. Check your settings on both ends, and the cable.
31. ## Thread: Brackets in Random.[Next]()

by dbasnett
Replies
4
Views
139

### VS 2013Re: Brackets in Random.[Next]()

Here is a reference for what the others have said.

http://msdn.microsoft.com/en-us/library/hwx24eb6%28v=vs.110%29.aspx
32. ## Thread: Pascal's Triangle

by dbasnett
Replies
0
Views
188

### Pascal's Triangle

An implementation of Pascal's Triangle.

Class PascalsTriangle
Private Class triRow
Property value As Integer = 0
Property aboveRow As Integer = -1
Property...
33. ## Thread: Random Wrapper

by dbasnett
Replies
0
Views
172

### Random Wrapper

Random is not thread safe, hopefully this will help

Public Class RandomWrap
Inherits Random
Private Shared lock As New Threading.AutoResetEvent(True)

Public Overrides Function...
34. ## Thread: [RESOLVED] Integer / String Concatenation

by dbasnett
Replies
5
Views
214

### Re: Integer / String Concatenation

This was knew to me, and found while helping a co-worker. I am so used to calling .ToString when assigning a base data type to a string that it never occurred to me that the concatenation operator...
35. ## Thread: [RESOLVED] Integer / String Concatenation

by dbasnett
Replies
5
Views
214

### [RESOLVED] Integer / String Concatenation

Options: Explicit On, Strict On, Infer Off

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim i As Integer = 3

TextBox1.Text &= i...
36. ## Thread: Reading a file makes RAM Usage too high

by dbasnett
Replies
13
Views
402

### Re: Reading a file makes RAM Usage too high

You have a one line read / convert. Try changing that one line to this and see if it helps.

' Dim bytesf As String =...
37. ## Thread: Possibly a datatype problem -- debugging needs help

by dbasnett
Replies
3
Views
180

### VS 2010Re: Possibly a datatype problem -- debugging needs help

Here is a solution of sorts. It uses the least optimal algorithm for fitting (first fit), but might give you some ideas.

Public Class Form1

Private Sub Button1_Click(sender As Object, e...
38. ## Thread: Help me understand Generics

by dbasnett
Replies
31
Views
610

### VS 2010Re: Help me understand Generics

This is a guess at what you might mean.
Class xMyGeneric(Of MyGeneric)
Public Property Prop As MyGeneric
End Class

Class MyGenericList(Of MyGeneric As xMyGeneric(Of...
39. ## Thread: Dart Out Shots

by dbasnett
Replies
0
Views
162

### Dart Out Shots

Calculates all 3 dart checkouts for a given score.

Dart Outshots Solution
40. ## Thread: [RESOLVED] Timer spanning multilpe forms

by dbasnett
Replies
14
Views
314

### Re: [RESOLVED] Timer spanning multilpe forms

DateTime is much coarser. There is even a remark in the DateTime.Now method description that addresses this; "The Now property is frequently used to measure performance. However, because of its low...
Results 1 to 40 of 500
Page 1 of 13 1

Featured

Click Here to Expand Forum to Full Width

Survey posted by VBForums.