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
Catalyst-proof
May 11, 2011

better waste some time with you
I mean sure, but I kind of feel like once you reach a certain point as a programmer, you realize that you could either religiously memorize the non-transitive points of equality in your programming language, or you could... find a language that does the work it's supposed to, while you do the work you're supposed to. Gah, I don't know.

Adbot
ADBOT LOVES YOU

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

Janin posted:

I never get tired of posting this.



:toot: and :hf: to tef


ps I'm not sure what you meant earlier when you said 'elided' braces. Elision is the omission of one or more sounds in a word such that it's easier for the speaker to pronounce. I'm not sure what the analog to this with regards to braces would be - maybe something like
code:
if (foo())
    bar();
?

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
I can sorta understand 0 == null and "" == null but "php" == 0 is :wtf:.

Someone explain that to me.

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

MEAT TREAT posted:

I can sorta understand 0 == null and "" == null but "php" == 0 is :wtf:.

Someone explain that to me.

When one operand is a string and the other is an integer, it juggles the string to a number for comparison. If the string begins with numeric data (optional sign, number, optional exponent), it evaluates as that number. Otherwise, it evaluates as 0.

From PHP.net:
php:
<?
$foo = 1 + "10.5";                // $foo is float (11.5)
$foo = 1 + "-1.3e3";              // $foo is float (-1299)
$foo = 1 + "bob-1.3e3";           // $foo is integer (1)
$foo = 1 + "bob3";                // $foo is integer (1)
$foo = 1 + "10 Small Pigs";       // $foo is integer (11)
$foo = 4 + "10.2 Little Piggies"; // $foo is float (14.2)
$foo = "10.0 pigs " + 1;          // $foo is float (11)
$foo = "10.0 pigs " + 1.0;        // $foo is float (11)  
?>

Golbez fucked around with this message at 22:18 on May 10, 2012

Strong Sauce
Jul 2, 2003

You know I am not really your father.





I would say I'm pretty well seasoned in PHP, but 1) I never knew == was not transitive and 2) I never knew "php" == 0 is true, which is probably why I assumed == would be transitive.

Man, that is truly horrible.

tef
May 30, 2004

-> some l-system crap ->

Golbez posted:

** Most people simply go for /[^A-Za-z ]/, without realizing the single space part of the instructions.

unicode :eng99:


Otto Skorzeny posted:

:toot: and :hf: to tef

:toot:

tef fucked around with this message at 22:50 on May 10, 2012

ToxicFrog
Apr 26, 2008


Otto Skorzeny posted:

ps I'm not sure what you meant earlier when you said 'elided' braces. Elision is the omission of one or more sounds in a word such that it's easier for the speaker to pronounce. I'm not sure what the analog to this with regards to braces would be - maybe something like
code:
if (foo())
    bar();
?

Yes.

tef posted:


What happened to your old avatar? I liked that one.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Otto Skorzeny posted:

:toot: and :hf: to tef


ps I'm not sure what you meant earlier when you said 'elided' braces. Elision is the omission of one or more sounds in a word such that it's easier for the speaker to pronounce. I'm not sure what the analog to this with regards to braces would be - maybe something like
code:
if (foo())
    bar();
?

In the JVM there is the concept of lock elision where if the JVM detects it can remove a lock it will do so

Zhentar
Sep 28, 2003

Brilliant Master Genius

Zamujasa posted:

Besides, I can't help but think that localization issues might cause problems, too. Does it always use "days"? (Then again, PHP in general seems to barf all over localization formatting.)

If it's localization you're worried about, you already got yourself into trouble earlier...

Zamujasa posted:

The documentation says 0 == Sunday and 6 == Saturday.

A number of countries (mostly in the Middle East) consider the weekend to be Friday and Saturday, and some consider it Thursday and Friday.

tef
May 30, 2004

-> some l-system crap ->

ToxicFrog posted:

What happened to your old avatar? I liked that one.

So did I :smith:

Some ie9 user got butthurt that my avatar crashes/slows down their browser

raminasi
Jan 25, 2005

a last drink with no ice
Does anyone know anything about Modelica? Because I'm in a training seminar and it's looking like Modelica inheritance exists as a shorthand for composition rather than as a facility for any sort of substitutability semantics. Is that a horror? It feels like one.

Zamujasa
Oct 27, 2010



Bread Liar

Zhentar posted:

If it's localization you're worried about, you already got yourself into trouble earlier...


A number of countries (mostly in the Middle East) consider the weekend to be Friday and Saturday, and some consider it Thursday and Friday.

I was operating under the assumption that getdate() always returned the same values (being numerical), while text-based functions like strtotime() and date() would be localized.

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde

MEAT TREAT posted:

"php" == 0 is :wtf:.

Someone explain that to me.
It follows the tradition of Microsoft BASIC and Perl so there's nothing to explain. :smug:

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"

Otto Skorzeny posted:

ps I'm not sure what you meant earlier when you said 'elided' braces. Elision is the omission of one or more sounds in a word such that it's easier for the speaker to pronounce. I'm not sure what the analog to this with regards to braces would be - maybe something like
code:
if (foo())
    bar();
?
exactly

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
Ps i love performing strength reduction when my crappy compiler won't it just brightens my day so much!

narbsy
Jun 2, 2007
Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP

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.

narbsy posted:

Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP

What the gently caress?

Opinion Haver
Apr 9, 2007

Semantically significant comments. Hell loving yes.

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.

yaoi prophet posted:

Semantically significant comments. Hell loving yes.

I like how you actually have to 'compile' your php code if you use that framework. Just what php needs.

pseudorandom name
May 6, 2007

Which of course raises the question, why have the directives in the comments?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Extending the syntax generally breaks IDEs and such.

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

Plorkyeran posted:

Extending the syntax generally breaks IDEs and such.

Hello attributes/annotations, nice to meet you!

hobbesmaster
Jan 28, 2008

Plorkyeran posted:

Extending the syntax generally breaks IDEs and such.

As a C++ programmer I would argue that thats half fun!

:smithicide:

Captain Capacitor
Jan 21, 2008

The code you say?

tef posted:

So did I :smith:

Some ie9 user got butthurt that my avatar crashes/slows down their browser



Break all the browsers!

Suspicious Dish
Sep 24, 2011

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

narbsy posted:

Not to jump on the PHP bandwagon, but: Aspect Oriented Programming in PHP

I wonder when colleges will start offering Underwater Aspect Weaving.

Goat Bastard
Oct 20, 2004

Golbez posted:

When one operand is a string and the other is an integer, it juggles the string to a number for comparison. If the string begins with numeric data (optional sign, number, optional exponent), it evaluates as that number. Otherwise, it evaluates as 0.

From PHP.net:
php:
<?
$foo = 1 + "10.5";                // $foo is float (11.5)
$foo = 1 + "-1.3e3";              // $foo is float (-1299)
$foo = 1 + "bob-1.3e3";           // $foo is integer (1)
$foo = 1 + "bob3";                // $foo is integer (1)
$foo = 1 + "10 Small Pigs";       // $foo is integer (11)
$foo = 4 + "10.2 Little Piggies"; // $foo is float (14.2)
$foo = "10.0 pigs " + 1;          // $foo is float (11)
$foo = "10.0 pigs " + 1.0;        // $foo is float (11)  
?>

just saying

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



A horror by mine own hand:

code:

void contConcHelper(int level, NSString *inLine, NSString **outInitial, NSArray **outSubLines) {
  NSMutableArray *lines = [[inLine componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] mutableCopy];
  
  NSString *initial = nil;
  NSMutableArray *subLines = [NSMutableArray array];
  
  for (NSString *line in lines) {
    if ([line length] <= 248 && [line rangeOfString:concSeparator].location == NSNotFound) {
      //line's good to go.
      
      if (initial == nil) {
        initial = line;
      } else {
        //we already set the first line so make a CONT node
        [subLines addObject:[NSString stringWithFormat:@"%d CONT %@", level+1, line]];
      }
    } else {
      //we need to split the line on >248 or concSeparator
      
      NSString *leftover = line;
      
      BOOL firstPass = YES;
      
      while ([leftover length] > 248 || [leftover rangeOfString:concSeparator].location != NSNotFound) {
        NSUInteger toIndex = 248; //assume length is the reason
        NSUInteger fromIndex = 248;
        if ([leftover rangeOfString:concSeparator].location != NSNotFound) {
          // split on concSeparator
          toIndex = [leftover rangeOfString:concSeparator].location;
          fromIndex = toIndex + [concSeparator length];
        }
        NSString *bite = [leftover substringToIndex:toIndex];
        leftover = [leftover substringFromIndex:fromIndex];
        
        if (firstPass) {
          if (initial == nil) {
            initial = bite;
          } else {
            [subLines addObject:[NSString stringWithFormat:@"%d CONT %@", level+1, bite]];
          }
        } else {
          //we already set the first line so make a CONC node
          [subLines addObject:[NSString stringWithFormat:@"%d CONC %@", level+1, bite]];
        }
        
        firstPass = NO;
      }
      
      [subLines addObject:[NSString stringWithFormat:@"%d CONC %@", level+1, leftover]];
    }
  }
  
  *outInitial = initial;
  *outSubLines = [subLines copy];
}
Augh

Gul Banana
Nov 28, 2003

Zombywuf posted:


26 year old bisexual. First, I'm a cachemaster. If you’re unfamiliar with that term, it means I'm a master of the proxy. You wouldn't last one hundred milliseconds in a query against me, I assure you.

Zombywuf
Mar 29, 2008

Gul Banana posted:

26 year old bisexual. First, I'm a cachemaster. If you’re unfamiliar with that term, it means I'm a master of the proxy. You wouldn't last one hundred milliseconds in a query against me, I assure you.

30 year old straight white cis male. 100ms at the proxy? Last one I worked with had latencies in the single digits, unless there was some specific hack in there to fix some lovely backend bug or marketing wanted some lovely targeted redirect/splash screen.

Bhaal
Jul 13, 2001
I ain't going down alone
Dr. Infant, MD
So I was going to revisit that "fractal of bad design" writeup to reference something to a coworker, and in doing so I found something of a (sad, depressing) horror when googling to get to it:

Google => php fractal of bad design:

It's not even on the first page. Every hit is a blog or forum or whatever TALKING about and relinking the original. One is in a forum for a small, out of the way piece of software that is used where I work and therefore I have it referenced a lot in my history, but their site sure as poo poo doesn't see the kind of traffic to merit it being front paged like that.

The same search terms bring it up as the first hit in both DuckDuckGo and Bing. Google, man, what happened? :smith:

I hear a lot of talk about how Google has started making GBS threads where it eats when it started to bring :pcgaming: Social Networks :pcgaming: into its search, but this is the first time where it's really struck home.


EDIT: His blog isn't directly linked until page 12, and then it's just to the docroot, not directly to the article. :psypop:

Bhaal fucked around with this message at 21:29 on May 11, 2012

Zombywuf
Mar 29, 2008

Bhaal posted:

I hear a lot of talk about how Google has started making GBS threads where it eats when it started to bring :pcgaming: Social Networks :pcgaming: into its search, but this is the first time where it's really struck home.

I remember when Google removed/de-ranked blogs from their search rankings because they were too spammy.

Opinion Haver
Apr 9, 2007

Zombywuf posted:

I remember when Google removed/de-ranked blogs from their search rankings because they were too spammy.

Can't be that, it's the first result for "php: a fractal of bad design".

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
Yep. Including the "a" brings it to number one for me. I have no idea why.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

It's how Google is treating the keyword. The first guy's search it seems like they're treating 'php 'fractal' 'design' 'bad' etc. all separately. It looks like an exact match for the title though 'php: a fractal of bad design' which Google is probably treating as a granular, indivisible keyword. What's messing up the first query is probably because they're weighing 'php' (an enormous keyword) and 'design' more.

zeekner
Jul 14, 2007

Dont forget that Google customizes results based on your search history. I get a lot more programming based results for otherwise ambiguous terms, where I would get much more generic results from a non-customized search.

Suspicious Dish
Sep 24, 2011

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

Geekner posted:

Dont forget that Google customizes results based on your search history. I get a lot more programming based results for otherwise ambiguous terms, where I would get much more generic results from a non-customized search.

I search with my account logged in, and then in Private Mode, and I saw no differences.

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Suspicious Dish posted:

I search with my account logged in, and then in Private Mode, and I saw no differences.

Same browser and same IP? Google probably can infer it's you just from that, (or from some other long lived cookie you didn't wipe out, I'm just postulating)

TOO SCSI FOR MY CAT
Oct 12, 2008

this is what happens when you take UI design away from engineers and give it to a bunch of hipster art student "designers"

trex eaterofcadrs posted:

Same browser and same IP? Google probably can infer it's you just from that, (or from some other long lived cookie you didn't wipe out, I'm just postulating)
Google doesn't do per-user tracking except through their login cookie. This search result is simply wrong, for everyone.

Opinion Haver
Apr 9, 2007

Guess what this evaluates to in JS:

code:
(![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]

Adbot
ADBOT LOVES YOU

Gazpacho
Jun 18, 2004

by Fluffdaddy
Slippery Tilde
A universal Turing machine.

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