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
chippy
Aug 16, 2006

OK I DON'T GET IT
It wasn't :(

Adbot
ADBOT LOVES YOU

door.jar
Mar 17, 2010

Likely an acronym for Testing & Assurance or similar that someone hasn't thought through.

feedmegin
Jul 30, 2008

QuarkJets posted:

That's because the terminal that comes with OS X is garbage, whereas most Linux terminals are pretty good by default

Aren't they all terminal emulators technically? A real terminal is, like, a VT220.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Real terminals basically don't exist anymore, so writing "terminal emulator" is a pointless waste of space.

Ego Trip
Aug 28, 2012

A tenacious little mouse!


door.jar posted:

Likely an acronym for Testing & Assurance or similar that someone hasn't thought through.

I thought it through. I even giggled a little.


chippy posted:

It wasn't :(

:( indeed. I'm not an HR person, but I've been told it all comes down to how long you were at prior jobs, what you can say to "Why are you leaving your current position", and how well you can answer the technical questions.

Ego Trip fucked around with this message at 23:10 on May 11, 2014

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Ego Trip posted:

I thought it through. I even giggled a little.

You're bad at jokes.

Doctor w-rw-rw-
Jun 24, 2008

Ego Trip posted:

I thought it through. I even giggled a little.
Think again. Jokes that objectify women are more awkward than funny. And liable to make people feel uncomfortable. At the very least, it makes me feel uncomfortable.

It's all in good fun for yourself if you're not sensitive to that kind of joke, but many men and women alike are affected by it, and just won't speak up about it. So it's actually not all in good fun.

(USER WAS PUT ON PROBATION FOR THIS POST)

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Also, the original meaning of the acronym wasn't clear.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
"T&A" has stood for "testing and acceptance" in many contexts for years. If you google the acronym, it's on the first page of results - in fact, it would have been quicker for you to google the acronym to find the allegedly unclear meaning than it was to reply with high dudgeon as you did. But by all means poo poo up the thread with the same derail for the fifth time in a month!

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I did, actually. It's not on the first page for me, nor is it on the next page after that.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
I'm sorry your google-fu is weak - try the string "define t&a" and it will come up under the 4th result on the first page, or "t&a acronym" and it will come up under the second result on the first page :)

e: oddly enough, DDG gives a surgical procedure as the first result. I had no idea tonsillectomies & adenoidectomies were usually performed together :monocle:

Doctor w-rw-rw-
Jun 24, 2008

Otto Skorzeny posted:

I'm sorry your google-fu is weak

Google changes results based on location, language, and what it knows about you. I searched for something but since I'm in Japan at the moment I had to change google.co.jp to google.com and the various language parameters to find something simple. It simply didn't come up.

Dicky B
Mar 23, 2004

I like how you idiots bothered to google it but not just read the discussion you were replying to where chippy clearly writes "I used to be in testing and test automation".

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
Derail aside, I'm looking at a document now that some smug prick has sent my boss where he says "I've written code and an outline of further code that needs to be copied into the library for this project; please just type the letters into the screen as I've basically done everything for you".

Except (and this is PHP so maybe that's a decent clue as to what you can expect):

The class is just a container to hold 4 private properties called by getters/setters.
The class has no other methods or instantiation procedures.
The 'programmer' has provided us with 2 functions, called "getHoursSpent" and "getHoursRemaining", of which:

1. 3 out of the 4 parameters in the first function actually refer to data/filters that do not exist (and have not been requested to exist) anywhere in the existing project;
2. The first function "getHoursSpent" instantiates the class, calculates all the values for the 4 properties and assigns them (including hours spent and hours remaining), and returns the object with that data inside it;
3. The second function "getHoursRemaining" does the exact same thing, but with only 1 out of 2 parameters expecting data that doesn't exist; and
4. All values default to null, and I have absolutely no indication that he has considered error handling or whatever the gently caress on his end, and he hasn't requested any.

I might remind you that the functions, as described, exist outside the class. They're not in the class constructor. They are literally two differently-named functions that at the end of the day take the exact same parameter, calculate values, and then return the exact same object which contains 4 values, only one of which a reasonable person would expect to receive (according to the function name).

But we gotta keep the client happy, so I'm going to write this bat poo poo insane worthlessness based on their "IT Expert"'s instructions.

I feel like someone as new to this as I am should not have to confront this level of stupidity several times a day from people who have been doing this for years.

:psyduck:

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Sulla-Marius 88 posted:

I feel like someone as new to this as I am should not have to confront this level of stupidity several times a day from people who have been doing this for years.

Welcome to the world of professional programming. If you're good, you develop a bullshit spidey-sense that will start tingling when something is done in a really dumb way. If the person who did the dumb thing can't convincingly explain their rationale for taking that approach, that's a bad thing.

Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
The trouble is that they keep dragging you down to their level. There aren't enough (or any?) intelligent, competent managers in the world, so inevitably your choices are:

1. Tell them it's stupid and you'll do it a better way that they don't understand so you get passed over for the tender and they move to someone willing to say 'sure that sounds clever, I'll work within the confines of your existing insanity',
2. You tell them it needs to be redone to not be secretly broken, and quote them a time requirement that gets you passed over for the tender,
3. You tell them you'll do it and secretly fix it as you go, then blow out on time (or run afoul by accidentally fixing a major bug they've habituated into a 'feature') and they unleash the dogs on you for being incompetent, or
4. You agree to code it within the boundaries of their insanity and hope to god they wait til you're paid before they hit any of the 25+ fatal bugs you could have pointed out on day one -- and then you're stuck getting frantic calls at 4am Sunday morning for the rest of your life because "that code you wrote is broken again!".

e: And through all this you're stuck working with the other fools they managed to scrape together and simple emails asking for the location or definition of a simple function/variable/whatever have to get passed through fifteen different email inboxes before someone forwards you back a response saying that they didn't understand the question and you'll have to arrange a 4-hour meeting during which time you find out they know nothing about their own systems anyway so you might as well have just done it from the start, thrown it at them, and said "call me when it breaks".

Sulla Faex fucked around with this message at 15:26 on May 12, 2014

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

TinySSH posted:

easy auditable - TinySSH has less than 100000 words of code
reusing code - TinySSH is reusing build mechanism from NaCl and libraries from CurveCP implementation
no dependency on OpenSSL - TinySSH is using NaCl / TweetNaCl
Admirable ideas. Let's take a look at this easily auditable code.
C code:
sv unpack25519(gf o, const u8 *n)
{
  int i;
  FOR(i,16) o[i]=n[2*i]+((i64)n[2*i+1]<<8);
  o[15]&=0x7fff;
}

sv A(gf o,const gf a,const gf b)
{
  int i;
  FOR(i,16) o[i]=a[i]+b[i];
}

sv Z(gf o,const gf a,const gf b)
{
  int i;
  FOR(i,16) o[i]=a[i]-b[i];
}

sv M(gf o,const gf a,const gf b)
{
  i64 i,j,t[31];
  FOR(i,31) t[i]=0;
  FOR(i,16) FOR(j,16) t[i+j]+=a[i]*b[j];
  FOR(i,15) t[i]+=38*t[i+16];
  FOR(i,16) o[i]=t[i];
  car25519(o);
  car25519(o);
}

sv S(gf o,const gf a)
{
  M(o,a,a);
}

sv inv25519(gf o,const gf i)
{
  gf c;
  int a;
  FOR(a,16) c[a]=i[a];
  for(a=253;a>=0;a--) {
    S(c,c);
    if(a!=2&&a!=4) M(c,c,i);
  }
  FOR(a,16) o[a]=c[a];
}

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Aleksei Vasiliev posted:

Admirable ideas. Let's take a look at this easily auditable code.
C code:
sv unpack25519(gf o, const u8 *n)
{
  int i;
  FOR(i,16) o[i]=n[2*i]+((i64)n[2*i+1]<<8);
  o[15]&=0x7fff;
}

...

So I assume FOR is a macro that looks something like

code:
#define FOR(var,limit) for (var = 0; var < limit; ++var)

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Has that poo poo been passed through a minifier or something?

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Hammerite posted:

So I assume FOR is a macro that looks something like

code:
#define FOR(var,limit) for (var = 0; var < limit; ++var)
It's #define FOR(i,n) for (i = 0;i < n;++i), yeah.
Source is available http://tinyssh.org/install.html in the bz2 if you want to look at it. What I posted is from crypto.c

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
Reminds me of a less extreme version of the way J is implemented. Here's a random excerpt:

code:
#include "j.h"


static F1(jtinvamp);

static B ip(A w,C c,C d){A f,g;V*v;
 v=VAV(w); f=v->f; g=v->g;
 R CSLASH==ID(f)&&c==ID(VAV(f)->f)&&d==ID(g);
}

static B consf(A w){A f;C c;
 c=ID(w);
 if(c==CFCONS||c==CQQ&&(f=VAV(w)->f,NOUN&AT(f)))R 1;
 R 0;
}    /* 1 iff w is a constant function */

static F2(jtfong){A f;C c;V*v;
 RZ(a&&w);
 v=VAV(a); c=v->id; f=v->f;
 R c==CRIGHT ? w : c==CFORK&&(NOUN&AT(f)||CCAP==ID(f)) ? folk(f,v->g,fong(v->h,w)) : folk(ds(CCAP),a,w);
}    /* [: f g  with simplifications */

static F1(jtinvfork){A f,fi,g,gi,h,k;B b,c;V*v;
 RZ(w);
 v=VAV(w); RZ(f=unname(v->f)); g=v->g; RZ(h=unname(v->h));
 if(CCAP==ID(f))R fong(inv(h),inv(g));
 c=1&&NOUN&AT(f); b=c||consf(f);
 ASSERT(b!=consf(h),EVDOMAIN);
 RZ(k=c?f:df1(zero,b?f:h));
 RZ(gi=inv(b?amp(k,g):amp(g,k)));
 RZ(fi=inv(b?h:f));
 if(CAMP==ID(gi)){
  v=VAV(gi); 
  if     (NOUN&AT(v->f))RZ(gi=folk(v->f,     v->g, ds(CRIGHT)))
  else if(NOUN&AT(v->g))RZ(gi=folk(v->g,swap(v->f),ds(CRIGHT)));
 }
 R fong(fi,gi);
}
If you want a fun way to pass an afternoon, try teasing this apart. The scary part is that it starts to make a lot of sense once you've spent enough time staring at it.

return0
Apr 11, 2007

Otto Skorzeny posted:

I'm sorry your google-fu is weak - try the string "define t&a" and it will come up under the 4th result on the first page, or "t&a acronym" and it will come up under the second result on the first page :)

e: oddly enough, DDG gives a surgical procedure as the first result. I had no idea tonsillectomies & adenoidectomies were usually performed together :monocle:

Google for "define t&a" just brings up stuff about tits for me, and I search for technical things a lot, I think you are not correct.

MrMoo
Sep 14, 2000

The KDB developer produces even more terse code. You need many levels of mental problems to work with that.

http://code.kx.com/wiki/Cookbook/InterfacingWithC

MrMoo fucked around with this message at 19:18 on May 12, 2014

Athas
Aug 6, 2007

fuck that joker

Aleksei Vasiliev posted:

Admirable ideas. Let's take a look at this easily auditable code.
C code:
sv unpack25519(gf o, const u8 *n)
{
  int i;
  FOR(i,16) o[i]=n[2*i]+((i64)n[2*i+1]<<8);
  o[15]&=0x7fff;
}

sv A(gf o,const gf a,const gf b)
{
  int i;
  FOR(i,16) o[i]=a[i]+b[i];
}

sv Z(gf o,const gf a,const gf b)
{
  int i;
  FOR(i,16) o[i]=a[i]-b[i];
}

sv M(gf o,const gf a,const gf b)
{
  i64 i,j,t[31];
  FOR(i,31) t[i]=0;
  FOR(i,16) FOR(j,16) t[i+j]+=a[i]*b[j];
  FOR(i,15) t[i]+=38*t[i+16];
  FOR(i,16) o[i]=t[i];
  car25519(o);
  car25519(o);
}

sv S(gf o,const gf a)
{
  M(o,a,a);
}

sv inv25519(gf o,const gf i)
{
  gf c;
  int a;
  FOR(a,16) c[a]=i[a];
  for(a=253;a>=0;a--) {
    S(c,c);
    if(a!=2&&a!=4) M(c,c,i);
  }
  FOR(a,16) o[a]=c[a];
}

My guess is that these names correspond to procedures in some paper. Anyway, I do not find this hard to read - each function is small and self-contained, and can be audited in isolation.

Edit: For example, the point of the FOR macro is most likely to make it completely clear that the loop is executed an input-insensitive number of times, to eliminate timing attacks.

JawnV6
Jul 4, 2004

So hot ...
Yeah, and it's utterly impossible for any bug to be lurking somewhere between dense 1-line mathematical functions and a higher-level spec composing dozens of them for the simplest possible transaction.

Athas
Aug 6, 2007

fuck that joker

JawnV6 posted:

Yeah, and it's utterly impossible for any bug to be lurking somewhere between dense 1-line mathematical functions and a higher-level spec composing dozens of them for the simplest possible transaction.

No, but it may be easier for an auditor to ensure that he understands the interactions perfectly. I'm not claiming that anyone should write code this way, just that there's rhyme to the reason for some cases. Is everything in TinySSH written like this?

qntm
Jun 17, 2009
I like how the complete absence of comments leaves this intent and purpose of this code almost entirely up to personal interpretation. This is something that I've been missing from software development until now.

Hammerite
Mar 9, 2007

And you don't remember what I said here, either, but it was pompous and stupid.
Jade Ear Joe

Aleksei Vasiliev posted:

Admirable ideas. Let's take a look at this easily auditable code.
C code:
...

sv inv25519(gf o,const gf i)
{
  gf c;
  int a;
  FOR(a,16) c[a]=i[a];
  for(a=253;a>=0;a--) {
    S(c,c);
    if(a!=2&&a!=4) M(c,c,i);
  }
  FOR(a,16) o[a]=c[a];
}

I just noticed the for(a=253;...)

Powers of 2 (or 2^n - 1) is one thing, but magic constants like that seem pretty hard to justify.

Why is it so deathly important that it be under a certain number of words of source code, anyway?

JawnV6
Jul 4, 2004

So hot ...

Athas posted:

No, but it may be easier for an auditor to ensure that he understands the interactions perfectly. I'm not claiming that anyone should write code this way, just that there's rhyme to the reason for some cases. Is everything in TinySSH written like this?
I generally don't go searching for reasons to back up lovely code. I've seen the same "translated from a math paper" type of code and even then it's best to have some shred of evidence that's what it is rather than just hope for it. I'm sure I'm just too frickin' dumb to know why M(c,c,c) is followed up by M(c,c,i) in all but 2 cases iterating from 253 down to 0.

vOv
Feb 8, 2014

Even if you're translating math direct into code it seems like it'd be best to, you know, comment what the code is doing. Like I'm guessing that inv25519 inverts a point in an elliptic cryptography curve but it'd be nice to actually know that that's what it does.

Polio Vax Scene
Apr 5, 2009



Bytes are at a premium these days, you can't be wasting them on comments! Why, I bought a couple kilobytes from the Cloud a couple decades ago and now they're worth millions!

NFX
Jun 2, 2008

Fun Shoe
code:
//I'mallergictowhitespace.

Deus Rex
Mar 5, 2005

You can't waste space for comments on some platforms anyway: http://www.espruino.com/Performance

quote:

ESPRUINO EXECUTES CODE DIRECTLY FROM SOURCE

So source code size affects code execution speed.

On the Espruino board a simple loop will create roughly a 4kHz square wave (so 4000 iterations of the loop per second) using code like this:

JavaScript code:
while (1) {A0.set();A0.reset();}
While code like this will toggle a pin at around 3.5kHz.

JavaScript code:
while (1) { A0.set();                 A0.reset();               }
This applies equally to comments - so it pays to keep comments above or below a function declaration, not inside it.

Sinestro
Oct 31, 2010

The perfect day needs the perfect set of wheels.

Deus Rex posted:

You can't waste space for comments on some platforms anyway: http://www.espruino.com/Performance

Holy gently caress everything I read on that website is a new fountain of horrors. :allears:

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Deus Rex posted:

You can't waste space for comments on some platforms anyway: http://www.espruino.com/Performance

So post-process with a compiler (minimizer), like every other case where you want to write in something more comfortable than the machine understands directly. The advice on that page makes me hurty.

Spatial
Nov 15, 2007

Deus Rex posted:

You can't waste space for comments on some platforms anyway: http://www.espruino.com/Performance
Wow! Just a little faster and it will be comparable to ENIAC, created in 1946.

Jewel
May 2, 2009

Code Examples -> Breadboard

Cool code :)

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Subjunctive posted:

So post-process with a compiler (minimizer), like every other case where you want to write in something more comfortable than the machine understands directly. The advice on that page makes me hurty.

I'm not sure the "JavaScript is suitable for embedded systems" crowd will be terribly receptive to suggestions that add more steps to the build.

Just a guess.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

pokeyman posted:

I'm not sure the "JavaScript is suitable for embedded systems" crowd will be terribly receptive to suggestions that add more steps to the build.

Just a guess.

Can't talk, busy connecting the DOM Inspector to my logic analyzer.

Adbot
ADBOT LOVES YOU

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I'm the terrible timing bugs caused by code refactoring.

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