« first day (2239 days earlier)      last day (2703 days later) » 

4:00 PM
Well I guess the _r is for re-entrant, what's the _s?
 
Wes
@bwoebi is there a way to know if a int operation overflows to positive or negative? eg
echo (int)($exp);
where $exp can be PHP_INT_MAX + 1 or PHP_INT_MIN - 1 ?
 
@Wes hmm?
 
@Leigh windows likes to suffix their functions with _s
 
@Leigh "safe"
 
@Wes What type is $exp?
 
4:03 PM
With basic qsort you can't pass extra data (often called a context) which means you often have to use globals. This makes it less safe, obviously.
 
Ahh contexts, the reason for my current return type variance annoyances ;)
 
Sup PHPers
 
I love it when projects come together :)
for the rare few minutes that it seems to be working I feel like a monster app developer...
then I spend the rest of my time trying to convince myself that I still deserve this job even though all my apps don't work like expected
 
7.1 still not in dotdeb :(
 
Wes
@bwoebi assume that i have an integer that must be multiplied by 2. at some point will overflow to float, how do i know if overflowed to negative number or positive? :B i'm not supposed to know what the operation was. do i just need to check the sign of the float?
 
4:06 PM
 
@Wes sure
 
Wes
okay, i thought that wouldn't work
 
@Wes it's undefined behavior.
 
Wes
thanks :B
 
@Wes If your int was promoted to float, it wont suffer an integer overflow
 
4:07 PM
You can't overflow and then check.
Wait, are we talking about php or c?
>.<
 
Wes
@LeviMorrison i can't? :|
 
Well things don't overflow to float in C
They just overflow
If you are near the C they might overflow into it I guess
 
@DaveRandom good old civ
 
Oh, we were talking about C?
 
From the $exp, I assumed PHP :p
And the "at some point it will overflow to float"
 
Wes
4:09 PM
what i want to do is take a int, multiply by two, if the result is larger than PHP_INT_MAX then do something, if the result is smaller than PHP_INT_MIN do something else, if there is no overflow, do a third option
 
Good luck :P ... (PHP_INT_MAX + 1) is less than PHP_INT_MAX
(on 64 bit)
 
@Wes why dont you just use bc_math
 
I don't understand the difficulty here :-/
 
bcmath is slow as hell, use gmp if you have it
 
Wes
@Gordon i can also use a very large abacus, but i need integers here :B
 
4:11 PM
@Wes why?
 
@Wes If you want to multiply by a power of 2, you can actually do what you want, without float promotion
 
$newVal = $oldVal * 2;
if ($newVal > PHP_INT_MAX) {
    // overflowed positive int
} else if ($newVal < PHP_INT_MIN) {
    // overflowed negative int
} else {
    // did not overflow
}
why does that not do what you want?
You could also wrap it in if (!is_int()) if you wanted
 
@DaveRandom untested, but with $oldVal = PHP_INT_MAX / 2 + 1, due to IEEE floating point, $newVal will be less than PHP_INT_MAX
You lose the important parts of the precision
 
4:14 PM
Just check is_float + sign?
 
^ this
 
!!> $oldVal = (int)(PHP_INT_MAX / 2) + 1; var_dump($oldVal * 2 > PHP_INT_MAX);
 
Wes
$newVal = $oldVal * 2;
if(is_float($newVal)){
    if($newVal > 0.){
        // overflowed positive int
    }else{
        // overflowed negative int
    }
}else{
    // did not overflow
}
 
huh
 
Wes
4:14 PM
would this work?
 
well that sucks
 
@Wes yes
 
@Wes Also you could shift right by 1
And actually overflow
 
Wes
i have no control on the operation, i just have a var that can be an integer or a float (if it overflows)
thanks for the help guys
 
Anonymous
@DaveRandom day 2 pastebin.com/qLF2Cdvk
 
4:17 PM
Please will you remind him that this is not code golf
:-P
 
!!> $oldVal = PHP_INT_MAX / 2 + 1; if ($oldVal << 1 < 0) { throw new OverflowException(); }
 
[ 7.0.0 - 7.1.0 ] Fatal error: Uncaught OverflowException in /in/R5aWC:1 Stack trace: #0 {main} thrown in /in/R5aWC on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ hhvm-3.12.0 - 3.13.2 ] Fatal error: Uncaught exception 'OverflowException' with message '' in /in/R5aWC:1 Stack trace: #0 {main} <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
[ 5.6.0 - 5.6.28 ] Fatal error: Uncaught exception 'OverflowException' in /in/R5aWC:1 Stack trace: #0 {main} thrown in /in/R5aWC on line 1 <br/><i>Process exited with code <b title="Generic Error">255</b>.</i>
 
oh god, I crashed notepad++
what have I done
 
@Leigh does shifting a float cast it to int?
 
shouldn't do
 
Wes
4:19 PM
@Tiffany why are you using that first of all
 
Does shifting a float make sense?
 
@DaveRandom no.
 
Because $oldVal will be a float there
 
@DaveRandom no?
 
(I think)
 
4:20 PM
@Wes I've been using it for about six or seven years and I'm used to it. I'm not modifying php files.
 
oh, it does cast it to int
 
!!> var_dump($oldVal = PHP_INT_MAX / 2 + 1)
 
can someone remind me how floats are represented internally?
 
but also shifting a float makes no sense
 
4:20 PM
@Leigh yes
 
I learn it every 6 months then forgets
 
@DaveRandom ah yea, INT_MAX is not divisible by two
 
yes :-P
 
@FlorianMargaine simple ieee 754 double
 
4:22 PM
so. PHP's floats are C's doubles?
 
Wes
yes
 
yes
 
Magic Casting RFC... I think I'll refrain from commenting.
 
Anonymous
4:27 PM
@Wes heh, at least they're taking it well
 
@LeviMorrison Me too…
 
90 minutes until lunchtime!
mutton either for lunch or dinner... I'm not sure
 
Hello all
 
Anonymous
My place serves Christmas dinner every day from now up until last working christmas day.. sorted
 
Does someone have a minute to help me out with a MySQL call, before i loose my last bits of sanity ?
Jealoux on Jay :P
 
Anonymous
4:31 PM
@NilsMunch :) Just ask your Q and someone will help if they can
 
its about searching by float in MySQL
i have a record with a float value of 1.3
but when i search for records that are >= 1.3, it does not appear
me searching 1.2 or larger
but when I search 1.3 and larger : i.imgur.com/8FT8Uar.png
no records.
 
floating point... yay
 
am i missing something obvious here ? :I
 
Yes.
Floating point is inexact by definition.
 
@JayIsTooCommon that's pretty fat, dood
 
4:33 PM
@Wes :D
 
Anonymous
@rabbitguy Probably gonna have some rabbit too.
 
but... we can agree that (1.3 <= 1.3) yes ?
 
Thing is... that value might not be 1.3
It might be 1.299999998
 
:I
even if I set it to 1.3 ?
because it works with 1.1 and 1.2
 
Not all numbers can be exactly represented.
 
4:35 PM
@JayIsTooCommon sounds good to me!
 
Anonymous
gross
 
my direct boss will take us all out for a steak lunch sometime in the next few weeks
a local steakhouse, but tbh I haven't had a good steak from them in a long freggin time...
like, they really suck at not only cooking steak, but getting good cuts of meat
 
That makes close to zero logic for me :I But looks like i need to read up on how floats work
Im just gonna go pure int on it then :) Int i can trust :P
 
@NilsMunch decimal
 
@rabbitguy is it in poor taste to request a place that has good steak?
 
4:37 PM
Wow, second time I get to use this link in like 15 mins
put 1.3 into decimal representation and hit enter
 
@Tiffany the fact that my boss and I aren't trying to kill each other now everytime we say hi is a blessing...
 
Ah.. i see
 
I'll just have the salad bar and call it a lunch
they have a killer salad bar there
 
well., for my purposes, im just going to go pure int's and restore my sanity :P
 
2 mins ago, by PeeHaa
@NilsMunch decimal
 
4:39 PM
@NilsMunch Or round
 
Don't restore sanity by doing insane things
 
@rabbitguy lol, point taken
 
Anonymous
@PeeHaa Time to quit smoking ;)
 
@Tiffany yall remember the stories I was telling about my boss
 
@JayIsTooCommon That's silly :P
 
4:40 PM
yup
 
but thanks Levi... i was spinning in circles and considering devoting my life to Cthulhu for a minute there...
 
I went to the hospital, and when I came back all of a sudden I can snack at my desk, listen to music, and he's not watching my every move online
 
@NilsMunch Or as PeeHaa says, use a data type that supports the precision you're looking for
 
You are using mysql. You are already devoting your life to Cthulhu
2
 
Wes
@PeeHaa did you heard the story of the kid Stroll?
 
4:42 PM
Don't think so?
 
Wes
paid millions to Williams for the 2017 seat
 
I am shocked
 
Wes
i am laughing because they could've bought the mercedes seat now :P
 
:D
 
Wes
to be fair he's not completely incompetent though :P he is both good and rich
 
4:44 PM
Is he ok or really actually good?
 
anyone else watching South Park this season?
 
Wes
i don't know a lot about him but i heard he is not just money
 
@PeeHaa Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn
 
he is mostly water
 
@Tiffany I didn't know you spoke Klingon?
or did you sneeze and hit your keyboard when you did?
 
4:58 PM
@rabbitguy SRs'lyeh?
 
:D
 
@Gordon nice
I didn't know until recently that Mtn Dew and Lemonheads was a complete and balanced diet
 
@rabbitguy mglw'nafh fhthagn-ngah cf'ayak 'vulgtmm vugtlag'n
 
@Tiffany I think your ctrl key is stuck again
 
5:01 PM
@rabbitguy hlirgh
 
lol
 
@Tiffany just in case: it's :wq to exit vim
10
 
:P
on facebook, in the About section, about a year ago, I changed my religion to Cthulhu
 
I'm sticking with Jedi
 
I figured it should be appropriate that I quote some...
 
5:04 PM
And political to rebel alliance
 
I just found out R'lyehian is really Lovecraft trying exit Vim
 
aye
 
and R'lyeh is under pacific, it seems
 
I just found out R'lyehian is really Lovecraft trying exit Vim
 
5:05 PM
my political views are set to "A mix between idealism and pragmatism
Oh, hell. Why not anarchy?"
trying TO exit Vim
 
i am offensive and i find this a vim user
 
@Tiffany can't edit tweets :(
 
@Gordon I know :(
 
and yes, we can see you were trying :D
 
I've tried to edit my own tweets from my twitter account months ago. I ended up deleting the tweets, fixing the grammar, and re-tweeting
 
5:09 PM
that's what everyone does
 
When Facebook added the ability to edit comments and statuses, I was overzealous about making sure my comments and statuses were correct. It doesn't help that I usually proofread AFTER I post something and see the problem after.
 
@Tiffany anarcho-communism?
 
socialism ftw!
 
@tereško I kind of swing more towards anarcho-libertarian, to be honest.
which I guess is similar to anarcho-communism in some senses.
 
5:24 PM
Turns out 16 GB of RAM is not enough for a decent LLVM compile
 
@tereško Wait, now after googling again, you're right. Essentially anarcho-communism, kind of libertarian-communism. Belief in private property, but help the community.
 
libertarianism in the US isn't really much like communism... more towards the right than the left
the word has been twisted in our politics
 
@Tiffany libertarian-communism would be almost exact opposite of anarcho-communism
 
@NikiC what are you compiling?
 
@bwoebi llvm...
I have to do the linking sequentially because it fails otherwise
 
5:28 PM
oh, I thought you compile something with it
@NikiC well… I just use the preinstalled version of it…
 
@rabbitguy oh, I know. My beliefs are in the middle, basically. I am left leaning for the sake of pragmatism (at this point in time, government exists to try to prevent the complete breakdown of society), but ideally, I'd prefer to live in a world where government is not necessary. That communal efforts work towards the betterment of the whole, while still valuing the individual. This is a bit too concrete, because there are still things I'm mixed on, because there's too much of a gray area.
Or I don't understand the ideas well enough to form an opinion that I'm willing to give.
 
@tereško did I do something wrong?
 
it just seems you have not put all that much thought in it
 
@tereško I'm just a socialist for the free shit :D
 
5:39 PM
@tereško I was speaking in a high level way of explaining it. There's more to it than that, but I felt I had already rambled enough.
@rabbitguy but do you believe in also helping the rest of society? >.> cause that's where socialism breaks down.
 
@Tiffany no... just me ;)
 
Wes
@bwoebi and to check if a float is exactly representable as integer? is this correct?
(float)(int)$float === $float
 
hello
im trying to make my webservice work in PHP
 
@Wes it should
 
service runs fine in browser
but when its acessed through the code
it runs into this erro
 
5:41 PM
@AwaisShaikh what service?
 
Wes
@bwoebi that scares the hell out of me :B
 
@Tiffany tbh, though, yes, I believe it is society's job to make sure society is taken care of at least basic needs
 
@Wes yes.
 
Wes
ha
 
but I also believe in social darwinism and we need to let that shit iron itself out
 
Wes
5:43 PM
i never mix float math and int math, but if integer overflows you can't avoid it...
 
@Tiffany how can i insert picture here?
 
@AwaisShaikh you mean into chat?
 
there is a button to the right of your chatbox "upload..."
 
there isnt any button
there is just "send"
 
5:44 PM
not to the right of that button?
 
no
nothing to the right
 
you on a desktop or a mobile dev?
maybe it's a rep thing, I dunno
anyhow... lunchtime
see yall on the flip side of the day
 
there isnt anything :@
anyways
i have run into Permission error
you do not have permission to view this directory or page
 
@rabbitguy might be based reputation or something
 
while service runs fine into browsers
 
5:48 PM
are you accessing the service in the browser from where the service is hosted?
 
no outside of it
 
if you're receiving a permissions error, then something doesn't have read access
 
it is accessible everywhere
but only into browsers
 
what is your code ran as?
what account?
and what access does that account have?
 
its a windows account
it has admin rights
 
5:51 PM
What would be the best way to echo html in a function? I have the code as follows, but it would look better without all the echos
function display_images($images, $quantities = array()) {
foreach($images as $number => $src) {
$number++;
echo '<div class="image" data-image="' . $src . '" data-number="' . $number . '">';
echo '<span class="remove">x</span>';
echo '<div class="image-container">';
echo '<img src="' . $src . '">';
echo '</div>';
echo '<div class="quantity">';
echo '<span class="arrow up">^</span>';
echo '<span class="number valid">';
if(!empty($quantities))
echo $quantities[$number - 1];
else
echo "1";
echo '</span>';
 
anyone?
m really stuck here
 
are you running IIS?
 
what's the exact error you're receiving?
make sure the files you're trying to run have IIS_IUSRS with read permissions. I can't remember if they need write permissions
Not sure if this is the issue you're experiencing, but this is worth a read: howyoudo.info/index.php/…
 
ok so it is only accessible
but methods are not working
 
Wes
5:58 PM
@JayIsTooCommon the entry theme sucks hard...
 
gives "The http request was forbidden with client authentication scheme 'Anonymous'"
 
7
Q: The HTTP request was forbidden with client authentication scheme 'Anonymous'. The remote server returned an error: (403) Forbidden

fanuc_bobI am trying to create a secure webservice. Here is the contract and service implementation [ServiceContract()] public interface ICalculatorService { [OperationContract()] int Add(int x, int y); } [ServiceBehavior(IncludeExceptionDetailInFaults=true)] public class CalculatorService : I...

0
Q: The HTTP request was forbidden with client authentication scheme 'Anonymous' WCF SSL

FloFirst of all let me describe my system. I have a virtual server (Windows Server 2012 R2 with IIS 8.5) with two running systems. One is for receiving Informations from Devices and the other one is for presenting and combining the users information with the device information. The two systems are ...

 
6:10 PM
I was wondering whether
if(functionTakesLongTimeToComplete() || true)
or
if(ture || functionTakesLongTimeToComplete())
will be faster. I presume the second would be faster since the interpreter will see true first and execute the rest of the code
Or does PHP not work that way and they both take the same time to evaluate
 
Wes
@JayIsTooCommon til they actually sell a camaro with the dixieland theme horn
 
I tested it out with sleep() and was surprised that
if(ture || sleep(5))
is faster than
if(sleep(5) || true)
sleep(5) doesn't even execute in the first example
 
@sweg_yolo_69 Congrats, you just learned about lazy evaluation!
!!wiki Lazy Evaluation
 
In programming language theory, lazy evaluation, or call-by-need is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing). The sharing can reduce the running time of certain functions by an exponential factor over other non-strict evaluation strategies, such as call-by-name. The benefits of lazy evaluation include: The ability to define control flow (structures) as abstractions instead of primitives. The ability to define potentially infinite data structures. This allows for more...
 
FeelsGoodMan
 
6:25 PM
twitter.com/Ocramius/status/804750399823638529 … On that notw @Ocramius … you haven't bashed the amp framework and aerys yet :>
 
Morning
 
@Ocramius I'm thankful we weren't a laravel shop...
 
eheheheh
 
which PHP MVC framework is easy to learn and fun to code?
I m coming from a Java background
 
@PradyutBhattacharya Room 11 recommends Vanilla PHP
 
6:38 PM
@Machavity I have done basic PHP coding using SQL calls, sessions and all, just wanted to learn a MVC framework
 
@PradyutBhattacharya There aren't any mvc frameworks using php that I know of
 
@PradyutBhattacharya Ah, ok. Here's a great primer to MVC in PHP
 
@Machavity nobody wants that shit. It uses globally accessible and mutable arrays of arguments, with output being uncontrolled and every other bad practice I've ever heard of…
 
@bwoebi IKR. People need to stop using PHP and switch to Wordpress
 
Totally... WP > *
 
6:44 PM
any ideia how much time generate all 30! permutations of integers takes?
 
@WithoutNameZin on what? An abacus?
 
1) this is an xy problem 2) depends on the hardware
3) try it
 
c++ using a pocketwatch, or a phone, or an intel, or an amd, or two midgets in a suitcase?
 
6:46 PM
I'm trying, but it's not ending...
 
give your midgets some bread and water... they will work faster then
 
thats why Im asking
 
Ladies and Gentlement, the PHP room will now try to debug a C++ problem using nothing but JavaScript and baling wire
 
hey! 'member when the PHP room talked about PHP stuff?
 
:D
 
6:49 PM
running on a i5 2.7Ghz
 
I'm still sticking w/my original estimation...
7
 
minutes?
 
@rabbitguy Wait, I thought this room was for discussing how to use C to ruin the Internet
 
has it been longer than 7 minutes?
 
because it had already taken about 10min
13min
 
6:50 PM
then i must not mean minutes
@Machavity ruin the Internet? How do you ruin something that is already ruined?
 
@rabbitguy Facebook found a way. And it uses PHP
 
+1 to php
 
Wes
7:14 PM
@JayIsTooCommon i'm dying
 
@Ekin I was listening to the album this morning in the office
 
I'm about to listen/watch pulse '94
 
hi all I'm intermediate MEAN stack developer and want to work as a freelacer but i don't get any project over freelance.com so i want to switch to php. is that right ?, please guide me will really appreciate you guys
 
@Ekin watch? can't say I ever have
 
7:23 PM
yeah I watch the concert at least once in every few months. It's a nice one
I also do the same for the wall movie
 
Anonymous
@Wes in a good way?
 
Wes
lol yeah. jeremy's house xD
 
Anonymous
:P
 
@Ekin depressing, but I used to watch the Wall quite a bit. An excellent piece of modern art, but it is depressing nonetheless
 
indeed
 
7:46 PM
I need to come up w/a movie to watch this weekend
 

« first day (2239 days earlier)      last day (2703 days later) »