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

INABIAF. It's not a bug. It's a feature. As much as it has been "explained" as to how this makes programming easier I still consider it a failing of the language. Range generates numbers starting at the first number and proceeding by the increment up to but not including the second number. So in order to get the numbers from 1 to 10 you have to use range(1,11). I always favour clarity over everything else so this design choice offends me.

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

If you have the room and the user folder is not too big you might try to just copy the guid-named profile to the correct username. At least this would preserve the original in case that doesn't work. If you don't have the room then just rename the guid-named folder to the correct username.

When new user profiles are created, all Windows does is copy a default user profile into a folder with the new user name.

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

Even a complete whack-job can be right occasionally. To wit...

... if devotion to truth is the hallmark of morality, then there is no greater, nobler,
more heroic form of devotion than the act of a man who assumes the responsibility
of thinking.

... the alleged short-cut to knowledge, which is faith, is only a short-circuit
destroying the mind.

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

Try this:

  1. power down the laptop
  2. remove the battery
  3. disconnect the AC power
  4. hold down the power button for 15 seconds
  5. plug in the AC power but do not reconnect the battery
  6. try to boot

If that works then reconnect the battery.

rproffitt commented: 15? I've run across 30 seconds. Over time I find one out at 45 seconds. So for that reason, I put 60 seconds up on my sticky post about this. +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The problems (google) with Daniweb are not due to Dazah or to neglect on Dani's part. They are (google) due to outside forces (google) that have conspired (google) to push daniweb far down the list of google search results. What these outside forces (google) are I have no idea.

Aeonix commented: You know, I was always wondering why assholish Stack Exchange is one of top results and great DaniWeb is not to be found. Kappa. +0
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

It is bad practice to have duplicate data. That could lead to inconsistencies. I advise you to store the date as one column and create a view with the derived columns. That gives you non-redundant columns plus the convenience of pretending that the derived coulmns actually exist (simpler queries).

diafol commented: My thoughts too +1 +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Yeah, but powershell requires an enormous amount of effort to learn before you can do anything really useful. And once you have a powershell script it is essentially unreadable. The nice thing about vbscript is that it is easy to understand and does not require a lot of knowledge to use effectively. Not to mention that the code skills transfer nicely to vb.net. Is

$a = Get-ChildItem C:\Scripts -recurse | Where-Object {$_.PSIsContainer -eq $True}

immediately obvious? Is $_.PSIsContainer meaningful?

rproffitt commented: Yes and +1. +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

I want to learn to play the guitar.

rubberman commented: Ha Ha! +14
rproffitt commented: When is your first concert? +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

The problem is that on some systems the Advanced option has been removed from the GUI. Thus the only way to set/unset the metered option is via the command line.

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

In the case of Obama, the smear campaign consisted of things like "he was not born in America" and "he's a Muslim". In the case of Bush, the "smear" campaign consisted of facts. Similarly with Hillary, the right wing media kept screaming "Benghazi" even after several GOP investigations officially cleared her of any wrongdoing.

The SNL debate parodies had a great line where fake Trump complained that the media was making him look bad by reporting on everything he said and did.

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

You saw where I loaded the values into the text fields for frmDetails. Retrieve the details from the database and populate the DGV on frmDetails the same way you populate the DGV on the main form.

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

I see that the print statement uses parentheses which tells me this is 3.x code so it should work. Is it too much work for you to copy/paste the code and try running it yourself?

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

I thought this was only me, but apparently there are other users who have noticed that somewhere in the last few Microsoft Updates, the option to set a wi-fi connection as metered has been removed. Fortunately, you can still set/unset this option from the command line. For details, and a vbScript option to make it idiot proof please see this thread. This may also work for Ethernet (cabled) interfaces although I have not tried it because I never use a cabled connection.

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

I was checking out my settings to lead you through the steps when I noticed that the Advanced link on my wi-fi settings was missing. This is where you would go to set/clear the metered option. Lacking this, there is a command line option. Open a command shell and type:

netsh wlan show profiles

On my laptop I see

Profiles on interface Wi-Fi:

Group policy profiles (read only)
---------------------------------
    <None>

User profiles
-------------
    All User Profile     : KenNet
    All User Profile     : mynet-camp
    All User Profile     : mynet
    All User Profile     : ROGERS7608

The profile I am interested in is mynet-camp. For further details type

netsh wlan show profile name="mynet-camp"

On my laptop I see

Profile mynet-camp on interface Wi-Fi:
=======================================================================

Applied: All User Profile

Profile information
-------------------
    Version                : 1
    Type                   : Wireless LAN
    Name                   : mynet-camp
    Control options        :
        Connection mode    : Connect automatically
        Network broadcast  : Connect only if this network is broadcasting
        AutoSwitch         : Do not switch to other networks
        MAC Randomization  : Disabled

Connectivity settings
---------------------
    Number of SSIDs        : 1
    SSID name              : "mynet-camp"
    Network type           : Infrastructure
    Radio type             : [ Any Radio Type ]
    Vendor extension          : Not present

Security settings
-----------------
    Authentication         : WPA2-Personal
    Cipher                 : CCMP
    Authentication         : WPA2-Personal
    Cipher                 : Unknown
    Security key           : Present

Cost settings
-------------
    Cost                   : Fixed
    Congested              : No
    Approaching Data Limit : No
    Over Data Limit        : No
    Roaming                : No
    Cost Source            : User

The area of interest is Cost Settings. You …

rproffitt commented: By your command. *bewoop bewoop. +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Here's a simple example.

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddRow("Frank", "Bowles", "Parker")
        AddRow("Richard", "James", "Harvey")
        AddRow("Kenneth", "Harry", "Morgan")
    End Sub

    Sub AddRow(ByVal col1, ByVal col2, ByVal col3)
        Dim row As Integer = dgvTest.Rows.Add(1)
        dgvTest.Rows(row).Cells(0).Value = col1
        dgvTest.Rows(row).Cells(1).Value = col2
        dgvTest.Rows(row).Cells(2).Value = col3
    End Sub

    Private Sub dgvTest_CellDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvTest.CellDoubleClick
        If e.ColumnIndex = 2 Then
            frmDetails.txtFirst.Text = dgvTest.Rows(e.RowIndex).Cells(0).Value
            frmDetails.txtMiddle.Text = dgvTest.Rows(e.RowIndex).Cells(1).Value
            frmDetails.txtLast.Text = dgvTest.Rows(e.RowIndex).Cells(2).Value
            frmDetails.Show()
        End If
    End Sub

End Class

dgvTest is a DataGridView with three columns. frmDetails is a separate form with three TextBoxes that are populated when the user double clicks on column 2 (last name) of a row in dgvTest. The new form is displayed non-modal so that the user can see details from other rows without closing the details form.

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

The old world is dying and the new world struggles to be born. Now is the time of monsters.

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

It's 22:21 CST and all I can say is what the #### is wrong with you people!!!!!

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

My mistake. Apparently Stephen G. Nash, "graduated in June 1982 from Stanford University, with a Ph.D. in Computer Science."

rproffitt commented: Believe it or not, I have code from the 70's and it is cringe worthy. +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

That is some massively butt-ugly code. I hope you have a large amount of test data that you can run through both the FORTRAN and C++ versions so that you can verify your translation.

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

OPTDRD calls OPTSTD and in OPTSTD the value of ITRMCD is set to a non-zero value at

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

Show us what you have so far.

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

Doesn't "do this as best you can" add overhead?

The people who write the tools (compilers, interpreters) generally know a lot more about optimization tricks than the rest of us. In some cases, with properly written high-level code, optimizations can be done that, were they done at the source code level, would render the code unintelligible. So in most cases "do this the best you can" is generally better than you or I could do it.

Assembly works 1 on 1 with the CPU...Assembly's so-called OP codes work in ratio 1 to 1 in binary, and is often pretended that Assembly is just language of processor. "You just don't go lower than that".

Essentially true but does not take into account micro-code. Assembly, though, is the lowest level accessible to the programmer.

it doesn't care about social engineering

No software cares about social engineering or anything else for that matter.

applications are made in Assembly in order to not make people insane by typing 1's and 0's.

Applications are generally not coded in Assembly because the (possibly) limited gains in execution speed/efficiency are greatly outweighed by the much longer development time required by low-level coding. I've had to code at the bit level, assembly level and all other levels above that. My sanity is mostly intact.

Assembly has no security flaw

Any code that performs any non-trivial task can have security flaws.

Assembly has no possible corruption as …

rproffitt commented: This is certainly doing your best. +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Check my code (It's not that hard to program this).

It may not be hard to program that but without whitespace and comments it is much more difficult than it should be to read and understand it.

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

You can loop through all of the pictureboxes by

For Each pbx As PictureBox In Me.Controls.OfType(Of PictureBox)()
    pbx.Image = ...
Next

or if you have named them with the same prefix followed by a number like PictureBox1, PuctureBox2, etc. then you can access them by name as

Dim pbx As PictureBox
.
.
.
pbx = Me.Controls("PictureBox" & i)

as long as you give i a value beforehand. If you are creating code for PictureBox events you can use the same handler for all similar events.

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

Sounds like a homework assignment. It also sounds like you didn't read this sticky or the Daniweb rules

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

I no longer have a database installed so I can't try anything with parameters, but a few years back I posted a code snippet that inserts a picture (binary file) into a database without parameters. Perhaps that will help.

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

I have had similar problems and I have found it was easier overall to just rebuild everything from scratch. That means creating a new project while keeping the broken one open. Create a form of the correct size then go to the original form and do "select all/cop", then go to the new project and paste all the controls on the blank form. Do the same copy/paste for the code.

ddanbe commented: That's what I would do too. +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

When I click on 5 hours ago in the Trump, instead of being taken to the end of the thread I get the first post on the first page.

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

Each iteration means the another copy of the function is running until the last one exits.

That's not quite the case as I understand it. There is only one copy of the function. What happens is that with each call, values get pushed onto the stack (and get popped off when each call exits).

rproffitt commented: This is/was covered in the course compiler design years ago. No one takes that course today. +11
rubberman commented: I wrote a fibbonacci computation routine once that used recursive exceptions... :-) That was to test the "new" to C++ exception handling algorithms +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In autoit you can make the desired window active then send commands to click specific controls. If you install Autoit, look at the AutoitX help file. You can instantiate an autoitx object from within vb, c# or even vbscript. Typically to click a button in a window you use

WinActivate - to make the desirec window active
WinWaitActive - to wait for the window to become active
MouseClick - to click a particular button

AutoIt includes a program which you can use to get the name of the button you want to click.

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

You have to

  1. Clearly define your problem
  2. Show us that you have tried to solve this yourself
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

My two cents - a goto should only be used as an escape. In some rare cases when you have code that has several levels of nesting and whenever an error occurs you want to just bail out, (I think) it is acceptable to use a goto to drop out to the outermost loop end (or module end, etc.). There are cases where this is much cleaner (clearer) than coding multiple flags and tests. I also believe that anyone who codes a goto in the "up" direction should be drawn and quartered.

ddanbe commented: Severly flogged and salted! +15
cereal commented: http://xkcd.com/292/ +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

any help ?

Did you even bother to check out the links I gave you? I have used both of these products to automate tasks for years.

rproffitt commented: Automatic +1 +11
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

You might want to use Notepad++ instead of Notepad. It's better, supports regular expressions, and is free. Your search term as a regex is

\(.*$

and your replacement text is blank. In brief "\(" matches a left parenthesis, ".*" matches any length string and "$" matches the end of line. In toto the string matches everything from the first "(" to the end of the line.

cereal commented: +1 +14
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

In order to use a ProgressBar you have to know the total number of rows before you start. If you don't know this before you start you will have no way of knowing where you are in the transfer. The following code assumes you have 142 rows. Every time you add a new row you increment the value of the ProgressBar by one. The line with the Sleep is only there to slow things down so you can see the ProgressBar moving.

Dim numRows As Integer = 142

ProgressBar1.Maximum = numRows
ProgressBar1.Value = 0

For i As Integer = 1 To numRows
    ProgressBar1.Value += 1
    System.Threading.Thread.Sleep(50)
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

On my Dell laptop I can toggle the top row between function keys and media keys by pressing Fn+ESC. Pressing Fn+F1 toggles the mute and occasionally I miss F1 and press esc by mistake (thereby toggling the function keys). Perhaps this is what is happening with you.

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

Useful except the OP has this thread tagged with vb.net. Bit operations on bytes can be done easily with

Function SetBit(ByVal byteval As Byte, ByVal bitnum As Byte) As Byte
    Return byteval Or (1 << (7 - bitnum))
End Function

Function ClrBit(ByVal byteval As Byte, ByVal bitnum As Byte) As Byte
    Return byteval And (255 Xor (1 << (7 - bitnum)))
End Function

Function FlipBit(ByVal byteval As Byte, ByVal bitnum As Byte) As Byte
    Return byteval Xor (1 << (7 - bitnum))
End Function

Note that these functions number the bits left to right (MSB to LSB) zero-relative.

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

Test your web pages in a bunch of different browsers and see if they wiork.

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

Keep in mind that Math.Round exhibits (in my opinion) odd (no pun intended) behaviour. It behaves differently depending on whether the integer portion of a number is odd or even. For example

Math.Round(2.5) evaluates to 2.0
Math.Round(3.5) evaluates to 4.0

That's why I prefer to roll my own that always rounds x.5 up to the next integer. You can code this for any decimal place by multiplying by a factor of 10 and adding 0.5 before truncating. For example, to round 2.56 to one decimal

Multiply by 10 (to give 25.6)
Add 0.5 (to give 26.1)
Truncate (to give 26.0)
Divide by 10 (to give 2.6)
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

So use rproffitt's suggestion but encrypt the embedded mp3. Or distribute the encrypted mp3s as separate files and embed the decryption key in your application.

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

Use a DataGridView rather than a ListView. That would allow you to change colours of individual cells in any way that you want. To change an individual cell you code

dgvData.Rows(row).Cells(col).Style.BackColor = Color.Thistle

replacing row& col with the 0-relative row and column numbers.

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

Please note that you are posting a solution to a question that was asked 9 years ago.

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

Just because "Get along with co-workers" was listed last does not mean it is not important. It is important because it was on the last. That's like saying if you list the top three surgeons in the country the guy in third is a hack because he was the last on the list.

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

The Wall Street Journal reports that employers nationwide are having a tough time finding workers who can "communicate clearly, take initiative, problem-solve and get along with co-workers."

Note what item they listed first.

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

Could you possibly include an Archive All button?

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

You can reference a control dynamically by name like

num = 4
dim tbx as TextBox = Me.Controls("TextBox" & num)

Then you can reference the control through the variable. If you want to cycle through a series of TextBoxes just put it in a look like

For i As Int = 1 To 5
    dim tbx as TextBox = Me.Controls("TextBox" & i)
    tbx.Text = ....
Next
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

If you plan to write your own app (wrapper) but don't want to write your own tag code you can use either Perry's IDs Tag Library (which I have used) or this one which I have not tried.

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

You can start by watching this video on "How to do it".

ddanbe commented: Mmm, was my sarcastic undertone so noticeable? +15
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

Unless the code in question is inside a loop that will be executed millions of times, a slight (but otherwise unmeasurable) increase in efficiency is not worth sacrificing clarity.

JamesCherrill commented: Yes yes yes +15
Suzie999 commented: Shout! +8
Reverend Jim 5,225 Hi, I'm Jim, one of DaniWeb's moderators. Moderator Featured Poster

There is an ecosystem at work which filters certain guests and viewpoints across the major networks. These guests in turn know what their assigned role is within the highly choreographed—although not often if ever explicitly stated—rules of the performance. The host moderates; “both sides” of an issue are presented; false equivalency is maintained; untruths and outright lies are allowed to go uninterrogated and exposed; the echo chamber reverberates; the commercials are then played.

  • Chauncey DeVega
AssertNull commented: Interesting article by DeVega +0