« first day (2204 days earlier)      last day (2748 days later) » 

3:00 PM
It's probably for the best
 
Anonymous
:P
 
@LeviMorrison for packed strings, we may not need to store the length anyway, it can be quickly calculated
possibly in a single instruction, not sure
 
@Andrea Yes, but if it can be stored that's even better.
@Andrea Doubtful.
 
ooh my snitch function worked, that was easy
PHP allocates a lot of strings. whoa.
 
@Andrea stdlib alone would have quite a few.
Excited to hear your analysis.
 
3:10 PM
@LeviMorrison yep
 
@Andrea how could you calculate it?
 
oh I see, the known strings aren't zend_string
 
@JoeWatkins ??
 
oh wait they are ...
 
@bwoebi find last set bit
 
3:13 PM
what length are you talking about storing ?
 
CG(known_strings) is an array of zend_string pointers
 
yeah
 
@JoeWatkins they are, they're interned at startup
 
@Andrea except that null bytes are allowed in PHP strings
 
right so what length are you talking about storing ?
 
3:14 PM
@bwoebi ah, true…
 
and you need another instruction to round up @Andrea
 
@JoeWatkins the length of a string
@bwoebi yeah…
 
but they are zend_string
 
@JoeWatkins we are talking about the idea of packing strings into zvals or pointers
 
oh right, I totally missed that
I'll shut up
 
3:16 PM
> I can't seem to recall specifics anymore but I do believe some people
would greatly prefer to remove the internal array pointer for
iteration and deprecate these functions.
wtf @Levi ?!
 
@LeviMorrison here's the raw output (no interned strings atm alas): gist.github.com/TazeTSchnitzel/982abb693e36f40c918cf3fd21918e35
 
IAP is like one of the greatest things when using arrays as lists / queues @Levi
 
@bwoebi I remember hearing people talk about it but can't remember who.
 
now for analysis
 
3:17 PM
@LeviMorrison must be someone having no idea about their uses
 
@bwoebi I was thinking it might have been you and @NikiC, which is why I mentioned you in the email.
I am apparently mis-remembering, at least partly ^_^
Sorry.
 
@LeviMorrison well, what I'd like to see is seeking into a list based on a key
which is an O(n) operation in userland, and O(1) internally…
 
Heh, I totally wandered away in the middle of helping @Riccardo. Whoopsie.
 
@LeviMorrison github.com/php/php-src/pull/645 … this one is moderately useful too
 
    length
 34 0
174 1
 22 2
133 3
250 4
268 5
328 6
374 7
215 8
265 9
369 10
353 11
218 12
193 13
142 14
138 15
168 16
132 17
 99 18
 75 19
 93 20
102 21
 59 22
 60 23
 29 24
 38 25
 30 26
 22 27
 10 28
  5 29
  4 30
  5 31
  1 32
  8 33
  3 34
  7 35
  4 36
  4 37
  1 38
  1 48
  2 49
  1 51
  3 52
  2 53
  1 55
  1 66
  1 129
  1 277
 
3:23 PM
especially nice would be if $whence could be a key too
@LeviMorrison what's that?
 
@salathe I did it thanks to jay now tell me what do you think about this
I'd like to write to a file all I did for debugging purpose
and I foud this
 
8
Q: Write and read php object in a text file?

NantuI want to write a php object in a text file. The php object is like that $obj = new stdClass(); $obj->name = "My Name"; $obj->birthdate = "YYYY-MM-DD"; $obj->position = "My position"; I want to write this $obj in a text file. The text file is located in this path $filePath = getcwd().DIRE...

 
@bwoebi The first column is the number of times that length of string was encountered; the second column is the length of the string; this is from gist.github.com/TazeTSchnitzel/982abb693e36f40c918cf3fd21918e35
 
@LeviMorrison yeah, it will be a totally unpredictable branch :-/
@LeviMorrison Albeit a small cost, packed strings would cause hash values not being retained
 
3:29 PM
@bwoebi Yes.
Hashing on-demand may be faster depending on how many times the hash has to be calculated.
Allocations are expensive, as are cold memory accesses so...
I think it'd be worth experimenting with.
 
man, the English in that question @Riccardo is so bad... I had to fix it...
using PHP object in text file is not possible... but the person asking the question wants to use a PHP object to write to a text file...
 
“Hmm, this is taking a while”. checks PHP code… oh: for ($i = 0; $i < $len; $len++) {
8
 
lol @Andrea
 
@Tiffany
are you talking about the english in the question I posted?
 
yes
 
3:32 PM
oh poor him
 
I edited it to clarify what the question was asking for
 
Is doceditor broken again?
nvm just slow as usual
 
I'm pedantic and a grammar/mechanics nazi with English.
 
@Tiffany Um, are you sure that's what their question was really asking?
 
@bwoebi courage
 
3:33 PM
back in the elementary when I started to learning english I used to be mocked about my knowledge when I went to england
 
@salathe well, considering that you can't write a PHP object in a text file....
 
@LeviMorrison trivial crappy analysis: gist.github.com/TazeTSchnitzel/…
 
@salathe I would have to assume that they're wanting to use a PHP object to write into a text file
 
@Tiffany sure you can, look at the answers, or use var_export(), or write PHP code to the file.
 
right, but a text file is .txt
not .php
 
3:35 PM
Heh, so?
 
soo.... how do you write PHP code in a .txt file and expect it to work?
 
it's hard to expain I'm from Rome and I'm 25 and I've been studying it since I was 6 and back in the early days people abroad took the piss out of me because of my elementary knowledge and strong italian accent @Tiffany
 
Extensions are a lie
 
it's so humiliating
 
@Andrea Sort $lengths by key please :D
 
3:36 PM
@LeviMorrison yeah, I'll do that
 
@PeeHaa if I'm incorrect, that's fine, but I'd like to be told why I'm wrong so I can learn
 
@Tiffany Um, by doing exactly that. Write the serialized/exported/hand-written file contents, then read it back. They're not asking to execute the .txt file directly.
 
what you wrote doesn't make sense
 
@salathe I did it I finally managed to write the php object into a txt file
 
@Andrea 1583 strings in your sample with length < 8, if I didn't screw it up anyway.
 
3:38 PM
@Tiffany one last thing.. am I proficient in english?
 
@salathe that would still be done using a php file though...
@Riccardo your written English is well enough to make sense.
 
from fuc**** 0 to 10? :P
 
@Tiffany he could've done file_put_contents('foo.txt', json_encode($obj)); $obj = json_decode(file_get_contents('foo.txt')); ... it's just writing some representation of the object to a file, so he can read them back out.
 
Note that require __DIR__ . '/foo.txt'; for as expected @Tiffany
 
3:39 PM
@JoeWatkins are you referring to my edit?
 
No idea what the question was though
 
yes
 
Just yelling words at this point of the day
 
alright
 
note how PHP's sorting for strings is nonsense, ugh
 
3:39 PM
@PeeHaa ayo man I made it
now I'll go your way
thus I will have an alternative
I'm happy
 
I'll rescind my edit if I can
 
I drank a sip of beer today.... it was bitter....
 
My numbers are different; I wonder if it's because of non-printable characters and such.
 
@Archer That's good. @Jimbo's still bitter about me and his mom
 
was it an IPA?
 
3:41 PM
@PeeHaa :p
 
@Archer Uh.. where do you live again?
 
@LeviMorrison you probably used a decent piece of software
 
@littlepootis does it matter?
 
PHP's comparison and sort operators are garbage
 
3:42 PM
@Andrea Especially that stupid spaceship thing. :P
@Riccardo happy to see that you got a good result :)
 
@littlepootis I'm afraid I can't really tell you....
 
@Archer he's asking because the quality of beer differs ... also the available options differ
 
@salathe I'm not at the finish line but I'm going to go past bolt
 
@Andrea awk "{ print length($1) - 2 }" gistfile1.txt | sort -n | uniq -c
 
Your weekly user notes WTF:
 
3:45 PM
Ah.
 
> how to get content one images in page a name site, example: post message user fb
 
oh, it was a heineken ...
 
ugh
 
awk '{ print length($1) - 2 }' gistfile1.txt | sort -n | uniq -c
 
@LeviMorrison I used the simplest C code possible that produces valid PHP/C strings, it'll encode \\ and " “wrong”
 
3:45 PM
@PeeHaa but.. but.. *how to?!"
 
> if $filename has a relative path file_get_contents returns the uninterpreted sourcecode of the php-file with all comments etc.

I don't know whether this is a bug or intented or caused by server-configuration.

I think this behaviour should be included in the description of the function.
Said description:
> Reads entire file into a string
 
@Archer I guess most of beers can be describes as "bitter" but in the same way as "tea is bitter"
 
@bwoebi oh? What are their uses?
 
I'm somehow getting a -1 and 0 length out of it.
 
I mean apart from abusing them to get the first and last element
 
3:48 PM
hm..
 
@LeviMorrison fascinating
by the way, make sure you're using the most recent version of the output
previously it escaped \\ and " wrong
 
@LeviMorrison whatever's currently in the gist
maybe I should drop the percentages actually
and just make it produce something that excel will like
 
@Andrea So... I have " in there.
Literally one double quote.
 
@LeviMorrison Using u1.reserved should be possible
 
3:52 PM
@NikiC Sweet. I look forward to the bugs :D
 
@LeviMorrison ah, yes, that might be the old code…
 
So in 32 bit builds we would only have space for 3 characters :D
 
updated with tabbed columns without percentages
 
@Archer I would have to guess Mallazia or maybe South Korea
 
@LeviMorrison if you're thinking about a new zval type, then 32-bit is the same as 64-bit
 
3:55 PM
@tereško ummm... no? :p
 
yeah, only pointers are the problem
 
@NikiC Duh; doubles are still 64 bit ^_^
Silly me.
 
^ In case you ever wanted to know the distribution of zend_string lengths allocated by PHP 7.2 when executing a single semicolon.
 
So the next question is, how does this change if instead you run, say, wp?
 
4:10 PM
yep
Patch here used for logging: github.com/php/php-src/compare/master...TazeTSchnitzel:snitch - doesn't handle interned strings currently.
 
sadly the_loop is too long.
Most of their function names will not fit.
WpQuery fits tho
 
well, this is with no compression
 
Correct.
Wordpress has a lot of 8 char names, btw.
 
let's assume we have 7 bytes to work with, or 56 bits.
That's eight 7-bit characters, ASCII (or SMS!) style, or nine 6-bit characters, or 11 5-bit characters.
 
Getting that 8th char without much overhead would be hugely beneficial for WordPress.
 
4:13 PM
@Leigh oh my god
 
So... if it contains an identifier that doesn't compress it doesn't do SSO?
Or have multiple flags that determine different kinds of SSO?
 
SSO?
 
Seems like if we have to inspect beyond length we won't see benefits.
Small String Optimization.
 
ah
@LeviMorrison possibly…
but consider this. most of these strings are not created dynamically, surely?
they're string constants in source code, or identifiers
the compiler can spend as much time as it wants on optimising those
 
I'm used to SSO meaning single sign-on o_o
 
4:16 PM
@LeviMorrison we should be free to optimise as much as we like for non-dynamic strings
 
@Tiffany Seriously Sexy Ostriches
 
@DaveRandom Such Sad Observations
@DaveRandom Sentence Skills Obsolete
 
Hey guys.
I'm using PHP7 and.
        protected function checkPermissions()
	{
		if(is_writable(dirname($this->path))){
			return true;
		}
		throw new InstagramException($this->path);
	}
I have this method.
Keeps throwing an exception on Windows 10.
 
Okay. What is the problem?
 
Any idea why?
 
4:18 PM
@Tiffany Superfluous Septuagenarian Osteopaths
 
I've tried directory sharing settings.
And also tried:
 
@HassanAlthaf What exception?
 
"InstagramException"
 
I'm curious about moving to a 128 bit payload. I know in the short-term it would have disastrous performance issues but there are quite a few things that could benefit from larger payloads; things like strings, arrays... maybe bignums.
 
Thrown when you can't create a folder.
 
4:19 PM
don't you need an else?
 
@LeviMorrison the ideal from my perspective would be moving to a 64-bit zval. unfortunately, we make good use of all those 128 bits.
 
That means putting more on the heap.
 
@LeviMorrison in some cases.
 
You'd have to see a large improvement in instruction encoding/decoding to justify it.
 
@Tiffany No, it's return or throw, although that's a weird mix. Generally either you return bool or throw in the false case, not both
 
4:21 PM
Looks like it's possible to create directories.
This stupid method is pissing me off.
 
@HassanAlthaf instead of checking if it's writable, try writing to it and see if it fails
 
Guys where can i ask a very general question? I feel like i will get roasted if i do so here...
 
@Andrea Unfortunately, it's a library.
A buggy library with no other options.
I want an API to create IG accounts.
Only one that I can find.
 
@HassanAlthaf is it namespaced?
 
@Valbone here is as good as any place. Trust me, I've asked my fair share of stupid questions. :3
 
4:22 PM
Yes.
 
If we did 48-bit payloads with 16 bit meta we could maybe do it, but I'd only want to do that if we can have bignums.
 
@HassanAlthaf okay, here's an idea for you:
namespace some\bad\library;

function is_writable() {
    return true;
}
 
@Tiffany, can i just drop the question link here?
 
I did that.
 
as long as it's not Wordpress
 
4:23 PM
Doubles would have to go on the heap but I'm not sure how big of a deal that is.
 
@HassanAlthaf oh, did it not work? D:
 
I think that's the only exception
 
Integers, strings and arrays are far more common types.
 
It works.
 
@LeviMorrison we could use floats instead of doubles in some cases
 
4:23 PM
No, its not Wordpress
 
Look @HassanAlthaf @Andrea it's not lying to you, the path really is not writable
 
0
Q: Dropdown Javascript menus overlapping

ValboneThe goal is to, in the header, make the first two titles open as expandable dropdown menus. I have little to no experience in coding, especially javascript and jquery. I have achieved the effect for one button (https://gyazo.com/c8abca5a6c73fc5e4856e85727b57b55) and whenever I add the second one,...

 
Can't update ever again.
 
@Andrea I wouldn't personally consider doing mixed precision floats for a single type.
 
@DaveRandom It is lying. I just did "mkdir" on that exact path right after the if condition.
 
4:24 PM
@HassanAlthaf not necessarily. this doesn't need to be in the other library, you can add it to your own code. it's a horrible workaround, but so long as you execute such a file before you call the library function that looks for it…
 
@LeviMorrison depending on implementation, not necessarily
 
@Valbone if it's Javascript, HTML or CSS related, have you tried the HTML/CSS/WebDev chat? There's also a Javascript chat. It's preferable to keep specific questions in their specific chatrooms.
 
@Andrea horrible idea
 
Anyone knows any good Instagram API to create accounts?
 
@NikiC Agreed.
 
4:25 PM
The official one doesn't allow it.
 
@HassanAlthaf if the one you're using is this bad, you might as well use the Instagram API directly with some sort of PHP REST client
 
But there are applications doing it.
 
@Tiffany I have not, and did not know there was such section. Thanks, will check it now.
 
@HassanAlthaf look up how others have done it
 
Unfortunately, there's no code.
 
4:25 PM
@HassanAlthaf Then maybe you should consider doing only what their API supports?
 
@HassanAlthaf What precisely did you do? If is_writable() did not work correctly on Windows, someone would have noticed by now. Not least, I would have.
 
@NikiC er, probably, yes.
 
@LeviMorrison Looking at other peoples work, my client expects me to do that.
 
@HassanAlthaf Tell them you are not going to violate the ToS.
 
yeah, that might be worth mentioning to them
 
4:26 PM
...or make them sign a thing and charge them a shitload extra
Probably just don't do it though
 
@LeviMorrison The entire job is this.
 
eval("
    namespace some\bad\library;

    function is_writable() {
        return true;
    }
");
 
Btw, let me link you guys to the library
 
this is horrible but it works
 
4:27 PM
@HassanAlthaf if it's troublesome enough, fork it. or submit a pull request, or an issue.
 
Everything is broken in this library.
I have fixed so much
 
@HassanAlthaf contribute those fixes back upstream, if you can.
What are the best #PHP string classes or Unicode string classes already out there? I'd like to see what prior art there is. RTs appreciated.
by the way, any help with ^ is appreciated
 
Nice @salathe \o/
 
@HassanAlthaf Then tell them you are not going to violate the ToS and decline the job.
 
4:43 PM
guys, I'm facing a problem with php and can't find the answer
can you possibly help me?
Im running script throght CLI, and it's crashing with Out of memory (allocated 32243712)
32243712 = 32Mb
BUT
I'm runing clean new just downloaded php with memory_limit = 512M in it (128 by default)
under Windows 7
and I have no clue why it's crashing at 32Mb
 
Did you restart your webserve?
 
As I said Im running CLI
 
oh sorry :P
Beer was at fault there...
 
Did you edit the correct ini?
 
4:46 PM
@PeeHaa lol
 
clean php have -develop and -production predefined php.ini's, I have used develop one and changed 128 to 512 M
and script crushing at 32 mb, not even at 128
 
Did you rename it to php.ini?
 
yes ofc
I even checked it inside my script throught ini_get('memory_limit')
also
 
What does php -i | more tell you?
Especially the location of the ini, possible other config loaded and the value you get there
The first value that is
 
4:50 PM
memory_limit => 512M => 512M
I checked the limit like that: have ran while(1) loop with continiously concatinating string and checked memory_usage and it have went after 32mb limit
but when I run my script without it, it crashes at 32mb
sry for my english tho :)
 
Your English is fine
It's like you're from Manchester cc @DaveRandom
 
lol
I hope you get idea with the loop and memory check
 
ok if the correct ini is being loaded and the value of php -i is correct it can only be something in your script that's (incorrectly) setting the limit
 
php.ini location is as expected
after php -i
 
Can't you do a ini_get() just before the loop?
 
4:54 PM
Yes I did
shows correct value
 
Impossible :P
 
I also did it right before the command that crashed at 32mb
and it's shows correct value
I agree ;D
but
 
Can you paste the exact error message?
Also how big is the script? Can you gist it?
 
Fatal error: Out of memory (allocated 32243712) (tried to allocate 131829 bytes) in D:\web\OpenServer\domains\petkorm.local\parser\vendor\phpQuery.php on line 506
script is not so big, Im parsing some info in it
and using memory reasonable, not loading big files in it
 
phpQuery lol
 
4:56 PM
:)
 
That's that sizzle thing for php right?
ah yes it is
 
I googled that Out of memory is not the same Php's memory exhausted or smth error, it could mean that OS is limiting the process
 
@PeeHaa ah... such resemblance, much wow
 
but how Windows 7 can limit the process' memory lol
 
It shouldn't
The only way that should happen is if you run out of physical memory I guess
But even than it should just swap afaik
 
4:59 PM
I have 4Gb memory and checked when script is running
it's okay
like 70% is free
 

« first day (2204 days earlier)      last day (2748 days later) »