« first day (2386 days earlier)      last day (2562 days later) » 

12:11 PM
You want to implement both v1 and v2?
 
@RonniSkansing yes, for people using older version of the app until it goes discontinued
 
74265 still not fixed -- isfinite failure remains – #74507
 
@Prix I dont have any examples or such.. but I think you would just need to integrate them both
as separate things
 
@RonniSkansing well I am doing it as namespace so for example I have use Models\AccountModel; then I call something like new AccountModel(...), I could use a if switch based on the selected api version but it would look like AccountModelV2 for example, and I would have to have a second name space for that structure, so I was looking for a better option maybe of achieving this or look at some other examples to see what people usually do for ideas...
 
how about separating it in the namespace also so v1\Models\AccountModel and etc?
 
12:23 PM
Man... PHPStorm 2017.2 is out and people are angry about that parsing change
5
 
ah @Machavity but the changes were good
 
@RonniSkansing I'll let you wade into that morass of vitriol
 
@Machavity damn you made me click that fake link
 
@RonniSkansing that looks more appealing indeed
 
@RonniSkansing not that, its just that his link have 1 letter off
and I didnt pay attention to it and was like wtf am I seeing this random page
 
@Prix maybe it can help to encapsulate the logic api integration
and easier to deprecate
 
@Prix Don't worry, this should make everything clear for you.
 
@DaveRandom eeh do I really have to click it?
 
@Wes yup, you may find some there, but that table only has the ones explicitly set there
also moins
 
12:30 PM
@Prix You don't have to do anything. But now it's just sitting there staring at you so you will. Maybe not right now but it will eat you and eventually you'll have to or you will go insane.
2
 
@RonniSkansing indeed but it would still be a bit awful doing like if (configv2) { instantiate this model } else { this one }
 
@Prix wouldn't you have different endpoints though?
 
@DaveRandom and PHP stands for psychological human process...
 
@Prix so in front will be one api?
which serves v1 and v2 api operations depending on the client?
 
@DaveRandom yes they are the endpoints are like api/v1/... and the new one is api/v2/...
but there is a lot of changes in the models from v1 to v2 as well
 
12:33 PM
So then why would you have different models in the same logic? Surely the routing layer would deal with that
 
so the models aren't exchangeable
 
the v2 api controllers would only interact with the v2/../ model layer
 
Also god damn it you made me use the word "model" as if that's a single thing :-(
 
@RonniSkansing basically the config the user would set the version he wants and that would be the trigger to define the endpoint is what i had in mind
 
12:35 PM
Quick, someone trick him into saying "view" and "controller" and his journey to Laravel will be complete
 
remember BB-8 from Star Wars? this is him now. feel old yet? https://t.co/avYppaS1o3
 
So something like Controller::action would implement calls to v1 or v2 depending on the clients config?
 
@DaveRandom mmm what you mean? to have both models as one and work based on the endpoint? that would be confusing for methods that doesn't exist in one but exist on the other or are simple different no?
 
@Machavity There are plenty of pictures floating around if you want to view my controller
 
is that your wife? =p
 
12:36 PM
oh snap
 
:36854072 yep pretty much, right now it looks like something like this:

    public function getAccountModel()
    {
        if (!isset($this->models['account'])) {
            $this->models['account'] = new AccountModel($this->container['client']);
        }

        return $this->models['account'];
    }
 
@Prix well personally I'm a fan of treating different versions of an API as completely separate applications
like, I'd put then on different domains
 
rrrr this fixed font always trolls me
if I move the spacing of the first paragraph it breaks the formatting lol
 
Yeh you have to do stuff like that as two separate messages
 
but will getAccountModel implement both v1 and v2?
 
12:38 PM
@DaveRandom yeah I was considering that as well but also wanted to see my options with the current designed for learning purposes
 
@Prix My learning has taught me that this is the best approach :-P
 
@RonniSkansing based on the config the user selected it would either load v1 or v2 one way or another the model classes would need different naming to be distinguished between each other or a way to be able to load the namespaces based on the selection which I am not sure is possible?
@DaveRandom and mine is telling me not following yours might proven itself harder than it needs to be lol
 
:)
 
@Prix you have two ways to do it: one is to add 'v2' somewhere in the API request . The second way is to use Content-Type header .. like application/json;version=2
 
12:44 PM
Radical as this is, I am going to put some clothes on and maybe even eat something. bbiab
 
as a side note, @Prix: usually there are no plural "models" in an application
unless you are trying to integrate two independent business domains
"Account" is not a model
 
@tereško oh no I don't have access to the the API it self, I am only writing the library to interact with it...
 
that changes nothing
 
@DaveRandom good stuff here, glad to see most of what I am doing with the current API fits the good sides written there
 
@DaveRandom I think he has a typo there. It says "OAuth 2 is the shit.", but it should be written without "the"
 
12:48 PM
@tereško that was just an example I don't have an Account model... -_-
 
it was a really bad example
 
well excuse me for not thinking of a perfect example to provide I just wanted to illustrate the situation and that was the first thing that came to mind
@DaveRandom but honestly in the end even work-wise having it separated would be much easier to write as well...
 
well, what "cam to your mind" was referring to a service locator (or maybe - registry) as a DI container and referring to a class instance as "model" ... ad wrap it all in a class, which one would probably ed up calling "Application" or "Context" or some there names that are popular for god-objects.
:P
and I am not even mad (probably because I ate just few minutes ago)
 
@Prix very much so. It's much easier to version control in terms of backporting if you have the different versions as different branches in VCS
It could be that you would separate the routing logic into a separate repo for the front controller, but maybe not, depends exactly what it needs to do, if it's at all possible so get the web server to do it for you you should
 
indeed the controller would fit on both without changes
 
12:54 PM
@tereško I don't have much experience with really, because every time I pick it up I go "nope" 10 minutes into trying to understand it. So probably true.
 
@DaveRandom my biggest gripe with it is that people insist on using it as authentication system, when it clearly is made for authorization
 
@tereško OK so then not necessarily inherently shit, just frequently misused
Wouldn't be the first tool invented that was used for more than it's supposed to be...
Although also I don't really know enough about it to properly understand what it is for, and if anything I'd have thought that would be the other way around
 
Oauth2 is best used for authorizing third party users to run things on your behalf. Like you have an app that accesses Facebook data (hence why they live and die by it)
But yeah, Oauth2 is the regex of logins
 
1:12 PM
@Trowski @bwoebi youtrack.jetbrains.com/issue/WI-36195 < You might have PHPStorm already seen complaining.
 
Wes
@kelunik i submitted that too
 
@DaveRandom You can use it for both. /cc @tereško
@Wes Couldn't find it.
 
just because you can do something, it doesn't mean that you should
 
@tereško Why shouldn't you?
 
Wes
@kelunik me neither actually :B
maybe i thought i submitted it but i forgot :B
 
1:17 PM
@Wes youtrack.jetbrains.com/issue/WI-36193 might also be a duplicate, but couldn't find the exact issue.
 
@tereško what do you mean it's used for authentication?
 
@kelunik because it is trivial to circumvent it
 
@tereško How?
 
the getting authorization token
 
Could you elaborate?
 
1:21 PM
when you "authenticate" with the OAuth token, you have not actually authenticated the user
you have only proven, that you have an access to the user's information
if you steal that proof, you magically get "authenticated" using OAuth
anyway, I am at work ATM
you probably should google about the subject, @kelunik
 
That's authorization, yes. Authentication with OAuth works by doing getting the identity of the current user on an external site.
 
no
it is done by proving that you are authorized to access user's identity
anyway, google, please
I need to earn moneys
 
@tereško I won't. I think you're talking about a different thing I'm talking about.
I'm talking about social logins that work mostly with OAuth.
 
you wont google, because you think that I am wrong
brilliant
bye
 
hi
 
1:25 PM
@tereško I think that we're talking about different things.
 
hello everyone
 
You're talking about OAuth provider <-> third party service I think and I'm talking about a user authenticating at that third party service.
 
Wes
1:46 PM
hello andho \o
 
hey @Wes
How's it going?
 
Wes
wondering if i would be happier if i were a farmer rather being a programmer :B so... not so good... as usual :D you?
 
Anonymous
.. i'd quote again but i've done it enough
 
Wes
do it
 
Anonymous
2 days ago, by JayIsTooCommon
Mar 13 at 9:27, by JayIsTooCommon
@PaulCrovella I think i'd actually prefer goat farming..
 
1:56 PM
I'd never thought of farming. Maybe carpentry. I've just resigned from my job recently so not so worried about work stuff now
still serving last few weeks though.
 
Wes
maybe alpacas too
 
I worry about the company I'm leaving though.
 
@Wes I'm happy you said programmer and not designer :P
 
Wes
these guys are so funny. they spit to people they don't like
 
so alpacas are llamas right?
 
Wes
1:58 PM
llamas are way bigger iirc
but similar
 
ah
 
in SO Close Vote Reviewers, Nov 2 '16 at 13:15, by Machavity
@Magisch Yo Dawg, I heard you like VBA so I put VBA in C so you could rethink your life as a farmer
 
@kelunik when using acme-client is it still necessary to respond to <Domain>/.well-known/acme-challenge/ http requests ?
 
@staabm Yup.
 
@Machavity the message that was replying to is special enough to be quoted as well
in SO Close Vote Reviewers, Nov 2 '16 at 13:04, by Magisch
@Tunaki One of the programmer guys at my workplace knows only VBA really. He had to write C once so he did stuff like #define If ;if ( to make it so he could code in C but have the code look like VBA
 
2:13 PM
Dear lord
How are these people even employed?
 
@MadaraUchiha those are the people, who are not only employed, but also have the seniority
 
Dev keeps committing "cron" as "chron" for some reason it's really irking me lol
Damnit @Machavity lol
 
2:31 PM
@kelunik Yeah, I noticed that too, initially thought I accidentally deleted some code handling React promises.
 
@Trowski I made some changes locally to byte-stream. That's what I have now:
interface InputStream {
    /**
     * Reads from the stream.
     *
     * @return Promise Resolves with a string when new data is available or `null` if the stream has closed.
     */
    public function read(): Promise;
}
interface OutputStream {
    /**
     * Writes data to the stream.
     *
     * @param string $data
     *
     * @return Promise Succeeds once the data has been successfully written to the stream.
     */
    public function write(string $data): Promise;

    /**
     * Closes the stream.
     *
     * @return Promise Succeeds once all remaining data has been successfully written to the stream.
     */
    public function close(): Promise;
}
 
Ooo that's nice
 
I also added BufferedInputStream and BufferedOutputStream. I think we might need flush on OutputStream.
 
@kelunik Aerys uses end() on WritableStream a lot, so maybe end() instead with an optional chunk instead on OutputStream?
 
@Trowski I removed that, because it mixes responsibility.
 
2:36 PM
There's a fine line between UX and SRP…
 
@Trowski I think the Aerys API should change anyway.
It should accept a InputStream or string.
 
@kelunik As it is, it's a WritableStream. I don't see a reason to change there.
Other than possibly switching it to your proposed OutputStream.
 
@Trowski I renamed it to OutputStream, because BufferedReadableStream doesn't sound that good.
 
hi guys, i have a question and need a little info about it. I have a Magento ecommerce web application built year ago, now the requirement for the client is, he want to build Native Android app for the same. Is It possible to generate Rest API's from the built website??
 
@Sean :D
 
2:41 PM
Not sure whether I trust 11 too much or I just forget the day
 
@Trowski So it's only composable with pipe(File\stream("filename.png"), $response)?
Maybe we should make write just accept InputStreams?
Regarding closing of InputStream / ReadableStream: I guess we should just use the CancellationToken mechanism to cancel the operation producing the stream instead of the stream itself. @bwoebi @Trowski
And I think Socket shouldn't implement ReadableStream and WritableStream, but provide methods to access these, just like Process has getStdin, getStdout and getStderr.
 
3:06 PM
@kelunik Yes, but that's the approach we've taken in a lot of areas, i.e.: Iterator\map().
 
@Trowski Things I usually just don't use.
 
@kelunik Socket is sort of the de-facto stream… if it doesn't implement the interfaces then I fail to see the point.
 
@Trowski How do we call the methods for closing then?
 
@kelunik I have to drive for a few hours today… let me think about how this could be handled.
@kelunik What's wrong with close()?
 
@Trowski It doesn't allow half-closed sockets.
 
3:09 PM
@kelunik end() could close the write side, close() could close the read side.
 
That's not intuitive.
I expect close to close both then.
 
That might be better, end() closes the write side while close() closes them both.
Right now actually end() waits until the last bytes are written, then calls close().
I've never found half-closed sockets to be useful, what's the purpose?
 
@Trowski We use them in Aerys for example I think.
HTTP/1.0 clients can close for writability to signal the end of a streamed request body.
 
@kelunik That makes sense. So maybe end() for write, close() for both would be useful.
Unless there's some purpose to closing only read… but just don't read it.
I think that's what Node does… will have to check.
 
3:41 PM
evenin
 
3:55 PM
@FélixGagnon-Grenier someone reverted your edits to my question title =)
 
4:19 PM
array_shift($foo) throws "null given" instead of "Undefined variable" – #74509
 
@Jeeves yo
 
Wes
not a bug ^
 
@Linus Hi.
 
!!dad
 
I wouldn't buy anything with velcro It's a total rip-off
 
Wes
4:23 PM
it's like that for all functions taking references, right?
 
@Wes yep
 
@Dereleased oh well....
 
@NikiC yeah, it's awkward. I should maybe just go for class, like ZPP does. re: classname, I like class more as it's shorter and already a reserved word, and PHP considers names of classes and the classes themselves interchangeable in several places. also, ::class
 
4:38 PM
Not a programming question, but there's a bunch of smart people here.

I saw something this morning that was really weird. There was a car with LED headlights behind me and when I looked in my rearview mirror the lights seemed to be bobbing up and down significantly relative to everything else I could see in the mirror.

But when I turned around and looked with my eyes through the back window, I didn't see anything. Nor in my side mirrors.
I know LED headlights have a low PWM cycle which might make it look like it's flickering...but movement? And why only in the rearview? I don't understand.
 
win32/sendmail.c anchors CC header but not BCC – #74510
 
Anonymous
@Allenph you might eventually get an answer here but physics.stackexchange.com might be quicker
 
@Andrea yeah, got a point there
 
@Allenph I've noticed a similar thing with LED signs on buses. I think it might be because not all the lights are lit at once (it scans), so the movement of you/your eyes/your environment is more obvious than for most things you look at.
 
5:04 PM
@Allenph aliens
 
@samayo ping
 
5:22 PM
 
wat. I am confused as to who is the target of these
 
sysadmins of course
 
5:40 PM
evenmin
 
yo
 
o/
so... I started using loopback.io
it kinda just works™
 
Hi boiz
Has anyone ever used Pascal here?
 
I have
long long time ago
 
Well, I'm using FreePascal
 
5:52 PM
... I can still remember
 
And the output is messed up. At first I thought its my program, but I realized, every other program is bugged on Pascal
On my PC
Tried diff versions, didnt work. :(
 
you will have to define "bugged"
the compiler in Pascal usually tells you what your errors are
 
There is no error in the program.
The compiler is broken I think lol
Look at the cursor, it should jump to the next line.
 
Cannot construct a \DateTime from a valid format ("Y-\WW") – #74511
 
But it freezes there
Until I press enter for the next output.
(I haven't even placed a readln for me to press enter at all)
Most interesting part is, output is different in two different versions.
 
5:56 PM
what happens if yo compile it on linux?
also, what is your code
 
Sending code. I don't have linux.
 
put some output right after readln(camelCase);
 
Works perfectly fine
On that compiler
Alright
Ahh, worked this time.
But shouldn't it skip to the next line with 'readln'
 

« first day (2386 days earlier)      last day (2562 days later) »