« first day (3722 days earlier)      last day (1226 days later) » 

12:01 AM
the issue is (was) that LIMIT $x, $y requires holding the last $y rows in memory at all times
 
Looks like t-sql now has OFFSET and FETCH parameters... since 2012
 
whereas the TOP $y approach can do everything on the wire unbuffered
I used to understand this properly once
pg peeps also say that even tho limit exists it should be avoided for perf, it's slow sugar I think
we are rapidly nearing the edge of stuff I can talk about with any degree of confidence though
@MarkR ah yeh there's that as well but iirc that should be avoided for anything other than accessing existing cursors(?)
it's a protocol-level thing, instructing the server to discard redundant data instead of transmitting it - but you can't stop it from being generated obv
I mean all bets are off with all this stuff in MySQL anyway because that is very much Buffer All The Things
 
It seems like something that the indexes would be used for
 
oh yeh sure there's a lot of shortcuts you can take there, I'm talking about stuff which needs a full table scan or some mental join that is uncachable, worst-case basically
 
I probably have a fair few of those as well :P
 
12:08 AM
btw random tip: if you are ever doing any shit with SQL server and you have a query which is inexplicably producing a stupid query plan, shove OPTION(RECOMPILE) on the end of it
I still don't really understand what it does, other than "make stuff work properly" :-P
A bit like (*SKIP)(*FAIL) - no idea what it actually does other than "fix stuff when you made things too complicated" :-P
Sep 14 '12 at 16:02, by ircmaxell
it means that *SKIP FAIL*ing to do what I want. (In other words, just do what I want it to)
at least I am in good company @ircmaxell :-P
 
On the topic of caches, it took me 2 years to track down a bug in mysql's query cache that took down our entire production at random intervals for several minutes at a time, dozens of times. Only found it by accidentally forgetting to re-enable the cache one time... of course, once you know what you're looking for... (percona.com/blog/2009/03/19/…)
 
wow 8 years ago
@MarkR I have basically no relevant experience of running MySQL in prod, the last version I touched in anger was 5.5 I think
and then I worked somewhere that used mariadb a bit later but I never touched it
 
I switched to MariaDB several years ago (when MySQL got eaten by Oracle) for our self-managed workloads, but after moving to gcloud and using their managed offerings I believe that's their own modified MySQL
 
my dba/db devops experience is basically all SQL server and postgres, and then weirder shit (LDAP)
@MarkR I think the amazon thing is as well (?)
 
Yeah, I watched their recent keynote on their DB scalability and was incredibly impressed.
 
12:15 AM
oh that does sound interesting
 
Unfortunately I have to run MySQL without fully compliant disk flushing because the amount of burst transactions is nuts.
 
I've always meant to look into how google run their DNS servers, I'm intrigued as to how they maintain such an insanely high level of uptime on an explicit IPv4 address
like it's a single routed address, there must be a spof in there somewhere
you can move it around but it's always there
 
It's anycast isn't it?
 
it's IPv4
so unless ISPs are doing some magic, it's straight routing
 
12:19 AM
(talking about 8.8.8.8/8.8.4.4, obv the IPv6 stuff is less of an issue)
@Danack yes I am intimately familiar with BGP... in fact I spent about 20 mins today sitting on my hands waiting for zen to fix the bgp announces for the leased line I was setting up
 
My belief is that is Google cloud platform exposes something similar to what google uses for their own stuff - so reading their docs might provide some insight: cloud.google.com/network-connectivity/docs/router/how-to/…
 
ah yeh good shout
 
Or might result in wanting to host everything off a single large box.
 
Aye, it's anycast, goes to the nearest endpoint as advertised by the routers, presumably the central store is replicated multiple times... so probably no single point within it
 
right, so that's not really IPv4 then, that had some special infra in place
 
12:22 AM
Then again, consider all of google accounts when down because they forgot to allocate themselves disk quota, who knows \o/
 
> zend_mm_heap corrupted
that's pretty bad
 
@DaveRandom not so special. It's how a lot of services operate at that kind of scale. And how some telecom operator in Turkey can 'accidentally' route half of a large services traffic to itself.
 
or rather, google have done some deals with some infra carriers to make that work, because "pure" IPv4 doesn't have any provision for that afaik
 
Does it not? advertising the shortest route to a particular IP address seems pretty fundamental to bgp
Then again the ipv4 element of it isn't concerned with routing in the first place afaik.
 
@Girgias I once had this when I had a brace out of place and ended up mixing *(ptr+n) vs (*ptr)+n, somehow it ended up being precisely right to overwrite part or the allocation table instead of segfaulting, took me like 2 solid days to find
@MarkR yeh it is, but said IP is supposed to be the same host no matter where you started
 
12:28 AM
@DaveRandom Yeah, I've been dancing around this for a while, because the segfaults I get are utterly useless
So I know where too look at finally
I have also some mem leaks that I need to take care of buuuuut that's something else
Still don't grok the difference between safe_emalloc and a normal emalloc tho
 
@Girgias something something emalloc() can sometimes overflow memory_limit whereas safe_emalloc() is validated every time, iirc
 
Huh, okay, I suppose I can just use efree() as usual?
 
oooh
Jan 19 '12 at 19:23, by NikiC
@ircmaxell My main question with that is: Why not just emalloc with a * b + c ?
Jan 19 '12 at 19:24, by ircmaxell
a * b + c can overflow the integer. Whereas safe_emalloc checks for overflow conditions
basically safe_emalloc() just validates the values before plugging them into the calc to figure out how many bytes to alloc
 
Okay, probably should use that more often then
 
so basically as long as you have total control of a, b and c you don't need it
 
12:37 AM
Well, in this instance I don't have control of b
I'm refactoring PDO's quoter handler
 
ah well yeh sounds like you want it then
 
12:48 AM
wow, that was a few years ago
 
Sooo, how am I meant to free a safe_emalloc() call when the buffer is used to init a zend_string()
Cause weirdly I don't have this issue with emalloc() :| (or maybe I'm dumb)
 
@ircmaxell happy holidays!
 
Ah no, I didn't enable debug...
 
 
3 hours later…
3:36 AM
@LeviMorrison and to you as well!!!
 
4:14 AM
Bah-humbug. I have a sigsegv on instantiate_all_classes.phpt in CI that I thought I replicated locally, and then fixed, and pushed back up. However, it still happens in CI but not locally.
 
 
2 hours later…
6:14 AM
Good morning.
 
 
1 hour later…
7:33 AM
morns
 
8:05 AM
Good morningggg
 
 
1 hour later…
9:28 AM
I understood, the problem seems with access to the inner object, because the first var_dump/print_r the representation it's correct.
https://3v4l.org/AQZ4f
 
10:25 AM
Value or error_reporting() within handler with errors suppressed is 4437, not 0 ・ Documentation problem ・ #80548
 
10:58 AM
Hi, I want to allow the user to update some data he has saved (on database). Now I tried fetching all the data from the database and displaying them in inputs, select and text area tags with a default value, which are stored on database. How can I get only the form data whose values are changed from the default value and prepare a dynamic update query? What I mean by dynamic update query is updating only the changed values which are sent through POST information.
MY table structure looks something likes this
 
@RifkyNiyas: Normally you don't need to care to only update changed columns. The database normally updates only changed ones. Just noting, not that you look for problems too far off.
 
Products table having the common information about all products and a category column. And there are category tables(each with a specific name) having the specific details about each category. The id of category table references the id of products table
 
So there is one row with the defaults and in a different row you only want to store non-defaults?
 
@hakre Ok. Then should I just prepare a normal update query right?
 
@RifkyNiyas In general yes. But also see my last question.
 
11:05 AM
@hakre Sorry i could not understand you!
 
@RifkyNiyas My apologies. Maybe we can figure this out. Which part?
 
There are no default rows in tables. Only the values user entered are stored as records
@hakre Ok. That default and non-defaults you have mentioned? I could not get it
 
@RifkyNiyas okay, then try with the standard update. In case it does not 100% what you want, we can figure this out.
@RifkyNiyas Let's ignore that part for a moment, this was merely related to having more than one row.
 
@hakre Ok ill try it out.
And one more thing to understand. Will foreign key constraints restrict my update statement?
 
@RifkyNiyas They need to be fulfilled if they are enabled, yes.
This is also normally what you want, to keep the data consistent in the database.
Otherwise a foreign key may not be of (much) use.
 
11:11 AM
@hakre Yes. They are enabled. Now will there will be an error if I update only the data in products table?
@hakre Noted
 
Well in short this depends. If there is a violation, the update is rejected. IIRC the whole row is not updated then. Depends a bit on the database. Do proper result/error checking (that depends on the driver and library, e.g. PDO or mysqli).
 
Ok. Ill try it out
 
Yes, always get results first. And also try to break things.
Breaking things is a good result :)
 
@hakre 👍👍
@hakre Noted and well understood😂😂
Thank you so much
 
@RifkyNiyas Especially if you do this intentionally. That's often nice with computer systems, you can re-do so sandboxing is easy.
And also you can learn that way how to really mess things up.
 
11:16 AM
@hakre Yah! Thats what I am looking for
 
Hey guys, how much reputation points do I need to start bounty?
 
@Yotam 50+
 
11:34 AM
Thank you
 
11:50 AM
o/
 
12:36 PM
@Tpojka what is that anchor magic?
Never seen that before
 
Copied from google results as is.
Probably one of full text keyword sentences saved in google server for that page. I searched for "stackoverflow starting a bounty".
 
12:53 PM
 
@Tpojka OK, it doesn't work on firefox, but it did work in my mobile opera
I thought someone knew a cheat code for the internet
 
@AndrasDeak When that search result was clicked from google page (of search result collection) it was highlighted actually. I don't know if that works for everyone except myself who searched or Google just want to collect relation who is sharing links to whom.
 
@Tpojka yes, that's what opera did. Your link doesn't have any relation to google.
 
@AndrasDeak I would say it does over on page google-analytics, my search result and someone else's click after that. Kids, search from private browsing window. :B
 
1:10 PM
my point was that it can't be a google feature
 
That would be some JS I suppose.
 
 
2 hours later…
2:59 PM
Hi, suppose I have two apps A and B. B requires some permission from A to access data, so everytime B needs to display that data to the user, they are redirected to A. Now, A on successful authentication, redirects to B with a GET request param which contains a unique code that B stores in the client side. That value is checked in B before sending any output to the user. Now, if the session between B and the user were to be hijacked, is there a chance that the unique code may also be exposed?
The user has to send the unique code with every request to prove that the user was authenticated by A.
 
ever have one of those moments where you stop what you're doing and say to yourself "wtf am I doing, im making this way harder than it needs to be"
I just had one of those moments. Who needs the hassle of getting a bucket, filling it with water, finding something close to lean a pole against, to drown a pest that's been caught.
once you've got hold of it, anything remotely sharp will solve the problem in less time than it'd take to go get the bucket.
 
3:15 PM
Hello folks :)
 
3:56 PM
Morgens
 
4:16 PM
Hi, are there any specific reasons for input tags with a default value does not get submitted to a PHP script?
I have this html tag <input name="sellVehilceModel" type="text" class="form-control " id="vehicleModel" placeholder="eg:M5" pattern="[0-9A-Za-z\s,/-]{2,10}" value="<?php echo $vehicleModel?>"> where in the HTML it shows the value as M5 but when the form is submitted I var_dumped the post array. Other inputs with default value are present but there is only empty string in the above input
 
4:49 PM
you made a mistake somewhere else, not sure where but there's nothing inherently wrong about that code (except missing escaping)
but if the value is "M5" then that isn't the cause of the specific problem you have now
 
mornin room.
Merry Christmas room!!!!
 
6:01 PM
Merry Christmas!!
 
@DaveRandom Ah yes! there was a duplicate. Fixed it. Thank you
Merry Christmas everyone!!!
 
6:19 PM
Merry Xmas
 
@RifkyNiyas ah yeh, in this case PHP will use the "last" duplicate value in the query string/request body
please make sure you are escaping appropriately as well, it's most likely as simple as replacing <?php echo $vehicleModel?> with <?= htmlspecialchars($vehicleModel) ?>
note also that <?= is shorthand for <?php echo
you should pay attention to encoding, but the default is utf-8 and you should probably just be using utf-8 throughout anyway so it's most likely fine
 
6:46 PM
CentOS is dead, long live Rocky Linux?
 
 
2 hours later…
8:42 PM
Merry merry whatever is yours.
 
seems not to load extension curl ・ PHP options/info functions ・ #80549
 
9:09 PM
 
bug search: Nonsensical "the following words were ignored:" w/ trailing space ・ Website problem ・ #80550
 
9:40 PM
With wordpress 5.6 and php 8.0 on debian i got a SIGSEGV maybe opcache ・ Reproducible crash ・ #80551
 
10:06 PM
@Danack bizarre, intrigued by the fact that the only rhel professional I know, who I talk to weekly, has been silent since this whole thing kicked at ~10 days ago
it almost feels like an april fools
red hat playing the *very* long game :-P
 
"Bazinga, see you in 2021"
 
> you know this platform we pushed for two decades as being designed for long term stability? lol jk
I've always prefered rhel to deb, looks like those days are over :-/
(no I will not be running servers on fedora :-P)
which is the other thing that I don't get here... I always understood fedora to be the "canary" branch, centos to be "mainline" and full blown rhel to be "enterprise"
I guess you could switch that so that centos is "beta" and rhel is "mainline"
but either way, each distro had a well defined role and reason to exist... if centos is no longer long-term stable how is it different to fedora?
...or maybe just my view of the world is wrong, but I know I'm not the only person who things all those things because I have spoken to others
 
10:23 PM
I think that the new match syntax is more similar to arrays rather than switch statement. 3v4l.org/9kcjU Change my mind.
 
@ircmaxell inorite I am so old
@Dharman start here
match is a language construct, arrays are data stores, they are conceptually quite different
 
Match will not execute all statements until executed
 
arrays dont execute anything? :-P
 
They do, so you can't use them to execute functions based on the value
 
Match is syntactically similar to an array, but it is not an array
 
10:33 PM
got a sesame seed stuck in the gap where I had a tooth pulled years ago, been there for like 4hrs now, it's driving me insane
 
Floss? Toothpick?
 
it's quite a deep pit in the gum from where the root of the tooth used to be and I don't like poking stuff in there because I have hurt myself in the past
toothbrush making no dent, probably making it worse if anything
 
Can you get a cap for the gap? ...lol
I have a fake tooth from where I had a tooth pulled, but it was rather pricy. I went the extreme route
 
yeh but it's expensive and I don't care enough, this is a minor annoyance once every 6 months and it's a molar at the back so there's no cosmetic impact
 
@DaveRandom if you're running after containers, you look for speed while users are looking for the other type of speed that comes with stability.
 
10:37 PM
I look for fire+forget, where "forget" is 5+ years :-P
 
likely rhel knows where it's customers are now. riding the cloud train.
 
I am my own devops team, in general
 
sure, and this is sane.
 
@DaveRandom an annoyance that has the potential for injury, I think it's enough justification to get it covered at least so it's not a hole in the gum
 
@hakre ofc, I'm sure this is a decision made my sane people for solid business reasons
 
10:38 PM
@DaveRandom from what rhel has said themselves, they want centos to be the upstream of rhel.
 
it's not immediately obvious to me, doesn't mean it doesn't make sense, I am still vaguely aware of that :-P
 
it's just that for most centos users, this is no way what they want.
 
for me the issue is that that's what I thought I already had
18 mins ago, by DaveRandom
...or maybe just my view of the world is wrong, but I know I'm not the only person who things all those things because I have spoken to others
i.e. that ^
I am aware that the fault is at least partially mine
 
which fault? (I don't get it)
 
in that I thought that centos already essentially functioned as a stable upstream for rhel
and all the mad shit that might break stuff goes into fedora first
 
10:41 PM
@Dharman They're all very similar, if statements, ternaries, array lookups, switch, etc. Lot of the RFC was bike shedding which one is the most similar although it really doesn't matter. Match is trying to do something none of them do.
 
okay, guess then that one part is that kind of stability and the other part is release stability (and stability).
 
well I always thought the main functional difference between centos and rhel is that rhel comes with support from people who are paid to know what they are doing
 
and if centos worked for you the way it was released for what you need it, I don't think it's your fault at all. it was more a proof that what (previously others than redhat) offered was fine.
they just skipped years within days and changed the release cycle (to the benefit of customers like facebook as far as I've heard).
 
yeh when I say "my fault" I just mean that maybe people (including me) are complaining about shit they don't really understand :-P
 
wasn't it redhat buying out core-os and then ditching it?
 
10:45 PM
I dunno, I'm not close enough to that world to have a true understanding of it tbh
 
@DaveRandom :) yeah, using =/= understanding, but you don't complain either. perhaps that rocky linux is what you're looking for.
 
I know how to make *nix-based computers approximately do what I want and not burst into flames, after that everything else is a bonus :-P
 
@DaveRandom and understanding it is some decades of actual computer science me guesses.
 
yeh exactly
I know enough to know that I have no fucking clue :-P
 
btw. I'm going back to more debian based stuff (like in general).
 
10:49 PM
I've had a very windows-y life the last couple years anyway, don't do devops in a professional capacity any more so it's mostly just toys these days
@Tiffany fair point but also... like £600 to avoid occasional minor annoyances doesn't seem worth it
got it out finally btw :-P
got pissed off enough to poke shit in, got away with it
 
"I've hurt myself before" *proceeds to poke gums with stripped cat5e cable end*
 
I've definitely never done that*
* in the last 3 months
 
we don't judge, you swine
 
schweinhund, I think you'll find. I'm english.
 
11:08 PM
Anyone happen to know about libraries for syntax checking? Working on a PHP Discord bot. Want to create feature where users provide code (javascript for example). The bot then checks the code for syntax errors and returns them. Think I need some kind of linter(s) for this, but I'm honestly completely new to this concept
 
php -l
however if you want to highlight syntax errors that's a totally different kettle
 
Ye, that would work for syntax checking PHP code. I'm looking for a more general way. Need to syntax check Javascript and Python mostly
 
github.com/nikic/PHP-Parser would be a good place to start
@icecub that is a language-specific problem there is no "general" solution
 
For python you can fire up python and run ast.parse on the source. If it fails there's a syntax error :P
 
in the same way as there is no easy way to validate both English and french text with a single tool
 
11:12 PM
and I'm pretty sure that anything can be valid JS with the right browser
(not really)
 
every language has plenty of tooling around it but if you want to unify them you will have to do it yourself afaik
@AndrasDeak interesting, first time I have heard IE6 described as "the right browser"
 
some like it rough
 
sure but I don't think that's legal in any state
 
Ye I know. Poor choice of words on my side. I meant a more general approach to do this from within PHP. Was hoping for a way to do it without running the code. Like I've been looking at the v8js extension for PHP, but it can only do it after executing the javascript. Throw some bad code in there and everything crashes
 
Bad is one thing. Malicious? Lot worse.
 
11:15 PM
still not convinced that MS browsers are not malicious
 
Ye but I mean something basic like creating an insane amount of arrays causing a memory overflow exception for example
 
for PHP you can just lint (php -l) and you can also load (open the file with php -f and prepend the autoloader - gives you undefined global constants and autoload issues)
 
@icecub yeh but that's because you asked the engine to execute it, what you want is lexers and parsers
 
@icecub you can guard against things like that by restricting resources, but it's probably very hard to guard against rm -rf /
 
which v8 probably has
you want to do everything except execute the code basically
 
11:17 PM
yup
 
which is what php -l does
and I imagine node has a similar flag
 
@AndrasDeak likely not possible with any dynamic language without executing it already.
 
Bobby Tables says only touch user input with an insulated stick
 
Ye exactly. That's the whole idea
 
and indeed most CLI binaries for scripting languages
 
11:17 PM
@hakre not sure what you're saying there, sorry :)
 
Anyway, thanks guys. Got some more info to work with now :)
 
tl;dr look at language-specific tools
 
@AndrasDeak the result of code of a dynamic langauge (like PHP but also like Python or JS) you can not statically infer completely unless you actually execute the code.
 
if you try and make it generic you end up with ctags, and no-one wants ctags
 
@hakre ah, yes. Then I agree, although this is mostly a guess on my part. I know it's impossible to sandbox python's eval and friends.
 
11:19 PM
@DaveRandom well, that's why there is exuberant ctags, right?
 
yeh, although it's now "universal ctags"
 
@AndrasDeak yes, that's it. most commonly eval is a road-block.
 
that's what opengrok uses, and many tools like that which don't work properly when you give them invalid code :-P
 
I've seen bots in SO chat execute code, but either those work based on a trustee system, or a whitelist.
 
@DaveRandom invalidate all the things.
 
11:20 PM
ctags is great as long as you know the input is sane
the second half of that is often problematic though :-P
 
@AndrasDeak would be a nice idea for @Jeeves to 3v4l.org code pastes in room 11 :D
 
Out-sourcing vulnerabilities? Makes sense :)
 
we used to do that
 
php-src (err, php-parser I meant) is pretty amazing btw.
 
!!> echo 'foo';
@PeeHaa ^ fixit fixit fixit fixit fixit fixit fixit fixit fixit fixit fixit
 
11:22 PM
> 8. When commenting out code using a #if statement, do NOT use 0 only. Instead use "<git username here>_0". For example, #if FOO_0, where FOO is your git user foo. This allows easier tracking of why code was commented out, especially in bundled libraries.
github.com/php/php-src/blob/master/CODING_STANDARDS.md Lol, that seems a tiny bit outdated ^^
 
@IluTov I've never seen that comment before and that makes a shitload of sense
obv you can grok it from blame but that would be so much less thinking
 
sounds like a nice idea as long as you're ok to see your username all caps.
 
It's especially funny that it mentions git, although git is exactly the tool to solve these kinds of problems.
 
(well the comment does not suggest to use caps)
 
Does this refer to preprocessor code?
 
11:25 PM
@AndrasDeak yes in PHP src.
 
thanks
 
@IluTov it is but it's nice to read it inline in the code without any required action
 
@IluTov since when does git solves the problem to read code? the opposite is the case, it creates multiple revisions of nearly identical code and you have to read even more :P
 
but then someone hides -DFOO_0 among compile switches ;)
 
@hakre *changes username to SELECT * FROM dave*
 
11:27 PM
@DaveRandom or try with git username injections as well .... :D
 
DROP DAVE
from at least 100 cm high
 
I am already a git, don't need any more usernames injecting
 
@hakre Well, just knowing who commented out the code helps very little. What you really need is a comment.
 
right I need to bail because I am weak sauce
nn all
 
night
 
11:28 PM
@DaveRandom sleep tight
 
Merry Christmas to everyone who is post-midnight
 
have it well in your bettgestell
 
don't let the sesame seeds bite
 
everyone else: fuck you
:-P
nn <3 x
 
@DaveRandom so... yourself?
 
11:29 PM
definitely me. fuck me. dick.
 
I can't, post-midnight here
 
idk, maybe if you have a long enough strap-on that goes the other way round the earth we could... I'll do some sums.
/me actually sleeps
 

« first day (3722 days earlier)      last day (1226 days later) »