« first day (1495 days earlier)      last day (3453 days later) » 

12:01 AM
prolly, less ops to handle and/or less mem to store
 
^ that
I believe objects are, er, heavier-weight(?)
 
hmm... mem: obj VS. arry
^could someone explain that ^ and maybe if the comparison is broken?
 
12:19 AM
@CSᵠ memory_get_usage only counts allocated zvals I think. I.e. it doesn't cover internal strings.....so for the class one the keys don't take any memory.
Also, counting arrays have lots of internal pointers for iterating over them.
 
php-internals is a gold-mine for WTFs
 
@Danack how to bech it bettr?
 
@CSᵠ As you can see, HHVM takes infinitely less RAM ;)
 
infinitely... HHVM buzzword,,,
 
@CSᵠ If you are trying to measure how much an instance of an array or object takes. i) Do the all the measurements in the same script ii) create some test arrays and classes before creating the things you're going to measure, to allow all the code to be processed outside of the measuring bit.
It may just be easier to post a question on programmers.stackexchange asking how much memory arrays + classes should take in PHP.
And for the record......I miss structs.
 
1:17 AM
Hi how can i convert HTML to PDF ?
 
@Nephil install a virtual pdf printer and print the page
 
@CSᵠ thank CS, sorry I forgot to mention using PHP language..
 
@CSᵠ thanks CS.. i ll have a look
 
1:32 AM
@CSᵠ thank you a lot i ll have a look at this too
 
2:22 AM
Why would site load fast sometimes and slow sometimes? What would cause the inconsistency?
 
shared hosting, user peak, bad code, etc, w, etc
 
How can bad code lead to inconsistency?
 
2:37 AM
that will always be a mastery
 
 
3 hours later…
5:57 AM
3
 
6:37 AM
@AndreaFaulds I still think it's completely bonkers that try_int() doesn't throw and to_int() does.
I understand there is precedent in other languages for this naming<->behavior mapping, but it's still ridiculous
try_ should throw, and to_ should not.
/My tired, probably not completely coherent $0.02
 
7:10 AM
hello every one. any queries regarding php. i feel happy to help you. so you can ask
 
7:32 AM
morning! :D
 
posted on November 19, 2014 by kbironneau

/* by MonsieurLeMarquis */

 
hi guys. anyone ?
 
7:52 AM
I wish you all a splendid morning gentlemen
 
Morning.
 
hi gyus need help with downloading image from remote server to my server. This post has many solutions - http://stackoverflow.com/questions/724391/saving-image-from-php-url.
This is taking too much time in my local. is it normal ?
and only half image is there not full image.
 
@AndreaFaulds Proper objects use less memory if properties are declared, see gist.github.com/nikic/5015323.
 
8:19 AM
I overslept for the first time in about 4 years ... that was nice ...
morning all ...
 
good meurning
@JoeWatkins oversleeping.. the good old days.. :)
 
Are there here some whiskey drinkers?
 
8:46 AM
it kinda depends on the scale
 
@Duikboot check!
 
I bought a few weeks ago for my birthday my first bottle. Lagavulin 16.
But I want to try a new one so I can compare them. @Naruto Have you already done a lot of tastings?
 
@LeviMorrison well, you have an overwhelming majority :P
 
@Duikboot that's kinda the "semi-expensive" part of spectrum
you probably should try some of the cheaper stuff to be able to compare
 
Well I was thinking to buy mini-bottles to compare.
 
8:55 AM
@Duikboot isn't that one pretty sweet? And I'm just an occasional drinker..
 
m orning
 
It's very 'smoky' And it's the first one I am ever drinking. So I was thinking to try some others. Are there some especially 'fruity' ones ? ( I mean are there some who are known for their specific taste ) ?
 
Morning
 
@Duikboot I like that one a lot. very smoky.
 
9:00 AM
@Duikboot this book is a map of whisky
 
Morning
 
@Duikboot Can try Johnny Walker Gold Label for a non-smoky somewhat fruity one.
Also, make sure to try the Lagavulin undiluted and then sprinkle drops, and really just drops of water, into it. You wouldn't believe how much a whisky can change from a single drop of water.
 
I see offtop
 
@Gordon You hired many people?
 
@Fabien i took part in hiring
 
9:05 AM
You ask them about SOLID?
 
@Fabien yes
 
How many of them actually know of or what it is?
 
GRASP SOLID
 
@Fabien less than 10%
 
In the 90% do you hire and if yes, how are they?
 
9:07 AM
yes, we do hire them even if they dont know SOLID. we try to figure out whether they fit in mostly.
they dont need to be superspecialists
if they have a decent working understanding, we consider them
the ones we hired are all quite good I have to say
 
Are they all German?
 
Do you have any key things that you ask or feel to know if you'd like to bring that person on board?
 
@Jimbo not at all.
 
Some russians? :^ )
 
There's always one chinese one
 
9:11 AM
@Fabien I usually ask them what they do to improve their skills
@sectus Yes, one. And we had one from Estonia earlier on.
 
Answer to that would be "Post on StackOverflow"
BOOM - instant job
 
:P
 
@Jimbo yes, there is.
 
@Gordon That's a good one.
 
@Gordon well .. I mostly read larval forum and /r/PHP tp keep up to date with latest skills
 
9:14 AM
@Fabien then I ask them what's the last tech book you read and how did you like it
 
@Gordon , what language do you use in your team on the job?
 
@sectus a mix of english and german
 
@Jimbo You should come work here :P
 
thinking about emigrating, @sectus ?
> $this['orm.class']= 'vendor\orm';
lol
 
@tereško , I have just started to think about.
 
9:17 AM
yeah ... russia lately seems like a shitload of fun
 
@Fabien we also have a programming test they need to do before we invite them. They got 30 minutes for that. If they don't submit total nonsense, we call them to talk a little bit about the solution. If they can explain their solution well and maybe add some improvements, we invite them to the office.
 
@Gordon I can imagine something like Gib mir das test results. Wir werden the first scrum cycle initialisieren
 
@Gordon What's is the test like (assuming you don't tell directly due to google).
 
@tereško , I am not worried about job there, but I cannot get exp. that could get from foreign lands.
 
=/
 
9:19 AM
@ziGi well, yes. that's qute normal for german techies. We try to speak english all the time to not exclude the non-german speakers. But if they are not around, we fall back to german.
 
yeah, that is a serious problem in this neck of the woods too
 
@Gordon well that's normal, but I think it is good that you speak German too because they can learn if they are in such surrounding.
 
How is work @tereško?
 
annoying
 
For example my bosses speak English but most of the time they speak Dutch and they forget we speak English. And then I start speaking Dutch but sometimes it takes me time to explain something more complicated
 
9:20 AM
Are you any more stable monetarily?
 
heh, we have that problem at work too... the non-french speaking want us to speak french, we want to speak english with them
 
@Fabien semi-stable
 
Getting there then.
 
@FlorianMargaine Bonjour monsieur micro-ordinateur :D
 
@Fabien basically, it tests your OOP skill and basic language construct knowledge.
 
9:22 AM
@Gordon Are you a regular whisky drinker? :)
 
@Duikboot no, I'm not an alcoholic
:D
 
:D
 
@Gordon what kind of tests do you perform?
 
@Duikboot I enjoy the occasional whisky
 
OOP is good but I guess for PHP, right?
since there are some slight differences between OOP structures in different OOP languages
i.e. in PHP you can't overload
 
9:23 AM
@Fabien Where's that?
 
in C++ you have multiple inheritance
 
@ziGi you get to write a class. It has some tiny algorithms in it. We want to see how you approach that. I cant tell you the details in public :)
 
@ziGi what do you need overloading for?
 
true
 
@Jimbo Southampton. Here
 
9:24 AM
I had a dream I was at school again last night, and teresko was a teacher and he was teaching oop and throwing board rubbers at everyone.
14
 
Have you tried Glenlivet 12 ?
 
@RonniSkansing because otherwise I have to write function foo(a = null, b = null, c = null) instead of writing three functions, or I have to be more verbose
 
@ziGi in c++ you also have "friend classes" .. please don't try to hold up c++ as standard of good OOP, ever
 
@tereško I never said that C++ is a standard
?
 
LOL ( This can cause why my email is not being send on the linux system: usr/sbin/sendmail: not found ) :D
 
9:26 AM
I was just pointing that there are differences
 
actually C++ is an ISO standard
 
in C++ you have pointers and copy constructors
 
ISO !== good
 
RFC 2616 is a standard :P
 
> C++ is standardised by the International Organization for Standardization (ISO), which the latest (and current) having being ratified and published by ISO in September 2011 as ISO/IEC 14882:2011 (informally known as C++11).[4] The C++ programming language was initially standardised in 1998 as ISO/IEC 14882:1998, which was then amended by the C++03, ISO/IEC 14882:2003, standard. The current standard (C++11) supersedes these, with new features and an enlarged standard library.
 
9:28 AM
@ziGi do you write C or C++ ?
 
both
but I am better in C I think
 
Morning all
 
there are many things about templates and overriding operators and memory management that I don't know in C++/11
 
@ziGi I am learning C at the moment..
 
and?
 
9:29 AM
Morning @PeeHaa, =]
 
do you know the difference between a struct and a union
 
hi everyone
 
@ziGi I might ask you some stuff, when I get stucked up. sure I know that, I think I got the basics syntax and etc in place.. almost =] atm just started reading a socket programming book
 
@tereško btw you do realize you have the magic __get() and __set() in PHP that allow you to do the exact same thing that friend classes allow you in C++
 
no, that's wrong
 
9:30 AM
hi @humphrey [=
 
how u doing
 
@tereško
__set() is run when writing data to inaccessible properties.

__get() is utilized for reading data from inaccessible properties.
 
@humphrey I am good thanks. Waiting to hear back from a job inteview and having fun with computers as always. How about you?
 
am having a problem displaying data from the database in a list view in android using php . I managed to display it in a toast .
check there
 
@RonniSkansing I haven't worked with sockets in C so I am not sure I'll be able to help you much with the libraries
 
9:32 AM
are u going for an interviews
 
@ziGi wrong, because magic getters and setters provide a public interface for accessing otherwise inaccessible properties
 
@humphrey no I already been there. Now I am waiting for the a call in for next round (hopefully) and my exp. with java is rather small
 
you are not changing the values directly, instead you are using a unified setter/getter
 
they will call u
mosdef
 
@tereško that doesn't mean it couldn't be misused
 
9:33 AM
3 mins ago, by ziGi
@tereško btw you do realize you have the magic __get() and __set() in PHP that allow you to do the exact same thing that friend classes allow you in C++
no amount of misuse would make that statement less wrong
 
ok fine, they are not exactly the same
 
so which language do u kill the most
 
@ziGi A struct is a collection effectively right, where as a union is to do with set theory?
> physically grouped list of variables to be placed under one name in a block of memory
 
zval is a struct, _zval_value is a union afair
 
__set and __get is just a methods with additional syntax sugar, how it could used to implement friendly class?
 
9:35 AM
So... coming @Jimbo? :P
 
@humphrey killl the most (love/hate?)
 
@Fabien Lol, maybe two years from now ;-) Gotta have 2 years at each company to not be 'job hopping'
 
posted on November 19, 2014 by kbironneau

/* by Povilas */

 
anybody here who can help with androd php?
 
@Jimbo the idea in a union is that it has the size of the biggest variable in it and one variable in it changes the other too. While the struct is a collection so the variables inside are independent
 
9:35 AM
@Jimbo pffffrtt. No one cares what you did <2 years ago :P
 
know / enjoy
 
@Fabien My CV must be pristine lol
Patience!
(what's the pay anyway)
 
guys I managed to buy a small car from adsense money
 
@humphrey php/js and trying to get C under my nails
 
@Jimbo Up to 35
 
9:37 AM
okay thats great
me am a junior in all
php mysql java
 
congrats on the car btw
 
@Fabien Nah, no go for me tbh. Got 39.3 - gotta be upwards from that to move to Southampton :P
 
thanks man
 
@Jimbo Dang, that's a lot of up north no?
 
@Fabien Yeah I guess, it was supposed to be 38 but then when me and HR signed the contract it said 39.3 so I was like don't say anything.... :P
 
9:39 AM
@Fabien I am fainling to display data from the database into android list view can help ? am using php json . but it can display in the toast chckout please pastebin.com/rsQLJc0g
 
@Fabien That's how you get more monies though, jump jobs every 2 years
 
@Jimbo Agree. At least until you're satisfied.
 
anyhelp with android php guys ?
 
@humphrey , php on android?
 
yes i connected my db using php
and display data in android using php
 
9:42 AM
@humphrey , what is your question?
 
I want to display data from mysql into the android list view
 
.. oh, joy .. "SOLID" becoming a buzzword: sitepoint.com/practical-oop-building-quiz-app-bootstrapping
 
uh
those tight layers
 
I really don't like sitepoint tbh, they allow everyone to post anything. And the admin is always hovering around on posts to bat people away
 
@tereško do you think that if you make an application that has Domain Objects and Data Mappers but for example some DOs need simple things they could query the DB directly and if the DO grows just then to put the query logic into a mapper or do you consider that a bad practice because application architecture is mixed with DB architecture and the idea of DO is to separate itself from the data source.
Martin Fowler writes that you could do a single Mapper that does that but I am still fuzzy on the subject
 
9:52 AM
@ziGi The problem is you write it like that, then you leave before you refactor - instant death for the next developer
 
@tereško .. and the examples goes like..
 public function setId($id)
    {
        $this->id = $id;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getQuestion()
    {
        return $this->question;
    }
    public setQuestion ...
 
@RonniSkansing scroll down , to the "Writing a Placeholder Mapper"
 
My iPhone capitulates when tryibg to load zend_vm_def.h in lxr :-/
 
Thank you. That find() was just what I needed
Now I am also ready to write a best practice oop mvc rest solid grasp application with psr-O
 
@ziGi what would be those "simple things"? I know what you mean in theory, but in practice the domain object has at most two states: "partially populated" and "fully populated"
usually when you think of "leading simple things", what you are actually dealing with are collections
 
9:57 AM
laters
 
@RonniSkansing , psr-O? :^ )
 
> The "Service Layer" acts as an outer shell, protecting domain knowledge from leaking to clients. In effect, the Service Layer is the API which clients can interact with. These application services then calls internal domain services after sanitizing the client requests, and when responses are appropriate, they sanitize domain responses, often by mapping Entities to simple DTOs, again to prevent leakage, before, finally, sending the client response.
 
@RonniSkansing .. and it was the first piece of code that was not setter/getter
 
@tereško what kind of collections?
 
@ziGi for example, "collection of users", when you need to retrieve data regarding a list of accounts
 
9:58 AM
I see
 
User[]
Oh wait we don't have typehints for that yet do we
UserSet[] or array $users
 
but I don't consider a collection of users to be "simple things"
 
If a User is just an Entity, then it's a simple thing :-)
 
@ziGi collection is a list of "simple things"
 
10:00 AM
Where can I read more on the topic?
 
in practice you rarely use fully populate domain objects in a collection
 
well if you need to output all the data to the front end
and you have extracted it from the data source, why not creating the whole collection
 
@Jimbo Oh I wish!
 
lol
 
Morning!
 
10:05 AM
Ok, another scenario that I was wondering about it the following: If you have a User Entity and you have to query for the data depending on what you need (for example if you query for authentication and you query for the profile information) then you need to select different fields from the table that you need, so you would partially populate the User Object depending on the situation. Otherwise it would be moronic to query * every time and populate fully the object
 
We had a course called "OOP". Well I guess it was more like a course about "classes in java" (difference between a class and an object, overloading, overriding, inheritance etc...)
 
@HamZa yeah, me too, they call it OOP
 
@ziGi Fair point... if you use an ORM you can lazy load specific parts I believe. You'd use a Repository to get the data you need.
 
@sectus yea, in the article it is a O.. =] not a 0
 
Well about learning oop. I am currently learning OOP and I am starting to understand it but I feel like I am missing a gap between 'how to programing OOP' ( As you learn by doing examples ) and the UI ... How they are linked and interact with eachother.

Is this where the autoload and bootstraping comes in with a router etc?
 
ThW
10:07 AM
Morning
 
@HamZa What about that? I know how it works.
 
@ziGi You keep using "@"...
 
Ah, it's irritating, I see, and I excuse myself but the thing is I write to 2-3 people at the same time so it becomes confusing
If you don't like it I won't ping you, please accept my apologies
 
using the reply button makes it easier to follow a conversation
 
10:12 AM
hate using mouse :(
good morning
 
@ziGi What Florian said, well it's just I thought maybe you didn't know about this feature or you just forgot about it :P
 
Is ruby a good language to get full understanding of php or am I talking nonses?
 
hehehehe
 
Genuine answer I just spotted on Stack Overflow: "I would suggest deleting all your code and starting from scratch." Classy.
3
 
@Gordon always does the trick
 
user2862309
10:15 AM
Ah, I use it but if you use the @ symbol it refers to the last message of that user
 
so he found either one of @tereško's comments … or one of mine.
 
@Gordon Oh look, another JavaScript guy complaining about StackOverflow
 
mornings
 
Getting down to the end of the shirts at #reinvent. Come grab your #StackOverflow swag before it's gone! http://t.co/1AGujNcgrI
StackOverflow does have t-shirts /cc @Gordon
 
@Jimbo awwww
I would totally get one
 
10:19 AM
Me too :)
 
@Jimbo I thought when you reach 100K they will send you one?
 
@HamZa Is that how it works?
 
@HamZa it was 200k iirc...
 
200!? Dammit!
 
@Jimbo I don't know. My head says that it has read it somewhere... Not sure....
 
10:21 AM
I would literally kill and/or climb over my own grandmother for an SO T-shirt
 
wow. Way too high...
They want us to repfarm or ....
 
We can make our own on Zazzle...
 
It's not the same :(
Would feel like a fraud.
 
well that said... they can probably send one your way if you have 100k or more and you ask for one
 
@HamZa Uncle @Gordon got some swag at 100K for outstanding contribution, but that was a special case, one of the SE mods was an advocate for it iirc (Anna?)
 
10:23 AM
@Fabor Fabien, is that you haha? You look totally ripped :D
 
Yeah. Fabor is my new online programming alias.
Wife and I in Mexico.
 
@DaveRandom Oh, thanks for the clarification :!
 
@Jimbo I never said they dont have any. I said I currently dont have any to give out. I requested some swag but it never arrived unfortunately.
 
Room 11 Stackoverflow t-shirts.
StackExchange can't actually sue someone for wearing a fake stackoverflow t-shirt can they?
 
ping @Danack?
 
10:27 AM
@Jimbo Well isn't it possible to make methods for obtaining different data in the Mapper and then you just populate the Domain Object using that data based on the case.
 
Imagine I got given one from a now deceased relative as a present and I am wearing it in their memory.
@ziGi I don't know, I always like having a nice, always up-to-date entity. Sounds like these extra things should be lazy loaded associations
 
@Jimbo SUE!
 
lol
 
@Jimbo Not for wearing, probably for selling
 
@Jimbo what are you implying by that. That if you have to do what I suggest that the code is smelly and it has to be split?
 
10:29 AM
@ziGi No not at all?
 
That said, if we get permission to reproduce the logo onto some special room-11 T-shits, I'm sure that would be fine
 
@ziGi I'm still thinking about your "selecting * all the time is a waste" . So, perhaps having lazily loaded associations for the things you won't need all the time, so that only when you call getX() (class method) does it actually go and get it... or something...
@DaveRandom I think that would be amazing
 
That assumes we could get permission, but SE are generally nice and reasonable people
 
ThW
Yeah, got a confirmation for PHPBenelux. happydance
 
or this one hahaha zazzle.nl/…
 
10:31 AM
@ThW speaking?
 
ThW
Yes :-) PCRE
 
wow E150 (don't have a euro symbol on my kbd), that's pretty good value
 
@ThW High 5!
 
@Jimbo @AlmaDo once told me you should basically never SELECT *, on the grounds that you almost never need every single column in the database unless you are providing some interface to directly inspect the raw data, and it implies that your application doesn't know about it's own database schema. I think he's probably right, although I have yet to effectively apply the policy to my own practices
 
@Jimbo yes, sounds smart, so basically what you are saying is that when you need a set of fields (from the DO) to be used, you just provide the mapper with those fields and the returned partial data is filled inside the DO
 
@DaveRandom I haven't either... but I think if you use an ORM (I'm thinking Doctrine), it allows you to do this pretty easily
 
Yeh well if you use an ORM you have a whole host of other problems...
 
@DaveRandom can you quickly summarize?
 
@DaveRandom That and you can see the fieldnames by looking at the query
It's win all over the place \o/
 
@HamZa Nice! 100% Cotton, I like
@DaveRandom lol... but it helps you write nicer code :(
 
10:39 AM
@ziGi Big and slow and unnecessarily complicated for almost every application, abstracting away an abstraction
 
AbstractFactoryFactory
 
@DaveRandom ok, I see
 
@Jimbo Only if you don't look at your ORM wrapper code, which needs to be maintained as well
 
@DaveRandom Wrapper code? I get entities, repositories and the EntityManager and that's pretty much everything ever needed
 
@JoeWatkins isn't there today?
 
10:43 AM
I'm here
 
oh!
morning :)
I was waiting for you to have your opinion on this, when you'll have time and will want to do it
and discuss a little bit about what to do with you
 
looks okay
 
(i.e. do you pull -f my branch or do you close your PR and let me open another one... I don't care either way, your choice)
 
I'll close the pr, you do it ...
 
10:47 AM
This is a CodingLove gif waiting to happen. Just needs a scenario.
 
@Jimbo Until you realize that hundreds of queries are happening on every page request and then you need to cache everything and optimize wherever possible, spending way more time that you would have otherwise... :(
 
done
 
@Patrick If you use the query builder, it concats everything into one query where it can, and uses proxies too
 
@JoeWatkins ty
 
@Jimbo how does the EntityManager work and when do you use it?
 
10:50 AM
@Fabor "When I test the bug-fix I copy-pasted from the internet"?
 
heh, sounds perfect :P
 
@ziGi I use it to save new entities to the db. Not sure if it's used by repositories or not (possibly)
 
Do it -_-
 
We had a discussion in here a while back about repositories having a save(User $user) method that uses the entity manager to do a save() and flush() within a repository method
I can't remember what the outcome of that was but it made sense.
 
Like AR?
 
10:52 AM
@Jimbo aren't the Repositories the ones that have the queries and ways to communicate with your DB?
 
Morning
 
@ziGi Yep, you use the query builder within them and return your entities
 
@Fabor no. the repositories save, not an entity saves itself
 
Ah right
 
Repositories retrieve?
Entities don't save themselves, they're dumb objects
 
10:53 AM
@Jimbo "We had a discussion in here a while back about repositories having a save(User $user) method that uses the entity manager to do a save() and flush() within a repository method"
 
The entity manager is the one that saves, but we were discussing using the entity manager in repository methods to save
 
Yeah doing that at work. But these days I would rather not use doctrine to be honest, had too much trouble with it
 
I'd like to read the whole doctrine book and get a real handle on how it all works
Can't make an informed decision until I've done that tbf
 
@Jimbo do you have any examples of such a flow and if it is not much of an imposition can I take a look?
 
Is there a way in php where i can show only current weekday and keep keep showing that weekday until that week is not past.. as the current week passes next weekday will show..and week days includes only business days..
please help
 
10:56 AM
feedback on a mail I'm going to send to internals: is it too pushy?
Hi list,

Since it's an often-requested feature/often-brought up bug, I think this PR should be pushed for merging: github.com/php/php-src/pull/904

The patch itself is not very big, and the feature not complicated to test. I'd like to see this merged for the next version :)

Regards,
 
@ziGi Here's a very basic repository, that uses the entity manager and builds queries to return entities
What I was saying is you would have a save(Server $server) method in there, and you would use the entity manager in there to actually save
 
@Florian ship it
 
hm
I'll add a note about not wanting to be pushy...
 
it's not pushy, it's a year old isn't it ?
 
well, true.
 
10:59 AM
if you don't push for shit to get done, it won't get done ...
 
shipped
 
you done master patch
?
 

« first day (1495 days earlier)      last day (3453 days later) »