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
necrotic
Aug 2, 2005
I owe my brother big time for this!

xtal posted:

I wait to tell people I use Haskell until it's required

There was no need just now :confused:

Adbot
ADBOT LOVES YOU

VikingofRock
Aug 24, 2008




necrotic posted:

There was no need just now :confused:

The Church of Haskell (purity be upon Him) demanded that post!

brap
Aug 23, 2004

Grimey Drawer
Curry be upon Him.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
In >>= we trust

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

VikingofRock posted:

The Church of Haskell

Not to be confused with Alonzo's Curry

Carbon dioxide
Oct 9, 2012

QuarkJets
Sep 8, 2008

did the fortran logo just get covered up by haskell?

FlapYoJacks
Feb 12, 2009
I see no C++. :colbert:

Absurd Alhazred
Mar 27, 2010

by Athanatos
What the hell is a goth jock? :confused:

Soricidus
Oct 21, 2010
freedom-hating statist shill

Absurd Alhazred posted:

What the hell is a goth jock? :confused:

They sack Rome and shove the senators into lockers

Suspicious Dish
Sep 24, 2011

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

Absurd Alhazred posted:

What the hell is a goth jock? :confused:

http://www.wikihow.com/Be-Joth

Absurd Alhazred
Mar 27, 2010

by Athanatos

WikiHow was a mistake.

Workaday Wizard
Oct 23, 2009

by Pragmatica
How to Be Wrong

VikingofRock
Aug 24, 2008




Absurd Alhazred posted:

WikiHow was a mistake.

We were so preoccupied browsing WikiHow, we never stopped to think if we should browse WikiShould.

Thermopyle
Jul 1, 2003

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


Jokes' on you, anchor tags on SA don't work in Chrome, so that just takes me to your post.

Suspicious Dish
Sep 24, 2011

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

Thermopyle posted:

Jokes' on you, anchor tags on SA don't work in Chrome, so that just takes me to your post.

i'm using Firefox

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

Absurd Alhazred posted:

WikiHow was a mistake.






(courtesy of https://www.reddit.com/r/disneyvacation/top/?sort=top&t=all)

zergstain
Dec 15, 2005

I have to ask, what's that blue and green one in the goth/nerd quadrant?

vOv
Feb 8, 2014

zergstain posted:

I have to ask, what's that blue and green one in the goth/nerd quadrant?

Clojure.

Votlook
Aug 20, 2005

zergstain posted:

I have to ask, what's that blue and green one in the goth/nerd quadrant?

Clojure

feedmegin
Jul 30, 2008


Looks like a tasty Tide pod

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
the question goes: why the gently caress is the art style so... horrifically uniform in wikihow?

Hammerite
Mar 9, 2007

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

Please don't post pics of me at work

dis astranagant
Dec 14, 2006

bob dobbs is dead posted:

the question goes: why the gently caress is the art style so... horrifically uniform in wikihow?

One absurdly prolific low rent artistsweatshop with over 2 million submissions.

Happy Thread
Jul 10, 2005

by Fluffdaddy
Plaster Town Cop

dis astranagant posted:

One absurdly prolific low rent artistsweatshop with over 2 million submissions.

Who pays for it and why???

QuarkJets
Sep 8, 2008

Hammerite posted:

Please don't post pics of me at work

which one of those ladies gave you that nice hat?

CPColin
Sep 9, 2003

Big ol' smile.
Just got tripped up because apparently Groovy's == operator uses compareTo(), if it exists, before trying equals(), which is just as well, because this is what Foo.equals() looks like:

code:
    @Override
    public boolean equals(Object other) {
        boolean result = false;
        if (other instanceof Foo) {
            Foo that = (Foo) other;
            result = (this.id?.equals(that.id) && super.equals(that));
        }
        return result;
    }
Note that the Foo class doesn't explicitly extend anything, so that super.equals(that) call goes to Java's Object.equals() implementation, which returns true iff you pass it the same exact object. So that kind of defeats the purpose of checking the id field first!

Hammerite
Mar 9, 2007

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

QuarkJets posted:

which one of those ladies gave you that nice hat?

I can't remember, I get so much attention it all kind of blurs together. Of course as you can see from the photo they were all super into me

duz
Jul 11, 2005

Come on Ilhan, lets go bag us a shitpost


Dumb Lowtax posted:

Who pays for it and why???

The company that owns wikihow, it's their differentiator. They farm out the artwork to south east Asia. That's why all the drawings are either tracings of stock photos or of people who would look Asian if the drawing skill was better.

Volguus
Mar 3, 2009

CPColin posted:

Just got tripped up because apparently Groovy's == operator uses compareTo(), if it exists, before trying equals(), which is just as well, because this is what Foo.equals() looks like:

code:
    @Override
    public boolean equals(Object other) {
        boolean result = false;
        if (other instanceof Foo) {
            Foo that = (Foo) other;
            result = (this.id?.equals(that.id) && super.equals(that));
        }
        return result;
    }
Note that the Foo class doesn't explicitly extend anything, so that super.equals(that) call goes to Java's Object.equals() implementation, which returns true iff you pass it the same exact object. So that kind of defeats the purpose of checking the id field first!

That's a bad equals implementation. Object pointer comparison should have been done at the start of the method and definitely not included in the id comparison line.

CPColin
Sep 9, 2003

Big ol' smile.

Volguus posted:

That's a bad equals implementation. Object pointer comparison should have been done at the start of the method and definitely not included in the id comparison line.

It also needs to be an OR instead of an AND. Right now, if it's not the exact same object, it'll never be equal, making the rest of the logic pointless. It gets worse:

code:
    @Override
    public boolean equals(Object other) {
        boolean result = false;
        if (other instanceof Bar) {
            Bar that = (Bar) other;
            result = (this.toString().equals(that.toString()) && super.equals(that));
        }
        return result;
    }
This class, at least, has a consistent (although dumb) implementation of hashCode() because it just returns this.toString().hashCode(). Its implementation of compareTo() is still wrong, though, because it compares only one field, while toString() contains all the fields.

Best part is writing unit tests that verify the broken behavior, for now, because it'd be silly to start fixing bugs while writing the initial test coverage of this code!

Edit: I made a utility that verifies compareTo(), equals(), and hashCode() are all consistent with themselves and each other and can't wait to unleash it!

CPColin fucked around with this message at 06:31 on Feb 8, 2018

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
i swear i posted this startup in here before but just

this whole idea. i do not like it

https://stdlib.com/

Winter Stormer
Oct 17, 2012

Suspicious Dish posted:

i swear i posted this startup in here before but just

this whole idea. i do not like it

https://stdlib.com/

I can't even tell what they're trying to sell me, but I'm just a humble country C++ dev

ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen
Finally, a service that will solve my ever-present nagging requirement to, uh, onboard external developers into my ecosystem with a single click!

b0lt
Apr 29, 2005

Suspicious Dish posted:

i swear i posted this startup in here before but just

this whole idea. i do not like it

https://stdlib.com/

left-pad as a service

Qwertycoatl
Dec 31, 2008

https://twitter.com/jckarter/status/961646984070180864

nielsm
Jun 1, 2009



Qwertycoatl posted:

C++ code:
void foo(int a, int b, int c, int d, int e, int f);

void bar(int x) {
    switch (x)
      foo(({case 0:; 0; }),
          ({case 1:; 1; }),
          ({case 2:; 2; }),
          ({case 3:; 3; }),
          ({case 4:; 4; }),
          ({case 5:; 5; }));
}

Why is that syntax legal at all?

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

nielsm posted:

Why is that syntax legal at all?

I sincerely hope it isn't, and that's just a compiler bug. :eng99:

e: As far as I can tell, labels (including case and default) can only appear before a statement, not inside an expression. So it's a bug.

Zopotantor fucked around with this message at 09:56 on Feb 9, 2018

Harik
Sep 9, 2001

From the hard streets of Moscow
First dog to touch the stars


Plaster Town Cop

Zopotantor posted:

I sincerely hope it isn't, and that's just a compiler bug. :eng99:

e: As far as I can tell, labels (including case and default) can only appear before a statement, not inside an expression. So it's a bug.

GCC says "error: switch jumps into statement expression".

How did someone even come up with that?

Adbot
ADBOT LOVES YOU

Qwertycoatl
Dec 31, 2008

Statement expressions are an extension that clang and gcc both support. gcc is sensible enough not to let you jump into one.

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