« first day (1527 days earlier)      last day (3418 days later) » 

OIS
2:00 AM
@zerkms in earlier days almost all teachers were male and the best qualified were male. But as they accepted more females that changed.
 
but the plan is: 1) split 2) pick one maintainer per lib 3) announce 2.x version LTS 4) move all libs to a free semver-based path (allows for quicker rewrites/iterations without worrying about BC too much)
@Danack so the idea is that Zend\Stdlib 2.x may work with Zend\Code 999.x
just fyi
 
@OIS again: I care of the result quality. I don't care of number of X chromosomes. Like, I don't care at all
 
enough
 
-------------- END ---------------------
 
@ircmaxell I am not good at language design - but 'Any' ≈ 'stdclass' doesn't seem that terrible.
 
2:01 AM
well
 
@ircmaxell who has $a and $A?
 
Foo foo = new Foo
Any bar = "this is a string"
foo = bar // <-- legal with those rules
@AndreaFaulds I think its more common than you'd think (horrible, but more common)
 
@ircmaxell What's the problem?
 
OIS
wait, I thought @AndreaFaulds went to bed
 
2:03 AM
Nah, I went to play CS:S :p
 
OIS
fun fact: the first programmers where all females
or the first "computers" more accurately
 
fun fact: the number of women taking CS declined in lockstep with the home computer revolution
 
@AndreaFaulds That is not a 'fun' fact.
 
@Danack Yep!
 
How many doritos I can eat in 10 seconds - that is fun.
 
2:05 AM
So why don't they apply on CS education?
 
@Danack how many?
 
Enough
Seriously
 
@ircmaxell ?
 
@ircmaxell you work for google, you could help with a google chrome extension issue? :D j/k
 
OIS
why can't we discuss this here? more female programmers would be huge
 
2:07 AM
Its not a constructive conversation.
 
I think it was a depressing conversation, but I don't see why it should be stopped
 
nativeMessaging is a PITA... there's no network tab to see what's wrong, and logging is meh at best
 
OIS
@FlorianMargaine have you tried reading the error log?
 
> and logging is meh at best
 
OIS
2:09 AM
that solves 99% of the errors...
well, at least 90%
 
I'm not talking about php, sorry
but a chrome extension communicating with a native application
 
I love my elePHPants
 
OIS
@ircmaxell you work for google?
 
Yes
 
OIS
why doesn't google release better php libraries?
 
2:13 AM
Because NSA
 
lol
 
You say "enough" then continue discussing it
it's inconsistent
 
@Ocramius please check irc
 
OIS
you can't give a link like that then say don't discuss it
 
2:16 AM
@OIS he actually can do so, he has a ban-hammer :-D
 
OIS
that's why I said it, cause it would be nonsensical
but I wouldn't continue discussing it anyway
I would like to go off on a tangent, but probably can't ...
 
atan()->go()
 
OIS
well, a tv broadcasting company in sweden went after a someone who wrote rape and death threats on the facebook wall of a female who wrote about female issues. They generally just said they didn't think it would matter
and after reading that I just felt ... and questioned ... really?
I always wondered why ppl would write rape and death threats with full name...
cause stupid
 
2:32 AM
Let's talk about scalar type hints!
 
OIS
I want non forgiving scalar type hints
this is prolly were I disagree with ircmaxell!
I want a int to be int incomming and float to be float incomming!
 
Non-forgiving scalar hints would be nice in some respects, but it's rather "un-PHP"
 
> but it's rather "un-PHP"
!!!
 
OIS
scalar hints is non-PHP
I would like scalar hints to mean "I don't have to check this in my code"
 
How often do you check it?
 
OIS
2:35 AM
@zerkms every time
 
Provide a quick example?
 
OIS
depends on the usecase
 
function isEven(int $num): int {
    return $num % 2 === 0;
}
 
@OIS just open a random file in your code and provide an example
 
OIS
but usually is this bool? is this int? is this float? is this string?
 
2:37 AM
well, I cannot imagine myself to be doing a lot of such checks
that's why I'm asking
 
OIS
then I have to connect my max which is where I program
* mac
 
any opensource library may be then?
 
OIS
but anyway, I always check type if it can make a difference, and a lot of times it can
 
well, I'm still curious of a real life example :-)
 
OIS
opensouze ctype_digits ?
* opensource...
 
2:39 AM
ctype_digits cannot be hinted
 
OIS
or just (int)
 
even if there were scalar type hints
 
OIS
@zerkms scalar values can not be hinted!
 
well, provide a scenario where we need it
^ ^ ^ "even if there were scalar type hints"
 
OIS
if I want an integer for an sql query
 
2:40 AM
it's too abstract
 
OIS
how is scalar value too abstract?
(int $id)
 
well, if I accept input from user (like id) and pass it as a parameter to a query
I don't care of its type
I just use prepared statements
and specify it's an integer
otherwise - it just does not pass validation
so I again don't need to have scalar types - because it's not possible for garbage to get there
 
OIS
...
 
That's right - that's why I asked a real life example
You treat it as a replacement for validation, which it is not
 
OIS
I usually check before I make a db query to save that time and to get the error message better...
 
2:44 AM
that's what validation is for
 
OIS
and also what about page x of n
 
it's validation again
 
How about public function setStatus (int $code, string $reason = null) { .. } ?
 
OIS
of course, validation is what it's about
 
sure
input parameters are strings
always
so you validate and cast it explicitly
 
OIS
2:44 AM
meqans I don't have to validate in the method accepting the values!
 
after that it's TOO LATE to use static type hints
 
OIS
instead of every method wchich accepts a value
 
you only validate once
 
OIS
no, every public method has to validate input unless there is type hinting
 
:-S
that's why I asked real life example from your code
since I don't see how it's possible
 
OIS
2:46 AM
it's a chain of validation
 
well, unless there is a particular code example from real life project - it does not make sense to argue about it
otherwise it's just an improvement for something that does not exist irl
 
OIS
from the controller to the last method you call, you should validate the input
 
well, show that
 
OIS
but you might not have to validate it's acutally integer
Im not sure how difficult this is to imagine @zerkms
 
2:49 AM
@OIS well, I'm a technical specialist, so I like to argue about real things
 
OIS
@zerkms then you always check for int in ALL your public methods
 
@OIS the thing is that - I don't
that's why I ask about a real life example
 
OIS
so much for technical specialist
 
@zerkms What about that? Valid use case for scalar type hints
 
@kelunik it is an example where types are implied
I was told that you have to check it everywhere
And then I see a method that does not follow the pattern
 
OIS
2:53 AM
I really like the type hint array
agreed?
 
Agree, because it's a composite type
 
OIS
if I could get one for int I would be estatic
 
there is a strong distinction between scalar and composition type in php by defisgn
 
OIS
don't care about anything else
 
@zerkms Just because the author didn't check everywhere, is this a reason not to introduce scalar type hints?
 
2:54 AM
but there is no that much distinction between scalar types
 
You can losslessly convert bool, int, float to string
 
@kelunik of course not. I was told that they do it everywhere, that's why I asked an example
 
OIS
also bool
 
and sometimes convert losslessly from string to bool, int, float
 
since I cannot imagine it to be possible
 
OIS
2:55 AM
@AndreaFaulds but I need the acutally type sometimes
I hardly ever work with bool
erm, float
I harldy ever work with float
 
Well, casting hints will convert the input for you.
 
OIS
since float is so unprecise
but I want code to convert the code first
 
function foobar(int $foo) {
    echo gettype($foo);
}
foobar(1.0); // "integer"
 
OIS
the code which call my function will be better at converting it then a general string to float
or string to int, or string to date
 
Well if you want to convert it yourself, nothing stops you.
 
2:57 AM
what's stopping you from converting it first?
ninja'd
 
OIS
well that would be datetotimeinterface
@PaulCrovella that's what I want, convert it BEFORE passing it, don't convert it with PHP "magic"
 
so convert it before passing it
problem solved
 
OIS
aye, but if PHP "converts" it then 99% will do that
no checks, no controlls
"shitty code" like was said when I entered this chat
 
PHP can't do date conversions for you
It'd just error...
 
> "shitty code" like was said when I entered this chat
it will be fragile
not "better"
 
OIS
3:00 AM
there is still DateTimeInterface
 
that's the point
 
OIS
just don't know why DateTimeImmutable has fromMutable whcih don't accept DateTimeImmutable
it should check DateTimeInterface not DateTime or DateTimeImmutable
 
don't get me wrong, i'd prefer strict types. i just don't expect them to happen and i think the bulk of the arguments presented (particularly those declaring what "99%" of people will do) entirely overblown
 
@OIS btw have you tried haskell?
If you haven't - try one day. Optional type inference + strong static typization is impressive combination
 
OIS
@zerkms nope, but I have a book about LISP I want to read
 
3:04 AM
I haven't seen strongly typed LISPs yet
 
OIS
btw I have programmed in C, C++, VB and Java
 
(I didn't have seen many of them though)
C++ isn't strongly typed as well
as Java
they perform implicit converts
(as soon as types are guaranteed to be convertible without loss)
 
OIS
@zerkms well, I mostly want to learn LISP cause it seems different, not cause it's what my job prospect is
 
@OIS that's why I played with clojure, yes :-)
it's for fun
 
OIS
aye I want to learn clojure :)
 
3:06 AM
it is amazing
very basic concept but very expressive
 
OIS
@zerkms Ill call on you as a guide if I need help ;)
 
@OIS there is a really helpful #clojure @ freenode :-)
 
I don't have too much of real experience - my the only real project was discarded due to clojure memory consumption :-(
 
OIS
my usual rule is don't pgroam in a language noone knows ...
*program
 
3:13 AM
and then you end up developing java :-)
 
OIS
lol
I'd rather develop in javascript
I've seen some bad Java code...
the language is not so important as the developer
and btw... allowing arrays as constants...
I have to say I don't like it
 
@OIS you can write perl in any language
 
OIS
if ppl start to define arrays as constants, ppl are going to ask how they can change the,
* them
 
(I hope I didn't insult any perl developers here)
@OIS what is wrong with array to be immutable?
as for a person who is about to learn clojure - it should become natural
 
OIS
in PHP, you should simply have a (static) method returning an array
LISP is a different language
 
3:20 AM
immutability is applicable for any language
 
@OIS How so? In C you can have constant arrays, nobody tries to change them.
 
it's just a language-independent approach
 
And bear in mind that strings are basically just arrays of characters.
 
OIS
strings are immutable in c as well
iirc
 
The ones in source code are.
 
3:21 AM
@AndreaFaulds which is very nicely demonstrated in haskell, which does not have a distinct type for a string at all!
but an alias for a "list of characters"
 
@zerkms Yep :)
@zerkms Also in C
Hah.
 
s/characters/bytes
 
typedef const char* string;
Now I can confuse C++ programmers >:D
 
OIS
@AndreaFaulds I just see half the questions on SO being about changing constant arrays..
 
@PaulCrovella they are characters in haskell
unicode codepoints
 
OIS
3:23 AM
and you know they will be abused
 
@OIS What questions?
 
just talking about php there
 
@OIS Abused?
 
OIS
aye
if you spend any time answering questions on SO you are amazed at the general ignoranze of most ppl. Google is a higher barrier for most then SO it seems.
 
that's not "most ppl". selection bias.
 
3:25 AM
@OIS Sometimes Stack Overflow destroys my faith in humanity for this very reason.
 
OIS
most ppl being questions on SO..
 
@OIS it's actually more about laziness
 
OIS
of course I don't ask many questions on SO
cause I generally find the answer faster with google
 
Halfway through trying to condense every question I've ever wanted to ask on here to fit the format, I find the solution.
 
@Mark that's part of the reason for the question format/standards
 
3:28 AM
@PaulCrovella Makes a lot of sense to me.
 
it's amazing how many people I've asked for a mcve only to never hear from them again
 
OIS
@Mark that's the way it's suppoed to be, but I see the php tag many questions are solver with site:stackoverflow.com [question]
 
@OIS Works great, until you see a Bit-Wise Operator in PHP for the first time and try dumping it into the search field. (True story)
 
OIS
@Mark I learned bitwise operator in C so I dunno
 
@Mark, you think that's bad try figuring out how this works
 
OIS
3:30 AM
but would be interesting to try
perl, for those who don't care about programmers health
 
Imma sleep, g'night folks :)
 
'night
 
I have to support some Perl Scripts at my job, it's painful. Trying to get them re-written in C# right now, but my boss isn't biting because HE doesn't know C#. He doesn't know Perl, either though.
 
OIS
gn @AndreaFaulds
 
@Mark it runs on windows?
 
3:32 AM
@zerkms It's compiled Perl
 
@Mark I asked about the software
 
OIS
@Mark you code in C#?
 
But also yes, where I work all the servers are windows.
Yes I code in C#
Somethings I just don't want do in PHP
 
OIS
I just asked cause you specifically mentioned your boss doesn't know that
 
He wants me to re-write them in PHP.
How you run PHP client side, I don't know.
 
OIS
3:37 AM
you can't run perl clientside either
so I don't really see the question
 
What exactly do you mean by client-side?
 
It's compiled Perl
Client side meaning: we compile the script into an EXE and deploy it to a network drive and anyone can run it
 
Ah, fair enough ... I do believe this is possible, but nothing official.
 
OIS
compiling perl... you can compile PHP code too...
 
rewriting perl scripts in python can be cathartic
 
3:42 AM
There's a precedent to our compiling perl scripts, some of the run on the servers to handle large file imports.
We've never done anything like compiling php
 
OIS
@Mark just saying, compiling ...
 
@PaulCrovella if it's windows - why not .net again
 
Well we'll do anything twice, it's convincing them to do it once that's the problem.
 
@zerkms I didn't say anything about .net
 
@PaulCrovella I know. It's just a more natural choice for windows environment
especially keeping in mind python interpreters are not installed on windows by default
and you would need to pack it into the executable
 
OIS
3:47 AM
best not run any code on windows ever except in a browser
 
The plan is to send everything server side to a que to be processed
But they still want the actual processing in php
 
OIS
gn
 
aww man, when a post starts with "I hope to god I'm asking in the correct place..." I just don't have the heart to close vote
 
 
1 hour later…
5:22 AM
any suggestions by anyone on the best redis client library for php?
 
 
1 hour later…
6:49 AM
so morning
 
7:23 AM
moin @cspray, @cspray's beard ...
 
7:50 AM
Morning room
 
moin
 
@JoeWatkins, I recently came up with this. Can we do something similar for php? pThreads has everything that's needed here. I don't have anything against javascript, however, I can't organize code in JavaScript as I want (my lack of experience with javascript, for sure).
The reason I don't want .net is that I am tired of being bound to that platform. Also it's pretty slow when things need to get dynamic
 
what do you want to call from where ?
 
I want something very similar to php extensions, or V8 addons (in terms of nodejs). I.e. I want to have interface programmed in php and simply call it from callbacks in nodejs.
The reason is that nodejs handles sockets way better than php.
 
you would need someone who knows about node internals to make that happen, I don't ...
don't see why not though ... it obviously can be done ... no clue how ...
could probably start with owin as research it looks like ...
but I'm clueless ..
 
8:02 AM
@JoeWatkins Thanks. Now I have starting point.
 
owin redirects to edge now
does node have api documentation ?
you might be better off not starting there ... is very .net specific...
start there, or read api documentation for node ...
also there is a v8 php extension iirc, worth a browse most likely ...
 
@JoeWatkins nodejs.org/documentation Api docs is the most interesting part, imho.
 
yep, it's all there ... looks simple enough ...
what you want is an addon, with the kind of functionality you find in most extensions in the addon rather than a php extension, you basically just need object_init[_ex], object handlers table knowledge, and class and function table knowledge and you can definitely make that work ...
the trickiest bit will be getting the layout correct actually ... not so easy to load php externally to php ... not least of all because most builds don't have a shared library ...
you might think about (read: be forced into) using the embed sapi actually ...
imho though, it might be better just to write a better sockets implementation for PHP ... that has to be simpler, and solve the actual problem you are having ...
a new socket extension with a nice OO api and all the bells and whistles is going to be more useful, the chances of this happening in core are quite slim, but there's nothing wrong with pecl ... everyone talks about making resources objects, but that's a massive change, breaking so many things that I don't think there will ever be a release of php where that is okay ... we can introduce new api's and deprecate the old, but delete the old ...
people are arguing today about whether to remove mysql from 7, been marked deprecated for many many years ...
tl;dr if the root problem is actually poor socket abstraction and API in php, then fix that ...
 
8:23 AM
@JoeWatkins Actually, that's a fair point. I thought it'd be simpler to make bridge but now I see efforts needed are almost the same.
 
sockets are arguably easier ... there are many extensions abstracting ev loops and more modern socket handling mechanisms, however they are all guilty of being ignorant of the way php works in some situations, you are plugged into this room and can just ask all the way through development ... I'd love a new sockets library to come out of room 11 for php7 ...
 
Yeah, and we have DaveRandom and rdlowrey. /me thinks time to get back to learning php internals
 
yeah daniels work serves as a good starting place for reasoning about the API ...
he mentions in his documentation the only problem with scaling sockets in php as they are is that the select call is crap, everyone knows this, so in some sense the research has been done for you, create a nice OO API and avoid select and we should have something that scales further than what we have now ...
and there's time to find out what is wrong with that approach before php7 is even in wide use ...
there will be something wrong with it ... but time is something we have for the first time in several years ...
I wouldn't just copy API's verbatim from daniel, he'll have made some compromise for the way php works that you may not have to make in an extension, but definitely good starting place ...
@bwoebi ping
I'm getting stick about phpdbg documentation on twitter ... apparently we're not doing enough to "keep modern php above reproach" ...
gonna have any time over holidays or you busy ?
imo there is nothing wrong with the select call, it would scale as far as we can make use of if it were programmed better ... in C you have fd_set's and use memset/memcpy directly to fill them, this is much different to the same call in PHP, populating hash tables and deconstructing them is expensive stuff that could be avoided if you provided some better way of manipulating fd_set's correctly ... there's no denying that modern stuff has nicer api's, however
used correctly, which is in part what modern api's are actually doing, you can squeeze performance from the old stuff just as well as the new ...
 
8:44 AM
good mornings.
 
moin
 
9:01 AM
morning
 
moin
 
I think (hope) the worst of my food poisoning has passed.
Going to take it easy today and try to eat.
 
sounds rough ...
 
Could've been worse. Only 24 hours. Some people take days. I think I spent about 3 hours out of bed total yesterday.
 
oh that sounds hard. my best wishes.
 
user1607528
9:16 AM
good day, is it really a bad idea to serialize and store array in database. It is just info about something, nothing to relate to other fields or tables later on, at least what i know now.
 
@Muhammet if it is just a binary blob, store it as a binary blob.
 
user1607528
9:32 AM
@hakre, no it is not binary data, 3-4 strings to display later on
 
@Muhammet well if you serialize it it's binary data. if it's not binary data then you wouldn't have serialized it so then this would be an argument against storing it in the database serialized.
strings ship with encoding. the database does a lot of work so that text is stored properly inside the database and transferred just right between database client and server. this at no case should happen with serialized data. hence serialized data is binary and must be stored as binary blob within the database.
 
user1607528
9:48 AM
thanks @hakre, i didn't know that, i thought the array is just encoded formatted as a string Edit ( I think I don't know how to differentiate string and binary date )
 
@Muhammet yes the result of serialize() is a string, it's just that strings in PHP are binary.
so there is no difference between a string and binary data in PHP.
 
user1607528
@hakre looks like string when you look at it :) , not like 1d0f04 fd031 what i first thought
 
@Muhammet that is because your terminal as well as your webbrowser display binary data normally as text - not as a hexdump.
 
user1607528
@hakre got it, no way to know if you don't know from docs then))
One more question, I want to learn right way to do this :
I have an app that submits songs, and in the form there are checkboxes for different `categories` `moods`. So I was thinking to store these category, mood in many-to-many relationship, but for example there will be like 20 rows for one song if 20 categories, moods checked
 
user1607528
should i just store them like category_ids_column -> 1,2,5,7,8,9,3
 
user1607528
9:58 AM
but then if i want to get songs that belong to id 9, it is not right
 
you want a relation here, so normalize that in the database. it allows you to search for that quickly.
an alternative is to store this in a manner you can quickly search for it: "[1][2][5][7][8][9][3]" this ensures that looking for 1 won't search for 10, too.
but what you have here is just that you can think about multiple possible ways how to solve your persistence needs. each comes with pros and cons. you could perhaps just grab a sheet of paper, put a line in the middle and list pros/cons on each side for each of these methods. additional some lecture like the SQL-Antipatterns book might open your mind for more insights and options.
 
user1607528
thank you @hakre, appreciate your help. I think I will create categories_songs and moods_songs tables for relation
 
most likely categories and moods are actually the same: a taxonomy. so you could normalize this and have one relation table that also references the taxonomy. this could be done with compound keys.
you can then add another taxonomy later on like bit depth or whatever.
 
Morning
 
user1607528
10:18 AM
ok, I will do some reading on this )). Thank you
 
user1607528
my concern was to have a lot of rows
 
user1607528
even for one song
 
user1607528
i guess that is ok
 
10:47 AM
well ... bitmask ?
I think since there's only a limited number of sensible moods, you could use a bitmask, and live with the limits ...
 
ringmon
 
indeed
 
Uuuuggggh morning
 
Christmas is so close
Maybe I should announce the scalar type hinting RFC on the 25th.
(jk)
 
hello
maybe somebody could quiclly help with vagrant and connecting to mysql
?
the php server is in vagrant image
but mysql is in host computer
and I dont get how to connect from vagrant to mysql
 

« first day (1527 days earlier)      last day (3418 days later) »