« first day (2474 days earlier)      last day (2699 days later) » 

Anonymous
14:00
@Andrea If you didn't use Libraries, I'd say you were trying reinvent the wheel. Using a framework to not reinvent the wheel.. meh.
@JayIsTooCommon I don't want to rewrite all the glue code myself.
what's "glue code"?
all I can think is the code, that end's up in the bootstrap file
and that's like 40 lines (it something like 1/5 of those lines being various use statements)
yesterday, by Madara Uchiha
lol
I know I am
@kelunik Why do you think I am?
14:16
@PeeHaa Passing passwords via the command line args exposes them to any process running on the system.
yes. I know. I am working on preventing that
And you have one process per operation, better just use amphp/parallel instead.
@tereško I've been using Slim but using a wrapper for the route callables to make them use Auryn as the DIC instead gist.github.com/Danack/335faa8cc1128d3637022cce675bb27b /cc @Andrea
Solves both problems.
@kelunik Doesn't parallel require external extensions?
14:16
@PeeHaa No, why should it?
If you use any Amp v2 lib, you probably already use it.
When i tried the examples they all used an external dep
Can you share where it is used / how to use it?
Anyone know what's the roguewave -> Friday link please.
@PeeHaa It doesn't work on Windows currently.
oh :(
Any outlook on a resolve?
Yes, v0.3.0 of amphp/process. @DaveRandom ping.
14:20
Ah the exe
FWIW I currently am actually encrypting stuff, for the poc but yeah that is puke
And how do you decrypt it?
pre-generate key
Which sucks
You could also just pass the password via env variables.
That would be as readable as anything else?
@Danack for last 6 months I have begun using Symfony's Router + DIC as basis and keeping the rest of the code custom
14:24
And please correct me when I am wrong
cat /proc/1/environ
cat: /proc/1/environ: Keine Berechtigung
oooh
Morning.
But /proc/pid/cmdline is world readable.
@Trowski o/
14:25
Yeah. Hence the encryption thing. But that is so much nicer indeed
/me burninates branch
@kelunik care to do an actual review once I dicked enough with it and move from poc to actual thing? <3
AWS SNS allows 1 million free push notifications. So... create an app, get your friends to install it on their phones. Send them hundreds of thousands of push notifications at 4am >8D
I suppose you don't really need AWS for that though
But it's where my head went
@tereško I have faith crisis each time I watch a question like that upvoted
@PeeHaa flipped through bugsnet and didn't find it
k maybe it's my memory being stupid again
14:32
impossibru
o/
@PeeHaa Can do that, but I'd really just use amphp/parallel for it or not care at all.
@PeeHaa or bugsnet search sucks, or I suck as bugsearch
@kelunik Yes. I will. I started out with that, but thought it couldn't work without external deps
You were on my list to ping anyway. But didn't really looked properly at it
@PaulCrovella both
@kelunik pong
14:36
Can I use amphparallel yet?
On windows
@DaveRandom There are open comments on your PR. I prefer a public constructor + start as instance method. @Trowski, too.
@kelunik Yep, I do. I'll have some time to review it later today.
I have a slight preference for the static ctor because it eliminates a layer of promise indirection but I don't care that much
Promise indirection?
@FélixGagnon-Grenier it's not just the question .. the answers are golden too
14:39
So that $proc = new Process(...); $proc->start(); yield $proc->join(); will still work without awaiting the start() promise
@DaveRandom Just error out if not yet started?
Well I don't see any reason to if we don't have to, attempts to fetch the stream will still fail but if code doesn't do that, there's no real need to break BC like that
like I say, I'm not hugely fussed
@kelunik can you elaborate on what you were saying yesterday about dropping the handle on a duplicate connect attempt being a DoS vector?
I can't work out how it would be
@DaveRandom If the streams don't work anyway, I don't see a reason to be inconsistent and have more code there.
@DaveRandom I have two primary concerns: 1) Process objects will automatically destruct and call kill() if no references remain. That is, they will not keep the loop running and there are not circular references in the loop, unless… 2) Calling join() will reference the exit code watcher and keep the loop running until the process exits.
@Trowski both of those elements are still true
14:45
@DaveRandom Any process can connect to that socket, even one run by another user. If that process connects and willingly provides another security token, the original child process won't be able to connect, because the handshake already failed.
w.r.t the existing impl, I don't actually really change it, I just moved stuff around
the first serious look at postgre data types makes me think I have no idea what database storage is actually about
@DaveRandom Awesome. Beyond that then anything else is just my personal preference and I'm open to suggestions or changes.
@FélixGagnon-Grenier a lot of that has to do with useful operations rather than just storage
@FélixGagnon-Grenier see. that's why learning about Postgre is important
14:48
@kelunik OK I will just remove that line. Personally I would prefer an indication that something suspicious is going on, but it doesn't actually make it any more secure to do that I suppose.
welcome in the world sunlight, @FélixGagnon-Grenier
@DaveRandom Then issue a warning if you want, but do not fail the handshake.
:)
circles, money, json. how refreshing
@kelunik oh as in an E_USER_WARNING? I didn't think of that, will do that
@DaveRandom yup
14:50
@tereško gratie
OK I will do that and address the other issues shortly
@FélixGagnon-Grenier and you can create your own types
like, I could have an unsigned smallint?
btw @kelunik why not use strict_types?
... I'll stick with integer for now tho
14:54
@DaveRandom There's no benefit in adding explicit (string) casts to every string function.
@tereško Any chance of that Dong build soon? :P
@FélixGagnon-Grenier no, like you could have make type BORK, which is a type, that contains only unsigned ints, that are divisible by 3
@Fabor I will try to do it this evenin
... I installed Darkest Dungeon, which stole some of my free time
@DaveRandom Rather tell me the advantage of strict_types. It just makes things inconsistent, because internal function calls always use weak mode.
Lazy shortcut: who should get my SO moderator vote..
@DamienOvereem jeeves
15:01
Do you want my vote @Jeeves?
@DamienOvereem Is that how you always vote for things?
@DamienOvereem With jelly, please!
Vote with jelly coming up
Anonymous
@Jeeves american jelly or english?
@JayIsTooCommon Can you talk.
15:01
@Jeeves Jay the person or Jay the type of bird?
@Leigh I thought it was an animal. You are a liar.
@tereško Cool thanks :). If one of those bugged prices is a component we want just add it and I will confirm price, but provide alternate just in case.
@kelunik clarity of intent. It forces you to be explicit about what you meant to do. It stops you from lazily avoiding checking for failures when you should be, and forces you to write code that is obvious that you intentionally did not check for failure.
@kelunik Depends on the amount of choices. If its 2 options, I flip a coin. Otherwise I use an X sided die. When I dont have the correct dice laying around I ask room11.
@DamienOvereem I don't know any of the candidates
15:03
But tbh.. I don't know any of these people so either I dont vote at all or I vote for someone that seems to have some fanboys here
Same :) Where is Gordon when you need him!
He couldn't handle being a mod. He is weak like that
Anonymous
he smells fairly bad as well
I also hear he eats babies
who are we talking about?
>>> rand(0,12);
=> 1

Number 1 it is..
Anonymous
@DaveRandom the weird one
Anonymous
15:06
monkey-shit coffee man
Oh @Jimbo, right
yeh, he definitely eats babies
And that concludes my work day. Ta ta all
@Jeeves who are you voting for?
@DaveRandom The elections are over.
useless
15:07
@DaveRandom I genuinely don't have the time, but if I did they wouldn't accept me after going through my previous history as they like to pick up on every comment ever made
we're all fucked then
oooooh I said "fuck". I'm definitely out.
The Vietnamese love their karaoke. I just don't understand why they're so bad at it :P
user6845426
15:10
@Danack I'll let you know how that one goes down..
user6845426
I think we've chosen Laravel
@DamienOvereem Most of the candidates are from SOCVR. Looks like Andy and Cody Grey will win
@kelunik connection timeout of 1 sec sound OK to you?
If it doesn't happen after a second it's going to
@DaveRandom Yes, I guess that's fine. We can increase it if we see Travis failures or other reports.
at least not in any useful way, a system that busy doesn't need more processes...
@kelunik well travis won't care, it's windows-only code
15:12
@DaveRandom s/Travis/AppVeyor/
/pretends he knows what that is oh right yes sure
@Trowski Why did we send the exit code on another pipe again?
@kelunik something to do with --enable-sigchld but it makes sense in other ways too, when I thought about it mor
Ah, right.
It gives you a stream that you can watch for the process ending, just watching the stdio pipes isn't really good enough because the process can close them before it ends
15:15
How do you do that on Win? Just watch a pipe, too?
Yeh, I borrowed the other direction of the stdin socket
@kelunik Yep, what @DaveRandom said.
since the socket is bidi and the child won't ever write to it, may as well use it for communication with the wrapper
I was also pondering whether it might be an idea to implement kill() by instructing the wrapper to do it rather than just killing the wrapper
not sure about that though
Also it would, in theory, be possible to make signal() do something useful on windows
windows does support exactly one signal that you can dispatch to a process, basically emulate pressing ctrl+break in cmd.exe
@JayIsTooCommon if you need it you have my sympathies
15:23
also @kelunik - and this isn't really implemented in the current PR because I couldn't work out the best way to do it - the process wrapper exits with -1 when an internal error occurs and writes error messages to it's stderr, that error message could be translated into an exception, but the Process would still have the correct exit code if the error occurred after the child has ended, but during the wrapper shutdown
I ignored it for now though because it's an edge case that doesn't really matter
@DaveRandom Are exit codes on Windows signed?
well they are DWORDs, the UI typically treats them as signed, documentation typically expresses them in hex
Warning: session_start(): Cannot send session cache limiter - headers already sent
!!canon errors
423
Q: How to get useful error messages in PHP?

CandidasaI find programming in PHP quite frustrating. Quite often I will try and run the script and just get a blank screen back. No error message, just empty screen. The cause might have been a simple syntax error (wrong bracket, missing semicolon), or a failed function call, or something else entirely. ...

15:26
<?php
session_start();
include("conn.inc");
include("functions.inc.php");
//Smarty Settings :Start
require('./include/smarty/libs/Smarty.class.php');  // put full path to Smarty.class.php
$smarty = new Smarty();

$smarty->setTemplateDir('./templates');
$smarty->setCompileDir ('./include/smarty/omTemplates_c');
$smarty->setCacheDir   ('./include/smarty/omCache');
$smarty->setConfigDir  ('./include/smarty/omConfigs');
//Smarty Settings :End
$s_activId = isset($_SESSION['s_activId']);
date_default_timezone_set("Asia/Kolkata");
oh that's not the one I thought it was
840
Q: How to fix "Headers already sent" error in PHP

Moses89When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain header() and setcookie() calls. What could...

Anonymous
@PaulCrovella aye.. not fun.
my code is like that i am facing that warning can any one help me???
!!canon headers
15:27
840
Q: How to fix "Headers already sent" error in PHP

Moses89When running my script, I am getting several errors like this: Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23 The lines mentioned in the error messages contain header() and setcookie() calls. What could...

@DaveRandom ^
book recommendations on object-oriented programming?
184
A: Reference - What does this error mean in PHP?

GordonWarning: Cannot modify header information - headers already sent Happens when your script tries to send a HTTP header to the client but there already was output before, which resulted in headers to be already sent to the client. This is an E_WARNING and it will not stop the script. A typical e...

I thought it would be that ^
@DaveRandom We only link to actual questions I think
starting to read GoF's Design Patterns but I realized I need a better foundation in OOP before I even begin to start going with this
and I know OOP is ambiguous because PHP can't truly use OOP, but you know what I mean
Anonymous
15:29
@PrashantBhatt again...
Anonymous
Jul 11 at 15:32, by JayIsTooCommon
Jun 15 at 15:32, by JayIsTooCommon
@PrashantBhatt have you googled?
Anonymous
and you found nothing of help?
@Trowski Do you use Process::__clone anywhere?
@PrashantBhatt check for whitespace before the opening <?php tag. Make sure your source files don't contain byte-order markers. Make sure the opening tag is the very first thing in the file. Make sure that file is not being included in the middle of an HTML page.
15:30
m seen that answer
@DaveRandom i dont have any white space
Anonymous
@PrashantBhatt read through the answer you've been sent
@kelunik @Trowski ftr I generally do not like clone, I don't think it's a thing that should be encouraged, at least with BOs like Process.
@PrashantBhatt find out where they were sent with php.net/headers_sent
@JayIsTooCommon me find two solution but does not work
Anonymous
@PrashantBhatt Have you read through the answer you were just sent? - stackoverflow.com/questions/8028957/…
15:31
@PaulCrovella TIL
@JayIsTooCommon one is white space and another is use ob_start
@Trowski @bwoebi 2nd/3rd opinions on github.com/amphp/process/pull/13#discussion_r129086827 please
@kelunik No. I defined it just so if it was used things worked as expected. Could throw as well.
@Trowski IMO it should throw, yes.
15:34
Ok, do that then.
@PrashantBhatt the top answer alone has a lot more info than that
@PaulCrovella i am include that file every where in my project but i am facing that warring in one page only...
@kelunik by "the path" do you mean the path to the wrapper exe?
@DaveRandom Yes, but same for the working directory.
github.com/amphp/process/pull/13/commits/… < It should do that for an invalid security token, too.
@PrashantBhatt did you even read through stackoverflow.com/a/8028987/2524730 in its entirety?
15:38
Or rather, any error condition originating from the client sending the wrong data.
Uninformed question. Will the exe be a separate download for windows users. Or will it just work out of the box without any changes after a composer update @DaveRandom and ampeople?
The wrapper exe will be fine, just wrapping it in double quotes unless it contains a double quote (it can't, it's a path, windows won't let you do that) or it ends with a backslash (it can't do that either because it's a file)
@PeeHaa Work out of the box.
k cool
Will sanity check the working dir though, you're probably right about that
15:39
@Tiffany thanks
Can anyone recommend a book on object-oriented design/programming?
Something I can read so I have a better foundation before I read Design Patterns
Oh no the working dir is fine as well @kelunik, it's wrapped in double quotes, it would only be a problem if it ended with a \ which is why I am rtrim()ing it
@Tiffany what part of Design Patterns are you struggling with?
@Trowski What's the problem in amphp/parallel if we go with a static ctor?
@Tiffany Regardless of actual OOP I would first read all of these php.net/manual/en/language.oop5.php
15:41
@kelunik ftr you can always just inject the promise instead of injecting the Process object, it's semantically identical...
@DaveRandom What if it contains quotes? It shouldn't be user input, but who knows.
@PaulCrovella it's not so much a part, but terms that are used that I have no experience to reflect on what they mean. e.g. "represent states with objects" I'm not sure what a state for an object is.
@DaveRandom I'd like to not break BC for amphp/parallel if possible.
@kelunik thinking about it I should just escapeshellarg()
@kelunik Mostly a problem of having to refactor Workers. They are given an execution context that they start/stop.
15:44
@PeeHaa I suppose I'll give this a try. Would rather have a book as it's easier on my eyes, but if there's nothing else, I'll do this.
@Trowski But the API could stay the same, you just call Process::start there instead of creating the process before?
@kelunik Worker::start() would have to be eliminated.
@Tiffany you'll learn more if you continue - that's just the intro giving you an idea of what's to come
A lot of things need to change just to accommodate start() being async now.
@PaulCrovella alright
15:45
@Trowski Ah, start is completely sync currently?
@kelunik That's going to trickle down to all the contexts and pools.
@kelunik Yes.
@PeeHaa why is that url oop5.. replacing it with oop4 or oop7 takes me nowhere
:P
Why is it called oop you mean :D
if it was all upper case at least I could pretend the 5 was an S
hehe
15:50
@folks has there been any need/talk about having a way to register a handler to any method, instead of defining for every method? the use-case is registering a top level handler for anything api related, I would have a single ['ANY', '/api[/{stuff:.+}], 'Capture\Class::handler'] instead of registering for each method used with the api
@Trowski sorry :-(
@FélixGagnon-Grenier i remember discussing it with nikita... the conversation is some where in this chat
I can't help feeling that it would be better to just change those stream return values...
s/better/simpler from a BC PoV/
or maybe passing an array of methods as first argument
Anonymous
@FélixGagnon-Grenier that would be better, imo
@kelunik @Trowski @bwoebi I'm going to make a patch that uses the Third Way™ then it can be discussed properly
@PaulCrovella woot \o/ ta
@FélixGagnon-Grenier Why are you moving those decisions to a global handler instead of smaller specific ones?
23 hours ago, by Félix Gagnon-Grenier
is it cleaner to add two top level routes to FastRoute, so that each of those is redirected to a module, which in turn loads a subset of routes in another dispatcher that then executes the handler or ask each modules for its set or routes and load everything at once?
I'm at the "two top level routes" step
yo dawg, I heard you like routers
15:56
ah
@FélixGagnon-Grenier strpos($SERVER['REQUEST_URI'], '/api') !== 0
@PeeHaa are you of the mind that registering all teh things would be better?
It depends how many root level you have I guess
@PeeHaa riiite. yeah, I guess I could in effect bypass the router altogether before starting the match
That's more what I am wondering
But is always it depends on what you are doing :)
:)
if I went that way, I'd just handle that at nginx conf level, tbh
I somewhat find this cleaner than a bunch of ifs before matching routes
why are there like, tens of ways to do stuff...
16:00
Whatever works for you is what you should do
@FélixGagnon-Grenier I'd go with latter
you can have a modular API but still not actually go through hoops just for the sake of it
@FlorianMargaine how would you manage the "module interfacing"? When I try and go that way, I always get to the point where I manually type the routes paths.
long term goal would be to register modules without changing code
... I guess the problem stays anyway tho, but I mildly feel like having one route and handler to register, by module, would be more easily manageable
@DaveRandom Third way?
Probably quicker to write than explain
damn
I finally did it
16:13
Congratulations on doing it :)
Thanks
@NikiC Fixed the generator segfaults on 7.0 or what? :P
murdered Stas?
No, I got hit by the foreach by reference followed by foreach by value issue
People always complain about it, but this is the first time in I don't know how many years of writing PHP that I got hit by it
Sorry to disappoint :P
16:15
Hi everyone
le-sigh is the name of the achievement
@NikiC Congrats. Can't remember if I ever hit it because I hate references ^_^
I mean, I had to get that hate somewhere but I don't recall specific instances.
@dipper So, time to update your CV then.
@NikiC you should do that too ^
evenin lords
16:18
and lordettes
someone watched GoT
Yeah
There's a room for the GoT guys
Anonymous
Still haven't seen a single episode.
I think I saw the first season

A Game of Threads

Warning: Game of Thrones S7 SPOILERS
16:20
@FélixGagnon-Grenier and this is why I don't use dispatching routers
@tereško could you elaborate?
Anonymous
> I am suspicious of all the things that the average people believes.
― H.L. Mencken
@samayo you flat earther
Anonymous
square flat earther
Anonymous
It's flat and square, and no ... am not trolling
16:24
@FélixGagnon-Grenier the routers, that are also responsible for executing the routed resource. Instead of just initializing Request instance.
user4962466
hey guys
user4962466
i am lost trying to understand an issue
Anonymous
@0x13a ... and the issue is?
user4962466
i ve got a sessions table which randomly gets duplicated entries
I'm learning PHP one or two months now and planing to make a false website just to train myself on basics. I looked at a tutorail on the web to make a member space and for the moment I made the sign part like in tutorial. So far so good.
But for the password to add a more security I decided to generate a random string concatenated with the password chooses by the user and hash the total.
Now in my BD I'd like to record only the random string generated (I called it $salt) and the hash called $mdp. But when I added that using the same syntax I thought I understood well it printed me the error
16:27
@tereško like in the first snippet here? I have always wondered what all this was
user4962466
user_id, created_at, updated_at
user4962466
in the php logic i have search by user id and date_diff(created_at, now()) = 0
incoming laravel question
user4962466
if present update
user4962466
if not create
user4962466
16:29
the only reason i can think of is the slave is too slow to update with the master
@FélixGagnon-Grenier that first snippet is a bootstrap example
@0x13a since it looks like some type of race condition, that explanation is as good as any other
can't you switch to some document-storage system instead?
master-slave setup in SQL is not conducive to being used as session backend
Anonymous
@Hexacoordinate-C what's the error
@samayo oops sorry i forget to add it "number of bound variables does not match number of tokens"
@Hexacoordinate-C you should use the new Password API: php.net/manual/en/book.password.php
Anonymous
@tereško s/master-slave/follower-leader
16:33
'new'
> This extension is available since PHP 5.5.0
well, some people are still learning the mysql_* extension...
@samayo talk to me after you have got your "Leader's Degree" ... right after your "Unmarried's Degree"
... then again, "unmarried" would probably found to be problematic, by the perpetually-offended crowd, since it presumes that "married" is the default
@tereško well I have not problem with hash
@Hexacoordinate-C you have. You just don't know it yet
user4962466
@tereško thanks
user4962466
16:36
i just needed a table for mysql
user4962466
to store sessions
user4962466
moving to another storage system means resources and time
@0x13a you should have used memcache, or some other distributed nosql thing
or you could go stateless
@tereško well for the moment my question is about my SQL request ^^
your SQL request is wrong
16:38
That is about what I am asking
also, you approach to naming in SQL could use some additional work
@Hexacoordinate-C you are binding 4 values, while only having 3 placeholders
have you not enabled exceptions for error reporting?
I don't understand your question
Well if I use (?, ?, ?, ?) instead of (?, ?, $salt, ?) I have another error "General error: 1366 Incorrect string value" what I don't understand is if I use do (?, ?, ?) in first line and ($pseudo, $mail, $mdp) in second line everything goes well. What I just want to do is to record my salt.
@DaveRandom :P
16:48
@tereško you are asking me what I use to get message error ?
it means, that you have not set up your PDO instance correctly
read the tutorial, that I liked you to
I'm reading but is there something I should read more than another part ?
For connexion and error handling I did it pretty well on my code.

« first day (2474 days earlier)      last day (2699 days later) »