« first day (2978 days earlier)      last day (1977 days later) » 

12:03 AM
@Andrea I think this qualifies as violation of Geneva Convention
 
 
2 hours later…
1:57 AM
Storing files in DB: Yeh or ney?
 
@Wes Got my English Breakfast tea in mail today. I like it better than the Earl Grey now!
 
Rob
A very solid 'maybe'
 
@Rob Is that to me? If so, I was thinking on saving contracts and other documents relating to clients.
 
Rob
Yep, to you. I can see it argued both ways. If the site is heavily reliant on files - for example, an image host - you probably don't want it in the database. If you just want to store a client's logo and don't wanna bother with the extra effort of backing up files? Chuck it in the database.
 
Can you expand on don't wanna bother with the extra effort of backing up files?
wdym exactly? Still have to Bup
 
Rob
2:01 AM
Well, if the file is stored in the database, you only need to backup the database. You don't have to deal with backing up files from the disk at the same time, and maintain consistency
 
@Rob ahhh
thanks for help
 
Rob
Er, well, don't take that as the 'best practice', just my opinion on the matter :)
 
I'll prob just store the location of file in db
or name
 
Day 8 of this advent calendar was a lot easier than day 7
@JBis That's what I'd do
 
2:17 AM
I think I underestimate how many records can be in a db. Like apparently 500mil+ is fine and I'm getting worried at 30k.
 
3:16 AM
@Andrea If only I could namespace "array" or "list" inside of "Spl".
 
 
2 hours later…
Wes
4:54 AM
morn
i woke up with the "badger badger badger" song in my head youtu.be/EIyixC9NsLI
bagge bagge bagge bagge bagge bagge bagge
 
Wes
5:06 AM
@tereško do you know of a good computer case that has a decent internal cable management? i got myself a cooler master but man it's so shit... there are no places where to hide the cables. i don't want it to be pretty, i just want to be able to do do dust maintenance without having to undo all the things
 
5:33 AM
Morngins
 
I haven't googled too much into it, so it could be just something that I need to look into more.
But figure I would ask out of curiosity if anyone else has encountered the problem: I'm trying to install PHP 7.3 with fpm on debian 9.6, but when I try to install from ondrej's ppa, I'll get an error - Couldn't find any package by glob/regex 'php7.3-fpm'
It could be that 7.3 with fpm isn't ready? but it looks like it should...
and adding the -fpm suffix is what I've seen for previous versions of php 7.x
 
Can't you search in the repo for php7.3*?
 
I'll also get a 404 for some of his package lists, but it doesn't look they're anything important
@PeeHaa yeah, I should
I'll have to try that in the morning after I've had some sleep
there's a note that says I should add his ppa for nginx, which I tried to do, but ran into its own set of problems. Granted, I don't know if I need his version of nginx for PHP when I can use what's already in the debian package lists (and have before without problem)
@PeeHaa thanks for the suggestion, now I go to bed
 
5:48 AM
@Tiffany night :)
 
guys do you agree that passing the value of the query string directing on the link is not safe?
<a href="?p=home"></a>
 
Why not?
 
someone could do a attack with sql injection
 
wat
 
but i'm not sure
 
5:59 AM
How is sql related to an element in html?
If you have a literal <a href="?p=home"></a> in your code there is nothing bad that can happen
 
its on the url
 
So?
Data only becomes dangerous when it is used in a specific context in a wrong way
 
what about this? <a href="?p=<?php echo $q['link'] ?>"></a>
 
That's vulnerable to xss
 
zstandard compression support – #77281
 
6:03 AM
@user236945896 You should escape that using htmlspecialchars passing the correct encoding
Still nothing to do with sqli though :)
 
<?php echo htmlentities($url, \ENT_QUOTES, 'UTF-8', false); ?> is enogth?
i like to use htmlentities
 
@user236945896 why?
 
i just do what ppl taught me
i'm asking if it's correct
 
htmlentities encodes too much for html context
It probably doesn't hurt, but it's useless
Also note that if you need to pass false for the double encode param it probably means you have a problem somewhere else
 
you meant that i don't get any security with htmlentities?
 
6:07 AM
@user236945896 You do, but no more security than with htmlpecialchars
Where htmlentities encodes more characters (which is not needed in your normal html document)
 
nice info, i got like 30 useless queries, because i tought that passing the value of the query string on the links was not safe lol
you said that htmlentities encodes too much, do you think that it's kinda heavy to the server?
 
No. There would be no noticeable difference on the server
Nor on the client side for that matter
 
Are you doing AoC this year PeeHaa?
 
@Alesana Nope
Been working on some side projects lately
 
Ah nice. I have been spending too long on some of them myself
I'm putting side projects on halt until after Christmas haha
 
6:17 AM
:-)
lol that spam in my mailbox:
> Mijn programma heeft je camera ingeschakeld en het proces van je masturbatie
vastgelegd.
The process... :P
 
Haha did you see that Black Mirror episode?
 
Unless it's from the older seasons probably not
I stopped after season 2 or 3
 
I don't remember which one. But in it he gets a virus and the virus records him masturbating, then the guy blackmails him
 
Nope. Didn't see that one
 
Ah. Yeah if they can access their camera then I have a feeling they have better ways to communicate with you than your spam folder
 
6:22 AM
:)
btw how to get to the room11 leaderboard of aoc? @Alesana
 
@PeeHaa You need to at least sign up for aoc, then go to private leaderboards, and put in the password 114365
 
ah that's why I didn't find it
k
 
Wes
still not enough snow for skis
morning :B
 
@Wes I took a basket and went sledding a few hours ago
 
Wes
i'm going to make a video of me using the skis the first time, and it's going to be hilarious :B
 
6:34 AM
@Wes morenigns
@Wes Yes please
 
Wes
maybe tomorrow... it's still snowing
 
I wish I had snow here instead of constant rain :(
 
Wes
:(
 
@PeeHaa Does it snow often there?
/me is ignorant about geography/weather
 
Wes
where is peehaa sandiego in the world right now?
 
6:39 AM
@Alesana It never snows in the city where I am
@Wes izmir, TR
 
Wes
is it on the coast?
 
Oh I didn't know you were in Turkey
 
@Wes yep west coast
@Alesana Been here off an on for the last year. Now am actually allowed to stay for a full year
 
@PeeHaa Do you like it there?
 
@Alesana It's ok. I am not here for the country :-)
 
6:43 AM
Ekin is in Turkey too right?
 
Wes
looks much nicer than "it's ok" though
maybe in summer it's better :B beach is nice
 
@Alesana yeah that's the point :)
 
Wes
but you are ginger, so that's not something you can appreciate :B
 
@Wes It's good, just the people and politics and stuff is... meh :)
 
Wes
ah yeah that sux
 
6:44 AM
I think I am missing something...
 
@Wes I like going from white to red in 5 minutes :D
 
Wes
lol
brb shower
 
enjoy
I should do the same, but lazy
 
I should sleep myself, is there such a thing as too lazy to sleep?
 
hehe
@Alesana What time is it there?
 
6:48 AM
1:47am
 
ah not that bad
:)
 
I am trying to get to getting 8 hours of sleep a night but it never happens :P
 
Wes
before i go or i forget. in chrome socket count is limited per domain to 6
there are plenty of requests to increase that number, or allow the user to set it
google wontfixed them all
 
@Wes Is that any kind of socket?
Normal tcp + websockets + whatever?
 
Wes
the irony is that the limit is shown on google's own sites
 
6:50 AM
hehehe
 
Wes
i am sharing a google drive account with a guy at work
i would do stuff like finding the next file to download while the previous is still being downloaded, but it's not possible
or upload multiple files at once
eventually you are going to hit that, not sure why
it's not that i am uploading a million files, it happens with just two even
anyway, lata :B
i'm gonna switch to firefox today
 
o/
 
Wes
7:23 AM
bagge bagge bagge bagge bagge bagge bagge bagge bagge
pls someone take that song out of my skull :B
 
Wes
7:38 AM
lately chrome's been a bitch... it's so slow
i got myself a new pc and it's slower than the previous one... but it's not the computer's fault, it's chrome that suddenly turned crap
 
I have moved back to firefox a long time ago
 
@Wes It gets like that for me every once in a while when I have 50+ tabs open. It's usually a reminder for me to close my tabs anyways
 
Wes
problem i have with firefox is that devtools suck
 
It's workable for me
 
Wes
so can't actually abandon chrome
 
7:41 AM
Not as good as chrome's but I can live with it now
 
8:00 AM
ahistorical without concern for history or historical development; indifferent to tradition.
 
Google's in-browser Lighthouse tool is irreplaceable
 
 
2 hours later…
10:07 AM
"options" part is not complete – #77282
 
morns
 
Morgen
 
10:37 AM
posted on December 11, 2018 by amphp

* Fixed a bug in NativeDriver causing 100% CPU usage when any timers were used (#251)

 
11:27 AM
I ate something that didn’t sit well and it made me a full-stack developer, in the sense that I’m now struggling on both the frontend and the backend.
 
user7659542
12:19 PM
Is there any way to pass data, outside of the form, to another php script?
 
user7659542
I want to pass the current language of the webpage to my php script, when sumitting a form
 
@Wes my standard recommendation is: pick Fractal Design (something from the Define series)
@Wes not if you install the actual "developer edition"
 
@traducerad query string or session variable.
 
user7659542
@Tpojka Hmmm that's what I thought...
 
Try and see if it satisfies rest of logic.
 
user7659542
12:30 PM
@Tpojka session variables is too complex, for such a detail
 
@traducerad why do you want it separate from the form? Do you know about hidden form fields?
 
user7659542
@Danack Never heard about the latter
 
user7659542
actually this is what happens:
 
<input type='hidden' value='whatever' name='somename' />
 
user7659542
1) you submit the form on the main webpage
2) an e-mail is sent using the form's data, via a PHP script
3) you are redirected to some webpage which shows a message telling an e-mail was sent
4) 5 sec later you are redirected to the main webpage again
 
user7659542
12:32 PM
I actually want to make sure that the text you see on step 3, is written in the correct language
 
For that, in step 2 you have to know which language should be used, right? Try
redirect("Location: /step3?lang=lang_known_in_step2");
and in step3 script check for $_GET['lang']
 
user7659542
@Tpojka Hmm ok, let's try that
 
user7659542
but
 
user7659542
how do I pass the page's language from step 1 to step 2?
 
user7659542
ok no, I have an idea :)
 
user1804599
12:49 PM
You put it in a hidden field in the form, or in the query string of the action of the form.
 
user7659542
@rightfold yep exactly what I am trying atm
 
user7659542
that being said I feel like hidden fields are dirty hacks
 
user7659542
@Tpojka header("Location: redirect.php?language="$_POST["language"]);
 
user7659542
any reason you are using redirect in stead of header
 
header is right function. I posted somewhat pseudo code.
Don't forget to stop execution after, i.e. exit; after header line.
 
user7659542
12:52 PM
@Tpojka how so?
 
user7659542
brb
 
Just header() function, if not last line in script (or method in case of OOP), will not stop execution of next line even if client is being redirected unles you manually stop further execution with exit or die construct/function.
 
@Sjon Nice feature, though I cannot think of a real use case; I mean, opening command line and typing php -a is not any harder than using your REPL - or does it have features I haven't thought of?
 
@bwoebi not yet - but I intend to add all php-versions
@bwoebi in theory I could even add interactive gdb on debug-builds
 
1:18 PM
Not really related, but the debugging feature I miss most is reverse debug. My workflow right now consists of dumping the opcodes via phpdbg -qrrO=log file.php finding the place where code deviated from expected flow and put a breakpoint there... Quite annoying to have to bisect code flow ...
@Sjon could be probably nice, in particular for sharing. Would love to see a crash report on bugs.php.net/ and then just jumping to your gdb tool for a quick analysis (and would be even more awesome if you could hook rr behind that :-D)
 
@bwoebi I've never used rr - but it seems similar to gdb. I'll see how it behaves
 
mornign
 
@Sjon rr is a plugin on top of gdb essentially
@Sjon reverse debug is so useful to find where a value has been altered last, in particular with refcount issues
 
user7659542
2:03 PM
Everything works like a charm, thx guys!
 
Hey everyone ! Quick question: I'm trying to execute a PHP script through CLI on a Windows Server. I've done that plenty of time. I just updated my dev environment to PHP 7.1.25 and when I call a script using my PHP local variable (`%php71% mysql_collation.php --collation=utf8mb4_unicode_ci`), the script won't take the parameters... it keeps showing the script's help file instead of executing it with the parameters I passed.

The behavior happens with any other script too. Only thing I tried that's been working is `%php71% -v`
 
Wes
@tereško ah right, i never tried that :D
@tereško they look tiny
 
lol?!
 
Wes
i am looking at the wrong thing probably
 
2:18 PM
is it the mITX one?
 
Wes
well they are smaller than my old chieftec full tower
90x30x70cm ish
 
sure, do what you want - it was just a suggestion
 
Wes
lol i am looking for a video, the site sucks and they look tiny in the photos
also it's not that my new coolermaster is giant
it's super shit, the hard disks nearly touch the gpu -__-
@tereško can you link me one?
 
link what exactly?
a specific model?
Define R6
 
Wes
ok so yeah that is tiny... i have 8 hard disks.... don't ask.... i am just waiting for them to die....
i could reduce to 6, get rid of the oldest ones
that would look a bit too crammed i think... thoughts?
 
2:32 PM
buy a nas
 
Wes
too many shits around i dislike :B
this is the one i have now
basically it's 2 motherboards tall
 
> The usual request time on a dev environment is around 2-5 seconds
What.
 
Wes
@tereško i am not contesting your advice, i like big cabinets because i want the hot air to be dissipated internally by the large metal surfaces of the case, rather than have a fucktonne fans that only bring dust in
 
you are fixing the wrong problem
and now, pleas stop pinging me
 
Wes
.......
 
2:56 PM
Good morning!
 
3:08 PM
Morning.
 
3:45 PM
o/ Morning!
 
Good morning! I didn't even know chats on here existed! Nice!
 
For extension building, what would be the best way to persist a HashTable across multiple requests? If I wanted TTL on the values, would it be best to just have dependencies for APCu or Memecached? Or should I try to add true thread-safe C globals? :)
 
4:17 PM
memory exhausted when unserialize data – #77283
 
5:02 PM
Oct 7 at 16:01, by rtheunissen
There will be if RvW is overturned or even on the table again
so, @rtheunissen, still believe that Kavanaugh will overturn RvW?
 
5:58 PM
Random thought while reading internals: Just because every other language calls it FFI, doesn't mean PHP should - maybe it should be called something like ExecuteDangerousCThings
 
@AllenJB HereBeDragons
 
6:12 PM
is it faster to use $i = 0; foreach ($a as $v) {echo $v.$i; $i++;}or foreach ($a as $k => $v){echo $v.$k;} while having the key index is same as the i values
 
6:26 PM
Does anyone have any idea why this would take ~10 minutes to execute? I know there's a lot of looping but someone has the same logic in JS executing within seconds.
 
@Danack But why? Why FileNotFoundException is a notion that transcends libraries
Having to catch your/NotFound, and my/NotFound, and his/NotFound, and her/NotFound seems rather unruly.
And don’t get me wrong, I’m not suggesting that all exceptions be distilled to a select few, but when something is as ubiquitous as above, it doesn’t make sense.
I’d actually argue that, provided the context was correct, catching all of this above mentioned variants of NotFound and rethrowing as a core provided exception; rather than the inverse
 
6:55 PM
> Add but wrap at 32 bits
... what is (1<<32) actually supposed to represent? it's not the biggest 32bit integer, var_dump returns int(4294967296)
 
7:06 PM
@FélixGagnon-Grenier Biggest 32-bit integer + 1
mod probably isn't the best way to do that.
 
hmmm.. ok :)
oh right, that's the unsigned integer
strangely enough, it actually amounts to max unsigned integer + 2
 
($a + $b) & (2 ** 32 - 1) might be more obvious.
Err... no, it should be + 1.
 
2,147,483,647 is max signed 32bit integer, so unsigned would be twice that?
which is 4 294 967 294
1<<32 finishes with 296
 
No, it's not twice 2,147,483,647, as that is 2^31 - 1.
The max unsigned would be 2,147,483,648 * 2 - 1.
or rather 2^31 * 2 - 1, or of course 2^32 - 1.
 
hun. I am missing key fundamental concepts here I think :)
Not sure what that -1 represents... googles away
 
7:20 PM
@FélixGagnon-Grenier Binary representation of integers. www3.ntu.edu.sg/home/ehchua/programming/java/…
 
Since there are 32 bits in which to store binary digits, the max you can represent is 2^32 - 1.
Signed integers use twos-compliment, which effectively makes bit 32 represent if the number is positive or negative.
It's sort of like a flag that changes how the other 31 bits are interpreted (and makes binary math easier for a CPU).
So rather I should have said "Binary representation of integers with a fixed width."
 
ok, I think that I can grasp. however I don't understand the -1. If I have 3 bits, and keep one to "sign it", the biggest integer I can represent is... oh it's 3, not 4, since we start at 0?
00 -> 0
01 -> 1
10 -> 2
11 -> 3
 
Right, so with 2 bits, the largest integer you can represent is 2^2 - 1.
 
that falls into place
so, if we think back to the "Add but wrap at 32 bits" doesn't that mean that their math is broken, since they wrap at 2^32 and not 2^32 - 1? for instance, if two operand amount to exactly 2^32, shouldn't the "wrap" actually return 1?
 
7:40 PM
No, because they're using mod.
e.g., 3 mod 4 = 3, 4 mod 4 = 0, 5 mod 4 = 1
 
8:33 PM
Twenty years from now, kids are gonna think "Baby it's cold outside" is really weird, and we're gonna have to explain that it has to be understood as a product of its time
"You see, it used to get cold outside"
 
(stole from Reddit)
 
@Alesana We're having a pretty cold winter so far here. According to Farmer's Almanac it is supposed to be a rough winter.
 
So that I can isolate them per library, and then report on them per library. That was if I normally get 5 S3FileUpload/NotFound per day and that jumps to 100 / minute, but there are not other file not found exceptions, I can see instantly that the problem is with S3FileUpload rather than anything else.
(that explanation does work better with other exception types, e.g. NetworkConnection.)
 
@Alesana There are some older songs that are very weird now and I cannot imagine someone writing them today. Like the song with the lyrics "You're 16, you're beautiful, and you're mine."
 
8:39 PM
> but when something is as ubiquitous as above
Although the problem might be similar, the cause and solution is very likely to be peculiar to the library/code that sees that problem.
 
@StatikStasis Well, I think that the way climate change works is the cold air moves to other places so it will still likely get cold in 20 years (even colder in some places). So, while the joke isn't 100% accurate, it's still pretty funny
 
@Alesana Oh- my comment was just a general comment. Not really in reference to global warming. I just know you're a state above me so figured you were seeing some of the same weather there.
 
@StatikStasis Ah yeah. Snow everywhere!
It had been a long time since I have seen snow like this
 
Where is snow?
 
Especially this early. It's usually February before we see it.
 
8:45 PM
in NC
 
Southeast
 
North Carolina
 
snow is melting here
 
Beautiful day in CA :D
 
8:45 PM
4C today, it's warm
 
Yeah it's melting here too but I did have fun when it was 8 inches and fluffy as can be
 
it's good snow when it's wet, cause it sticks together and you can make snowmen and stuff
 
base64 – #77284
 
@Jeeves wat
 
@Trowski yes. let's think with the 2bit system. The largest integer is 2^2 - 1, that is, 3. adding 2 + 2 would then wrap, returning 1. However, with their function, (2 + 2) % (2^2) returns 0. (2 + 2) % ((2^2) - 1) returns 1, the amount of the overflow. Am I understanding "wrap" correctly?
 
8:51 PM
@FélixGagnon-Grenier No. 2 + 2 would wrap, returning 0.
 
oh, 0 is actually counted for the wrap?
 
10 + 10 = 100, but the leading 1 "falls off", leaving 00.
 
right. ok, thanks for all that :)
 
hi every one does any body knows How to Send an Email on Error Exceptions in codeigniter
 
...
@FélixGagnon-Grenier you can think of it as a number wheel (like a number line, but in a circle), that has the numbers 0, 1, 2, and 3 on it.
 
8:57 PM
hmmm yes. I think I was imagining the wheel losing the 0 after wrapping
 
@tereško why was this brought up? No I really don't think so, never did. I said "or even on the table again" which is still true.
 
hi every one does any body knows How to Send an Email on Error Exceptions in codeigniter
 
9:15 PM
> RCE
"First, write some custom code that needs to be run on the target server"
aka it's a privilege escalation that is probably only a threat in shared environments.
ugh.......except if you allow people to configure their imap like that....in which case....fair enough.
 
heh blog writers love to add drama to the headline
its a nifty bug for imap_open imo
 
9:47 PM
Imho the main bug is that we didn't kill the imap extension in php 7
This is the reason why you don't let "but there's no replacement extension" win over "it uses a library that's not been maintained for a decade"
 
Wes
10:05 PM
!!should i go to bed or pull yet another all nighter
 
You should go to bed.
 
Wes
don't tell me what to do
 
lol
I used to be able to pull all nighters and work the next day
Hopefully I can get back to that point
 
@LeviMorrison you asked for final questions on variance - is there a notable change in performance for any of the alleged standard tests?
@Alesana never going to happen. But the good news is you do get better at getting stuff done without needing to do all nighters.
> so performance impact has not been measured. However, there will be some impact as this adds new opcodes to verify variance at runtime, which obviously has some cost.
you could just wait for someone to complain...
 
Wes
seriously:
!!should i go to bed or pull yet another all nighter
 
10:10 PM
You should pull yet another all nighter.
 
Wes
ok.
 
Right now if a type extends something then it will get a verification opcode. This can be optimized a bit to only be emitted if a runtime variance check is needed, which would only slow down code that currently does not compile as well as new code that uses the feature.
I don't think it is will be hard -- just a bit tedious. I already started working towards this.
 
@Danack That works I suppose :P
 
10:47 PM
Missing REQUEST_METHOD in INPUT_SERVER – #77285
 
 
1 hour later…
11:56 PM
my boyfriend got me a Switch o_o
 

« first day (2978 days earlier)      last day (1977 days later) »