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
Look Around You
Jan 19, 2009

No Safe Word posted:

This is the deleted post:



Note that two folks have voted to undelete the post

"I think you're violating several man rules as well." :raise:

I don't even know what to say about that, other than that it seems pretty sexist. I certainly wasn't aware that there were any specific rules I had to follow as a man, maybe there's a rulebook somewhere? :confused:

Adbot
ADBOT LOVES YOU

The Gripper
Sep 14, 2004
i am winner

Look Around You posted:

"I think you're violating several man rules as well." :raise:

I don't even know what to say about that, other than that it seems pretty sexist. I certainly wasn't aware that there were any specific rules I had to follow as a man, maybe there's a rulebook somewhere? :confused:
Really? The latest edition of the man code is titled "Don't contact your ex on Valentines day" and the subtitle is "p.s. why are you asking nerds on stackoverflow for relationship help".

Bunny Cuddlin
Dec 12, 2004

Look Around You posted:

"I think you're violating several man rules as well." :raise:

I don't even know what to say about that, other than that it seems pretty sexist. I certainly wasn't aware that there were any specific rules I had to follow as a man, maybe there's a rulebook somewhere? :confused:

GOOD TAKEAWAY FROM THAT, YOU SOUND LIKE A FUN GUY

Hughlander
May 11, 2005

Look Around You posted:

"I think you're violating several man rules as well." :raise:

I don't even know what to say about that, other than that it seems pretty sexist. I certainly wasn't aware that there were any specific rules I had to follow as a man, maybe there's a rulebook somewhere? :confused:

I believe this is what it's referring to http://www.amazon.com/Bro-Code-Barney-Stinson/dp/1442339586

To take it full circle, I'd love to see a version about Brogrammers literally writing Bro-Code.

Dicky B
Mar 23, 2004

brolang.

code:
yo
come at me stdio
shout out "Hello, world!"
cool story bro

Hammerite
Mar 9, 2007

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

Dicky B posted:

brolang.

code:
yo
come at me stdio
shout out "Hello, world!"
cool story bro

I hope you realise that now that you've posted that, someone is most likely going to do it. I guess at least it probably won't be as bad as LOLcode.

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
It is unfortunate that such gag languages are almost always sugar for essentially ALGOL semantics. Couldn't brogrammers brogram in a functional or declarative style? Is a little creativity so much to ask for in my extended jokes?

edit: presumably a brolang would never feature something like s-expressions. Despite an enticing name, you cannot say "homoiconicity" without "homo".

Internet Janitor fucked around with this message at 17:37 on Feb 10, 2013

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Internet Janitor posted:

It is unfortunate that such gag languages are almost always sugar for essentially ALGOL semantics. Couldn't brogrammers brogram in a functional or declarative style? Is a little creativity so much to ask for in my extended jokes?

edit: presumably a brolang would never feature something like s-expressions. Despite an enticing name, you cannot say "homoiconicity" without "homo".

BroseF, the F is for "functional"

Opinion Haver
Apr 9, 2007

Internet Janitor posted:

It is unfortunate that such gag languages are almost always sugar for essentially ALGOL semantics. Couldn't brogrammers brogram in a functional or declarative style? Is a little creativity so much to ask for in my extended jokes?

edit: presumably a brolang would never feature something like s-expressions. Despite an enticing name, you cannot say "homoiconicity" without "homo".

Yeah, we need some bronads up in here.

kitten smoothie
Dec 29, 2001

What's the best alternative to HN, at least where I can find the few gems of good knowledge without the useless startup circlejerk?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

kitten smoothie posted:

What's the best alternative to HN, at least where I can find the few gems of good knowledge without the useless startup circlejerk?
/r/programming/ gets pretty much the exact same submissions as HN (since anything that makes it to the front page of one will be submitted by karma whores to the other), but with a much narrower focus. The comments are still pretty hit-or-miss, of course.

pseudorandom name
May 6, 2007

Is there a site like /r/programming except "Check out this amazing C feature!" with a link to the atexit() man page doesn't get 300 upvotes?

Doctor w-rw-rw-
Jun 24, 2008

pseudorandom name posted:

Is there a site like /r/programming except "Check out this amazing C feature!" with a link to the atexit() man page doesn't get 300 upvotes?

To be fair, I hadn't heard of atexit(), though I was aware of Java's equivalent.

Damiya
Jul 3, 2012
words

Damiya fucked around with this message at 20:34 on Feb 10, 2013

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

pseudorandom name posted:

Is there a site like /r/programming except "Check out this amazing C feature!" with a link to the atexit() man page doesn't get 300 upvotes?
You'll have to start a new link aggregator every year or so to have 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 think we also forget that HN wasn't very good to begin with, nor proggit, nor *shudder* slashdot

Tei
Feb 19, 2011
Probation
Can't post for 4 days!
I fail to understand what is so interesting about atexit. Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

C is old as poo poo, and surely, there's some weird crap in it, from the old days.

You are not forced to use that stuff, ...like in any programming language, "you can use the good parts" .

Steve French
Sep 8, 2003

Tei posted:

Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

what

Suspicious Dish
Sep 24, 2011

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

Tei posted:

Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

Sure, why not.

KaneTW
Dec 2, 2011

Tei posted:

I fail to understand what is so interesting about atexit. Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

C is old as poo poo, and surely, there's some weird crap in it, from the old days.

You are not forced to use that stuff, ...like in any programming language, "you can use the good parts" .
Looks like your brain segfaulted there.

Optimus Prime Ribs
Jul 25, 2007

Tei posted:

Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

This is like the programming equivalent of "Has anyone really been far even as decided to use even go want to do look more like?".

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

Tei posted:

It's like somebody in the C language design committee thought basic error handling is important enough to embed into the compiler initialization code, or something.
This is what I got out of it.

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
The Cavern of Cobol is yacc and we've failed to parse this undecidable grammar

Lorem ipsum
Sep 25, 2007
IF I REPORT SOMETHING, BAN ME.

Tei posted:

I fail to understand what is so interesting about atexit. Is like somebody in the c language design trough basic error handling it something worth enough to embed in the compiler initialization code, or something.

Trough error handling actually sounds like a neat feature.

kitten smoothie
Dec 29, 2001

pseudorandom name posted:

Is there a site like /r/programming except "Check out this amazing C feature!" with a link to the atexit() man page doesn't get 300 upvotes?

I'm happily willing to accept that, as it's still far preferable to poo poo like this ("I am a minimalist! I get my shirts tailored! I buy Apple!") or the 374th Aaron Swartz related article.

Opinion Haver
Apr 9, 2007

kitten smoothie posted:

I'm happily willing to accept that, as it's still far preferable to poo poo like this ("I am a minimalist! I get my shirts tailored! I buy Apple!") or the 374th Aaron Swartz related article.

quote:

I tend to refrain from telling people how much TV I don't watch until they ask about a show or commercial they have seen or are following and wonder if I follow.
Please don't downvote me but what's that saying again?...
"Great minds discuss ideas; average minds discuss events; small minds discuss people."
I would place discussing TV shows / commercials, unless they spark discussion about ideas (like "that's an awesome marketing strategy/use of psychology" or "do you think the world could really be headed towards that scenario?"), somewhere between average and small minds.

:smug:

Bunny Cuddlin
Dec 12, 2004

lmao at his inadvertent admission that his understanding of economics hasn't changed since he was 11 and the blinding irony of the fact that the privilege he wails an apology about is what has kept it that way

That Turkey Story
Mar 30, 2003

kitten smoothie posted:

I'm happily willing to accept that, as it's still far preferable to poo poo like this ("I am a minimalist! I get my shirts tailored! I buy Apple!")

Haha, oh god.

Edit: I think I have an immediate disdain for anyone who describes himself as having "a knack for aesthetics."

That Turkey Story fucked around with this message at 16:44 on Feb 11, 2013

nielsm
Jun 1, 2009



Let's complain about PHP some more.

Today's frustration: The value false converts to the empty string.
We are serializing some arrays to XML to send over network. Another PHP thing is then reading it back in. So I put a false into one of those arrays, and because false converts to the empty string I get an empty element in the XML. When that gets deserialized again, it becomes an "empty element" object instead, since it contains no text nodes. And this "empty element" object evaluates as truth.
Thus, by the combined powers of PHP and XML even pure falsehood can become truth.
:cry:

(Solution: Send 0 instead of false.)

Strong Sauce
Jul 2, 2003

You know I am not really your father.





People have taken that picture of Steve Jobs sitting on his floor sipping on tea next to a lamp to the extremes. If I recall from his book Jobs not having any furniture in his house was a combination of being really lazy/indecisive and the fact that he was obsessed with having the best furniture (but there isn't any because none of it is good enough for him).

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine

nielsm posted:

And this "empty element" object evaluates as truth.

I feel like this is the core of the horror. A SimpleXML object created from an empty tag will evaluate as false, but I believe that is the only modern situation in which an object can ever be false.

Tei
Feb 19, 2011
Probation
Can't post for 4 days!

nielsm posted:

Let's complain about PHP some more.

Today's frustration: The value false converts to the empty string.
We are serializing some arrays to XML to send over network. Another PHP thing is then reading it back in. So I put a false into one of those arrays, and because false converts to the empty string I get an empty element in the XML. When that gets deserialized again, it becomes an "empty element" object instead, since it contains no text nodes. And this "empty element" object evaluates as truth.
Thus, by the combined powers of PHP and XML even pure falsehood can become truth.
:cry:

(Solution: Send 0 instead of false.)

Maybe you know why a 19 year old can buy a 6 dollars beer with only 1 dollar?

php:
<?
$age =  19;
$limit = 18;
$is_milk = false;
$price = 6;//beer price
$money = 1; //the money he have

$can_pay_it = $money > $price;

$can_drink = ($age > $limit or $is_milk ) and $can_pay_it;


echo $can_drink ? "can drink":"no beer for you";
?>

biochemist
Jun 2, 2005

Who says we don't have backbone?

Tei posted:

Maybe you know why a 19 year old can buy a 6 dollars beer with only 1 dollar?

php:
<?
$age =  19;
$limit = 18;
$is_milk = false;
$price = 6;//beer price
$money = 1; //the money he have

$can_pay_it = $money > $price;

$can_drink = ($age > $limit or $is_milk ) and $can_pay_it;


echo $can_drink ? "can drink":"no beer for you";
?>

That's frustrating. Do you need to assign a value of 0 in a logical statement or something rather than assign it the way you're doing it? eg. If $money < $price then $can_pay_it = 0 ?

nielsm
Jun 1, 2009



Tei posted:

Maybe you know why a 19 year old can buy a 6 dollars beer with only 1 dollar?

php:
<?
$age =  19;
$limit = 18;
$is_milk = false;
$price = 6;//beer price
$money = 1; //the money he have

$can_pay_it = $money > $price;

$can_drink = ($age > $limit or $is_milk ) and $can_pay_it;


echo $can_drink ? "can drink":"no beer for you";
?>

I believe that the "and" operator binds weaker than the assignment operator, so it parses as:
($can_drink = ($age > $limit or $is_milk)) and $can_pay_it;
You should use the "&&" operator there instead. (It does the same thing, but has different precedence.) Same thing for "or" and "||".

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

nielsm posted:

I believe that the "and" operator binds weaker than the assignment operator, so it parses as:
($can_drink = ($age > $limit or $is_milk)) and $can_pay_it;
You should use the "&&" operator there instead. (It does the same thing, but has different precedence.) Same thing for "or" and "||".

In the good old days, if you mowed down someone in the street while driving drunk, the drunkenness could serve as a defense in court - "he's not a murderer your honor, he was just really, really drunk!"

Enos Shenk
Nov 3, 2011


So after reading this thread for a bit, I thought I'd root around on my backup drive for a bit. I remembered seeing an old mIRC bot I wrote sitting in a dusty corner of the drive.

I wrote this thing back in 1997 or so, when I was a clueless teenager. I know mIRC scripting isn't much of programming, but it was my first foray into it. You don't need to know a thing about the syntax to realize why this is atrocious.

code:
#poopoo on
on 1:TEXT:*:?:{
  set %dothingy $read $mircdir\texts\randbin.txt
  set %thingthingthing $nick
  echo -a msg -> $nick %dothingy
  if %echo == 1 { timer 1 4 msg %relay -- Msg -> %thingthingthing %dothingy }
  msg $nick %dothingy
  timer 1 8 /enable #poopoo
  disable #poopoo
}
#poopoo end
I'm pretty sure I used to name all my variables like that back then...

The Gripper
Sep 14, 2004
i am winner

Enos Shenk posted:

I'm pretty sure I used to name all my variables like that back then...
I submitted this to our internal bugtracker as part of a repro for a toolchain bug, only remembered I'd named everything in the stupidest possible way after I'd hit submit.
C++ code:
extern "C" {
	__declspec(dllexport) void dongs(int x) { printf("hi"); }	
}

class Penis {
	private:
		std::string dongs;
		int craps;
...
	Penis* r = new Penis("arse", 1);
This was under 20 minutes ago.

The Gripper fucked around with this message at 21:38 on Feb 11, 2013

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

The Gripper posted:

I submitted this to our internal bugtracker as part of a repro for a toolchain bug, only remembered I'd named everything in the stupidest possible way after I'd hit submit.

This was under 20 minutes ago.



nielsm posted:

I believe that the "and" operator binds weaker than the assignment operator, so it parses as:
($can_drink = ($age > $limit or $is_milk)) and $can_pay_it;
You should use the "&&" operator there instead. (It does the same thing, but has different precedence.) Same thing for "or" and "||".

:psyduck: ....just why.

Are there other languages where assignment isn't lowest precedence in a given expression? Or at least where && ≠ 'and'? It's at least not the case in Python. The precedence is documented in PHP but not justified (as far as I can tell).

ultramiraculous fucked around with this message at 21:49 on Feb 11, 2013

Opinion Haver
Apr 9, 2007

ultramiraculous posted:

:psyduck: ....just why.

Are there other languages where assignment isn't lowest precedence in a given expression? Or at least where && ≠ 'and'? It's documented in PHP but not justified (as far as I can tell).

Perl. The reason and binds weaker than assignment is so you can do something like

code:
$result = foo() or die "what the gently caress?\n"
# which is equivalent to
($result = foo()) or (die "what the gently caress?\n")
(which will evaluate foo(), store it in $result, and then fatally exit if that value is false-y) and they decided to make 'and' have similar precedence.

Adbot
ADBOT LOVES YOU

Bunny Cuddlin
Dec 12, 2004
code:
fields = line.Split('-').ToDictionary(x => x.Split(':')[0].ToString(), y => new Field(y.Split(':')[0].ToString(), y.Split(':')[1])));
:haw:

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