« first day (1929 days earlier)      last day (3029 days later) » 

8:00 PM
Ok people. Best web service ever created! Brought to you by PeeHaa Useless Inc
 
hm.hm.hm
 
@PeeHaa what did you do? :-D
 
You're welcome
 
horray
 
8:01 PM
At least I assume it works
 
It does…
and nice you have a wildcard cert ^^
 
\o/
@bwoebi Yeah. Have had one for a couple of years now. Really nice. But next year will be letsencrypt I think
This doesn't look right though @bwoebi
> 100.0 0.2 5775:48 php
top output
 
that was me ^^
for (i = 0; i<100000;i++) connection.send(JSON.stringify({click: true}))
:-D
 
Would that be aerys' responsibility or mine as a developer?
 
502 bad gateway … did you kill it?
 
8:05 PM
@bwoebi You did
aerys puked
 
out of memory
or what?
 
Nope 4G free
 
why did it crash then?
 
Let me run with -d.
Oh wait... disabled on production...
 
run with zend.assertions=-1 and -d
it'll trigger a warning, but meh
fine for debugging on prod^^
 
8:07 PM
Yeah hold on. Let me restart
 
Hey look, an issue that would have been made more obvious with my "Warn about invalid strings in arithmetic" RFC: stackoverflow.com/questions/35043445/…
 
@PeeHaa hmm?
 
Can you dos again?
 
yip
 
Ah yeah
mem
 
8:11 PM
told ya ^^
 
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /srv/Amplify/vendor/amphp/amp/lib/PrivatePromisor.php on line 26
PHP Fatal error: Uncaught LogicException: Cannot run() recursively; event reactor already active in /srv/Amplify/vendor/amphp/amp/lib/NativeReactor.php:52
Stack trace:
#0 /srv/Amplify/vendor/amphp/amp/lib/functions.php(46): Amp\NativeReactor->run(Object(Closure))
#1 /srv/Amplify/vendor/amphp/aerys/lib/Process.php(128): Amp\run(Object(Closure))
If you're happy and you know it:
segfault
 
obviously, if you only have 128 MB …
I know … I've gotten that segfault already a few times with such errors, but no idea why
can you retsart with more mem?^^
 
Sure. Moment
 
-dmemory_limit=-1
 
I don't think that's a good idea dave
 
8:16 PM
why not? your swapspace is soooo empty!
 
:P
Hit it now
 
no crash :-)
 
:-)
 
also PrivatePromisor is a weird place to allocate 20 KB…
 
mornun
 
8:23 PM
Mogguh
 
memory bandwidth isn't free...
 
@PeeHaa btw. these 100k updates are also a lot of processing work on browser side
 
Yeah
 
...except when you can pass it onto someone else's computer.
 
That's the beauty of websockets! I pass it onto everybody's puter! :P
 
8:28 PM
lol
 
foreach into list is cool, but it'd be neat if we could use named keys.
foreach ($arrayOfMaps as list('name' => $name, 'age' => $age)) {

}
Given:
$arrayOfMaps = [
    ['name' => 'Foo', 'age' => 42],
    ['name' => 'Bar', 'age' => 84],
];
Thoughts?
 
cramming everything onto one line is not great. Why do you need to do it on one line rather than:
foreach ($arrayOfMaps as $maps) {
    list('name' => $name, 'age' => $age) = $maps;
}
 
@NorthbornDesign There is a proposal pending to introduce this
 
Oh? Neatsauce.
 
@PeeHaa the only thing I don't userstand is the delay between when I send the 100k messages and when I get the 100k replies
 
8:36 PM
I'm also not sure
 
Send at T=7, Replies starting at T=158
 
It should send the update the moment a frame comes in
 
yes
even with 10000, less delay, same behavior
 
I don't think I am doing it wrong because I really increment the count and send the update
 
no you aren't
hmm, I think I know why…
 
8:42 PM
> PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in /srv/Amplify/vendor/amphp/amp/lib/functions.php on line 860
PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0
 
+1 thanks, now I know how floats are stored. PS: No, Windows doesn't. At least in PHP5.3.1/Win7 I did have floating point issues ;) — NikiC Sep 29 '10 at 16:56
 
lol
 
inb4 @kelunik pops in to tell me I should install supervisord
 
@PeeHaa how many did you send? 1M? xd
 
yeah think so. Lost count of 0s
 
8:44 PM
onWritable() is dequeuing one frame after the other, but onReadable is getting like 400 small messages per fread()
@PeeHaa the reason you get these memory exhausted is the buffer of still-to-be-sent frames
 
hello is there anyone that could help me with some algorithmic stuff?
 
@bwoebi Well push them out faster damnit
I need moar frames
 
@PeeHaa I probably should…
let me see what I can brew together
 
k
@DaViDa Just ask your question if somebody is here and wants to help they will
 
This one is about run time encoding:

Given following bitstring: 11111110000111110000000000
For the amounts i need to use 3bits, what is the outcome of the compression?
7 = 1 4=0 5=1 and 10 = 0
 
8:50 PM
....you probably ought to just do your homework yourself.
 
so what I have is:

7 4 5 10
111 100 101 0
10 = 101
so: 111 100 101 1010
however 10 must be expressed in 3 bits so 010?
it counts it as wrong
@Danack No I am not, I want to try to solve this with understanding which is way i showed what I have tried. The reason for the chat is for quicker response as I have several things I dont understand
 
@PeeHaa pull plz (I mean composer update Aerys)
 
@DaViDa What is it for then? What is the context that has caused you to have this problem?
 
moment
Done
 
also restarted?
 
8:58 PM
yeap
wait no
> Updating amphp/aerys dev-master (bdd5768 => 3be97cd)
That's that the commit isn't it
 
@Danack I have a test tomorrow and have been studying, and some things like above I cant seem to understand, the thing I tried above for example returns that it is incorrect with a practice test. So basically I think the problem is how would I express 10 in the binary language using 3 bits?
 
@PeeHaa no
@PeeHaa 5d11c44 is
 
Stupid composer/github is lagging behind
 
@PeeHaa composer ^^
 
@PeeHaa s/packagist/
 
9:01 PM
So slow :(
 
@Charles why?
 
@AboutLeros Please format your code - hit Ctrl+K before sending and have a look at the FAQ.
 
WINRAR!
 
\o/
Updated to correct commit and restarted @bwoebi
 
@AboutLeros You need to check that $res is not false. Also, stop using ext/mysql, for the sake of all that is good and holy in this world.
 
9:03 PM
@DaViDa The wording doesn't make any sense. It might not be a homework question, but it's still a weirdly phrased non-real world programming problem. If that is the actual text from the question, you ought to ask a tutor what the fuck it means, as it makes no sense to me.
 
@PeeHaa much better
 
@AboutLeros Also you may want to look into slq injection or rather prevention of it
 
@AboutLeros Why? Well, why don't you go ahead and review the mysql_query documentation, and you will quickly discover the "why" to both of my suggestions. :)
 
oh, i see. . . :P
 
@bwoebi Yeah. I saw the counter jumping althought at the end it seemed like it did single messages again
 
9:05 PM
In specific, check out the giant red box at the top... and then check out the Return Values section.
 
i wasn't aware.
 
For debugging check the return values of the functions you are using. Also you can ech oout the query and run it manually in your database client
 
@PeeHaa can you please goto Websocket/Rfc6455Endpoint.php and s/8192/65536/ on lines 482, 486 and 501?
 
Or just visually check the query
@bwoebi Most certainly
 
and then restart, obviously :-P
 
9:07 PM
@Charles what would be a better way of doing it?
 
Restarded @bwoebi
\o/
 
@PeeHaa perfect
 
@Andrea lol
 
@AboutLeros Use PDO or mysqli. One moment, trying to find that one correct link, I always misplace it....
 
9:10 PM
!!docs mysql_query
 
Where in the world is that wiki page with the PDO-for-ext/mysql-people walkthrough?
 
Fuck you @Jeeves
!!version
 
!!docs mysql_query
 
9:11 PM
Please, don't use mysql_* functions in new code. They are no longer maintained and are officially deprecated. See the red box? Learn about prepared statements instead, and use PDO or MySQLi - this article will help you decide which. If you choose PDO, here is a good tutorial.
 
@Jeeves yes, i got that thanks :)
 
^^ click the "here is a good tutorial" link in that post.
 
@PeeHaa barely 17 seconds for 100k parsed and broadcasted messages (to two clients)
 
The OWASP guide is good, yes.
 
@PeeHaa that sounds like a solid performance
 
9:12 PM
@bwoebi Yeah that is some proper nice technology you have made there
Really nice
 
@Charles This is gold. thanks @Jeeves
 
yeah thanks @Jeeves
 
@PeeHaa though, I probably should limit it to like a 100 msgs/second (per connection)
 
You guys are gonna have to make Jeeves reply to "thanks" "thank you"
 
9:13 PM
@Charles I don't follow?
 
@AboutLeros Jeeves is a bot :)
@PeeHaa Ewww, you want me to write PHP!?
 
@Charles sure.
 
hmmm.. if not done tonight when I get home, I'll definitely have a try at that
 
@Charles hehe point taken
 
is there a simple way to use a str_replace on ONLY the first instance of that strings occurance (without knowing the starting or ending index?)
 
9:14 PM
@Charles ok, did not not that. . . :D
 
@Charles well, the PHP we write is so disconnected from the typical crappy PHP … you won't even notice it's PHP, so awesome :-P
 
@captainrad Use preg_replace instead
 
alright, I was thinking that might be the best solution.
thanks @PeeHaa
 
@captainrad Simple, no, but finding the index of the first instance, doing a substring extraction and replacement, then putting the substring back in could work. I expect given that you're thinking about indexes already that you don't wanna do that, and I don't blame you.
 
@captainrad np
 
9:15 PM
Otherwise I'd consider doing it using a regex without the /g flag
@bwoebi I'll take your word for it. For now.
 
@NikiC I don't suppose you have any free time to proofread my article on reimplementing the range operator (same tpunt/articles repo)?
 
:28399416  is this better?  echo $comp_name = $row['comp_name'];
 
heheh chat MD never change
 
@tpunt I can check it out tomorrow
 
@NikiC Thanks :)
 
9:29 PM
@AboutLeros No. Well, maybe. It's important that you make sure the return value from the query is actually a statement handle, and that if it is a statement handle, that there's data to retrieve.
Pessimistic code is safe code.
 
@PeeHaa do you agree that it's a good idea to limit it to like a 100 msgs/second (per connection)?
btw. pushed the numbers to 65536 now ^^
 
@Charles i was using a while statement
 
I want to view a XML file in a way where I can collapse stuff like in a tree without downloading software or installing stuff how can I
I need this to figure out how to parse the data with Regex
it can be JSON or XML
oh wait
browser might be able to do it
 
@AboutLeros Assignments return the assigned value, so as long as the assignment is truthy, that should work in a while. That said, addressing a boolean as an array isn't a good idea, so you should skip the while if the statement handle is false.
 
@Charles im learning so much through this journey about XML JSON REGEX Google API
 
9:38 PM
@ChrisOkyen I haven't looked at a raw XML file in Firefox in forever, but it used to have a collapse/expand mechanism... I know Chrome does not have one. IIRC IE used to have one as well, but again I havent' checked.
 
@bwoebi I think that should be enough for everyone, but I might do some testing with it later to check what a reasonable amount is resource wise
 
Yep IE does for the browser im using @Charles Version 11
 
Yeah, but I think IE cocks up on large xml
 
ahh
 
@PeeHaa actually, as you see we can problemlessly parse and send a tens of thousands messages per second
 
9:40 PM
@Charles Thanks :)
 
@PeeHaa so, if we set it to 100/sec (which is already plenty), it should be fine
 
yeah I was more thinking about higher rather than lower :)
But no sane application would need that I think
64k ought to be enough for everyone
 
@PeeHaa said nobody, ever
 
:-)
 
@PeeHaa you always can set the limit manually higher…
 
9:44 PM
Yeah
 
Is is safe to show an example of XML code if the url has my GOOGLE API key
should I give that to the publice on chat
 
Probably not
if it should be a private ey
 
IDK if it should I just made it for my little home project
 
if I have a string `$content = "this is SUPER a string that contains the word SUPER three SUPER times' and I want to wrap the first instance of "SUPER" like so... "<a href='blah'>SUPER</a>" and leave all other instances alone.. what would be the best option
would it just be preg_replace?
 
@ChrisOkyen Just xxxxx out the key to be sure :)
 
9:45 PM
I am just trying to steer away from regex
 
@captainrad why?
 
but it is a url
can't do that
 
@captainrad why?
 
@ChrisOkyen pastebin?
 
@ChrisOkyen Just get the xml and pastie that
 
9:46 PM
yurp
 
Damn you@Patrick
twice in a row
 
HAHAH LOL
 
:P
 
why to which part?
 
> steer away from regex
 
9:46 PM
@captainrad if you hover over the message it shows what it was replied to
too much text, peehaa was faster -.-
 
:D
 
I guess I dont HAVE to steer away from it....
 
just seems more complex then it needs to be
 
@PeeHaa why does everyone say that
 
9:48 PM
regex101 really helps making it simpler
 
@captainrad sounds like a simple regex. just wrap it in a nice little function with a name that describes what it does.
 
@ChrisOkyen Say what?
 
let me write up an example..
 
Why do people say stay away from RegEX
 
@ChrisOkyen some think they are slow. some have emotional scars from seeing horrible regex.
But if you use them responsibly, go for it
 
9:50 PM
^ that
 
@ChrisOkyen I say it because I fear what I don't know ^_^
 
I think its freaking awesome
 
any idea what to expect from a 1.5h senior dev coding challenge from a company that actually follows SOLID etc?
 
Good coffee :P
 
I don't even drink coffee. Blasphemy... :o
 
9:53 PM
This is what it is like for me first time seeing RegEX
 
Take your laptop and an empty working code base with you maybe?
@ChrisOkyen and the 5000th time.
 
@Danack they don't want me to bring it, already asked
 
Regex First Time... Like Porn
 
and the 5000th time.
 
Oh that wasn't frustration
 
9:55 PM
gonna be weird, they use phpstorm and german keyboards, I'm used to english keyboard +sublime with a bunch of plugins
 
Oh god german keyboards
 
hahaha
 
yeah.....I would push back on that straight away.
 
Only thing worse is azerty
 
Do germans type angry on keyboards
German Keyboard : REICHSTAG GUTENDAG!!!! ANGRY ANGRY
 
9:56 PM
You have to hit capslock to prevent all caps
 
wtf
 
I can switch the z and y, it's the symbols used for programming that are impossible to find on the german one. You need some serious finger acrobatics
 
That was intentional to sound in text how German sounds ( like their mad )
 
Before the interview, ask them explicitly how they cater for people who have gotten used to using particular IDEs, and how they might not be as productive in 1.5 hours as people who are using an ide they are used to using?
 
Oh the words used ... Only two German words I know
 
9:57 PM
If they have a sensible answer to that - such as, "lol we don't care about the code written in the test, we're just testing how your work to solve problems", then it's not a problem.....If their answer is "WHY DON'T YOU USE PHPSTORM LIKE EVERYONE ELSE", maybe, problem.
 
I may have to ask the q about regex but ima see if I an get it without asking
 
Anyway....
So, I made some more things: Jig Templating library and Tier 'framework' which has a skeleton application and almost has documentation Tier 'framework'
4
 
perhaps my implementation of preg_replace is the issue.. or at least one of them, I am a php newb mostly
 
9:59 PM
404s
 
Don't look too closely, at least one of them needs re-writing......but they're still better than Twig or other frameworks....
 
!!docs preg_quote
 
[ preg_quote ] Quote regular expression characters
 
@captainrad ^
 
@PeeHaa that's very case-insensitive of Travis
 
10:00 PM
@Danack :-)
 
@PeeHaa cool looking into it
 
@Danack isn't jig the lib with a dinosaur?
 
@captainrad Also replacement doesn't need / delimiters
 
CachingGeneratingFileBodyFactory
Is this aimed at people coming from java? ;p
 
Also this should be $formatted_url = '<a href="$1">$1</a>'; W@captainrad
 
10:02 PM
So I want to Find Var in every instance where this patteren occurs in the XML


-<duration>

<value>22572</value>

<text>6 hours 16 mins</text>

</duration>


-<distance>

<value>Var </value>

<text>606 km</text>
 
@Danack quick feedback on jig... adding a function looks complicated
well, not complicated, but boilerplatey
 
what have you tried?
 
@Patrick You're calling it Enterprise Ready? I will take that as a complement!
 
@tereško who me
 
10:05 PM
hehe
 
@Danack missing syntax highlighting here tier.phpjig.com/examples/cachingExecutables
 
yeah.....also words...
 
oh lol. Didn't notice it :P
 
and better prod error handling... ;)
 
@Patrick Reasons why I am not allowed to be a sys-admin, number 637.
 
10:08 PM
I would personally think it's nice when the skeleton pages where properly indented
 
http://images.memes.com/character/meme/first-day-on-the-internet-kid So I want to grab VAR only in certain cases where the below patern is in XML

<distance>

<value>660459</value>

<text>VAR</text>
 
@ChrisOkyen what have you tried? show your code (in a pastebin pls)
 
//distance/text/text()
IIRC
!!docs domxpath
 
PeeHaa I don't know what that is
oh look into it
 
10:13 PM
@PeeHaa so after using preg_quote on the given strings I pass them through preg_replace as the pattern and the replacement?
 
Just the pattern
 
I think i need to read up more on preg_replace pretty sure im using it wrong
 
yeah you are ;)
Hold on
@captainrad 3v4l.org/XE2M3
 
oooooh
 
Use () to create a capture group so you can reference it in the replacement
 
10:27 PM
cool cool.
thanks!
 
np
 
also glad to discover that site, I was looking for one like it earlier today
 
<DirectionsResponse>
<route>
<leg>
<step>
.... more and more <step>
<distance>
<value>660459</value>

<text>VAR</text>
</distance>
..... all end tags

continues <route> <leg> <step> .... <distance> Value> however many times theirs routes
How can I say ... Get REGEX you @#@!, do get all values within <value> that arte in <distance> which are below <step> but not in side of it which is in all <routes> and a sandwich
<route>"/n""/t"/<leg></n" "/t" "/t" <step>"/n" "/t" "/t "/t" * wildcard "/n" "/t" "/t "/t" "/t" <distance> something like that
that's pseudo code but
 
ó/
 
Like do I need to include the tabs character for <> below its containing <>
like do I have to include the tab in front of <fish> and </fish>

<dog>
.....<fish>
.....</fish>
</dog>
used . intead of space because of format
 
10:41 PM
@Ekin o/
 
that moment where you realize your memory is near full because you left the traffic capture on en0 open…
 
Use an xml parser @ChrisOkyen
 
like regex?
I gotta use something VBA lets u
 
github.com/amphp/aerys/commit/… … sigh. And I don't really want to segment fread()'s into chunks of 500 bytes as that would be just slow for most use cases. \cc @PeeHaa
 
Not an intentional rickroll being about VB this whole time
 
11:01 PM
guys am using SO like WMD with HTMLPurifier when i put an image url is strips the '<img' is there a way to fix this.
 
@PeeHaa do I need to include a tab escape character for the XML tages
*tags
 

« first day (1929 days earlier)      last day (3029 days later) »