« first day (2196 days earlier)      last day (2752 days later) » 

9:02 AM
@Wes Did you mean ... fuckdown? <small>powered by Stack Overflow</small>
 
:P
 
Wes
:P
 
@PeeHaa I call bullshit
 
@Patrick why do you want to prevent that? if someone wants to break your code they will. aint your problem
 
@DaveRandom "trying"
 
9:04 AM
@Gordon well let's turn it around then. I want to be able to signal when a class is made to be extended.
If I make everything final then all non-final classes are extendable
 
@Patrick abstract
 
@PeeHaa non-abstract classes can also be extendable
 
I know what he means, like what the virtual keyword does for methods in C#
 
Sure they can
And that's fine
 
I got this idea from effective java and it made a lot of sense
at least to me...
 
9:05 AM
> java [...] made a lot of sense
 
@Patrick if anything in it is protected or public, it's enough signal
 
Don't believe you
 
@Gordon well for the same reason that I don't like ducktyping. I try to code defensively and want to make breaking my code as hard as possible
same argument could be used against type hinting, why bother? Someone can break your code anyways if they want
 
That's a silly comparison
 
I don't see a disadvantage by final-by-default except that mocking becomes hard
 
9:08 AM
I think the effort to use final properly doesnt outweigh the utility
 
If you pass another type it always break. If you extend it doesn;t always break
 
effort as in writing another keyword or something else?
 
effort in deciding when to use it
 
brb attempt v2
I blame @DaveRandom
 
I accept the blame
 
9:09 AM
no effort involved, use it by default and only get rid of it when designing something for extension (which should be rare and a conscious effort)
 
to me final is kinda like making things singletons because conceptually the thing will not be instantiated more than once. that might be true, but it doesnt need to be enforced.
 
if classes were final by default, would you argue that we should always use the extendable keyword?
 
For non-primitive public API classes, I probably would
 
@Ocramius thoughts?
 
I dont use inheritance often enough to bother about final
and imo, wanting to make things final stems from overuse of inheritance
 
9:14 AM
The thing is, every tool has uses that it's original designer did not imagine. I don't see the point in deliberately preventing people from doing something I didn't imagine with some code I wrote. Sure, people can write horrible code with that, but the world runs on horrible code, and I don't have to maintain that horrible code.
 
hello @PeeHaa are you there
 
Yeah definitely. But on a team, with juniors, others might do things they shouldn't. Code reviews should catch that, but why not code defensively in the first place?
 
@lewis4u he is DND
 
[Click here and fix this chat](mailto:jobs@stackoverflow.com?subject=Application&body=Hi!%0d%0a%0d%0aI+ca‌​n+fix+your+markdown.+Even+for+multiline+messages+in+chat!%0d%0a%0d%0aKind+Regards‌​).
 
lol
 
9:15 AM
@Patrick because it implies you are not trusting your juniors. educate them instead.
 
I guessed it doesn't support mailto: links. :-/
 
ok @DaveRandom can you just confirm something for me
i'm in doubt
and wan't to clear something out
 
@kelunik well you got the link/text the wrong way round, but I doubt it would anyway
@lewis4u Yes, I can confirm that it's my fault. What did I do this time?
 
In relational DB a OneToMany relationship is automatically OneToOne relationship when looking from other side
 
@DaveRandom Indeed.
 
9:17 AM
true or false
actually belongsTo
 
@lewis4u You mean that from the PoV of the many, they are only related to one thing?
 
@lewis4u No, it's ManyToOne when looking form the other side. :P
 
damn now i know what is wrong....a one to one relationship is not the same as belongs to??? OR???
 
@Gordon I do understand the "why bother" approach if you have a functioning team. But I still feel like using final would be more correct in theory at least. Even if it's just to clearly signal if something is made to be extended or not.
 
!!canon xy
 
9:18 AM
957
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

 
@lewis4u ^ I suspect this. What are you trying to do?
 
yes Dave exactly
 
let me guess, laravel magic active record model not working correctly?
 
i have this question and i don't know if this diagram is ok
 
What diagram?
 
9:19 AM
here is the link
 
Cannot access facebook at work
nor do I want to...
 
wait
 
@Patrick and your team is not functioning? also, again: standard method visibility imo gives enough clues as to what parts may or may not be extended
 
0
Q: How should relationship diagram look like with these statements

lewis4uI have 3 tables USERS ORDERS OFFERS 1 User has many Orders 1 Order belongs to User 1 Order has many Offers 1 Offer belongs to Order 1 Offer belongs to User 1 User has many Offers If someone could help me to draw this diagram....i need help. I made it this far and i'm not sure if this is ...

 
@Patrick Usually you don't have a good reason to explicitly prevent extension.
If you always prevent it first, you have to change code just to allow it later. If it's a library, you even need a new release for that.
 
9:21 AM
@Gordon it is, but I'm writing a book on the side and this is something that I wanted to cover in there (but I might skip it now after this conversation)
 
this should be simple any yet it isn't @DaveRandom
 
@kelunik but if you don't prevent it, you have to support it in all future versions unless you want to break BC
 
@Patrick check out verraes.net He has a number of posts on making things final supporting your argument, for instance verraes.net/2014/05/final-classes-in-php I still think it's a pointless thing to have
 
@lewis4u It's fine. What you basically do is look at one user and ask: How many orders can one user have? → Many. Then you have a look at one order and ask: How many users can belong to one order? → One. In "Standardkardinalität" you just write it like you did.
 
mornin'
 
9:24 AM
@DaveRandom i just have this feeling like something is missing :D
because one order can have multiple offers
 
@Patrick What does "support" mean? It's usually enough to state that when overriding the method, children must call the parent except where otherwise noted.
 
that is what's driving me crazy
 
@lewis4u where does the user ID come from in the Offers table ?
 
from user table
users table
 
@Gordon pretty much my thoughts, but I completely get your point of view and tbh I have been removing final in my code whenever I needed to mock something
 
9:25 AM
in your doagram there is only linik between Offers and Orders
 
yes...something is missing
is this better:
 
I already told you what is missing
 
I think I'll cover it like that in the book. but suggest that it's not worth using even if it's more correct since it only makes life harder for little benefits, at least in php's current state
 
yes, it seems better
the rest of issue would be related purely to the style
 
9:28 AM
ok
thanx
 
@Patrick note that it's just my opinion. I am not saying I am right on this. I just dont see the benefit
 
@tereško this, the use of mixed language adds a lot of mental overhead @lewis4u
 
half translated
 
Also I'd question the name of the offers table, seems like that should maybe be applied_offers
sine in general an "offer" can be applied to more than one order
 
got a vs setup yet chris ?
 
9:34 AM
auf deutsch ist es anfragen und angebote
 
@lewis4u please change your column names to english (I'm a native german speaker)
 
OK right, but surely you have some other table that keeps track of the items that are currently "angebote"?
i.e. when you are building an order, how do you know whether there is an offer or not?
 
@lewis4u unfortunately the programming languages are in english .. and your code should be written in a single language
 
another user makes an offer for it and it's saved in offers table
 
@lewis4u requests and offers?
 
9:37 AM
i mix it....
 
don't
 
request/order what is more appropriate
 
quotation
 
@lewis4u an order is what happens after someone agrees to an offer
or quotation
request -> quotation -> order
 
Done some work \o/
 
9:39 AM
ok it is wrong to call it an order
 
!!should I beer now or do more work?
 
do you have some other word for quotation
@Patrick
 
That's case sensitive? Or am I @Jeevesing wrong?
 
You should beer now.
 
\o/
 
Anonymous
9:40 AM
It's like, still morning for you right? xD
 
@lewis4u offer seems fine too, but I'm not a native english speaker
request -> offer -> order
skip the order if that's not part of what you are building
 
@JayIsTooCommon It's past 12 in Ankara
 
anfrage -> angebot -> bestellung
 
#WorksForMe
 
Anonymous
lol
 
9:41 AM
es gibt nur anfrage und angebot.....
a user can accept one offer
and that's it
but he can recieve multiple
and then decide
 
@JoeWatkins are you there
 
Anonymous
@lewis4u Stop pinging random people
 
but why!?!?
 
9:47 AM
ok sorry
 
@DaveRandom I might just attempt to look into jeeves plugin repos this weekend. That should help a lot with deuglifying the codebase
@kelunik
 
Anonymous
@PeeHaa Are you prompting authors to create their own repos or just creating them under R11?
 
@JayIsTooCommon Either way should work
I am super annoyed by the current one file per plugin thing mostly
 
Anonymous
What would be separated out though?
 
9:53 AM
It end up with code wrapped in a single class which stinks
 
grrrr
 
As example the twitter plugin @JayIsTooCommon
That thing does parsing, formatting, (later) uploading, posting, making coffee, etc
 
@PeeHaa I'm that used to autoescaping that I first didn't notice and thought it's an old version of purifier that has a bug.
 
Anonymous
@PeeHaa Yeah, I guess acceptable for some small plugins though a separate settings/config file would be better than constants, no?
 
But it's one of those project where you keep finding other vulnerabilities while investigating a single one.
 
9:56 AM
@JayIsTooCommon What do you mean by constants?
@kelunik ugh rabbithole driven development
 
We should seriously consider just taking the PHP runtime without all the standard libraries and making a new PHP. With sane function names and APIs. With great async support. Ensures all that old stuff simply doesn't run.
 
Anonymous
@PeeHaa If we go into separate repos, stuff like this github.com/Room-11/Jeeves/blob/master/src/Plugins/… would be better suited in a separate config file?
 
But nobody got time for that. And nobody got time to port the good libraries.
 
Anonymous
Bad example.. "default" but you get the gist :P
 
@PeeHaa The only problem I currently have is how to specify what plugins to load. Would be good to just composer require them somehow, but can't really modify the Jeeves composer.json at the point of deployment because then updates would become difficult. I can't get away from the thinking that having Jeeves and all the repo plugins required by a top-level package is the only way to get around that - that way updates can just be done with composer update on the live server.
We can then scan the vendor dir for things with a plugin manifest jeeves.manifest.json or whatever.
 
10:02 AM
Think I'm going to give this rabbitmq thing a shot
 
Don't really like it though
Still not looked to see if you can programatically composer require stuff in a way that doesn't modify the app composer.json, that's what we really need
I do like the idea of scanning the vendor dir though, because that would let you keep multiple plugins in one repo if you wanted to
 
@DaveRandom You can just use Composer's package-type for that and set it to jeeves-plugin or something like that and then scan composer.lock.
 
That sounds even better
 
There's also an extra that can be used.
 
still doesn't solve the problem of how to actually build a dependency set in the first place though
I don't really want a top level package but I can't come up with anything better
 
@JayIsTooCommon I think that would be a candidate for a config thingy file somewhere
 
Usage:
  install [options] [--] [<packages>]...

Arguments:
  packages                       Should not be provided, use composer require instead to add a given package to composer.json.
^ @DaveRandom That might work.
 
Anonymous
@PeeHaa As in a global one?
 
@JayIsTooCommon note that this is just the default value for a config option
 
@JayIsTooCommon package specific
 
Anonymous
10:08 AM
9 mins ago, by JayIsTooCommon
Bad example.. "default" but you get the gist :P
 
Once we have manifests we can build a system whereby you can specify config options supported by your plugin actually in the manifest
 
@JayIsTooCommon It's not a bad example :)
 
Also manifests will enable github.com/Room-11/Jeeves/issues/63 and we can do something with !!help
 
@DaveRandom You can just have one repository that only includes a composer.json that requires @Jeeves + the plugins to load.
You'd need one repository / folder with a composer.json per deployment.
 
@kelunik Well yes this is the only solution I can see but I don't like it somehow
We can build some kind of deployment tool to set that up for you though
 
10:11 AM
You can just build a custom Composer installer.
 
I am leaning towards ^
I should probably just write something sucky and let somebody get annoyed enough to fix it :P
 
Anonymous
@PeeHaa @DaveRandom Would it be easier to separate out plugins after/alongside a Web UI?
 
Well we could leverage that to install plugins, but we would still need to composer install it
The more I think about it the more confused I get
 
\o/
Done
 
Anonymous
10:18 AM
lol
 
:-P
 
Anonymous
I know web UI would be a lot of refactoring but could coincide with the plugin changes to save time
 
Well all this is a pre-requisite to the web UI, as far as I can see
Note that I already put the architecture for an embedded web server in place
In fact there is a little PoC web API in there already
 
💩
 
Anonymous
oh - I thought it would be a complete change
 
10:21 AM
brb going to do some work v3
 
@JayIsTooCommon Configure this and it lands in this
Obviously it needs re-architecting in terms of the actual implementation, but the basic framework is there already
 
Anonymous
ah nicee - what's your plan for the authentication side of things?
 
:)
That was hardish iirc
Didn't we kinda decide on openid somehow?
 
Stack API
 
Anonymous
And then what, detect if they're an RO for the rooms where the bot is running?
 
10:25 AM
Scrape their chat profile page to find out what rooms they are owners of ;-)
 
Can we make a dedicated thing for scraping SO?
And yes as said before: I love dedicated packages :P
I's have a problem
 
:P
 
@tereško PHP Templating and View in MVC is not the same. View is responsible for generating new output to the user based on changes in the model and getting user actions to controller. How it will be implemented doesn't matter. It can be a separate class or just a template. So the author of this answer is correct, if he posted just a part of whole class — Clickbeetle 27 mins ago
 
Wouldn't SO not take well to being scraped?
ToS wise :P
 
Anonymous
@PeeHaa 's - Keep the a in there because you're a foreigner
 
10:27 AM
:P
 
@PeeHaa I have the same problem. Let's start a self-help group. Although that sounds complex, so we'll need to break it up. You work on the self component, I'll do the help one.
4
 
What do you think about separating the plugins into an actual controller'ish part and the actual plugin logic? Right now, they are combined (which is certainly good enough for any pragmatic purposes), but it's somewhat mixing responsibilities, e.g. taking the request, preparing the response, returning the response. I think we could split that. basically, make all plugins mini-apps.
 
@DaveRandom hahahahah
 
Anonymous
lol
 
@Gordon I am more than happy to see suggestion / demo implementations of what it would look like
I am agree stuff should be separated out somehow
But I need to see / do it to find out what works
 
10:29 AM
@Gordon I was thinking about this. Actually, you can specify literally everything about what's currently the plugin interface in the manifest file.
Then you can architect it internally however you want
 
@DaveRandom Would be nice to at least have some consistency between plugins though :)
 
Another component of this is that we need some way to specify DI config in the manifest file
which equally should be doable
 
ugh damn you all. work work attempt v4
 
This is super complex though and I have a feeling it's one of those jobs where it will only start to become obvious what the right way is after we start working on it
 
:P
 
Anonymous
10:32 AM
ion - That mars lander has been lost
 
Also: I think it's important to remember here that performance is not something we need to worry about that much. It doesn't really matter if the bot takes 30 seconds from a cold start as long as everything is quick enough when it's running
 
Trying to explain why SomethingInterface extends BaseInterface { /* no extra methods */ } adds literally no value
 
Anonymous
@DaveRandom Out of interest, is there throttling in place for the amount of rooms he can be in?
 
user6619012
code : $stmt = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid");
$stmt->execute(array(":uid"=>$_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
 
user6619012
error :
 
user6619012
10:35 AM
`Fatal error: Call to undefined method PDOStatement::prepare()` in line
`$stmt->prepare('INSERT INTO tbl_users(user_image) VALUES(:user_image)');
 
@JayIsTooCommon at the end of the day, the orbiter is the really long-term important bit of that mission.
 
what is runQuery() ?! and why is your PDO instance called "user home" ?!
 
That's loser talk
 
user6619012
@tereško : $stmt->prepare('INSERT INTO tbl_users(user_image) VALUES(:user_image)');
 
@JayIsTooCommon elaborate?
 
10:36 AM
that answers nothing
 
!!docs pdo::prepare
 
[ PDO::prepare ] Prepares a statement for execution and returns a statement object
 
user6619012
@tereško pls check
 
user6619012
<?php
include 'home.php';

// session_start();
require_once 'class.user.php';
$user_home = new USER();

if(!$user_home->is_logged_in())
{
header("Location: index.php");
die();
}

$stmt = $user_home->runQuery("SELECT * FROM tbl_users WHERE userID=:uid");
$stmt->execute(array(":uid"=>$_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);

/* php codde */

if (isset($_POST['submit'])) {
// new data

$imgFile = $_FILES['user_image']['name'];
$tmp_dir = $_FILES['user_image']['tmp_name'];
 
Read the docs again @user5348fh8y5
 
10:37 AM
@user5348fh8y5 no
 
Anonymous
@DaveRandom i.e. someone invites Jeeves to 50 different rooms, would the server handle it or is there a limit in place to stop that?
 
Anonymous
@DaveRandom Yeah, shame after a 7 year journey though
 
user6619012
@PeeHaa @tereško please check here : stackoverflow.com/questions/40146564/…
 
no
@user5348fh8y5 please READ THE WARNING
 
user6619012
Thanks a lot @tereško @PeeHaa
 
10:43 AM
@JayIsTooCommon Shouldn't be a problem. We have no idea what the actual capacity is until we try it, but I'll say with confidence it should be able to handle a few hundred in one process
 
Anonymous
noice
 
lol, some dude just answered with the exact same variable names I used on mine
 
@PeeHaa I don't know Jeeves' architecture. I've never looked outside a Plugin. How does Jeeves decide which method in the Plugin to call?
 
@PeeHaa yes, but what uses these Endpoint things
 
10:53 AM
Basically we have a collection/manager which loops through them
 
Ping @Tyrael
 
On start all plugins are registered at github.com/Room-11/Jeeves/blob/master/cli/run.php#L170
 
@PeeHaa and what does pass the Command to the endpoint?
 
What do you mean?
 
@PeeHaa something calls the endpoint methods and passes the Command instance to them
 
10:58 AM
You mean when a plugin is being triggered?
 
@PeeHaa yes
 
We have a action thingy in there iirc. 1 sec
afaik this which is built up from this which is filtered based on github.com/Room-11/Jeeves/wiki/…
!!should I shawarma or doner?
 
You should doner.
 
hahahahah
> are you ediot @Ekin, I have copied but just explained it little bit.. you dumb..what is there to laugh out.. stackoverflow is not your property – Nitin 6 mins ago
 
oh lol
I didn't even see that
 
11:08 AM
I can only assume the "explained a bit" part is:
> Try with this
:D
 
:D really can't understand some people, specially today
 
is ediot someting like the electronic version of an idiot?
 
Yup, but the open source one. Apple has it's own proprietary iDiot
 
heh
maybe there was a pun with my name starting with e, but nah
 
Anonymous
@PeeHaa classy
 
11:13 AM
@JayIsTooCommon Europe does not have good history of putting things actually on Mars...
@Gordon the PluginManager class is the thing which dispatches websocket events to plugins. There are a couple of layers between that and the actual websocket handler code, but for re-architecting the plugin system, it's the PluginManager where all the relevant stuff is
 
@DaveRandom I once left a Mars in a locker for a month. I can tell you, that put life on it!
 
Anonymous
@Gordon jesus...
 
Anonymous
food, bbiab
 
@JayIsTooCommon he knows me. And he knows I am right!
 
11:22 AM
@PeeHaa There are also two layers of event dispatch within the PluginManager itself, because there is the low-level event dispatcher and the higher level message event dispatcher (and yes, these could probably do with being broken up a bit)
The event filter stuff is for low-level events
In a way I suppose there are actually 3 layers because there the specific Command level dispatch as well
 
@DaveRandom hmm, I have to dig into that first. I was mainly thinking about separating the non-chat parts from the chat parts, e.g. in the scrabble plugin: split off the scrabble calculator because it doesnt need any of the chat things
 
That's dealt with as part of messages though, since commands are still messages
@Gordon Right, and you can easily do that in this system. Auryn will deal with the DI for you. So what's currently your Plugin class just becomes basically a front controller to dispatch events within your plugin.
 
yeah, the current plugin thing is just wiring then. and we can probably generify this.
 
In fact I'd like to remove the Plugin interface entirely, all of it's members are for getting at config data that can be specified in the manifest
i.e. you specify the name of your controller class and map it's methods to things entirely within a config file
@Gordon What you can do for now, though, is put multiple class defs in you file. Auryn will still figure out what to do just fine if you do that, as long as no ctors ask for scalar values.
 
@DaveRandom oh, I don't intend to do any of this nao. I was just thinking about the future.
 
11:30 AM
^ @PeeHaa It's still in my activity stream. :P
 
Cool. There are several plugins that are candidates for this, e.g. twitter and translate both depend on external libs
 
@kelunik lol
 
@DaveRandom the main benefit for me would have been to write a unit test for the calculation then without having to mock the Command and the ChatClient, e.g focus on the actual plugin logic instead of the wiring
 
@DaveRandom I am old fashioned :)
 
11:37 AM
:-P
Actually I think the issue is more that I am a bad person
 
also I cannot be bothered to setup a dummy jeeves for testing
 
The problem with tests though is they make it difficult to break API/ABI. And I like doing both of those things.
 
you mean the API/ABI of the chat bot itself? that would be another reason to split the plugins from it then.
we "just" need some sort of contract between plugin writers and chat infrastructure
 
We just need to sort everything out. That's all.
 
Anonymous
@Gordon it's realllyy easy btw
 
11:41 AM
@JayIsTooCommon then please provide a docker image for it.
 
ABI?
Application Bollocks Interface?
 
actually let's make all the plugins docker containers
and then we just docker compose the endpoints
you'll never know if you need to scale up rebecca independently
 
@Gordon ABI in PHP? :'-D
 
uh lol, downvoted, I hope someone had a good reason except being angry
 
It was my revenge for copy pasting that poor fellow's answer
 
11:55 AM
heh, aalrite I'm getting more vodka
 
@Jimbo Anal Banana Insertion
 
Anonymous
As long as it's one of your 5 a day
 
Anonymous
!!wotd
 
paroxysm: any sudden, violent outburst; a fit of violent action or emotion.
 

« first day (2196 days earlier)      last day (2752 days later) »