Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Pollyanna posted:

This is a dumb question for me to ask so late into my career

Jfc this is a dumb question. Slow the gently caress down and learn something instead of trying to check boxes. You're on your second job in the software industry. You have plenty of time.

Adbot
ADBOT LOVES YOU

TheresaJayne
Jul 1, 2011

TooMuchAbstraction posted:

If you ever find yourself writing a "recognize an email address" function for serious applications, you are doing it wrong.

Most people doing that preclude my email address from existance.

i have a - in the email rather than a _ and it keeps getting denied as not being a valid email

ToxicFrog
Apr 26, 2008


TheresaJayne posted:

Most people doing that preclude my email address from existance.

i have a - in the email rather than a _ and it keeps getting denied as not being a valid email

This right here is why email address validation/recognition gets so much hate: 99% of the time it's being used by idiots to "validate" emails being entered into a website. Where "validate" means "reject all sorts of valid emails because they have weird, alien characters like '.' or '-' or '+' in them".

If you're really lucky you get a site that uses different validation code for different parts of the site! So it'll let you register with and email address that you can't log in with, or you can register and log in but the page for unsubscribing from their lovely mailing list doesn't work.

Pollyanna
Mar 5, 2005

Milk's on them.


I thought special marks like . and _ were ignored in emails?

nielsm
Jun 1, 2009



Pollyanna posted:

I thought special marks like . and _ were ignored in emails?

Depends entirely on the server. Google ignores them, but nothing about Internet email requires that they have meaning or are ignored.

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

Blinkz0rz posted:

Jfc this is a dumb question. Slow the gently caress down and learn something instead of trying to check boxes. You're on your second job in the software industry. You have plenty of time.

Seriously. I'm 15 years into my career. I work with people that have been writing software for 30 or 40 years. We're all still learning new things. Relax.

JawnV6
Jul 4, 2004

So hot ...

ToxicFrog posted:

This right here is why email address validation/recognition gets so much hate: 99% of the time it's being used by idiots to "validate" emails being entered into a website. Where "validate" means "reject all sorts of valid emails because they have weird, alien characters like '.' or '-' or '+' in them".
And it's all for naught, because Jim Lastname from Opelika, AL has signed up for 4 accounts with my email address in the last month.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
Another Django question here. I'm kind of new to this all overall, but I would suspect that there's something that can vomit a model's details in a view without me having to do much of anything--notably create an HTML template. Is this a thing? I'm working on a rather dry site where I have a lot of stuff like that. At best, I might just want to define order and create groupings.

I saw django-tables2 to generate the master table for all of this stuff, and that has made me very happy. Is there something similar for vomiting a specific instance of a model?

Linear Zoetrope
Nov 28, 2011

A hero must cook

Pollyanna posted:

I thought special marks like . and _ were ignored in emails?


nielsm posted:

Depends entirely on the server. Google ignores them, but nothing about Internet email requires that they have meaning or are ignored.

The "local" part of an email address is more or less just like, say, your Apartment Number. There are some rules about how things should be named, but in practice different "complexes" (domains) structure them differently. Depending on the server a.b.c may or may not be equivalent to ABC, A.b.c, a.bc, or any other number of things. Email is more or less agnostic as to how the domain handles the resolution of the local part just so long as it conforms to a subset of the overall standard (though Google does allow one invalid construction due to their handling: two periods in a row outside of quotation marks, which are not technically allowed, but this is because double dots are ignored completely so theoretically an email validator could still be strict about this since if you're missing a period Google will still send it to the right place).

For the same reason, there are some edge cases in a theoretical email validator you could safely exclude. For instance, parenthesized comments are allowed at the beginning and end of both the local and domain parts (that is (a)me(blah)@(comment)you.com(ex) is the same as me@you.com), but by spec are ignored completely (which is why they're called comments). The issue, of course, comes in what happens if a theoretical email service allows invalid constructs without ignoring them. Then you're in a spot where you may reject someone's "valid" email because the domain they're registered at is poorly implemented.

Linear Zoetrope fucked around with this message at 02:42 on Oct 4, 2016

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Rocko Bonaparte posted:

Another Django question here. I'm kind of new to this all overall, but I would suspect that there's something that can vomit a model's details in a view without me having to do much of anything--notably create an HTML template. Is this a thing? I'm working on a rather dry site where I have a lot of stuff like that. At best, I might just want to define order and create groupings.

I saw django-tables2 to generate the master table for all of this stuff, and that has made me very happy. Is there something similar for vomiting a specific instance of a model?

Is there some reason the admin pages don't do what you want? If I recall correctly, they should be able to basically let you browse your database via a web interface.

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!

TooMuchAbstraction posted:

Is there some reason the admin pages don't do what you want? If I recall correctly, they should be able to basically let you browse your database via a web interface.

I pretty much want a read-only presentation with that kind of power, with the admin page available under the hood.

TooMuchAbstraction
Oct 14, 2012

I spent four years making
Waves of Steel
Hell yes I'm going to turn my avatar into an ad for it.
Fun Shoe

Rocko Bonaparte posted:

I pretty much want a read-only presentation with that kind of power, with the admin page available under the hood.

Pretty sure the admin page is written in Django, so you could just go diving into the internals to find what renders that, and make a copy with all the write tools ripped out.

Otherwise, you're looking at reflection, which is super easy in Python. Analyze __dict__ for the model instances, print key names and corresponding values. Only issue is that the model probably has a bunch of "hidden" keys (from parent classes) that you don't care about. But there may be a array or set or something that enumerates all the keys that correspond to model attributes; it's been awhile since I dug into this stuff.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Rocko Bonaparte posted:

Another Django question here. I'm kind of new to this all overall, but I would suspect that there's something that can vomit a model's details in a view without me having to do much of anything--notably create an HTML template. Is this a thing? I'm working on a rather dry site where I have a lot of stuff like that. At best, I might just want to define order and create groupings.

I saw django-tables2 to generate the master table for all of this stuff, and that has made me very happy. Is there something similar for vomiting a specific instance of a model?

There's a Django thread.

mr_package
Jun 13, 2000
Is there a good simple way to track who is doing what on the servers so people don't knock me off my RDP session or I don't ask IT to physically reboot something someone is working on? I assume slack channel is the default but slack is effectively banned where I work.

Mixed network win/mac/linux, mostly VM but some physical machines.

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

mr_package posted:

Is there a good simple way to track who is doing what on the servers so people don't knock me off my RDP session or I don't ask IT to physically reboot something someone is working on? I assume slack channel is the default but slack is effectively banned where I work.

Mixed network win/mac/linux, mostly VM but some physical machines.

Gold standard for simplicity is just using the OS specific tools on the server to find out who is logged in etc, correct? Ex. tasklist /fi "SessionName ne Services".

Edit: Do IT departments at places really just reboot poo poo without warning, assuming no one was using it for anything important?

Fergus Mac Roich fucked around with this message at 21:40 on Oct 4, 2016

22 Eargesplitten
Oct 10, 2010



Fergus Mac Roich posted:

Edit: Do IT departments at places really just reboot poo poo without warning, assuming no one was using it for anything important?

Go read the "poo poo That Pisses You Off" thread in SH/SC. People do pretty much every possible stupid thing.

Is there such a thing as too much commenting, assuming you're not trying to do it? For example, in a game project, I've got loops that create a grid, then loops that create pathfinding triggers, and then a statement that creates the player. I've got comments for each, basically saying the same thing that I just said. It goes like this:

C# code:
       //creates asteroid field
        for (float x = 1.5f; x < 21.0f; x+=2.0f)
        {
            for (float y = -1.5f; y > -21.0f; y-=2.0f)
            {
                AsteroidList.Add(Instantiate(Asteroid, new Vector3(x, y, 0f), Quaternion.identity));
            }
        }

        //instantiates paths which trigger enemy movements
        for (float y = -.5f; y > -20.5f; y-= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(10.5f, y, 0f), Quaternion.identity));
        }
        for (float x = .5f; x < 21f; x+= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(x, -10.5f, 0f), Quaternion.Euler(0, 0, 90)));
        }

        //creates the player and places it on the board
        GameObject GameObjPlayer = (GameObject)Instantiate(PlayerShip, new Vector2(20.5f, -20.5f), Quaternion.Euler(0, 0, 90));
        Player = GameObjPlayer.GetComponent<PlayerShip>();
I haven't tested the path part, I just coded it in, so that might not be right. Really, the question is about the commenting.

Skandranon
Sep 6, 2008
fucking stupid, dont listen to me

22 Eargesplitten posted:

Go read the "poo poo That Pisses You Off" thread in SH/SC. People do pretty much every possible stupid thing.

Is there such a thing as too much commenting, assuming you're not trying to do it? For example, in a game project, I've got loops that create a grid, then loops that create pathfinding triggers, and then a statement that creates the player. I've got comments for each, basically saying the same thing that I just said. It goes like this:

C# code:
       //creates asteroid field
        for (float x = 1.5f; x < 21.0f; x+=2.0f)
        {
            for (float y = -1.5f; y > -21.0f; y-=2.0f)
            {
                AsteroidList.Add(Instantiate(Asteroid, new Vector3(x, y, 0f), Quaternion.identity));
            }
        }

        //instantiates paths which trigger enemy movements
        for (float y = -.5f; y > -20.5f; y-= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(10.5f, y, 0f), Quaternion.identity));
        }
        for (float x = .5f; x < 21f; x+= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(x, -10.5f, 0f), Quaternion.Euler(0, 0, 90)));
        }

        //creates the player and places it on the board
        GameObject GameObjPlayer = (GameObject)Instantiate(PlayerShip, new Vector2(20.5f, -20.5f), Quaternion.Euler(0, 0, 90));
        Player = GameObjPlayer.GetComponent<PlayerShip>();
I haven't tested the path part, I just coded it in, so that might not be right. Really, the question is about the commenting.

Try not to comment things that SHOULD be obvious to a competent developer. Doing //declare X is useless. Comments should be more focused around WHY you are doing something, and/or explaining non-obvious code. In the above case, I don't think it's bad, though I would also consider moving the commented sections to their own CreateEnemies() and CreateAsteroids() methods.

Peristalsis
Apr 5, 2004
Move along.

22 Eargesplitten posted:

Is there such a thing as too much commenting, assuming you're not trying to do it? For example, in a game project, I've got loops that create a grid, then loops that create pathfinding triggers, and then a statement that creates the player. I've got comments for each, basically saying the same thing that I just said. It goes like this:

Yes, there is such a thing as too much commenting, but no, you're not guilty of it here.

This would be too much commenting:
C# code:
       //creates asteroid field by nested loops that do outer stuff and inner stuff.  All the inner stuff
       // happens for each iteration of the outer loop.  Because it's a nested loop.
       // TODO:  Look for ways to optimize this to eliminate nested loops.
       // Here's the outer loop
        for (float x = 1.5f; x < 21.0f; x+=2.0f)  // x is outer counter variable - note that it's a float 
                                                  // rather than an integer because reasons
        {
            // Here's the inner loop - it runs a bunch of times for each iteration of outer looop.
            for (float y = -1.5f; y > -21.0f; y-=2.0f)  // y is inner counter variable - also a float rather 
                                                        // than an integer
            {
                // Here's where it's finally doing something - it adds a new asteroid object to the list of
                // asteroid objects.  Here's some long comment about some very minor gotcha that nobody
                // will ever read, because anyone who is already plugging away at this code will already
                // understand this trivial point.
                AsteroidList.Add(Instantiate(Asteroid, new Vector3(x, y, 0f), Quaternion.identity));
            }  // end inner loop
        }  // end outer loop

Peristalsis fucked around with this message at 23:58 on Oct 4, 2016

JawnV6
Jul 4, 2004

So hot ...
Looks about right to me. Descriptive, could skim them to figure out the flow without having to read code, not so verbose that future maintainers won't bother updating them. The one thing that sticks out is the float constants. There's 21, 21.0, 20.5, 10.5, 1.5 and it's not clear from this section where those come from or why some stop short. If we doubled the board size, what would have to change? How would I know that?

Think of comments like the mental context you have in RAM that'll get lost when the next dev pulls from disk, comments let you save the context off in an easily restored way. If there's any choice you made or reasonable substitution that wouldn't work, comments can help others be aware & avoid those pitfalls.

Hughlander
May 11, 2005

22 Eargesplitten posted:

Is there such a thing as too much commenting, assuming you're not trying to do it? For example, in a game project, I've got loops that create a grid, then loops that create pathfinding triggers, and then a statement that creates the player. I've got comments for each, basically saying the same thing that I just said. It goes like this:

C# code:
       //creates asteroid field
        for (float x = 1.5f; x < 21.0f; x+=2.0f)
        {
            for (float y = -1.5f; y > -21.0f; y-=2.0f)
            {
                AsteroidList.Add(Instantiate(Asteroid, new Vector3(x, y, 0f), Quaternion.identity));
            }
        }

        //instantiates paths which trigger enemy movements
        for (float y = -.5f; y > -20.5f; y-= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(10.5f, y, 0f), Quaternion.identity));
        }
        for (float x = .5f; x < 21f; x+= 2.0f)
        {
            PathList.Add(Instantiate(Path, new Vector3(x, -10.5f, 0f), Quaternion.Euler(0, 0, 90)));
        }

        //creates the player and places it on the board
        GameObject GameObjPlayer = (GameObject)Instantiate(PlayerShip, new Vector2(20.5f, -20.5f), Quaternion.Euler(0, 0, 90));
        Player = GameObjPlayer.GetComponent<PlayerShip>();
I haven't tested the path part, I just coded it in, so that might not be right. Really, the question is about the commenting.

I'm more for the literate coding. For me that's 3 functions called:
createAsteroidFields()
createEnemies()
createPlayer()

Then there's no need for the comments.

22 Eargesplitten
Oct 10, 2010



That's actually a good point about the methods. I'm going to do that. Probably create minX, minY, maxX, and maxY variables as well. That's what the foo.5 numbers are for. The board goes from x = 0 to x = 21 and y = 0 and y -21, but the objects are centered on the .5s. Maybe I should do it differently, but I wanted to have a corner at the origin. Maybe I should do y from 0 to 21, I'll think about that.

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy

JawnV6 posted:

Looks about right to me. Descriptive, could skim them to figure out the flow without having to read code, not so verbose that future maintainers won't bother updating them. The one thing that sticks out is the float constants. There's 21, 21.0, 20.5, 10.5, 1.5 and it's not clear from this section where those come from or why some stop short. If we doubled the board size, what would have to change? How would I know that?

Think of comments like the mental context you have in RAM that'll get lost when the next dev pulls from disk, comments let you save the context off in an easily restored way. If there's any choice you made or reasonable substitution that wouldn't work, comments can help others be aware & avoid those pitfalls.

Further, code should be as self-descriptive as possible, which means that constants should at least be given something like
#define START_X_POS 1.5

So that your reference to the number also demonstrates its purpose.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.
Another way to think of it is that the code should be describing as much of the 'what' as possible. CreatePlayer, CreateAsteroids, START_X_POS, etc. That leaves comments for a requirement statement at the top of the file, ambiguous 'whats', 'whys', describing alternatives that seem sensible but won't work for reasons.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Stinky_Pete posted:

Further, code should be as self-descriptive as possible, which means that constants should at least be given something like
#define START_X_POS 1.5

So that your reference to the number also demonstrates its purpose.

#define TEN 10 :shepicide:

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy
typedef enum YESNO {NO,YES} YESNO;

the syntax is a little different, but this is real code running on real airplanes right now

Stinky_Pete fucked around with this message at 17:10 on Oct 5, 2016

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Stinky_Pete posted:

typedef enum YESNO {NO,YES} YESNO;

the syntax is a little different, but this is real code running on real airplanes right now

That line of code never runs. ;)

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy
Fine, real code compiled for real airplanes :rolleyes:

Mycroft Holmes
Mar 26, 2010

by Azathoth
Okay, I'm working with Visual Basic. What I need to know is how to access the data in a user entered list that can be of any length and how I can access data that is between a certain number range i.e. if I want to average a group of numbers between 10 and 25, how do I select only those numbers and add them. In addition, how do I select the highest and lowest numbers, for example If I need to calculate the range.

nielsm
Jun 1, 2009



Mycroft Holmes posted:

Okay, I'm working with Visual Basic. What I need to know is how to access the data in a user entered list that can be of any length and how I can access data that is between a certain number range i.e. if I want to average a group of numbers between 10 and 25, how do I select only those numbers and add them. In addition, how do I select the highest and lowest numbers, for example If I need to calculate the range.

Is this Visual Basic .NET, Visual Basic 6 ("classic" VB), or Visual Basic for Applications (macros in Word, Excel, Access), or perhaps even VBScript?
They're all distinct but related languages, VB.NET probably being the most different beast, but also the most desirable for modern/new development.

The user data, are they in a file, in a text box, added to a list box, or how are they stored right now?

In general what you will need is to make a loop that can iterate over the data one item at a time. When your data is in a list with N items, each item will have an index typically numbered from 0 to N-1. You can then make a loop that repeats the same block of code for all index values from a starting point to an ending point (e.g. from index 9 to 24) and calculate the sum, minimum and maximum.

Mycroft Holmes
Mar 26, 2010

by Azathoth

nielsm posted:

Is this Visual Basic .NET, Visual Basic 6 ("classic" VB), or Visual Basic for Applications (macros in Word, Excel, Access), or perhaps even VBScript?
They're all distinct but related languages, VB.NET probably being the most different beast, but also the most desirable for modern/new development.

The user data, are they in a file, in a text box, added to a list box, or how are they stored right now?

In general what you will need is to make a loop that can iterate over the data one item at a time. When your data is in a list with N items, each item will have an index typically numbered from 0 to N-1. You can then make a loop that repeats the same block of code for all index values from a starting point to an ending point (e.g. from index 9 to 24) and calculate the sum, minimum and maximum.

It's Visual Basic 2016, the newest one. The data has been added to a list box by the user. The data can be in any order so the loop you have mentioned won't work because the values of the data do not correlate to their index number.

nielsm
Jun 1, 2009



Mycroft Holmes posted:

It's Visual Basic 2016, the newest one. The data has been added to a list box by the user. The data can be in any order so the loop you have mentioned won't work because the values of the data do not correlate to their index number.

So each item has an "entry number" and a value, but the items may not be in entry number order on the list?

For that case you would most easily make a loop over the entire contents of the list, and ignore all items with entry numbers outside the relevant range. The items would be processed in the arbitrary order they are in on the list, but for the processing you described the order should be irrelevant.

Mycroft Holmes
Mar 26, 2010

by Azathoth

nielsm posted:

So each item has an "entry number" and a value, but the items may not be in entry number order on the list?

For that case you would most easily make a loop over the entire contents of the list, and ignore all items with entry numbers outside the relevant range. The items would be processed in the arbitrary order they are in on the list, but for the processing you described the order should be irrelevant.

Ok, so I'm having trouble figuring out how to set up the function to do that. I need to find the number of students with As in the list. An A is between 100 and 90. The code I have so far is:
'number of students with As and percentages
Function StudentNumberA(ByRef dblAStudents, ByRef dblAPercent) As Double
Dim I As Double
Dim dblCount As Double
For I = 0 To lstGrades.Items.Count - 1
If >= 90 And <= 100 Then
dblCount += 1
End If
Next
Return (dblAStudents = dblCount)(dblAPercent = (dblCount / lstGrades.Items.Count))
End Function


My question is, what do I put as the variable that corresponds to the current item on the list, given that it will change with every loop? Also, how do I find the lowest and highest numbers?

Mycroft Holmes fucked around with this message at 00:39 on Oct 6, 2016

fritz
Jul 26, 2003

Stinky_Pete posted:

Further, code should be as self-descriptive as possible, which means that constants should at least be given something like
#define START_X_POS 1.5

So that your reference to the number also demonstrates its purpose.

Why exactly are you using the preprocessor instead of "const double START_X_POS{1.5};"

nielsm
Jun 1, 2009



Mycroft Holmes posted:

Ok, so I'm having trouble figuring out how to set up the function to do that. I need to find the number of students with As in the list. An A is between 100 and 90. The code I have so far is:
'number of students with As and percentages
Visual Basic .NET code:
    Function StudentNumberA(ByRef dblAStudents, ByRef dblAPercent) As Double
        Dim I As Double
        Dim dblCount As Double
        For I = 0 To lstGrades.Items.Count - 1
            If >= 90 And <= 100 Then
                dblCount += 1
            End If
        Next
        Return (dblAStudents = dblCount)(dblAPercent = (dblCount / lstGrades.Items.Count))
    End Function
My question is, what do I put as the variable that corresponds to the current item on the list, given that it will change with every loop? Also, how do I find the lowest and highest numbers?

Tip first: Put your code in code tags, then it retains formatting. You can also add a language name to the code tag to get syntax highlighting.

Your I variable should be Integer rather than Double, since it's an index. You don't have non-whole-number indices, it's better to use an integer when you don't specifically need floating point (decimal) arithmetic.

You can get the value of an individual item in the list with the Items property:
Visual Basic .NET code:
  Dim iCurrentGrade As Integer
  For I = 0 To lstGrades.Items.Count - 1
    iCurrentGrade = lstGrades.Items(I) ' Gets the value of item index I and stores into iCurrentGrade
    If iCurrentGrade >= 90 And iCurrentGrade <= 100 Then
      dblCount += 1
    End If
  Next

Mycroft Holmes
Mar 26, 2010

by Azathoth
Ok, I did some more coding, but when I run it, the output is zero.

code:
Function StudentNumberA(ByRef dblAStudents, ByRef dblAPercent, ByRef dblAAverage, ByRef dblARange) As Double
        Dim intIndex As Integer
        Dim dblCount As Double
        Dim dblTotal As Double
        Dim dblNumber As Double
        Dim dblMax As Double
        Dim dblMin As Double
        For I = 0 To lstGrades.Items.Count - 1
            If lstGrades.Items(intIndex) >= 90 And lstGrades.Items(intIndex) <= 100 Then
                dblNumber = lstGrades.Items(intIndex)
                dblCount += 1
                dblTotal += dblNumber
                If dblNumber > dblMax Then
                    dblMax = dblNumber
                End If
                If dblNumber < dblMin Then
                    dblMin = dblNumber
                End If
            End If
        Next
        Return dblAStudents = dblCount And dblAPercent = dblCount / lstGrades.Items.Count And dblAAverage = dblTotal / dblCount And dblARange = dblMax - dblMin
    End Function

nielsm
Jun 1, 2009



You have to consider what you're actually returning and how.

In VB, the = operator is only used for equals comparison, not assignment. Using = for assignment is a statement form that just looks deceptively like a comparison expression.
What you have in your Return statement is a series of comparisons chained with logical And, not assignments.

From how your function is declared, I assume you mean to have it return four values by taking in references to variables to fill.
You have to assign those four as separate statements.
After that, you can really change the Function to be a Sub instead, because you don't actually produce a "return" value, you rather modify four passed-in variables.

Klades
Sep 8, 2011

You're also just checking the first student in the collection over (I assume VB automatically initializes things, anyway) and over instead of incrementing. intIndex should be your loop control variable.

And prefixing every variable with its type makes me retch but that's just me.

Mycroft Holmes
Mar 26, 2010

by Azathoth
Nevermind, fixed it.

Mycroft Holmes fucked around with this message at 17:53 on Oct 6, 2016

Stinky_Pete
Aug 16, 2015

Stinkier than your average bear
Lipstick Apathy

fritz posted:

Why exactly are you using the preprocessor instead of "const double START_X_POS{1.5};"

That was my "at least."

Adbot
ADBOT LOVES YOU

fankey
Aug 31, 2001

Not exactly a programming question but figured this might be the best place to ask. We sell a Linux 'applicance'. This device has an embedded web server for configuration. We'd like to support HTTPS out of the box but I'm not sure the best way ( if even possible ) to ship with a usable certificate. Options I've come up with

  • Self signed. Browsers freak out which doesn't give users a good feeling
  • Individual signed cert. Given that we could be selling 10k+ units a year I'm not sure this is even feasible. These devices won't have valid domain names so letsencrypt is out.
  • Ship every device with the same signed cert. Not sure if this is considered good practice or not.
  • Let the user install their own cert and use HTTP until they do. Given our user base this really means that no one will be using HTTPS.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply