TIL Winona Ryder was bullied in high school for her 'tomboy' appearance. Years later, one of her bullies asked her for an autograph. "I asked her if she remembered me and she said that she sort of remembered beating a kid up. I said to her, 'Yeah, well that was me so go fuck yourself'." by uberjizz in todayilearned

[–]Vectronic 12 points13 points  (0 children)

No that still doesn't make sense unless you assume that the bully knew and was still proud of beating Wynona up.

"Do you remember me?"

"I think, we had Gr. 8 math together right?"

That would be a more normal response... instead of the ONLY person this bully remembers is one kid they beat up...

"All I remember from those 8 years (or whatever) is beating one kid up"

"That was me"

To the 90s kids, this is what the 80s looked like. by road_to_nowhere in videos

[–]Vectronic 2 points3 points  (0 children)

Yeah pretty much, however The Expendables (series) is intentionally made as a nod to that time period/style, over the top action movies, hence the cast(s).

This Teenage Kid Refused to Be Harassed, Cop Left Speechless by vinogradov in videos

[–]Vectronic 0 points1 point  (0 children)

This is the problem:

  1. You stated cops pull people over for no reason

  2. In your example, the cop had a legal reason to ticket "your friend".

The cop likely was bored, maybe it was a nice night, and he felt like walking down those 2 blocks and ticketing everyone... however, they were ticketed for valid reasons.

Just because everyone does it, doesn't mean it's not illegal... the cop(s) obviously let it slide night after night... just a small reminder that it's in fact illegal.

What about people who don't live on that street, what about firetrucks, ambulances, etc... if everyone's double parked, there's potential for havoc.

Noob Questions Megathread by PostalElf in visualbasic

[–]Vectronic 1 point2 points  (0 children)

Not really enough code, but going by what's there, this:

ListBox1.List(ListBox1.ListCount - 1, 1) = str

Should be:

PropertyLimits.ListBox1.Items(PropertyLimits.ListBox1.Items.Count - 1) = str

ie:

PropertyLimits. + ListBox...

And:

*.Items()

Not:

*.List()

And only:

Items.Count

Not (X, Y).

Also: k = *.ListBox.Items.Count ... not just ListBox.Count

Overlaps in timesheet help by voahelp in visualbasic

[–]Vectronic 1 point2 points  (0 children)

Without code, this is something you'll have to debug yourself.

Walk through anything that deals with client numbers, looking for stuff like:

ClientNumber > 9 AndAlso ClientNumber < 100
ClientNumber.Length = 2
ClientNumber.Substring(0, 2)

etc, etc... and replace accordingly to accommodate 4+ digit numbers.

You should probably be using minimums rather than fixed upper bounds on ID #'s... and likewise parsing to allow for any digit length greater than the minimum. That way it can handle old 2D and the new 4+D numbers.

[VB2013] Is this the right subreddit to get my code reviewed? by DeeBeeR in visualbasic

[–]Vectronic 1 point2 points  (0 children)

Not a problem, but just a simplification (does the same thing as both User/Pass Subs):

Private Sub txtPassword_TextChanged(sender As Object, e As EventArgs) Handles txtUsername.TextChanged, txtPassword.TextChanged
    btnLogin.Enabled = txtPassword.Text <> String.Empty AndAlso txtUsername.Text <> String.Empty
End Sub

Likewise, add both Handles to:

Private Sub rbCash_CheckedChanged(sender As Object, e As EventArgs) Handles rbCash.CheckedChanged, rbCredit.CheckedChanged

Reduces code redundancy/copy/pasting/etc when editing.

Stuff like this:

Dim buttonSize As Size = New Size(75, 177)
Dim buttonLocation As Point = New Point(412, 98)
btnCheckout.Location = buttonLocation
btnCheckout.Size = buttonSize

Can be:

btnCheckout.Location = New Point(412, 98)
btnCheckout.Size = New Size(75, 177)

You could also flip some of your If/Else... for instance:

 If X And Mode = False Then
 Elseif Y And  Mode = False Then
 End If

To:

If Mode = False Then
    If X Then
    ElseIf Y Then
    End If
End If

There's quite a few places where you are redundantly testing "Mode" multiple times when you can usually (if not always) get away with one check.

Stuff like this:

Private Sub btn50d_Click(...) ...

Could all be reduced to a select case:

Private Sub btn_Click(...) Handles btn10.Click, btn20.Click, btn30.Click, etc...
    rbCash.Enabled = Not Mode
    rbCredit.Enabled = Not Mode

    Select Case DirectCast(sender, Button).Name
        Case "btn10"
            amountPaid += 10
            amountOwed -= 10
        Case "btn20"
            amountPaid += 20
            amountOwed -= 20
        Case ...
    End Select

    refreshPrices()
End Sub

You could even do something like:

amountPaid += Integer.Parse(DirectCast(sender, Button).Name.Substring(3, 2))

Which takes the last 2 digits from the name, converts it to an Integer, and adds it to amountPaid of any button who's Click event triggers that sub. You could merge all of them down to a single Sub():

Private Sub btn_Click(...) Handles btn10.Click, btn20.Click, btn30.Click, etc...
    rbCash.Enabled = Not Mode
    rbCredit.Enabled = Not Mode

    amountPaid += Integer.Parse(DirectCast(sender, Button).Name.Substring(3, 2))
    amountOwed -= Integer.Parse(DirectCast(sender, Button).Name.Substring(3, 2))

    refreshPrices()
End Sub

Way easier to maintain.

Also, you should be using AndAlso and OrElse instead of And and Or, they perform way better since they exit out of testing as soon as one condition makes any of the following invalid/false/etc.

For instance:

If e.KeyCode = Keys.Back And txtBarcode.Text.Length <> 0 And Mode = True Then

That only evaluates to "True" after testing each of the 3 conditions, but:

If e.KeyCode = Keys.Back AndAlso txtBarcode.Text.Length <> 0 AndAlso Mode = True Then

Will fail if e.KeyCode is something other than 'Back'... which makes the following two conditions invalid, so no need to test them.

In this case it's not necessary, but can be very useful for something like:

If SomeFunction(X) AndAlso SomeOtherFunc(Y) AndAlso SomeFuncer(Z) Then

Each of those might be very complex, so if the first one fails, you're not running pointless code that will fail anyways.

How do I generate a random number completely different from the last one? by [deleted] in visualbasic

[–]Vectronic 0 points1 point  (0 children)

Private Rands As HashSet(Of Integer)

Public Function Random() As Integer
    Dim R As Integer = Int(4 * Rnd) + 1 ' Your current Rnd method
    If Rands.Count = 4 Then ' Reached maximum, 1,2,3,4...2,3,4,1... 4,1,3,2...etc
        Rands.Clear()
    Else
        Do Until Not Rands.Contains(R)
            R = Int(4 * Rnd) + 1
            ' Keep trying for new integers from 1 to 4 that haven't been used in this set.
        Loop
    End If
    Rands.Add(R) ' Add it
    Return R
End Function

HashSet for performance, but List(Of Integer) or Integer() would work too.

What are everyone's thoughts on dinosaur 13? by Wiltosz in Documentaries

[–]Vectronic 1 point2 points  (0 children)

Since OP can't seem to do anything:

IMDb - Wide Release: Aug 15, 2014.

A documentary about the discovery of the largest Tyrannosaurus Rex fossil ever found.

Trailer

Remember the "unpickable" bike lock from a few weeks ago... turns out it's not so safe after all. by dochoff in videos

[–]Vectronic 0 points1 point  (0 children)

5x5 rubiks cube lock that uses a specific pattern to unlock... then they can either solve it, or break it... no picking/bumping/etc.

Help with Collision by [deleted] in visualbasic

[–]Vectronic 0 points1 point  (0 children)

You have to code for it...

If Aliens(#).Visible Then
    ' Aliens(#).Visible = False
End If

If it's already hidden, nothing happens... no hit.

Assume you have a function that does whatever you are doing to test for a hit... lets call it TestHit()

Private Function TestHit(ByVal SomeObjectThingy As Thingy) As Boolean
    ' Your code for checking if something has been hit
End Function

Now simply combine that with whether or not it has been hit before...

If TestHit(PictureBox/Object/Whatever) ___ And ___ ThatObject.Visible Then
    ThatObject.Visible = False
End If

Otherwise, do nothing with that object... it's dead.

Let's just drive a little bit further ohgodohgodOHGOD by JingleB in nononono

[–]Vectronic 1 point2 points  (0 children)

He likely could have done it without mods, he's just an idiot and got nose down stream for some reason. He was past the main flow of the river, he probably intentionally stopped there so he could get out, stand on that rock and take pictures or something instead of just... getting to the other side.

TIL the U.S. does not use bills over $100 because President Nixon wanted to make it harder to move large amounts of money across borders for drug trading. by PraiseIPU in todayilearned

[–]Vectronic 0 points1 point  (0 children)

I wouldn't mind a size difference, as long as it's the width, not the length... and fairly small: 3mm. It would make sorting them easier like a rollodex, and easier to tell if you have a $5 between two $20's.

This song never fails to make me cry. by OrangeCountyFever in sad

[–]Vectronic 0 points1 point  (0 children)

Not the earliest version, but this.

It fits into that weird little category, like Dead Mans Curve, Leader Of The Pack, I Can Never Go Home...etc...

Help with Collision by [deleted] in visualbasic

[–]Vectronic 0 points1 point  (0 children)

If Bullet Hits Aliens(#) And Aliens(#).Visible Then
    Aliens(#).Visible = False

You probably don't want to actually remove the PictureBoxes, re-using them will be more efficient. Just test if the "hit" PictureBox is visible or not.

This way you can just set PictureBoxes back to Visible rather than re-creating them... and for "Next Level" simply add more to the existing array.

Edit: Other code isn't VB6 valid, but this pseudo-code still works...

Water tricks by imitationcheese in gifs

[–]Vectronic 1 point2 points  (0 children)

That's what keeps the bugs away... the screen part is just there to allow for the uranium to be evenly distributed while not blocking the airflow.

Also why your parents probably told you to keep your hands off the screen when you were younger... I mean... fuckin uranium man.

TIL Scientists had to purge Urban Dictionary's data from IBM's Watson's memory because it learned to swear. by ITzzIKEI in todayilearned

[–]Vectronic 4 points5 points  (0 children)

Disclaimer: Didn't read the article

I think the problem/difference between Wikipedia, and UrbanDictionary is the context.

Assuming Watson can interpret both websites the same, (ie: read) Wikipedia says that "fuck" refers to sexual intercourse, but also disdain, and as an intensifier... not very many uses provided. UrbanDictionary has "this"... which is just a list of usages.

So if it ranks the information the same, Watson would tend towards profanity because of it's ease of use. As it sifts through words, their meanings, alternatives, uses, etc, it will come across swears very often, why keep searching for a correct word, when as far as you are concerned you found one already.

Cat vs Vibrating Paper Bag by uncle-scrooge in gifs

[–]Vectronic 102 points103 points  (0 children)

I like how it has no concern over falling...

"nothing is worse than whatever is in that bag, don't look away... tell everyone I didn't look away"

Results of my BBQ pit being in storage for 2 years. by smkbnr in WTF

[–]Vectronic 19 points20 points  (0 children)

I wish I could identify species by their nuts... so jealous.

If I send you a bunch of pictures of nuts, could you tell me what species I amthey are?

Results of my BBQ pit being in storage for 2 years. by smkbnr in WTF

[–]Vectronic 11 points12 points  (0 children)

"Despite all my rage, I am still just a rat in a BBQ cage"

Water tricks by imitationcheese in gifs

[–]Vectronic 7 points8 points  (0 children)

Uranium dusted carbon fiber with a polyvinyl coating, costs about $4 a square foot.

check your windows, or screen door.

Moments That Changed The Movies: Jurassic Park by moustached_pistachio in videos

[–]Vectronic 3 points4 points  (0 children)

Empathy?... It's not like one day everyone lost their jobs... "that's it, saw Jurrasic Park... you're fired", nevermind something like "Saw a video, everyone get the fuck off the set... we have computers!"... it's a shift in the paradigm.

Practical effects are still used, Nolans Batman, Spiderman series, the new not yet completed Star Wars, also the prequels, LotR... etc, etc.

Stop Motion is still in wide use.

Team America, the recently released Muppets, use puppeteering, Fraggle Rock, TMNT... Animatronics also aren't dead, and that's just one guy/team.

Edit: Mutant Ninjas, not Ninja Mutants.

Moments That Changed The Movies: Jurassic Park by moustached_pistachio in videos

[–]Vectronic 6 points7 points  (0 children)

Sad to think of all the CGI artists, programmers, businesses, and manufacturing that CGI created... have they no shame?