Arduino Forum

Community => Bar Sport => Topic started by: PaulS on Apr 16, 2016, 05:09 am

Title: Re: How to serial print an array?
Post by: PaulS on Apr 16, 2016, 05:09 am
Quote
I'd like for the last Serial.println to just be Serial.println(arr);
I'd like to win the lottery, too. Neither of us is likely to get what we want just be wishing.
Title: Re: Re: How to serial print an array?
Post by: JaredBG on Sep 30, 2018, 11:38 pm
I'd like to win the lottery, too. Neither of us is likely to get what we want just be wishing.
Tell me, what do you get out of being a condescending crap bucket to anyone who doesn't phrase the question how you think it should be phrased or ask a question you don't think should be asked?
Title: Re: Re: How to serial print an array?
Post by: DKWatson on Oct 01, 2018, 12:20 am
Tell me, what do you get out of being a condescending crap bucket to anyone who doesn't phrase the question how you think it should be phrased or ask a question you don't think should be asked?
Wow!
Title: Re: Re: How to serial print an array?
Post by: JaredBG on Oct 01, 2018, 12:46 am
Wow!
You disagree with me? That guy has responded in the same tone to so many people.  I have yet to see him answer a question without insulting the person asking it.  If he has an issue with their question, just don't answer them.
Title: Re: Re: How to serial print an array?
Post by: Delta_G on Oct 01, 2018, 01:14 am
You disagree with me?
No.  But it would be smarter to just ignore him.  Because now you're on my "whiner list" and I won't help you and I really do.  You'd be better off to keep yourself together.  Nobody wants to help someone who is going to lose their shit if they think they're being insulted. 

If you want to talk about feelings and perceived insults then I would suggest the Dr Phil Forum (https://plugger.drphil.com/messageboard/topic/1625).  They're real people pleasers over there.  But don't expect them to know anything about code.  Here you can get great code advise, but you have to deal with the fact that techie people often lack people skills. 

It's entirely up to you which set of people you'd rather ask for help.  Try to make the intelligent choice.  Just don't be one of those whiners.  Nobody likes those.  And you'd rather be able to get help than get your licks in on old @PaulS.  He's just an old nobody who gets his willies throwing insults at children.  It makes him feel big when there's someone he can pick on.  You shouldn't feel mad at him.  You should feel sorry for him. 
Title: Re: Re: How to serial print an array?
Post by: Coding Badly on Oct 01, 2018, 02:03 am
Tell me, what do you get out of being a condescending crap bucket...
That guy has responded in the same tone to so many people.
At this moment in time the same can be said of you.

Quote
Apr 15, 2016, 10:09 pm
Seriously?  You dug up a thread 2½ years old to make your "point"?

Title: Re: Re: How to serial print an array?
Post by: ardly on Oct 01, 2018, 03:57 pm
Seriously?  You dug up a thread 2½ years old to make your "point"?


Maybe we are Inn a time warp?
Title: Re: Re: How to serial print an array?
Post by: Adrian15060 on Oct 01, 2018, 04:23 pm
Maybe we are Inn a time warp?
Haha we might be...
Title: Re: Re: How to serial print an array?
Post by: ChrisTenone on Oct 04, 2018, 06:21 am
A guy in the Project Guidance forum wanted some ready-made code, and referred to this as the "the friendly Arduino community ".
Title: Re: Re: How to serial print an array?
Post by: ardly on Oct 05, 2018, 03:17 pm
A guy in the Project Guidance forum wanted some ready-made code, and referred to this as the "the friendly Arduino community ".
I don't recall a lynching here for at least a week.
Title: Re: Re: How to serial print an array?
Post by: Qdeathstar on Oct 05, 2018, 05:23 pm
Oh Jerez guys, stop infringing on everyone's right to be an embacile.
Title: Re: Re: How to serial print an array?
Post by: Qdeathstar on Oct 05, 2018, 05:25 pm
@ardly, there was something about what rope to use, but I don't think it was posted in Project Guidance and being in the wrong forum, was aptly deleted.
Title: Re: Re: How to serial print an array?
Post by: AWOL on Oct 06, 2018, 12:20 am
Oh Jerez
Sherry?
I don't mind if I do.
Title: Re: Re: How to serial print an array?
Post by: ChrisTenone on Oct 06, 2018, 05:55 am
Whoa. I think we just got bar-ed.
Title: Re: Re: How to serial print an array?
Post by: ardly on Oct 08, 2018, 12:35 pm
Whoa. I think we just got bar-ed.
The bouncers here are pretty good and the bar is actually quite tame. The locals tend to sit in corners writing Haikus on beer mats or staring into their glasses and muttering about the weather. One guy keeps going on and on and on about snow, and he flashes a picture of his bird at anybody who will look.

There was a strange shepherd that came in last year, I think he was a German, but for the most part things are quiet. It is true that somebody was recently threated with a pitch forking  for using  'goto', but that was on the main forum, not in the bar.
Title: Re: Re: How to serial print an array?
Post by: GoForSmoke on Oct 31, 2018, 10:41 am
You disagree with me? That guy has responded in the same tone to so many people.  I have yet to see him answer a question without insulting the person asking it.  If he has an issue with their question, just don't answer them.
You haven't looked enough, he's answered me without being insulting, but then I'm not a narcissist.
If I couldn't take Paul, a compiler would reduce me to nothing rather quickly.

I just want to be sure, did he insult YOU or are you a Social Justice WARRIOR looking to correct 1st world indignities? Ever read Brave New World?
Have you got the intelligence to see that PaulS does not like time wasting idiots? Obviously not, his view is beyond you.

Anyway, you having to go back so far to drag up your example does put your whinge in perspective.
Title: Re: Re: How to serial print an array?
Post by: Qdeathstar on Oct 31, 2018, 12:52 pm
Were you on vacation goforsmoke?
Title: Re: Re: How to serial print an array?
Post by: GoForSmoke on Nov 01, 2018, 02:42 am
Just less active.
Title: Re: Re: How to serial print an array?
Post by: ChrisTenone on Nov 01, 2018, 05:50 am
He went for a smoke.
Title: Re: Re: How to serial print an array?
Post by: GoForSmoke on Nov 03, 2018, 12:56 am
The smoke to go for is the smoke of hairl;ine traces burning off cheap reject boards back before the PC clone boards arrived.

Go for smoke could be a hobbyist term for theater's "break a leg".

member A : I'm gonna see if that's the power pin.
member B: Go for smoke!
 
Title: Re: Re: How to serial print an array?
Post by: ChrisTenone on Nov 03, 2018, 04:19 am
There is also the smoke that should not be let out.

From your style you do not strike me as a tabakee user.
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 03:35 am
The bouncers here are pretty good and the bar is actually quite tame. The locals tend to sit in corners writing Haikus on beer mats or staring into their glasses and muttering about the weather. One guy keeps going on and on and on about snow, and he flashes a picture of his bird at anybody who will look.

There was a strange shepherd that came in last year, I think he was a German, but for the most part things are quiet. It is true that somebody was recently threated with a pitch forking  for using  'goto', but that was on the main forum, not in the bar.
On a side note, there are times when the use of a goto (properly hidden in a series of macros) can make for more readable code.  It allows you to have a single exit point from a function and that exit point does the cleanup if the return code is non-zero (i.e. a failure).  When I worked for NASA in the early '90s, we would hide the goto in a "RETURN" macro.  A function might look something like this:

Code: [Select]

typedef struct obj {
    int    val;
    char  *str;
} *OBJ;

typedef enum {
    ERR_InvalidArg = -199;
    ERR_NullPointer,
    ERR_MemoryAllocationFailure
} ERROR_CODES;

int  OBJ_Create( OBJ *handlePtr; int val; char *str )
{
    OBJ  handle = NULL;

    BEGIN("OBJ_Create");

    if (handlePtr == NULL)
        RETURN(ERR_InvalidArg);

    if (str == NULL)
        RETURN(ERR_NullPointer);

    handle = calloc(sizeof(struct obj), 1);
    if (handle == NULL)
        RETURN(ERR_MemoryAllocationFailure);

    handle->val = val;

    handle->str = strdup(str);
    if (handle->str == NULL)
        RETURN(ERR_MemoryAllocationFailure);

    *handlePtr = handle;

    RETURN(0);

    ON_EXIT {
        if (retCode != 0) {
            if (handle != NULL) {
                if (handle->str != NULL)
                    free(handle->str);
                free(handle);
            }
        }

        return (retCode);

    }
}


The BEGIN macro declared an int variable "retCode" and a "char *" variable "fnName" that was assigned the string that was the parameter to the macro.  The ON_EXIT macro hid a goto label "ExitFunction", the RETURN macro would set "retCode" and do a goto ExitFunction.  The "fnName" variable was declared so that you could add error messages throughout the code and not have to repeat the literal string, thus saving space and making it easier to change the name of the routine in the future without having to modify a lot of code.

It might not be as obvious that it would be useful in this simple example, but when you have a routine that is a lot longer and would normally have a lot of nested "if" statements or return statements, this can simplify the logic quite a bit.
Title: Re: Re: How to serial print an array?
Post by: Robin2 on Dec 07, 2018, 09:31 am
On a side note, there are times when the use of a goto (properly hidden in a series of macros)
Where do you get the stuff you are smokin ?  :)  :)

Maybe we need a Wall of Shame (https://forum.arduino.cc/index.php?topic=382458.0) for code ?

...R
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 12:09 pm
Where do you get the stuff you are smokin ?  :)  :)

Maybe we need a Wall of Shame (https://forum.arduino.cc/index.php?topic=382458.0) for code ?

...R
It was a series of macros that we developed back when I was working for NASA in the early '90s.  It acted as an extension to the language.  Because of the machines we were working on, portability, and other constraints, all code needed to be in standard 'C'.  No C++ allowed.  These macros allowed for a single exit point in the code and if used correctly, helped to minimize the chance of memory leaks (i.e. allocating memory in a routine and not cleaning up correctly when you needed to exit.  They acted as an extension to the language.

The macros were defined in a header file (ON_EXIT.h) and included in all source files:

Code: [Select]

#ifndef _ON_EXIT_H_
#define _ON_EXIT_H_

#define BEGIN(x) int retCode; char *fnName = x;
#define RETURN(x) { retCode = x; goto ExitFunction; }
#define ON_EXIT ExitFunction:

#endif


Since we didn't have C++ as an option, but we still wanted some aspects of object-oriented design, what we did was say that every 'object' consists of some sort object identifier (usually 3-5 capital letters) and every 'method' (member function) had that identifier followed by and underscore and then the reset of the member function name.  When you have large teams of developers working on a system and they are often from different groups or even different companies, this helps in keeping things organized.  When you have projects that large, you don't want everyone just doing their own thing -- you need agreed upon standards.  There's a difference between software engineering and just hacking some code together.
Title: Re: Re: How to serial print an array?
Post by: Robin2 on Dec 07, 2018, 12:16 pm
It was a series of macros that we developed back when I was working for NASA in the early '90s.
I wonder if you have missed the fact that this Bar Sport section is just for foolishness :)

...R
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 12:39 pm
I wonder if you have missed the fact that this Bar Sport section is just for foolishness :)

...R
I guess we frequent different types of bars... Back when I was at NASA, we would sometimes go to a stripper bar called "Heartbreakers" for lunch -- both the male and female engineers.  Why?  Because they had a really good "free" buffet and there was just a one drink minimum.  So, we would each order a single $5 beer and nurse it while eating boiled shrimp, prime rib, cheesecake, and other such stuff.  The females usually sat with their backs to the dancers and for the most part, even the guys didn't pay any attention to the dancers -- we would be talking about various aspects of the design of the systems we were currently working on.
Title: Re: Re: How to serial print an array?
Post by: AWOL on Dec 07, 2018, 12:44 pm
Quote
a single $5 beer
Good to see NASA taking safety seriously.
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 01:37 pm
Good to see NASA taking safety seriously.
If a single weak-ass domestic beer affects someone enough that safety would be compromised, then they have no business being allowed out of their "safe space".  They would definitely not survive the long hours that we endured during the lead-up to a launch or a project delivery date.  I lived about 40 miles away and I kept a sleeping bag and pillow in my office so that I could crash out there instead of driving home because our on-site test times were late at night and we still needed to have other meetings the next morning to discuss the results of the tests.  There was a fitness center on base, so we could grab a shower and clean up in the morning.  There was a dry cleaners very close to my office, so I kept a couple of sets of clothes there.  Despite those long hours and hard times, it's an experience that I will always look back fondly at.  We had a good group of engineers on our team and everyone pulled their own weight.  We've all retired or moved on to other DoD or aerospace contractors around the country since that time, but we still keep in touch.
Title: Re: Re: How to serial print an array?
Post by: AWOL on Dec 07, 2018, 01:49 pm
One of yours? (http://articles.latimes.com/1999/oct/01/news/mn-17288)

A friend of mine was a contractor on a PA system for a large metro railway project.
As such, he was subject to railway health and safety legislation, with very strict rules on both alcohol and working hours.
No lunch-time drinks and no stupid all-nighters.

Title: Re: Re: How to serial print an array?
Post by: Robin2 on Dec 07, 2018, 02:16 pm
even the guys didn't pay any attention to the dancers
I was at one of those in Houston a long time ago. I can understand :)

...R
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 02:17 pm
The smoke to go for is the smoke of hairl;ine traces burning off cheap reject boards back before the PC clone boards arrived.

Go for smoke could be a hobbyist term for theater's "break a leg".

member A : I'm gonna see if that's the power pin.
member B: Go for smoke!
 
Back when I was an ET in the Navy, we would say that it was time to "smoke test it" after we had done some modifications / maintenance on a system.  Basically it meant to power it on and if smoke was generated, then it means that you did not fix the problem or you had screwed up in some other manner.  Either way, it was a bad situation when you consider that you might have a limited number of spare parts or that the nearest replacement could be thousands of miles away.  Sometimes, you would get a problem that would cause some other component to fail.  You did not know that there was a problem with the original component, but the second component failed spectacularly.  So, you would replace that second component and upon supplying power, it would fail again quite spectacularly, especially since you now might have the chassis open.  I remember once on a particular radar indicator where something was causing this PCB filled transformer to overheat.  The tar like substance that was in the transformer would get very liquid with the heat that was generated by the fault and then pop the overpressure plug.  At which point, this very warm low viscosity (because of the heat) would spray all throughout the unit and upon hitting the other components in the unit, it would solidify into basically tar.  Let's just say that this makes a very big mess on a large barrel switch.  We got a couple of cases of trichloroethane  from supply and proceeded to clean as much as we could.  We didn't know about the hazardous nature of that chemical back then, but we sure did end up breathing a lot of it while trying to clean up that unit. :(

https://en.wikipedia.org/wiki/1,1,2-Trichloroethane

Those types of problems are most definitely NOT fun to debug...
Title: Re: Re: How to serial print an array?
Post by: NavyVet1959 on Dec 07, 2018, 02:33 pm
One of yours? (http://articles.latimes.com/1999/oct/01/news/mn-17288)

A friend of mine was a contractor on a PA system for a large metro railway project.
As such, he was subject to railway health and safety legislation, with very strict rules on both alcohol and working hours.
No lunch-time drinks and no stupid all-nighters.


Nope, I had left NASA by that time and moved to greener ($$$) pastures... :)

The problem is not metric vs US measurement systems.  The problem is when one group thinks that one system in supposed to be used and another group thinks that another system should be used.

Our "all-nighters" were all work related.  You have a fixed resource that can be tested with on base and multiple teams needing access to it and they cannot share the systems during those times.  We had test platforms that were pretty close to these system back in our normal development labs, but they were EXACTLY the same and we were sharing them with other groups at the same time.  Eventually, we had to go on base and prove our code worked on a copy of the real system that was used during flight operations.  To do that, we had to schedule test times and sometimes the test times needed to be scheduled with other groups because we needed to prove that our various systems worked together correctly.  As such, you might get a test time from 22:00 to 04:00.  When you live an hour away, finishing up at 04:00 and doing the necessary post-test procedures meant that you would only have enough time to drive home, get cleaned up, change clothes, and drive back.  By sleeping in my office, I could get a couple of hours of sleep before going to the fitness center, getting cleaned up, and starting over.
Title: Re: Re: How to serial print an array?
Post by: GoForSmoke on Dec 07, 2018, 04:51 pm
I lived near a 1920's to present electric trolley system line where changed out PCB oil from transformer stations was used to kill the weeds along the track. We had a high cancer rate in families that gardened within a block of those tracks.