« first day (1440 days earlier)      last day (3521 days later) » 

1:12 PM
I have never lexd.
 
Ooh, new @ UI.
@tereško What's your opinion of collections when dealing with entities; as in, how do they play a role in the load/save/remove operations? I've been tinkering with implementing entity-collections as an aggregate of constraints ($age > 20, etc.) that when applied (iterated, perhaps) loads the objects. As far as saving, I suppose it'd just be a dumb collection of entities...
 
@DanLugg Isn't that the role of the db to organise those things when you ask for them? You're not going to get ALL the users from the database to find which ones are > 20 are you?
s/db/persistance
 
@Jimbo Well the rules could be translated to SQL (or whatever query language); if we had LINQ-esque expression decomposition that'd be infinitely easier...
 
@DanLugg I would say "sql is easier", but if it's not, we already have those query builder abstractions available
 
user895378
@Fabien on the airplane, whats up?
 
1:23 PM
@Jimbo Contrived example:
$userSet = new UserSet([
    new SetFilter('age', '>', 20),
    new SetFilter('lastName', 'like', 'John*'),
]);
foreach ($userMapper->map($userSet) as $user)
{
    // ...
}
 
@rdlowrey Bob helped me out. All good now.
 
@DanLugg Okay, and the mapper would iterate the Filters, build the SQL and retrieve the data?
For the given filters
 
@Jimbo Essentially; the transformation to SQL or whatever would probably be best deferred to some driver implementation for better reusability, but in essence yes.
 
@rdlowrey Where you headed?
 
@DanLugg Why? UserRepository::find(array('age' => '> 20', 'lastName' => 'LIKE John*'));
Or equivalent
 
user895378
1:25 PM
Palm Springs, California. Sister's wedding
 
user895378
I'll be reachable, just cant write any code
 
Never could anyway :D
 
Nice. Someone should warn the bridesmaids :P
 
/trololol
 
Maybe better:
 
user895378
1:26 PM
@Jimbo I see what you did there.
 
$userSetBuilder = new UserSetBuilder(/* filters */);
$userSet = $userSetBuilder->build($userMapper);
foreach ($userSet as $user) // $userSet is a simple collection
 
I don't know, that additional level of abstract seems not needed...

$users = $userRepo->find('blah' => '20');
foreach ($users as $user)
{
 
@Jimbo Well, I'm thinking if you're progressively building your predicates up, you may wish to have a Set or SetBuilder which can be mutated with different Filters.
*shrug*
 
@DanLugg You could make it config-based too with Filters :P
"This object", uses: "filter1, filter2"
 
Well, you could make it config based without them; but yes.
 
1:29 PM
And use YAML
Lots and lots of YAML.
 
lol
 
@DanLugg hmh. agree :-D
 
Bruce Lee agrees too.
 
I might be one of the last crazy bastards who thinks XML is great, but I'm not so crazy as to be deluded into thinking one should use YAML for anything.
 
1:33 PM
what's crazy about thinking XML is great? #xmlfansunite
 
> Here lies #YAML
 
ThW
@DanLugg XML+XSD = code completion for configuration files :-)
 
@ThW Agreed!
 
Honestly, what does YAML even solve? XML is pretty obvious: driving people batty, but also schema validation, interop, etc. JSON also obvious: browsers user JS. YAML?
 
1:33 PM
@NikiC Ah, okie dokie. That doesn't really surprise me, given that ?? is only a slight modification to ?:, which has the same precedence in C.
 
@ThW Yes! :D
 
XML has its uses. JSON too.
 
YAML doesn't do anything except let people write code like they write grocery lists.
 
YAML... we're YAML... and we hope you like YAML too.. ooh yeah.
 
YAML can handle self-referential data structures
That's about it
 
1:34 PM
In Norway/Sweden do they call it "JAML"?
 
@AndreaFaulds as if we'd need that.
 
@AndreaFaulds Okay, that I didn't know. And is pretty neat.
But that can (easily) be shoe-horned into both XML and JSON at the application level anyway.
 
@bwoebi If someone really needs that, you can do it in JSON, it's just not natively supported. Add some type of tagging to your format.
Right, what Dan just said.
 
jup.
 
What does it use; & or something, as a self-referential ident?
 
1:36 PM
damned yotube isn't autoplaying lists in this computer :\
anyone had that fence?
 
YAML is the easiest to read, then JSON, then XML :P
 
@Jimbo Dis. A. Gree.
 
YAML configuration pwns.
 
@DanLugg Taste my cactus, it's just plain text, it's B. E. A. Utiful.
It should be built in to PHP core like json and xml
 
but YAML Ain't Markdown, Lol
 
1:38 PM
Damn, I'm gonna buy J7 YML
 
@Jimbo I see you're training hard for your trolling exam?
 
@Ja͢ck Think I might pass? :D
 
@Jimbo I thought you were instructing the class, TBH.
 
> I'll be your trolling instructor for today; long live YAML.
 
HEIL YAML
 
1:40 PM
@Jimbo YAML can search it's "HEIL" in the hell.
 
The best serialisation format is JavaScript
Not JSON, JavaScript.
 
markup?
 
Supports: 1) Self-referential objects, 2) Short key syntax, 3) Dates and times, 4) Everything in JSON, 5) Comments, 6) XML, 7) NaN, Infinity, -Infinity, 8) undefined, 9) Trailing commas, 10) String interpolation, 11) Constant scalar expressions, 12) Non-constant scalar expressions, 13) Constant non-scalar expressions, 14) Non-constant non-scalar expressions
 
@DanLugg I am not entirely sure what you are asking about
 
Good morning
 
1:42 PM
mornin'
 
@AndreaFaulds Doesn't JSON support comments too with doubly used keys?
 
hey Anthony, you're right on time. We were just discussing how YAML is the best thing ever.
 
@bwoebi No, IIRC the behaviour of those depends on the implementation
 
Configuration? Why not PHP? :)
 
@AndreaFaulds assuming Javascript and PHP impls… everything else don't care.
 
1:44 PM
Configuration in JavaScript, echoed out by PHP.
 
Look at that, all those 14 possibilities
 
@tereško Basically, was just asking if you feel using a set/filter approach to loading collections is worthwhile or not (or even harmful) as I described after that message.
 
PHP is a configuration file that can write other configuration files ... wee!
 
JS > JSON
Oh yeah: 15) Constants, 16) Bitwise operators, 17) Lambda functions
 
Is there a builtin php function that appends the 'nth' to a day? e.g. 1 => '1st', 11=>'11th'
 
1:45 PM
@Danack Yeah, date() can do that.
 
@AndreaFaulds eih, why don't we then use PHP as a format?
 
@Danack date()?
@bwoebi Some have suggested that: var_import() is an interesting idea
 
urghs
 
@AndreaFaulds 1) ... 18) Is Turing complete.
 
@AndreaFaulds Ehh, $config = require 'config.php';? :)
 
1:45 PM
@DanLugg :D
 
@bwoebi because security
 
Er - I don't have a timestamp, just a day of month.
 
@Ja͢ck but teh secruities
 
@AndreaFaulds ehhhh
 
@ircmaxell I was comparing against Javascript…
 
1:46 PM
either way
 
PHP as a config format?
 
@DanLugg I don't use such "universal filters". They leak SQL in ... well .. services and maybe even beyond. Instead I have specific setter for the collection that define conditions: $users->setAgeRange(20, 32);
 
jsonp is incredibly dangerous...
 
return [];
 
@tereško Gotcha. I think I like that better.
 
1:47 PM
@Chris I'd like us to make TRUE and FALSE into literals, not constants, for PHP7.
 
@AndreaFaulds I, have suggested that ;-)
 
:)
Also, holy crap serialize is dumb, it serialises resources to integers
wat
 
Maybe I misread, but is ^^^ discussing that PHP as a config format has security implications?
 
I fail to see said implications.
 
1:48 PM
Oh, I forgot. JS also supports maps, and tuples.
All the things, really.
 
@ircmaxell not more dangerous than normal JSON data with CORS active?
 
@DanLugg you also might find this snippet useful: gist.github.com/0a564827072887985c6e
 
normal JSON is not interpreted as script by the browser, so no, it is significantly more dangerous
 
$config = (array) (require 'config.php'); where config.php contains return [ ... ]; -- what's the issue there?
@tereško Neat, thanks :-)
 
the abstract buildItem() method is supposed to return a new instance, which is added o the collection
 
1:50 PM
@ircmaxell just as long as the JSON isn't eval()ed to be transformed into an array…
 
no argument there
 
@DanLugg PHP 5.4 only
 
@Jimbo :-/
 
@DanLugg array() :D
 
@DanLugg Wait, you can get the return value of a php file?
 
1:51 PM
@DanLugg from DomainObject it inherits only this one:
public function setParameters(array $list)
{
    foreach ($list as $key => $value) {
        $method = 'set' . $key;
        if (method_exists($this, $method)) {
            $this->{$method}($value);
        }
    }
}
 
So, files really are just functions?
That's... kinda neat.
 
@AndreaFaulds yes, sure.
 
@AndreaFaulds In a manner, yes.
 
which is basically a shorthand for adding multiple values (almost exclusively used from within a data mapper)
 
I wonder if you can pass arguments to a file.
Anyway, gotta go. English phonetics lecture. :)
 
1:52 PM
@AndreaFaulds they are left in vm just like functions.
 
I tend to isolate scope by $config = call_user_func(static function () use ($path) { return (require $path); });
 
@AndreaFaulds no, you cannot. It's not a fcall opcode to enter them…
 
@tereško Yea, I see that. I know it sounds stupid, but I don't like defining abstract methods that implementors change the return type of.
So, buildItem would best not be declared/defined until the implementation (once/if we have some sort of support for generics, I'll be much happier)
 
yes
@DanLugg here is an implementation of a bit older version of that class: github.com/glome/cbc/blob/overhaul/src/cashback/Model/…
.. I also will have to start pushing fixes to that stupid project, if I keep using it for code examples
 
I normally prefer generalization, as with the set/filter idea, but I think I'll just go the route you have and do per-property predicates like setAgeRange.
 
1:55 PM
=/
it hasn't aged well
having this in the code basically screems "FUCK, I HAVE NO TIME TO THINK ABOUT IT": foreach ($this as $incentive) {
 
Beautiful, just wrote a config-based validation service. State your object, any validators and settings for them, and each object that typehints for the ValidatorAggregate gets their own individual validator :-)
Oh, and the config is YAML. /WHAT
 
@tereško I strongly hope that this $this is an array outside of a class scope?
 
@bwoebi nope, it's abused because the class inherits from something with implements \Iterator, \ArrayAccess, \Countable
 
Afternoon.
 
and I was really short on time and harassed to no end
 
2:01 PM
@tereško might be valid.
@LeviMorrison What are you doing in Europe?
 
At present, wondering why I left Lugano and came to Milan :D
Lugano was gorgeous...
 
And generally?
 
Yesterday I presented at a conference.
 
you presented? :-) what subject?
 
Yes, I presented an algorithm for determining whose job the scheduler should launch next.
 
2:05 PM
posted on September 25, 2014 by kbironneau

/* by tux linux */

 
presented means a different thing in the animal kingdom.
 
lol
 
@Fabien it's not about presents :-D
 
lol no
 
@LeviMorrison Interesting topic, at least I couldn't do any better than a naïve implementation…
 
2:08 PM
@bwoebi Was a fun project. The idea is not difficult in this case.
You have a tree of associations, where an association is either an account or a user.
Users go in the accounts.
We take that structure and sort it in a particular way.
Then we traverse the leaves (which are users) and assign priority based on their position, while allowing for ties.
 
@DanLugg ...have you not looked at anything I've been working on in the last few years?
:D
 
2:24 PM
@Jimbo you going to make it public?
 
hey guys, I am using PHPExcel library. I need to fetch the file to php://output, but the buffer is already filled with wordpress data. Is there a possibility to flush the buffer, fill it with PHPExcel data and then flush it again? I dont know if I understand the whole buffer thing correctly tho.
 
@LeviMorrison I thought you weren't 5.5?
@ircmaxell Sorry, C# has infected my brain like syphilis.
 
@falnyr why php://output? ... what exactly are you trying to do?
 
@Patrick
I am fetching the contents to the browser to download
 
2:37 PM
@iroegbu Might do. It uses Auryn. Will have to see
 
Basically (if you are familiar with wordpress) I have a query with posts that are extracted to the xlsx file, I set the headers and try to send the contents to the browser to download.
let me provide my code
 
@falnyr please don't
Wordpress code gives me eye cancer
 
People here aren't really WP people.
 
WP people aren't really people.
9
 
well the "Wordpress" part is very short :)
 
2:39 PM
@falnyr What you need to do is: don't create any output, set the headers and then just echo the file content. then stop the program. If you have anything before, then it won't work
 
@ircmaxell Also, select and filter are the same character length! Glorious, glorious alignment!
 
It doesn't matter if you are using wordcancer or not
 
did the chat just get an update or what?
 
2:40 PM
what
 
@bwoebi Seems like it, the @ gives you avatars now.
 
yep
 
eiw
 
@LeviMorrison sounds good and fun :-)
 
2:43 PM
@falnyr if you comment this line $objWriter->save('php://output'); and open the page in a browser, is there any content?
 
We should get rid of names and have only avatars. We can assign nicknames based on them. edit: being satirical
 
@Patrick if I comment the header with content disposition aswell there is no content
 
I can be "Pastry Boy"
 
the little tortilla boy
 
@Fabien I'd be "Shirtless Angry-Beard"
 
2:47 PM
Quiet Uncle Fester. :P
 
@falnyr ok, remove everything apart from phpexcel and the output itself, then see if that works (no headers, no ob_clean etc).
 
^ Wet head
 
@Fabien That sounds oddly racist.
 
hi everyone
i have a question not on php exactly , i have few websites and i'm searching for a good way to host them
 
@Shirtless Angry-Beard I think I know why.
 
2:51 PM
@Fabien You can call me SAB for short.
 
i'm thinking about , a reseller plan
 
@Rizerzero You know how to setup a web server?
 
@Rizerzero vps?
or managed vps
 
vps is too much
 
pay someone to manage it
 
2:52 PM
i know how to install debian
and the LAMP stack
 
@Patrick no output
 
but i'm not sure i can secure it well
 
@falnyr can you quickly pastebin the code you have now?
 
@RonniSkansing what are managed vps ?
 
2:54 PM
@Rizerzero I do not know if it is the right word. But basicly someone else takes care of the vps and you pay them for regular updates and etc
 
@falnyr put that line back in $objWriter->save('php://output');
 
@ronn
@RonniSkansing well , for my client i have so much to do with coding stuff
 
@Patrick mess on the screen now :)
 
@falnyr Then it seems like wordpress was not adding any output before? Maybe your headers are messed up
 
@RonniSkansing so i prefer something i don't need to take care of , i will have to ssh and update all the time ;[
 
2:57 PM
@falnyr have you tried with the headers and an exit after the output?
 
@RonniSkansing tha't whay i thought about reseller plans
 
@Rizerzero =] well that is just my opinion. Get a vps and pay someone to help you out. I do not know much about reseller plans.. is it like .. here is a cpanel, use it?
 
@RonniSkansing but have used a manged vps before ? any experience to share ?
 
@Rizerzero yes, I have someone else manage the one I use for business. I gladly pay and it is worth each penny
 
@RonniSkansing yes something like that
@RonniSkansing whitch service do you use ?
 
2:59 PM
@Patrick the exit solved it, thanks a lot mate :)
 
@Rizerzero don't worry about reseller plans. just get a normal cpanel where you can host multiple sites if you have to. But ideally just learn enough about servers so that you can run your own vps. Linode has some good tutorials
 
@Patrick linode ?
i have never head about them
 
you don't have to host with them. linode.com/docs/websites
 
@Patrick ah yes it's SSD a bit expansive for me
@Patrick i get it the tutorials looks fine
@Patrick thank you
@Patrick great but any suggestion for a hosting service
 
3:03 PM
@Patrick let we
@Patrick do more and more
@Patrick ping to you (:
 
@Patrick
 
@Patrick \0
 
is there a better place to talk web hosting and vps and learn ?
 
yo @AndreaFaulds ... updated issue with moar stuff
 
@Patrick
 
3:06 PM
oooh tab completion on names
did we have that before ?
 
@JoeWatkins OK. I can see your point with allowing other properties, I'll fix that.
I don't see how the property isn't public, though.
 
isn't ?
you mean is ?
it should be public property, declared like a normal property
 
@JoeWatkins dunno.. =] but you can tab forward and backward with tab, alt+tab, was that before?
 
the only reason for the handler should be to save on calling the unicodestring::length method upon construction ... not to hide anything ... it should be obvious that there is a length property, and obvious that it is public ...
 
It is a public property, but shouldn't you use a DocBlock @property if it was done with getters and setters?
Or do you mean I need to do something in the PHP code that makes it a "real" property?
 
3:08 PM
no I mean you need to zend_declare_property_long on the class entry
so it reflects properly
 
Ah.
@JoeWatkins Will that make it allocate a slot for it in the zend_object?
 
the handler is a detail the user doesn't need to know or care about, to them, it should have a length property from the moment of construction, by setting handler we are only saving the call ...
cache slots are for user properties I think, don't quote me on that ...
 
@bwoebi aww
Oh fuck
Someone broke the ZTS build.
 
3:13 PM
@Leigh I'd rather see you improve fcall
 
How to make the best secure in MySQLi?
I know mysqli_real_escape_string isn't enought.
 
Dmitry did it...
 
@JoeWatkins I don't even know why it's slow, I'm guessing due to stack pushing and popping and scope related stuff
 
@AndreaFaulds fixed
 
@JoeWatkins Thanks
Why anyone compiles with --enable-maintainer-zts off is beyond me
 
3:16 PM
travis should catch these build errors now I think ...
 
@JoeWatkins Sure, but all our builds fail anyway as we have failing tests.
 
yeah ... they were green ... for about ten seconds ...
 
Are we gonna fix phpng, or are we gonna XFAIL them, or are we gonna change PHP behaviour and update the tests?
:/
 
not sure what the plan is tbh
don't think there is a plan ... ask dmitry ...
bbc news are saying this bashbomb thing is worse than heartbleed ...
:s
not sure there are any financial institutions using bash as their web programming language ...
> The problem is particularly serious given that many web servers are run using the Apache system, software which includes the Bash component.
SHUT UP BBC YOU'RE DRUNK
 
ok
 
3:22 PM
@RonniSkansing thank's for the help
thankx guys
 
@Rizerzero np. Good luck with your business
 
@JoeWatkins I think they meant "LAMP stack"
Which does include bash
 
that's not what they said ...
 
I mean, it doesn't have to, but it almost always does.
@JoeWatkins It's what they meant.
It's not like anyone uses Apache for stuff other than PHP :p
 
sausages desert and ice cream ...
(I meant nonsense)
 
3:28 PM
@AndreaFaulds burn him :-D
@JoeWatkins git.php.net/… looks like fucked up indentation in the second TSRMLS_FETCH() …
 
in my editor it looks okay ...
someone will fix it ...
not sure how that happens ...
I indented that line same as the other one ...
 
@TomášAresakMalčánek Just use prepared statements everywhere.
 
I fixed it ... probably ...
or maybe made it worse ...
 
@JoeWatkins just set your tab width to 8, then you see it…
 
3:32 PM
8 ?
not 4 ?
 
@JoeWatkins no, it's better.
 
@JoeWatkins having trouble, not sure how to make a slot-less property
zend_declare_property_ex and friends all make a zval
 
@JoeWatkins I mean, you always indent with four spaces (when you mis-indent I mean)… make tab width 8 quickly, just to see it
 
"The Symfony codebase uses dependency inject almost everywhere, but it does not use auto-wiring" Er....can someone who uses Symfony 2 say for sure - does it use DI or a service locator?
 
3:35 PM
Then I always notice these things in my editor where I have tab size 8… ^^
 
@AndreaFaulds not sure why that matters ?
 
@Danack doesn't it dependency inject its service locator? :-D
 
will look lata, do what you can and merge it, or leave it for later ...
 
@JoeWatkins It feels wrong to allocate a zval here, it's not a real property.
 
gotta rush ...
 
3:36 PM
@bwoebi context
 
I fixed the modification/unset/set thing though
 
I'll just define it to be NULL
 
@Danack jup, that...
 
Also I would appreciate it if anyone has 5 mins to read console.basereality.com to check for stupid typos or things that are completely incomprehensible before I post it to reddit.
 
3:48 PM
uuuh, Auryn ;-D
@Danack the rounded top bar looks btw. stupid…
 
What's got two thumbs and can't design web pages for shit?
<-- this guy
 
eih, most things look fine!
 
@bwoebi btw you know each time you edit a post a new ping gets sent? like this.
 
@Danack I know, but I don't have sound notifications, just the native os x notifications…
and then I forget that issue… ^^
 
4:04 PM
posted on September 25, 2014 by kbironneau

/* by alan alan alan */

 
@Feeds lol
 
@JoeWatkins Merged.
 
@JoeWatkins Oh, hah. I feel better not doing it that way though, because that makes me feel like it's a NULL-typed property...
 
@MoshMage [tag:cv-pls]
 
@iroegbu though I was actually asking; turns out [tag] can't handle questions :P
 
4:58 PM
Guys, you're awesome but I like going home more; Read you all tomorrow :)
 

« first day (1440 days earlier)      last day (3521 days later) »