Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

lol PHP

Name: Anonymous 2007-06-10 6:42 ID:3V9R3kd3

1.) Run this code
2.) LOL


<?php
foreach(array(0xffffff, 0xfffffff, 0xffffffff, 0xfffffffff, 0xffffffffff) as $x)
printf("%s (%s)\n", $x, gettype($x));
?>

Name: Anonymous 2007-06-10 7:16 ID:FSLuZDsJ

>>1
THIS IS WHY WE DON'T SUBMIT /prog/ TO REDDIT

Name: Anonymous 2007-06-10 9:34 ID:SjCg3ecU

>>1
Fixing:
<?
array_map(create_function('$x', 'printf("%s (%s)\n", $x, gettype($x));'), array(0xffffff, 0xfffffff, 0xffffffff, 0xfffffffff, 0xffffffffff));
?>

Name: Anonymous 2007-06-10 9:41 ID:Heaven

Post output or GTFO.

Name: Anonymous 2007-06-10 9:47 ID:Heaven

>>3

Sage for shorttags

Name: Anonymous 2007-06-10 10:24 ID:Heaven

php sucks, write it in assembler

Name: Anonymous 2007-06-10 10:31 ID:N6vhaC2B

>>6
assembler sucks, write it in BBCode

Name: Anonymous 2007-06-10 10:49 ID:Heaven

>>4
Output from OP's code:

16777215 (integer)
268435455 (integer)
4294967295 (double)
2147483647 (integer)
2147483647 (integer)


Seriously.

Name: Anonymous 2007-06-10 11:48 ID:Heaven

>>8
Thanks, I lol'd.

Name: Anonymous 2007-06-10 16:49 ID:51UllKxx

>>9
i dont get it :(

Name: Anonymous 2007-06-10 16:55 ID:Heaven


% perl -Mbignum -e 'printf "%s (%s)\n", $_, ref $_ for (0xffffff, 0xfffffff, 0xffffffff, 0xfffffffff, 0xffffffffff);'
16777215 (Math::BigInt)
268435455 (Math::BigInt)
4294967295 (Math::BigInt)
68719476735 (Math::BigInt)
1099511627775 (Math::BigInt)


am i doing it rite?

Name: Anonymous 2007-06-10 17:07 ID:SjCg3ecU

>>4
Same output, of course. I was just fixing style.

Also, since I'm a Python weeaboo:

>>> map(lambda x: "%s (%s)" % (x, type(x)), (0xffffff, 0xfffffff, 0xffffffff, 0xfffffffff, 0xffffffffff))
["16777215 (<type 'int'>)", "268435455 (<type 'int'>)", "4294967295 (<type 'long'>)", "68719476735 (<type 'long'>)", "1099511627775 (<type 'long'>)"]

Name: Anonymous 2007-06-10 18:54 ID:zlcd8DOi

This is why php is so fucked up:

http://use.perl.org/%7EAristotle/journal/33448

Name: Anonymous 2007-06-10 19:14 ID:Heaven

ITT everyone is gay

Name: Anonymous 2007-06-10 20:21 ID:Heaven

[code]main = do mapM_ print [2^24, 2^28, 2^32, 2^36, 2^40][code]

Name: Anonymous 2007-06-10 21:29 ID:Heaven

>>14
Whee! I'm gay! :D

Fuckers.

Name: Anonymous 2007-06-11 4:47 ID:9XvYI3XQ

>>15
You're doing it wrong

Name: Anonymous 2007-06-11 6:34 ID:FdwwUCAw

>>17
No you are doing it wrong

Name: Anonymous 2007-06-11 6:35 ID:9XvYI3XQ

>>18
1. You are not a BBCode EXPERT PROGRAMMER
2. You are not printing data types for each result

Name: Anonymous 2007-06-11 6:49 ID:stMLZhfW

0xffffffff is a double; clearly a different type to  0xffffff or 0xffffffffff. who cares anyway lolz.  Ima EXERPT PHP PROGRAMMER

Name: Anonymous 2007-06-11 6:53 ID:a5LhG+RR

>>19
Here you go, unrolled for extra performance:
0xffffff (BBstring)
0xfffffff (BBstring)
0xffffffff (BBstring)
0xfffffffff (BBenterpriseString) Strings longer than 10 characters are Enterprise strings and have special string-handling logic for Enterprise uses, proving that BBcode is Ready for the Enterprise.
0xffffffffff (BBenterpriseString)

Name: Anonymous 2007-06-11 8:47 ID:FdwwUCAw

>>19
Like I give a fuck

Name: Anonymous 2007-06-11 9:25 ID:yNsJGhnt

>>17
Haskell is static-typed.
main = do mapM_ (\x -> putStrLn $ show x ++ " (Integer)") [2^24, 2^28, 2^32, 2^36, 2^40]

If there are some EXPERT PhD Haskell-fags here, I would like to see how I did that properly with Data.Typeable and typeOf, as I failed to write this myself (lol I'm EXPERT HASKELL NOOB).

Name: Anonymous 2007-06-11 10:15 ID:VajvBFTU

>>23
main = mapM (putStrLn . (\x -> show x ++ " " ++ (show $ typeOf x))) [2^24, 2^28, 2^32, 2^36, 2^40]

Name: Anonymous 2007-06-11 10:24 ID:pxaoNezf

>>15,17
16777216 != 16777215

( scratchpad ) [ 24 28 32 36 40 ] [ 2 swap ^ 1 - dup dup . class . ] map
16777215
fixnum
268435455
bignum
4294967295
bignum
68719476735
bignum
1099511627775
bignum

Name: Anonymous 2007-06-11 11:46 ID:yNsJGhnt

>>25
Damn.

s/2^(\d+)/2^$1-1/g;

I suck cocks.

Name: Anonymous 2007-06-11 12:23 ID:9XvYI3XQ

>>23
More like stupid typed am i rite?

Name: Anonymous 2007-06-11 12:50 ID:VajvBFTU

Static typing is superior. Dynamc typing is where eveything is a hash table and symbols are looked up at runtime. Fuck that shit.

Name: Anonymous 2007-06-11 12:55 ID:nyA4QwsZ

<?php='This thread is made of win and gold.';?>

Name: Anonymous 2007-06-11 13:24 ID:yNsJGhnt

>>24
NO WAI. That's why I failed this myself.
test.hs:2:56:
    Ambiguous type variable `a' in the constraints:
      `Typeable a' arising from use of `typeOf' at test.hs:2:56-61
      `Num a' arising from the literal `2' at test.hs:2:93
    Probable fix: add a type signature that fixes these type variable(s)

Name: Anonymous 2007-06-11 14:03 ID:8M78aAVJ

>>28
Dynamic typing is when your language doesn't touch your balls and allows every operation you can envision, as long as it's doable. Objects have type, and are checked for type as needed. Of course a watermelon can't read SICP. But a human can read SICP. And even if they don't descend from the same class nor they follow any stupid idiot restriction, a runtime-created alien class can read SICP if aliens can .read .

Name: Anonymous 2007-06-11 14:12 ID:a5LhG+RR

Quack motherfucker, QUACK!

Name: Anonymous 2007-06-11 15:45 ID:FdwwUCAw

>>28
lol you stupid fuck

Name: Anonymous 2007-06-11 23:40 ID:Heaven

>>25
factor ftw!
[ 24 28 32 36 40 ] [ 2 swap ^ 1 - dup dup number>string write class ")" swap " (" write pprint print ] map

Name: Anonymous 2007-06-16 19:46 ID:Xwymrb9i

>>34
[ 5 % ] { } make [ 1 swap 2 swap 4 swap 6 + * ^ - dup [ dup # " (" % class word-name % ")" % ] "" make print ] map

also, http://useless-factor.blogspot.com/2007/04/is-factor-turing-complete.html

Name: Anonymous 2007-06-17 0:36 ID:ljNDppE6

>>31,33

Stupid fucks.

Name: Anonymous 2007-06-17 3:02 ID:h9QS8sLp

>>28
>>38
Same person

Name: Anonymous 2007-06-17 12:16 ID:JDBLfXY1

Nope.

Name: Anonymous 2009-01-14 14:37

lol

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List