« first day (1432 days earlier)      last day (3510 days later) » 

8:00 PM
@AndreaFaulds I don't care what it does, same with the casts.
 
Same with the left-shifting with a negative number.
 
honestly, I care more about predictable type sizes than the edge case behavior
because then this entire function drops to like 4 lines... github.com/ircmaxell/RandomLib/blob/master/lib/RandomLib/…
 
Well, all this stuff is a prerequisite for bigints.
 
It still seems it would make more sense that ((int) INF) === INF and ((int) NAN) === NAN
 
8:04 PM
@DanLugg Impossible, though.
INF and NAN have no direct integer equivalents
 
Because infallible casting?
 
It's an inherently lossy conversion
 
@DanLugg no, because if you ask for an int, and get a float, that's weird
 
@AndreaFaulds So, 0. ;)
 
@salathe Zero is the least insane of the options IMO :)
 
8:05 PM
@ircmaxell The other side would be E_FATAL or 0 with E_WARNING
@AndreaFaulds Yes, with an E_WARNING.
 
@DanLugg Explicit casts aren't allowed to warn ;)
 
@AndreaFaulds Might as well be 7, or 9, or 123987418271. You're casting NaN/Inf to an int!
 
@AndreaFaulds Why?
 
@salathe Yep.
 
NAN == NAN is false; why would (int) NAN == NAN?
 
8:06 PM
Levi makes a good point ;)
 
@LeviMorrison That is a good point.
 
@DanLugg Tradition, I guess. Much like C's explicit casts
 
Okay, revised is_nan((int) NAN) // true
@AndreaFaulds I don't buy "tradition".
 
@DanLugg Integers lack NaNs and there is no way in hell we'll add them
 
@AndreaFaulds I never said they should be integers.
 
8:07 PM
If a cast doesn't produce the type asked for, that's stupid
Would break code, anyway.
 
If a cast produces 0 from INF/NAN, that's stupid.
 
Well it has to produce something
 
Yea, 0's fine, with an E_WARNING
 
@AndreaFaulds "7"
 
^^
 
8:08 PM
Bear in mind that, even if we change (int), we do float-int casts in a lot of other places
 
(int)NaN gives a string :D
 
True. I can't isolate my opinion of this from my general opinion of changes I would like made to the casting semantics at large.
 
@LeviMorrison: debating saying "the problem is that it threatens to fork not the project, but the community. Which is a very dangerous spot to be in... I'm not saying it's bad, but we need to be careful how the community adopts and views it... And saying it's the most exciting is really ignoring the damage it can do"
 
zend_dval_to_lval has to result in something, I chose 0.
@ircmaxell Talking about Hack, HHVM or the spec?
 
Hack.
 
8:10 PM
Aha
 
HHVM and the Spec are good for the community, they bring it together. Hack divides it
 
The thing with the Integer Semantics RFC is that, should it fail, all the changes in it will be reintroduced whenever I finally put the bigint RFC under discussion
it mainly exists to reduce future bikeshedding
 
Hey guys, I have a serious question. Why you guys don't like Laravel ? I have been learning Laravel recently and upon asking here about laravel I have always got negative comments and even my colleague encourage to learn Symfony and Zend in place of laravel. Why you don't like it ? (I know the notation if you like to go for it but my question is to you)
 
I have to justify my dislike of something?
If I say, "I don't like olives" I never have to justify it.
(Which, I love olives by the way, but my wife hates them)
 
@LeviMorrison yes. otherwise you're a bad person
 
8:18 PM
Please do do that again. I am not asking justification, I need your views
 
@Shashi Because it advocates so many bad practices?
 
I want to learn from you people
@Jimbo For example ? On thing that I felt till now -> fat controllers
 
@Shashi I advise lurking then. This is not snark.
@Shashi tl;dr: A lot of the stuff is designed around static everything, which is caused by / can promote / accidentally teaches bad practices. It's also hyped everywhere as the next big thing.
You also need to understand that all frameworks suck.
 
@Shashi Can you program without a framework?
 
Please don't talk to me about Laravel's 'facades'. They don't follow the facade pattern, service locator, global state, singletons. #php
 
8:21 PM
@Patrick Yes
 
The best frameworks are the ones that let you pick and choose individual components. This, in turn, lets you restrict how much suck you import into your own codebase.
 
^ Exactly
 
^^ +1
 
My cat is sad because life has given him many, many lemons & he cannot use them to make lemonade because he is a cat. http://t.co/PhAVk905EI
 
@Shashi Then just use components to build your own application suited to whatever you are trying to do
 
8:23 PM
@Charles so that way Symfony is much better than Laravel ?
 
@Shashi No Symfony also advocates poor practice in some areas
 
@Shashi Kinda. Keep in mind that Laravel builds on top of various Symfony components...
 
However I don't dislike Symfony as much, because it doesn't have a load of people bumming it like Laravel does.
 
On of the biggest problems with frameworks is magic. They tend to do too much magic. You've suddenly got a bunch of code you're relying on and you don't entirely understand what it's doing.
 
@derp ^^ This.
 
8:23 PM
There is no "best" framework, anyone telling you there is either doesn't know what they are talking about, or is trying to sell you something (or both)
12
 
"best" != favourite
 
For example, I started using Silex recently because I just needed a simple front controller and didn't want to write it, and have come to the realization that there's way too much magic in there for my own comfort. I'd only used a fraction of the possible features before, because that's all I needed...
 
@ircmaxell So what
is your suggestion
 
@Jimbo Correct, having a favorite is perfectly fine...
 
@Charles Way too much magic in Silex? It's only like a router, and a few hooks that allow you to plug in stuff
 
8:25 PM
"\App::make('router');" "It is not static - are you familiar with laravel's IoC?" An example of how #Laravel attracts stupid people.
 
@Shashi Just use components to build your application. I spent quite a few hours to write this tutorial for guys like you, so please give it a read :)
 
@Jimbo there can be too much magic in silex, if you use Pimple too much...
 
@Jimbo Yeah, and the instant you start using those hooks, suddenly everything becomes dependent on hidden magic. I prefer my magic to be explicit.
 
@Danack I had to re-read that a few times to sense the sarcasm :P glad you agree
@ircmaxell Yeah, I implemented Auryn so no more pimple :D
 
8:27 PM
@Patrick I have bookmarked it, will through soon
 
@ircmaxell Good point, most of the magic is in Pimple.
 
@Danack Yeah, don't use that :D I have never used a trait, and I don't think I ever will tbh, never found a decent use-case in an OO context
 
@Charles or its service hooks (whatever they are called, can't remember)
 
@Charles, you should look at this? It's where basically, you don't use pimple any more, you just type hint for the object you want in your controller onward, and it's auto-resolved for you. Meaning from the controller forwards (where devs write their code), you can write SOLID OO testable code without worrying how to wire it
 
@Jimbo There's 3 (i think), i) Universally consistent cache naming. ii) Injection of code that needs direct access to private methods for consistent error generation iii) Modifying PHP's behaviour e.g. catching any call to __get() and throwing an exception.
 
8:30 PM
Pimple is terrible, it is NOT a DiC, it's just a bloody box with a load of crap in it that you don't know about - i.e. service locator
 
So guys, How should I approach my next learning regime. If I stop learning things and just do projects, projects I just don't enjoy.
 
@Jimbo depends on how it's used...
 
@Jimbo Will take a look, thanks.
 
@Shashi - do projects you do enjoy? :-D
 
@Charles Worth it, you can write your own. I'm actually writing a wrapper around Silex now that integrates that fully, with docs and stuff, to help people realise that you shouldn't write code specific to a framework simply because you don't know otherwise
 
8:32 PM
well, lets put it this way: fuck Silex
 
I'm calling it, Aurex :D
bye bye pimple
 
@Shashi: That advice is not given entirely in jest - finding projects you are passionate about will spur you on to finishing them, and to learning how to build them better.
 
The real deal here is most of the interesting projects require framework knowledge, how to convince them then ?
 
@Shashi I don't have to know frameworks, because I know PHP
 
Convince who?
 
8:34 PM
lol
 
(I'm not sure I agree that "interesting projects" require framework knowledge. Some do, to be sure, but your own require whatever you like!)
 
@halfer Employers who have good projects
 
@ircmaxell do you think your work on constant scalar expressions can also be applied to all scalar expressions? I.e. if I write (60 * 60 * 24 * 7) that gets reduced at compiletime.
 
@Shashi real deal here is that you desperately want someone to tell you that frameworks are not piece of shit and waste of time
 
@Shashi Write your own project in a framework of choice. Learn the ins and outs, why it's good and why it's bad for the things you want to do, hack around a bit
 
8:37 PM
@tereško I feel you are right in a sense :(
 
@Shashi frameworks do not make good projects , good developers make good projects ... but frameworks are quite good at causing bad project to be made by good developers
 
@Leigh could it? yes. Is it worth it? I doubt it...
 
Ah right. Well, if you are looking to improve your skills, then there's no shortcut - study, study and study I'm afraid!
 
Alright ;)
 
now, constant folding is something big, and I do that with Recki. But that's way more than just reducing constant expressions
 
8:38 PM
(The trick is to enjoy learning stuff, imo)
 
@Shashi If you want to learn X framework go learn X framework. Just because something sucks doesn't mean you can't learn about it. My first car was a total piece of crap, and that taught me a lot.
 
Problem is I have childish focus span, unless I have some work in my hand I tend to switch my interest form on language to another.
@derp Agree
 
Here's a quandary; non-constant property initialization: private $foo = new Foo(); -- why is this not supported?
 
@DanLugg Because emotional baggage
And rogue cacti.
 
2 days ago, by ircmaxell
because PHP
 
8:43 PM
Is there any technical reason it hasn't been done? (I mean, something to do wit the engine making optimizations that would be negatively impacted by it, or something of that ilk)
I suppose that question extends to static variable initialization too; static $foo = new Foo();
 
Well, there's currently no mechanism to initalize those
do you do it before constructor? Or after?
and if/when you do, that needs to be a separate call from the constructor, since the constructor can be overriden, so more opcodes and hidden virtual methods, and object handlers
it's doable, but non-trivial
 
@DanLugg This is something that Java has right?
Isn't it like, DI but on the property-side
 
@Jimbo Yes, but certainly not exclusively.
@ircmaxell Well, following suit with other languages; before constructor for instance, when the definition is loaded for statics.
But I see what you're saying. Also, that'd surely become quite the endless debate.
 
@Jimbo no, it's quite difficult
 
@ircmaxell before, there's no question there
 
8:49 PM
@DanLugg no, I think as long as it's predictable and clear, that's not an issue
@DaveRandom well, I don't know about that...
 
Well, I can't see how it'd be possible to fire after construction.
 
Also, @DanLugg how do you handle serialization?
 
I think the more interesting question is why function foo($bar = new Baz) {} is not supported ;) That's a case where we don't really have any "when is it going to be executed" kind of issues
 
@ircmaxell Why is that an issue?
@NikiC Same vein, yes.
 
@DanLugg it's not, it's just something that would need to be handled...
 
8:52 PM
@ircmaxell Well, I'd assume it'd behave in the same manner that it currently does. What I mean is, I don't see how that'd even be touched.
class C {
    private $b = new B();
    public function __construct(B $b){
        $this->b = $b;
    }
}
 
@DanLugg what about deserialization?
 
^^ If C::$b isn't the instance I passed in, then there's a problem.
@ircmaxell The property is initialized (to new Foo) and likely overwritten with the deserialized field.
Can properties be omitted during deserialization resulting in nulls being assigned?
 
that's not cool, because you're initializing something that's going to be thrown away
 
Need to read first whether or not there is something that's going to overwrite it
Yay, let's pre-compile all the things
 
@ircmaxell The only reason to do it after would be to allow injecting $this or instance properties into the child constructor. I can see the value in allowing that syntax, but to me it only makes sense with constant ctor args - not allowing the parent ctor to work with it's own properties would be... weird.
 
8:55 PM
@NikiC Teehee, all the CS issues are work done by @JoeWatkins
 
@ircmaxell Although, we could shovel that onto the user by saying "that's your fault, you're doing it wrong" :D
 
(coding style issues)
 
@ircmaxell Well, if you're initializing a huge object graph into a property, perhaps via some singleton-esque magic, which is furthermore de/serializable, then I think you may have bigger problems.
 
Anyone here with voting rights who hasn't voted on the Integer Semantics RFC? (wink wink nudge nudge)
Excluding Anthony obviously
 
@DaveRandom You're referring to doing private $foo = new Foo($this);?
 
8:57 PM
Yes. Circular references are code smell (IMO)
 
@DaveRandom Surely, that shouldn't be possible.
That's constructor business, because at that point, you do have an instance.
$this AFAIK should only exist in the context of a non-static member body, not the class body.
 
Exactly
Therefore, you init the props before the ctor
 
Right, agreed (it almost sounded like we were arguing, but we're just agreeing repeatedly)
 
@DaveRandom You mean two objects shouldn't have references to each other?
 
Bidirectional/mutual dependencies are tricky.
 
9:01 PM
@LeviMorrison Yes. It almost always is indicative of VOs with BO methods.
 
"VO"? "BO"?
Voice-over and body-odor?
 
^^ That Value/Business Object?
 
lol
What @DanLugg said
 
I typically swap "business" for "service", but whatev's.
 
Whatever. Things that do stuff vs things that only represent state
 
9:04 PM
Do'ers vs Be'ers
 
Entities then
 
grumble how do I force the language parser to rebuild? On the mac just editing the file was enough, on linux it's not rebuilding
 
they don't think it be like it is but it do
 
@DanLugg that's a nice description
 
To be or not to do be... do? Do be do be dooooo
“To be is to do”—Socrates.
“To do is to be”—Jean-Paul Sartre.
“Do be do be do”—Frank Sinatra.
 
9:07 PM
I thought the last one was Scooby Doo
 
@Leigh Sinatra, Scooby; same thing really.
 
@Leigh do you have bison installed?
 
of course, I have that version of bison nobody loves
because debian
 
@Leigh Are you ever not going to be a monkey that looks, from the thumbnail, like it's brain is half out?
 
Or is it half in!
 
9:13 PM
I'd worry about sunburn
 
Opposite of brain-freeze... brain-burn.
 
Yay!
 
now do that with cats
 
good luck getting cats into a pool in the first place
 
9:20 PM
 
I said a cat, not a freaking preditor
 
Fair enough.
:-P
 
lol
 
hehehe
 
@DanLugg what. the. fuck.
 
9:27 PM
I gotta say, that cat don't look particularly happy.
 
This Guy Is Creating a Facebook for Rich People. It costs $9,000 to join. And, uh, he built it on WordPress. http://www.vice.com/read/this-guy-is-creating-a-facebook-for-rich-people-917
 
It really would be nice if we had non-constant argument defaults /cc @NikiC
 
Gotta say, his idiocracy fits all around
 
@ircmaxell See, why can't I ever have brilliant, obvious, money-making ideas like that?
 
9:45 PM
> I was just running through the back-end of the site and it seems to be set up in WordPress, which is… I don’t know if that’s of a concern to the people using it. Is WordPress secure enough? WordPress seems like a very common blogging platform to put a millionaires' social club onto. I can’t comment on the platform we used to design it but I will say we’re extremely confident in the security of the whole thing. That’s all I’ll tell you.
 
OK
I'm going to write an iPhone app
 
For ^^ that?
 
lol, oh okay.
 
To add a picture of a kitten to the Notifications menu
 
9:48 PM
@Charles Make a socialish site that's free to join, but people can pay to kick other folk off.
 
@derp Ah, like the libertarian's paradise?
 
Now that's an idea.
 
@derp Then step 2, let people that were kicked off buy their way back in by spending more than the person that kicked them out.
 
So, SomethingAwful, then?
A site that's quite hard to be banned from
 
Yeah but without the :10bux: upfront.
They recently hired a new guy to hack on their crappy code, some of the stuff he's had to work through is hilarious/terrible.
I wouldn't wish vBulletin on anyone.
 
9:51 PM
Guys, I'm trying to achieve something using PHP, but I don't know if I should "trim" or what... I have this sequential generated number, where the last digits are the client ID. I need only these last digits
For example: 26260610000000117 (ID is 117)
 
@ircmaxell That sounds like literally the worst social club I've ever heard of. A club specifically for those who are tired of hanging out with poor people...
 
The problem is, the ID could have 1, 2, 3 or even 4 characters, depending if it's a numeral, decimal, hundreds or thousands... So I think trim is not a good solution... What could I use in this case?
 
I'm quite happy to seal those people in a box and just let them get on with their pissing contest without bothering the rest of us though, I suppose
 
@LucasB Are you guaranteed to have all those zeroes?
 
@LucasB don't add all that other crap in front of it in the first place
 
9:53 PM
@Charles yes, it increments 1 by 1 as a visitor registers
 
@DaveRandom Yea, there should be a rule: once you fork over the $9000 you're permabanned from all other social media.
 
@derp I'm afraid I don't have much choice. This code is used to generate invoices, and the bank documentation says it has to be something like that
 
@DanLugg Hopefully they'll become an OAuth provider to make that easier for us to engineer
 
@LucasB Hmm. You could naively just look for a set of five or six zeros, then absorb all surrounding zeros, and try that... but that's dangerous and prone to accidents if you care at all about the data on the left.
 
@DaveRandom True, that could be facilitated. $oauth->isTooWealthy() // deprecated, use isSelfAbsorbedJerkOff()
 
9:55 PM
@Charles I just need the data on the right
 
lol, a WP-based OAuth provider platform
 
I'm sure it's already a plugin.
 
@LucasB Good, then discard everything on the left until you hit a sequence of zeros, then discard them and the zeros, and you could be all set.
 
lolwut
that deserves a shiny star
 
9:58 PM
I used to think WordPress was good
because looks are deceiving
 
It's like rule 34½ -- if you can think of it, there's a WordPress plugin for it.
 
@Charles thanks, I'll try that!
 
Well, I must forage for beer and remove my pants; off to home I go.
 
@Charles, is that good?

		<?php
			$number = 26260610000000117;
			$id = str_replace("2626061", "", $number);
			$id = ltrim($id, "0");
			echo $number;
			echo "<br>";
			echo $id;
		?>
Output:
26260610000000117
117
 
@LucasB Well, perhaps with more smartness of the str_replace, but the rest is good.
 
10:07 PM
@Charles you mean if there's a client ID with that number?
number I mean 2626061
 
wait, the part in front of it completely static? it's always going to be the exact same thing?
 
yes, the first digits are static, then a sequence of zeros, then the client ID
always 17 digits, that's why the zeros are there
 
just subtract 26260610000000000
 
Wait, if it's always 17 digits, then why not just substr it off?
 
it's like, in this case the client ID is 117
but it could be 69, or 1923
 
10:10 PM
$number -= 26260610000000000;
 
it doesn't necessarily have 3 characters, as in 117
 
10:27 PM
I just need one person to switch from No to Yes and another to vote Yes and my Integer Semantics RFC would pass...
 
10:50 PM
@AndreaFaulds find a couple people who are for bigint and lobby them based on what it'll do for that. Tie your RFC passing directly with something they want.
 
@derp That could work.
The problem is votes against require two votes in favour to counteract them, because of the 2/3 majority.
 
A lady I used to work with was incredible at stuff like that. By the end of a conversation not only were you for her idea, but she'd practically have you convinced it was your great idea in the first place.
 
11:13 PM
There is a plain-text file on another domain that I want to use grep on. How can I do this? wget http://path/to/file | grep search doesn't work.
Is there a better way anyways?
 
Shouldn't you curl that instead?
 
hey webfarty!
good thing you're here. :)
 
hello Villareal ^^
 
^ thats a normal surname here btw hehe
anyway, can you help me figure out something?
my head is going crazy because of these async calls haha
what do you call a pub/sub thingy that has weight/order?
 
@reikyoushin Priority based / prioritised ?
also probably stupid.
pub/sub is difficult enough already. Having them be non-deterministic doesn't sound like a good idea.
 
11:33 PM
@reikyoushin You mean using a priority queue?
 
11:46 PM
In MySQL, can a LIMIT be a variable?
mysql_fetch_array(mysql_query("SELECT X FROM Y ORDER BY RAND() LIMIT '$limit'")
Never mind.
 
Maybe!
 

« first day (1432 days earlier)      last day (3510 days later) »