Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

What ever gave you that impression? Democrats (most minorities are democrats) are often known for duplicate voting, and voting for dead people.

First of all, voting for dead people is highly innefective because dead people can't be sworn in. I'll assume you meant voting by dead people. I'd love to see any actual proof of that. How about the legislation that the Florida governor tried to ram through that even members of his own party couldn't stomach. They were found to be unconstitutional but he tried to push them through anyway. Rick Scott claimed there were more than 180,000 non-citizens on the voter rolls. Even his own election chief had to admit that the number was actually fewer than 200 (out of 11 million voters). And I mean 200, not 200,000.

Nathan Sproul was hired by several state Republican Parties to register voters. He was fired after it was discovered that his workers had a nasty habit of throwing out forms from Democrats.

Both Florida and Ohio tried to limit weekend voting in the last weeks before the election. They continued these efforts in spite of federally issued court orders to stop.

Fliers were distributed in many poorer, coloured neighbourhoods (where most of the votes go to Democrats) giving incorrect locations and dates for voting. Fliers sent to areas deemed Republican were given correct information.

Ohio and Florida specifically banned voting on the Sunday before the election – a day when black churches historically mobilize their constituents.

The …

mike_2000_17 commented: You nailed it! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The problem with security is that if you take all possible precuations then the app becomes

  • too time consuming to write and test
  • too expensive to develop/debug
  • too difficult to maintain

In our corporate environment I could reasonably assume that nobody was packet sniffing to ferret out credentials.

Look at airport security. If we took all possible precautions then every single item going on board would have to be examined by eye and by sniffer dogs and everyone would have to be strip searched and x-rayed. For that matter, no luggage would be allowed and people would have to surrender their clothing when boarding and be issued disposable clothing for the trip. Full body cavity searches would be mandatory to prevent against ingested or inserted explosives/weapons.

Of course, such measures would never be tolerated (then again, who could have forseen the current TSA measures). We always try to compromise between reasonable security and reasonable measures (again, TSA grope search?).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Did Karloff sire Clooney?

Put two days of beard on that picture of Karloff and he'd look a lot like Hugh Laurie as Dr. House.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I find a convenient way to handle complex logic is to use this form of the Select

Select Case True
    Case <conditional>
        code
    Case <conditional>
        code
    Case <conditional>
        code
    Case Else
        code
End Select

Normally in a Select you would put the conditional in the Select clause. With Select Case True you can put any conditional in the Case clauses. They don't have to be related. Just put them in the order you would code them with Else If statements. Also, if you want to remove parentheses in compound conditionals then

Not (a Or B)

is equivalent to

Not a And Not B

or to use the above example

not(EVENT_NUMBER.Text ="" Or person.Text ="") And Event_ASSOC2.Text <> "Stolen"

is equivalent to

EVENT_NUMBER.Text <> "" And person.Text <> "" And Event_ASSOC2.Text <> "Stolen"
TnTinMN commented: interesting use of Select +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Trend Micro has this to say about the link in your signature

Trend Micro has confirmed that this website can transmit malicious software or has been involved in online scams or fraud.

It smells like something and it's not teen spirit.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Rondo Hatton (1894–1946). He usually played brutish but dumb characters because of his acromegaly (a pituitary defect that causes uncontrolled bone growth). He was the inspiration for a similar character in The Rocketeer.

Annex_-_Hatton,_Rondo_(House_of_Horrors)_01Hatton_Rondo_01rondoshum2

LastMitch commented: This is interesting! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You want a UNION rather than a JOIN. Example:

SELECT * FROM Males   WHERE Mark > 50
 UNION
SELECT * FROM Females WHERE Mark > 50

will return one recordset

AndreRet commented: Indeed, my bad. Thanx for the catch. :) +13
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The first term is of type String, the second is not. You have to select a specific item and subitem in the collection. You probably want to search like this.

Dim found As Boolean = False

For Each item As ListViewItem In Bookmarks.ListView1.Items
    If item.SubItems(0).Text = txtName.Text Then
        found = True
        item.Selected = True
        Exit For
    End If    
Next

If found Then
    'do something with selected item
Else
    NoResultsFound.Show()
End If
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Technically, because it is made from rice, it's rice beer rather than rice wine.

LastMitch commented: Yoiu're right! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yankee - noun - sort of like a quickie except you do it yourself.

I couldn't hold back any longer.

diafol commented: You bad man +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

When you write code to use the Excel application object it is not unusual to end up with multiple Excel.exe instances running. You should check with Task Manager for this.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Aside from the casting, I think the reason The Social Network did so well was because of Aaron Sorkin's brilliant writing. Anyone see the first episode of The Newsroom. Pretty powerful stuff.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Are you a sex tourist?

Maybe he considers himself a sexy tourist though.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I heard that Ron Howard has acquired the rights to the Lensman Series by E. E. "Doc" Smith. I fondly recall reading it many years ago. The dialog desparately needs updating (it was stilted and sexist, but a product of the times) but the story was epic and (I think) far superior to Star Wars. J. Michael Straczynski is supposedly working on the script. See here and here

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Well, you can always use kick-a$$ and hope you don't get dinged for deliberate evasion of the filter.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you are just looping through a listview then why do you need to exit the loop using a buttor or menu? Surely it will exit after all of the items have been processed. Mayybe you should post the code so we can make a more informed suggestion.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I remember seeing a stand-up comic and I wish I could remember his name. He did a bit on something related. He said you have the right to be offended by something but not the right to arbitrarily label something as offensive.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

But what if the username does contain a ' and it is valid, like O'Neal? In that case a parameterized query will handle it or you can use

txtUserName.Text.Replace("'","'').
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is a big difference between spanking and assault. You can make one illegal and not the other.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

remove the editor box from threads that are too old and replace it with a message like the current one...

That sounds reasonable to me.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

"You see, there's different kinds of dead: there's sort of dead, mostly dead, and all dead. This fella here, he's only sort of dead" - Miracle Max (The Princess Bride).

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Dani has said several times before in this forum that there is nothing wrong with resurrecting old threads as long as the new posts are relevant to the topic.

That's why I included the phrase UNLESS YOU HAVE SOMETHING REALLY VALUABLE TO ADD. When you see three year old threads like this one that are clearly marked as solved then they really do not need further posts.

Apparently people are ignoring the banner. I thought that by putting text in the actual text entry area it would force people to read it. Even a pop-up on old solved threads would be useful. I, personally, have added to recently solved posts with tidbits that might be worth considering even if the actual question has been addressed so I can see that there are cases where additional posts are a good idea. But posting in a three year old solved thread is probably not.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

This has surely been mentioned before. I've noticed an increase in the number of noobs who are resurrecting old threads. Based on what I did shortly after joining (before getting lightly slapped on the wrist), it's likely the posters just didn't notice the thread date. Apparently the purple banner isn't sufficient. How about a pop-up when the Reply textbox gets focus or when a character is typed with the same warning and the option to continue if something really earth shatteringly worthwhile is to be added to the conversation? I know we all hate pop-ups.

As an alternate suggestion, you know when you receive a PM, the reply box already has some greyed out text from the original message? How about preloading the reply box on old threads with something like

WE APPRECIATE YOUR DESIRE TO CONTRIBUTE BUT THIS POST IS MORE THAN 3 MONTHS OLD. PLEASE DO NOT REPLY UNLESS YOU HAVE SOMETHING REALLY VALUABLE TO ADD. POSTING IN OLD THREADS WITHOUT GOOD REASON MAY RESULT IN INFRACTIONS.

This text could be automatically deleted when the box gets focus or when the first keystroke is detected.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Over the past two decades, the NRA has not only been able to stop gun control laws, but even debate on the subject. The Centers for Disease Control funds research into the causes of death in the United States, including firearms — or at least it used to. In 1996, after various studies funded by the agency found that guns can be dangerous, the gun lobby mobilized to punish the agency. First, Republicans tried to eliminate entirely the National Center for Injury Prevention and Control, the bureau responsible for the research. When that failed, Rep. Jay Dickey, a Republican from Arkansas, successfully pushed through an amendment that stripped $2.6 million from the CDC’s budget (the amount it had spent on gun research in the previous year) and outlawed research on gun control with a provision that reads: “None of the funds made available for injury prevention and control at the Centers for Disease Control and Prevention may be used to advocate or promote gun control.”

See the full article here

So the NRA is not only opposed to any type of regulation no matter how bat-crap crazy everything gets, they are also opposed to anyone actually studying the situation to see how bad it is.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That is about as useful as saying "I want to write a program that does stuff. Any suggestions?". I don't mean to be rude but how you design will depend on how the database will be accessed, as I stated earlier, and you didn't provide any further information.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Was that from the Kama Sutra, or from the Bible?

There is a form of the golden rule in just about every religion ever invented.

"Never impose on others what you would not choose for yourself." – Confucianism

"If people regarded other people's families in the same way that they regard their own, who then would incite their own family to attack that of another? "For one would do for others as one would do for oneself." – Mozi

"Now this is the command: Do to the doer to cause that he do thus to you." - Egyptian

"Do not to your neighbor what you would take ill from him." – Pittacus

"What thou avoidest suffering thyself seek not to impose on others." – Epictetus

"Expect from others what you did to them" - Seneca

"Hurt not others in ways that you yourself would find hurtful." - Buddhism

"And if thine eyes be turned towards justice, choose thou for thy neighbour that which thou choosest for thyself." - Bahai

"One should never do that to another which one regards as injurious to one’s own self." - Hinduism

"None of you truly believes until he wishes for his brother what he wishes for himself." - Islam

"He who desires his own good, should avoid causing any harm to a living being." - Jainism

"Oh, do as you would be done by." - Quakerism

"Regard your neighbor's gain as your own gain, and your neighbor's loss as your own loss." …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It's like if you take all your money out of the bank and start spending it. You might feel rich but in fact you are rapidly getting poorer.

OK. So I suck at analogies.

<M/> commented: No, it was pretty good +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You are in California? Where it is warm? You suck!

Actually, given a choice of extremes (hot or cold) I prefer the cold. I spent two weeks in Phoenix (actually Tempe, but that's splitting hairs) in August several years back. It was +47C or hotter the entire time I was there. That's 116F for you Yanks. It was like taking a brick to the face every time I stepped outside. And things in the car kept melting. You can always throw on another sweater or light a fire in the cold. Can't do much about the heat except bitch and sweat.

<M/> commented: Agreeable +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

For details on how to use parameterized queries please refer to this code snippet. It also suggests how to adjust your code formatting to make queries easier to read.

Begginnerdev commented: Nice link +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

A lot of questions in the VB.NET forum are database related. Most of the code that gets posted result in one or more comments like "use parameterized queries to avoid SQL injection attacks". I won't describe the nature of a SQL injection because it is easily looked up via google. There is a lengthy article at Wikipedia. What I will do here is give two examples of how to create queries using parameters. The first example uses SQLDB and the second uses OLEDB. The major difference between the two is that SQLDB uses named parameters while OLEDB uses positional parameters.

With SQLDB you give parameters names. Any name will do but it only makes sense to use a name that relates to the type of parameter. For example, if the corresponding database field is LastName you might name the parameter @lastName or @lname (all parameters must start with "@"). When you add the parameter values you can add them in any order and the @name you use must match the @name in the query string.

With OLEDB you specify a parameter with "?". When you add the parameters you must add them in the same order in which they appear in the query. The parameter names you use can have any name. This can lead to confusion as it might lead you to believe order doesn't matter. It is for this reason I much prefer SQLDB.

Another advantage to using parameterized queries is it avoids awkward syntax when …

Ashenvale commented: Thank you so much for giving me this great tutorial :) CHEERS! +2
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please post the code you are using to load and save the text. The usual way to load and save rich text is as follows:

Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
    RichTextBox1.SaveFile("d:\temp\myfile.rtf")
End Sub

Private Sub btnLoad_Click(sender As System.Object, e As System.EventArgs) Handles btnLoad.Click
    RichTextBox1.LoadFile("d:\temp\myfile.rtf")
End Sub
DyO152 commented: Use this if you want to save/load from/on RichTextBox +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In that case

TextBox1.Text = ""

Dim con As New SqlConnection("Server=.\SQLEXPRESS;Database=mydb;Trusted_Connection=yes;")
Dim cmd As New SqlCommand

con.Open()

cmd.Connection = con
cmd.CommandText = "select count(*) as count,Name from supplies group by Name order by count desc"

Dim rdr As SqlDataReader = cmd.ExecuteReader

Do While rdr.Read() And ListView1.Items.Count < 3
    TextBox1.Text &= rdr("Name") & " "
Loop

rdr.Close()
con.Close()
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Please try again. I have no idea what you are asking.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'm personally not interested and I don't qualify in any case, but if you want to attract interest I suggest you provide some details as to the type of project, time commitment, timeline, scope, required skillsets, etc.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

On the following table

Supplies
  ID
  Name

Containing the following rows

1   paper
2   book
3   book
4   book
5   pen
6   pencil
7   pencil
8   pen

The following query

select count(*) as count,Name from supplies group by Name order by count desc

returns

3   book
2   pen
2   pencil
1   paper

Then you can pick the three most frequent items from most to least frequent by stepping through the returned recordset until you have three items or you run out of records.

Begginnerdev commented: Nice +7
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster
  1. Don't hijack threads
  2. Don't resurrect old threads
  3. Show some effort before you post
  4. Provide some details
TnTinMN commented: You should make this post into a keyboard macro. You could use it a lot around here. +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

We have a friend who likes to go on about the coming apocalypse. In 2011 it was all about the Book of Revelation. Last year it was all 2012. I finally found a way to shut her up. Last year I asked her if she was convinced the world would end in December of 2012. She said "yes". So I asked her if she would sign a contract whereby she would sell me her house for $10,000 as long as I agreed to sell it back for the same price in January of 2013. She refused. I told her it was a no lose deal. She could take that end-of-the-world cruise and not have to worry about paying for it. She still refused. Didn't hear anything more about it after that.

The reason the Mayan calendar ended when it did is the same reason our calendar ends on December 31.

<M/> commented: Nice :) +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In the early 1920s, a citizens' group proposed legislation requiring

  • permits to carry concealed weapons
  • increased prison sentences for crimes involving guns
  • citizenship as a requirement to own a handgun
  • a waiting period between buying a gun and receiving it
  • gun dealers to provide police with details of all gun sales

That group was the National Rifle Association.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

people first began dying from diabetes in 1930s

They probably died of diabetes before this but just couldn't identify the cause.

<M/> commented: probably, my numbers could be wrong +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't have my dev machine so I can't test this but I believe the format for a date value is like

select * from tble where Invoiced > #01/05/2012#

so try

    "SELECT * FROM invoiced_filter " & _
    " WHERE Invoiced > #" & fromdte & "# AND < #" & todte & "#"
TnTinMN commented: correct on date format +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I am offended by #3 on that list.

diafol commented: ha ha +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I'd like to ask why <MICHAEL>'s last post was deleted. He expressed an opinion (a valid one if you ask me). It seems that the only reason it was deleted was out of fear of offending riahc3. There was no name calling. Every system has its foibles (or "personality" if you will). All problems are ranked on a scale from serious to not. The developers have some idea as to the effort required to fix each one. The effort is weighed against the annoyance factor and the perceived benefit. Then the problems are addressed in turn. This is how a business operates. If anyone finds that the existing problems are too annoying to live with then he/she is free to take their business elsewhere. As far as I can tell, that was the gist of <MICHAEL>'s post. I don't think it should have been deleted.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

How is this in any way related to the original question which asked about a Yes/No status field?

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I don't recall the show, but one character dissed the new-age beliefs of another and received a vigorous slap in return. He replied, "ah, yes. The sound of one hand clapping".

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Religion and politics. They both divide people into "us" and "them" camps. And once you do that it is almost impossible to use reason. Any attempt to use logic and facts to refute an opinion or belief just strengthens the tribal bonds.

But I'm getting off the thread topic. Apologies.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Some people claim that all religion is a threat to society.

LastMitch commented: You stand Correct! +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Why not have the remaining letters in a dropdown combobox. Once a letter has been guessed you remove it from the combobox. That way there is no need to validate input.

Begginnerdev commented: True +6
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

One of the things I have been steadfastly avoiding is writing code to print stuff. Most of what I want to print is from withing apps like Outlook or Word that already provide that functionality. But I finally ended up having to bite the bullet. What I ended up with was not pretty but it is (except for one flaw noted in the comments) adequate. I present it here for comments. Perhaps it will be of use to someone else.

In a nutshell, printing requires that you "draw" each item on the page, be it text or graphics. As such, you can't just stream text to the page. You must calculate the position of each string. When you print a document, the PrintPage event gets fired until there are no more pages to print. As long as you set e.HasMorePages to True before you exit the PrintPage handler the PrintPage event will continue to fire.

As I quickly learned by starting with a Microsoft example, if you try to print a line that is too long to fit on the page, it will just get truncated. You must provide the word wrap functionality by determining what parts of the line will fit on the page and what will not. The sample code does this by tokenizing each line of text and rendering each token separately. If a token will not fit in the remaining line then it is saved for the next line.

This is my first attempt at printing …

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you check out my code snippet BackgroundWorker IP Monitor it shows how to use Delegates to access the textbox from another thread. I think that is what you will have to do.

Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Index is a reserved word. You can either rename the field to something other than Index, or you can specify the field as [Index] as in

Dim myUpdateQuery As String = "UPDATE Sensor_Table         " & _
                              "   SET Equipment_ID = @id,  " & _
                              "       Location = @Loc,     " & _
                              "       Supervisor = @Sup,   " & _
                              "       Alarm_Start = @Astr, " & _
                              "       Alarm_Stop = @Asto   " & _
                              " WHERE [Index] = @LBIndex"