« first day (2810 days earlier)      last day (2137 days later) » 

12:03 AM
> There might be ordering metadata that is private, too.
That sounds like a problem that needs to be solved with package level visibility, rather than multiple responsibilities in the class.
 
12:16 AM
I can't seem to build php-src right now.. pcre broken?
 
master is OK on travis as of 3hrs ago
 
PCRE2_CODE_UNIT_WIDTH must be defined before including pcre2.h
Was compiling just fine, then rebased on master and ^
 
make clean; git clean -f; ./configure ?
may be missing some file generated by configure or some other such weirdness
when was you last HEAD from?
 
Maybe a week ago?
Nope, no good. So strange.
 
nothing jumping out at me from commit log, lxr doesn't turn up any def of it but that doesn't mean much tbh, it's not ultra reliable
I don't really understand m4sh...
but it's definitely a configure-time def
@Danack valid point, also I'm not super-keen on using == for anything already, adding hidden magic doesn't feel like it's helping that...
 
12:35 AM
@DaveRandom how's your job search going?
 
@Danack oh, I may as well just reveal this since it's now more or less official: I will be working at platform.sh \o/ (thanks in no small part to @FlorianMargaine)
18
 
@DaveRandom grats!
 
nice.
 
it's a million miles away from what was imagining, which is one of the best things about it
 
12:49 AM
hello can any one help me with this
//sort button
if(isset($_POST['sort']))
{$sort=mysqli_real_escape_string($conn, stripslashes($_POST['sort_by']));}else{$sort='time';}//different sort values from a list

//html table user sees
$query= " SELECT * FROM $data_base.$table ";
$result = mysqli_query($conn, ($query));

$results_per_page =32;

$num_row = mysqli_num_rows($result);
$total_pages = ceil($num_row / $results_per_page); //Calculate total pages with results

if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; //To get page value
i am supposed to do this with one query but i cant seem to archive it
 
@DaveRandom Congrats! Did that happen becouse of you guys working together on shifting lxr to platform.sh?
 
basically i just want to display data from data base and paginate it with one query
 
1:17 AM
@BobbyAxe it's not possible to do it with one query. If you think about it logically, a select statement returns a result set, i.e. tabular data, a list of rows. You can't extract information that does not fit in this model of "a table".
however, you are probably looking for SQL_CALC_FOUND_ROWS (google it)
@mega6382 no, apparently a large number of people are under the inexplicable impression that I am good at stuff
 
@BobbyAxe for the love of anything that is holy, read PSR-2 and format your code so it's not an eyesore
 
my gut says that giving them standards is not useful for what I assume is a beginner
 
but it will help him when asking questions in the future
 
someone should cover PDO and the numerous sqli vectors but I don't have time rn
 
@PeeHaa needs to merge my tutorial page :D
I think I have that on there
 
1:22 AM
@Tiffany sure, but just basic indentation lessons and how to do code blocks are probably sufficient, PSR-2 is a big scary beast for a total newbie, full of loads of stuff they don't need to know and won't care about without some more experience
 
I guess I should've specified the sections
the classes part can be ignored
@BobbyAxe addendum: read sections 2.4 and 5 of PSR-2, other sections can be ignored for now
 
@DaveRandom Well, when someone has an opinion about a lot of things, people tend to think that he might know what he's talking about. :P
 
Twitter, reddit and basically the entire internet are evidence of why that is a poor hypothesis
 
lol, you are right.
 
@DaveRandom well, you're better at Windows crap than our server admin, since you figured out how I can pin a web server to my favorites without it fucking up and requiring me to restart
using a UNC path, that is
I can't remember what the reason why the web server would keep me from accessing it, I want to say either my machine had updates, or the server had updates... or something else along those lines
 
1:37 AM
stale smb session token coupled with poor protocol design
I know a trick because it's a problem I have had a lot
 
:-P
 
people don't understand randomness, the effect is very prevalent with 50/50
random != changes frequently (necessarily)
 
Jeeves says I should play a stormcaller, but I'm still swinging towards seer
just cause I remember playing a seer years ago, and destroying everything with the distortion wave
watching my enemies' ragdoll corpses being flung towards the virtual ceiling of my screen
 
2:03 AM
good night
 
\o
 
2:17 AM
@DaveRandom thanks i am reading about it now, but leaving my code aside is there any possible way to display and paginate data in one query
@Tiffany thanks its just a bit difficult doing it on a mobile :( while on a train, will keep neat next time
 
2:47 AM
@DaveRandom congrats :)
 
3:07 AM
@DaveRandom Congrats! Is this where you were going to be working with Go or was that somewhere else?
night all
 
3:36 AM
anyone using docker here?
 
No I use Laravel
 
you dont use docker for your laravel?
 
I use vagrant and homestead
 
3:51 AM
You're welcome.
 
To anyone know about docker this is my question

https://stackoverflow.com/questions/50871175/laradock-in-laravel-got-py-error
please help
 
Timezone is incorrectly applied when converting dates beyond 2037 – #76530
 
4:54 AM
moin
 
o/
 
@DaveRandom grats ... what you doing there ?
 
@DaveRandom \o/
 
5:50 AM
Why newItem doesn't combine with the array? 3v4l.org/PCE5v
 
6:30 AM
@Shafizadeh read the docs
If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator:
 
Yeah got it .. I resolved the problem ... thx
 
@FantomX1 Come on... put some effort into your question
 
the issue is I currently dont have residual clues, I can read php://input via https but not via http, I updated it where normally browser redirects to https, but I receive http response also via http postman
 
6:46 AM
mornin
Is there some free online tool to create pictures with source code inside a window like this ?
 
Gimp + Take a screenshot from your IDE?
 
hey all i am working on url validation but didnt found any matching function or regular expression for my case
url : http://ba. is seems a valid url in filter_var($url, FILTER_VALIDATE_URL)
any one have gone through with same case
 
7:07 AM
@Patrick that will take too much time for me, I think there should be another way to do that
 
I'm so disappointed in my current job :/
 
@Alesana
why
 
I was so excited to be working on a team, learning new things, and building quality websites
 
But it's become really apparent that all my work cares about is making websites look good to their clients, no matter how horrible they really are
 
7:12 AM
and then what happen..
 
@Alesana you work for an agency?
 
@Gordon Yeah
I am seeing 20+ seconds load times (on desktop), leaving the MySQL user and password as root:admin, tons of HTML syntax errors,
 
working for an agency means tight arbitrary deadlines, overhours and no sense or time for quality.
 
That explains my concerns exactly
 
@Gordon thats ture
 
7:14 AM
The frustrating part is that we focus on SEO - and when a client complains that their site isn't ranking we tell them that we will rebuild it and we rebuild it worse than the first time
Because of tight arbitrary deadlines
We could spend so much less time actually doing something for their website and they wouldn't be complaining, but they want the clients to see that we're working for them more than they want us to actually work for them
 
@VishnuBhadoriya filter_validate_url will validate that a URL is syntactically valid, which http://ba is. What most people usually want is to validate a subset of URLs, usually domain names.
@Alesana afaik this is how all agencies operate: make it look pretty fast. next job.
 
@Gordon so is there any way to validate this
like any similar s.o link
 
moaning
 
@VishnuBhadoriya If you want to actually validate that a URL is active/valid you can do use some API to do a DNS lookup, if you want to just confirm it is a valid domain then you could test it against a current list of TLDs/gTLDs/etc..
 
7:21 AM
@Gordon I didn't particularly look for an agency but I assumed that it would be as good as any other place. I guess not
 
@Gordon and @Alesana thanks
i will look into those links
 
It's just really disappointing because I was so excited to finally get my first job doing web development type stuff, learning new things, getting practice, etc.. But in the end I am forced to produce horrible quality work that I'm not proud of, and all without learning anything
> People who work at agencies read this, and laugh because they can relate, but when they are done laughing, they just get sad. Really really sad.
That was actually really accurate to my experience, I thought I just found a rotten egg :/
 
please plus points on questions, no hate stackoverflow.com/questions/51036305/…
 
That's the average output when I put one of our websites through an HTML Validator :P
 
7:33 AM
totally normal
if people cared for valid html, there wouldnt be no html5 but xhtml2
but no… everybody was whining that xhtml was too strict and draconian and it would break websites if you just made a tiny typo… all just because hordes of "webdevelopers" couldnt be bothered to learn the very little rules.
so they invented html5… which basically has no rules and forgives everything
 
"tiny typo", that's shouldn't be a thing when it comes to HTML. It's either a typo or not >.<
 
a lot of it is to blame on broken tools as well. people have been using wysiwyg editors, like dreamweaver and they didnt produce valid html
 
Not closing some tag should cause some error instead of being rendered
 
or they painted their websites in photoshop and then exported it to a table layout with images
 
Ha! That sounds like something that my work would do
 
7:40 AM
yeah, because agencies tend to have designers that know how to use PS but dont know how to author any markup or code
@FantomX1 we are not a charity. put some code so people can actually see what you are doing. right now you are just making assumptions
 
My work actually used to use a website creator with Wordpress called Elementor, it is the most insane hunk of shit I've seen in a long time. I finally convinced them to move away from it but most of the websites are still made with it.
If you wanted something to have 15px padding on mobile, but 30px padding on desktop, you would have two almost identical elements, one with 15px padding which is display:none; on desktop, and the other which is 30px padding and display:none; on mobile
 
if you want to do actual software development, don't work for an agency. agencies usually just do microsites for marketing, meaning they are heavily focussed on how it looks and less on how it's built.
but it's good to have had a job in an agency at least once, so you now know what you dont want to have ;)
5
 
Haha yeah it's definitely an eye-opening experience. I do want to look for something else but right now I'm working from home which is convenient while I'm dealing with some other things
In a way it's a confidence builder though - I was convinced that everyone who worked in anything web/software related had much more experience than I. Turns out that's not the case.
 
7:59 AM
@Gordon true that, good 'dea I provided some examples, if nothing more, the question can serve as a unifying point when others might come with similar problem instead of duplicating questions and trying to see the possible backgrounds of it
 
benedict a newly married man, especially one who has been long a bachelor.
 
\o
 
o/
 
\o
 
8:17 AM
o/
 
p/
lol
 
@DaveRandom congrats :-)
 
ooh, congratz indeed @DaveRandom
 
With what? :o
 
8:20 AM
I concur, congrats! @DaveRandom
(IDK if I used that word correctly)
 
My condolences @FlorianMargaine
 
:P
 
@rtheunissen I think it's the task of the caller to tell how I want something ordered. It also isn't very extensible, as all objects within an array need to be aware of all possible contents of the array. A caller site knows what can be in there, but the objects themselves have no idea what their neighbors are. They can support a specific set of neighbors, but don't know them all. I also don't see why you'd want to order with internal state...
In addition to that using a single callback for the whole ordering completely avoid the object1 reports being less than object2 and object2 reports being less than object1 - the implementation is now at a single place.
 
It's not hard to write a static function and do usort($array, [MyClass::class, "sort"]); - bam no magic involved, it's obvious which function is being used when debugging and is absolutely flexible allowing for swapping
(and if all elements of $array are instanceof MyClass, that orderer still has access to private state if needed)
 
8:30 AM
morns
@FantomX1 By plus points, do you mean upvotes?
 
morni
 
/me is looking at a one...file... angular app, that was minified and left with bugs, using template files that I can't find on server
 
@Ekin slap @PeeHaa for it because it's clearly his fault
 
@mega6382 meme-arsenal.com/memes/aba886ce128b7994533ac32c5f5e7e72.jpg , yeah, I am desperate for (undeserved ) appreciation
 
he's probably sleeping after all the traveling back
 
8:39 AM
I see some others didn't understand
 
and no, just got thrown this app from 2016 and was told to fixit
 
@Ekin good thing he escaped the country after the votum
 
why would somebody make it impossible to decipher their code
@Gordon agreed
 
@Ekin security reasons
 
@Gordon So, what would you consider an ideal employer?
 
8:40 AM
@mega6382 one you like to work for and feel happy about it
 
:P
 
Evert replied it, lets buy him a chocolate
 
@Gordon well I see way too many entry points until it comes to the source code being this impossible to read
 
@Gordon Job security reasons?
"Well, you could hire someone else to rewrite it, but I'll fix it for half the price!"
 
sounds more like it
 
8:43 AM
@Gordon No, what I meant was, what kind of a place you would think would be best to gain experience and knowledge about the good parts of programming. As most of the outsorucing firms and the like mostly work on legacy codebases or rely on technologies like, Laravel, ROR etc
 
@Leigh yes ;)
 
Every company you will work for, you will work on "legacy" systems.
Even if you start your own, in one year you'll have some horrible shitty code that you'll call legacy
So, the best place imho, is to stick to communities, work on side-projects
 
I wrote some nice legacy code last week
 
@Leigh So, where will the money come from?
 
@TimCastelijns I'm writing some right now
 
8:46 AM
:P
 
I love backwards compatibility guarantees.
 
Does the guarentee have a guarantee?
 
@mega6382 IDK. I never really bothered with looking for a place to learn. I pretty much accepted that I would be a life long learner and I do that independent from my employer.
 
@Leigh hmpf.
 
@mega6382 also, every software you make will teach you something new. unless it's your 5th run of the mill $frameworkX project
 
8:48 AM
Yes, you are right about that.
 
tfw the production database has quadrupled in size overnight for no obvious reason...
also moin
 
@DaveRandom either someone decided you go big data now or someone added some xml somewhere. or both.
 
Can't get dateTime field with Sybase 16 ODBC driver – #76531
 
Who is in charge of hub.docker.com/_/php ?
 
mORNGINIS
@DaveRandom Nice \o/ What's the position?
 
Looks like when they pushed 7.2.7 changes, they missed the manifest
 
@Gordon turns out one of my colleagues has left me a nice leaving present of a MERGE query based on a join effectively has no filter, so it's exponentially filling a table with garbage \o/
and the table has been locked for writes for ~8hrs
 
@Leigh I had missing manifest a couple of times on various images lately
 
9:16 AM
@PeeHaa "Software Developer" :-P (srsly)
 
congrats on the quick job hunt! :) moving to France?
 
no remote, the company is mostly remote workers
 
nice
 
@DaveRandom kkcoolio
 
I will be going to Paris for a week for onboarding though
 
9:18 AM
Send stickers while you are at it :P
Or nudes
Or both
 
Jun 22 at 15:43, by DaveRandom
I may be in mainland europe in a couple of weeks anyway, where it will be significantly cheaper for me to mail then than it is from here
already on it
 
\o/
 
you already have nudes, but more can be provided
 
Awesome
 
9:31 AM
!!lxr password_needs_rehash
 
[ /ext/standard/password.c#241 ] PHP_FUNCTION(password_needs_rehash)
 
@DaveRandom Are you there this weekend by any chance?
Well, Friday. I will be at the Eiffel Tower between 11am and 12, in full lycra
 
Seems like PHP only cares for 2y as BCrypt variant except for password_verify where it doesn't care: lxr.room11.org/xref/php-src%40master/ext/standard/crypt.c#156
 
@Leigh no, although knowing that I may make a special trip
 
I'll send you a picture, it'll last longer
 
9:39 AM
@kelunik Wasn't that a specific choice because the first one had security issues?
 
^ I also vaguely remember that
I think it mattered for compat with things generated by crypt() in old PHP versions (or something)
but @ircmaxell will I'm sure be able to give you the full details off the top of his head, I remember he put a lot of thought into it at the time, the discussions just in here were very extensive
Scott probably could also tell you in a second
 
And I also remember 2x was removed on purpose
 
if you look at password_compat there may be some more comments in there
 
I know there's a very specific minimum php version of 5.3.something for the compat lib because of this exact issue
 
9:45 AM
Oh, I misremembered, 2a is 2x, Yea I believe generation of 2a/x was removed but verification left in
 
yep
 
@Leigh But password_needs_rehash seems to be broken then, because it should return true for 2a + different cost? /cc @ircmaxell
 
Yea I guess it was expected that password_hash would never generate a 2a variant, so rehash didn't check for it. I agree if it gets a 2a it should return true for needs rehash
I did the implementation for 2b... can I remember anything about it... nope! :)
 
Nevermind, it does return true, because it simply doesn't detect the algorithm as BCrypt. 3v4l.org/l1StD
 
In 7.3 we can't do GC_REFCOUNT(p)--; anymore, but we have GC_DELREF to replace it. What's the correct way to do it now so it works on both 7.2 and 7.3
 
10:05 AM
#ifndef GC_DELREF
#define GC_DELREF(p) (GC_REFCOUNT(p)--)
#endif
?
 
10:38 AM
@BobbyAxe fair enough, sorry that I came off as rude
 
11:11 AM
under what circumstance would PHP_VERSION on fpm yield a different patch version than -v would give?
as far as I can tell -v uses PHP_VERSION, yet I get different results
 
@Gordon left over objects from a previous build perhaps
 
this sounds obvious but the only thing I can imagine is that you are actually running different versions on cli and fpm. maybe you just compiled again and forgot to restart fpm or something?
 
make failed, did a git pull, ran make again, got half built with a different version
 
hmm. weird.
in my extension I am also using PHP_VERSION
oh… wait
fuck
so PHP_VERSION doesn't get evaluated at runtime but replaced at compile time?
 
Yep
 
11:24 AM
ok. that's the problem then. thanks
 
:)
 
> I will probably soon abandon the RFC, given all the hate here and on Twitter. It's not my passion to contribute interesting ideas to ignorant and hostile community.
 
would using phpversion() help?
 
@pmmaga Later o/
 
11:34 AM
:P
 
@DaveRandom I think it's buildconf that needed to regenerate something. Works now. :)
 
Integer overflow and excessive memory usage in mb_strimwidth – #76532
 
@bwoebi there's nothing stopping you from using a callback anyway. If you have something that has an obvious internal representation like a decimal type or money type or dimension or uuid (any value type really), there's no need to implement that static sort or provide a callback. In the cases where you want to sort or find by custom criteria, nothing stopping you from passing a function.
The reason why I'm pushing this is because objects currently don't have a way to define their ordering or what makes them equal or not equal to something else, and that to me is a gap in language functionality.
 
@DaveRandom I'm in the middle of moving so the Paris week will probably not be your first week
 
I agree with you that we don't need it though, but it does enrich the language. Python's cmp, Java's Comparable, .Net's IComparable, Ruby's Comparable...
 
11:46 AM
@ircmaxell I am lazy and my memory is lacking. You abandoned the default disabling of emulated prepared statements right? And it mostly just needed fixes of tests?
/me wants to revive the rfc
 
That is correct
Tests all over the place fail, including user land code
 
kk tnx
On a related note I want to do some "security" / sane defaults rfcs. Know of other places / things thatcould be "easily" fixed in some major at some point?
cc everybody
 
@PeeHaa session? :D
 
Already on the list
Well the ini defaults that is
Maybe cc @Leigh in specific?
 
12:04 PM
so close @PeeHaa, so close…
 
:P
 
@kelunik This was done intentionally. It will always return true, unless it's $2y (or another algorithm with a defined PASSWORD_* constant) and the options match exactly (cost, and others)
 
@rtheunissen ah right, m4sh controls what buildconf does, not configure directly
 
@PeeHaa deprecate ==?
 
Not sure I want to be the one that breaks code for 80% (number obviously pulled out of my add, but probably close enough) of code out there
 
12:11 PM
it's fine, just get @brzuchal to do it
 
:D
 
So, honestly, the case where two comparisons are strings, but it's interpreted as numeric, that one may be worth breaking things for
 
Yeah. That specific one is just stupid regardless
Adding it
 
If we deprecate == we may as well remove === and make == behave like today's ===.
 
@rtheunissen No
That would mean something "suddenly" works differently
I mean it would be the best thing to do in a way, but also the most wtf thing to do
 
imo ymmv
 
@PeeHaa but that's the ideal right? It's just getting to that point that requires a slow stepwise process?
 
Yes, but we are not living in an ideal world. We sadly cannot break things in hard to find ways
 
Morning!
 
12:19 PM
@ircmaxell wow that page's notifications are a little OTT
 
yeah, definitely odd :/
 
@salathe Oooh. I've got 2 new messages! :D
 
Do some of you have a hackernews account and would be willing to help me out? I'm still dreaming of reaching that front page one day... ^^
 
12:34 PM
@Patrick great
 
user379888
Hi. I am trying to echo $_SERVER['HTTP_REFERER'];
 
user379888
It doesnt show anything
 
It's a mostly useless header
It can lie. It can be committed. I will be omitted it certain cases.
Why do you need the value?
 
user379888
I want to know if the user is coming to my site from my own site
 
Why?
Hotlink prevention?
 
user379888
12:51 PM
I am trying to redirect users to a subdomain if they are coming from a specific country. I want them to be able to go to the main site too if they again hardly type the url.
 
If somebody manually types in the url there won't a referer header in any case
 
user379888
How to do it then?
 
You don't
You need to rethink what you are trying to accomplish
 
@ircmaxell Yeah, I realized that now, thanks for the clarification!
 
1:13 PM
You guys use Symfony much (at all)?
 
nope
 
user1804599
I use HTTP foundation, sue me
 
user1804599
@Ocramius also convinced me to use Symfony process library for talking to COBOL code
 
@rightfold need your full legal name
will do after that
 
user1804599
Speaking of web frameworks, I should continue working on my web framework
 
1:22 PM
@rightfold damn, are you creating your own framework?
 
user1804599
year cool right I must be really good
 
I found out, add ssh key form in gitlab is prepending the command issued to add the key on each line in authorized_keys every time I added one :P
 
@rtheunissen I don't think so. I mean when __equals is present and __compareTo is not.
 
@FahadUddin wouldn't it be more user-friendly to add some kind of notification-bar that links them to a localized subdomain ? Will also prevent issues with bots like Google
 
@LeviMorrison what is that in response to exactly?
 
1:26 PM
(Click the back arrow next to your name).
 
@rightfold Nope. Unless it's made up from other libraries.
 
user1804599
It uses DI and CoC (configuration over convention).
 
So auto error when __equals is present, __compareTo is not, and the object is compared for ordering?
 
@rightfold I like, configuration over convention, a lot of the frameworks now a days are convention over configuration. BTW you should checkout ZF2/3
 
@rtheunissen Correct.
 
1:37 PM
Currently is that's the case, and __equals returns true, ordering will automatically be 0. But if __equals returns false, ordering will fall back to compare_objects.
Can definitely warn on that last step.
 
No, don't do that!
Think about it: if you are adjusting what equality is you almost certainly need to adjust what ordering is or you will have major issues.
If your ordering is total then you don't need to define __equals, just define __compareTo.
But also it feels weird to "implement" compareTo just to throw.
 
@Fabor wish I didn't, but yes
 
@kelunik definitely, and thanks for the sanity check :D
@rtheunissen it feels weird having __comareTo and __equals at the same time, as what logical case would happen when __equals would be true, but __compareTo would be non-zero (or the reverse, where __equals is false, but __compareTo is true)?
 
1. Ordering must be 0 for values that return true for equals.
2. Some entities may return false for equals but 0 for ordering, such as Decimal(2.00) vs int(2).
Maybe decimal is a bad example vs integer. :/
 
1:53 PM
no, I think that's a good example
 
On point 1, we can enforce that internally and skip __compareTo if __equals returns true.
The current implementation checks __equals for true only if __compareTo is not defined.
 
that feels complicated. I see why, and don't disagree with why, but this feels very intricate...
 
Yeah, as a user who has implemented __compareTo, it would be counter-intuitive that __compareTo isn't called when I compare my object (when __equals returned true).

But, in theory, we either ask that the user follows the rule that values for which __equals returns true should also return 0 for ordering (I think Java does this as advice on the Comparable interface), or we enforce it internally.
I see this as 3 use cases:
1. I want to define equality and I don't intend to compare this object.
2. I want to define ordering and I'm okay that equal ordering implies equal value.
3. I want to define ordering but equal ordering does not mean equal value for this object.
 

« first day (2810 days earlier)      last day (2137 days later) »