« first day (2650 days earlier)      last day (2305 days later) » 

12:00 AM
You'd need to extend EACH of the different employee types to cater for each of the different holiday types.
Hello, my old nemesis, combinatorial explosion.
 
Ahhh. Yeah. How do you avoid that? I can see two ways.

1) Just having a giant god-class which has everything injected into it. (eww, I assume?)
2) Only extend linearly. (Impossible)
Driving home, but I'll be back in 20.
 
I think it should always be possible to convert from the source type, to a new type, adding in the extra bit of behaviour, at the precise junction in the program where you need to do that conversion, rather than having all of the behaviour in the source type all the time.
@Allenph I just write some code to convert from one type to another, adding in the extra bit that needs to be added. If i needed to inject that conversion into some code, I'd change the function above to be an injectable class:
class ConvertEmployeesToListOfPeopleToBePaid {

  public function __construct(PaymentCalcFactory $pcf) {
    $this->pcf = $pcf;
  }

  function makeListOfPeopleToBePaid(Employee[] $employees) {

   $listOfPeopleToBePaid = [];

   foreach ($employees as $employee) {
     $pc = $pcf->createPaymentCalculatorForEmployee($employee);
     $listOfPeopleToBePaid[] = new PayableEmployee($employee, $pc);
   }

   return $listOfPeopleToBePaid;
  }
}
> 2) Only extend linearly. (Impossible)
Hmm?
 
12:20 AM
Hi
should I store encrypted credit card in database?
 
It's not available to brazil
 
use paypal
 
12:39 AM
Otavio no
 
@SalOrozco what is the best option?
 
@Danack That makes sense, but isn't it easier with the same result to do polymorphism through inheritance and an interface then just typecast?
 
@Allenph easier how?
 
Storing credit card info yourself is never a good choice unless you are a big company. Use a third party to handle credit cards. Stripe, PayPal.
 
12:46 AM
 
Thanks
 
@Danack Because you don't have a the intermiary classes. At the end of the day you have to write a class for each if the calculators with your method.
Ahhh, wait I see why.
 
@Allenph Is that more difficult than including the methods in the other class, even for the single extension level? also:
55 mins ago, by Danack
Extending the entity for each case, breaks down almost immediately. Imagine you tried to use the same tactic to calculate how much holiday people are allowed to take.
 
Yep. I see why now.
Thanks @Danack.
 
np.
 
Wes
1:12 AM
@PeeHaa sorry again for adding you to the github org while back, i didn't know you would be added to watch every repo in it :B
 
Wes
1:53 AM
@Danack quite windy, eh?
wind from the atlantic is hitting hard here and even harder uk
 
2:24 AM
@SaitamaSama in that case... myanimelist.net/manga/1093/Rin
errrr wrong person
sorry @Wes :P
 
2:41 AM
lol that's a whole new level of creepiness @Wes :P I know how's the wind flowing around your house
 
Not as creepy as the number of white flags in your house.
 
white flags? what are those?
I mean... apart from being... white... flags?
 
3:08 AM
Joking about your French-ness.
 
"I have seen their backs before, madam."
 
 
2 hours later…
4:54 AM
YO
There is probably a better way to do what I am doing. Basically I'm doing .php?alphachar=$alphachar. to sort with $href but I also want to do .php?emplyeeposition=$employeeposition. and what ever other ways I want to sort
Not sorting all the different ways at the same time...or would I want to?...
 
5:40 AM
morning
 
morning
o/
 
5:57 AM
@MadaraUchiha yeah... Watched it .... Was pretty boring imo
@Wes lol
Also, mornings o/
 
6:41 AM
Mornings! :)
Does anyone know a MySQL editor for OSX that can help you design joins in a GUI, like flyspeed for windows? - Sorry if its not allowed here :)
 
Workbench?
 
7:29 AM
@bwoebi that would be a lie. Either I can tell you the version or I can't. Just run composer install or get rid of the version fetch if not vital.
 
8:26 AM
@Ekin that's very rude reply.
 
8:43 AM
moaning
 
8:57 AM
This command sets shell to an user: sudo usermod -s /bin/bash myuser
When should I do that?
 
@Naruto moaning intensifies
 
@tereško I'm following those steps we tried already for making a user and disabling root login. I stuck on this part:
 
hmm
what's actually confusing you in that line?
 
You know, .ssh directory isn't exit in ~
 
or is there no such file/directory
ah
well, you need top create them
by default your user will not have it
 
9:12 AM
the result of ls -a (currently I'm in ~ path) is:
.  ..  .bash_logout  .bashrc  .profile
@tereško ah
using mkdir ?
 
are you sure it your user?
are you not doing it with root?
 
@tereško no no, I've used su myusername
 
but, yes, mkdir is the command for that
 
ok
the final command is: mkdir .ssh
right?
 
yes
well, mkdir ~/.ssh to be safe (because I had no idea in which directory you actually are)
 
9:14 AM
ok, created
also I need to make a file named authorized_keys into .ssh directory?
 
yes
 
ok
emm, with which command I can make a file?
I guess, mkdir is just for directories, not files
got it
which flag of ls command shows me the accessibility of a file ?
-f?
 
usually you would just create a file using the text editor
 
@tereško I did it
 
but for creating an empty file there is a command: touch
 
9:18 AM
I did it :-)
 
9:33 AM
@tereško the .ssh directory should be 700 and the authorized_keys should be 600, right?
 
yes
 
ok thx
I did it all
I feel being expert :-)
 
posted on January 16, 2018

New Cyanide and Happiness Comic

 
now just make sure that you can log in with a key in a normal user and then you can disable root login in the main config
 
I can login without asking a password for that user
but something is strange for me
 
9:37 AM
?
 
the result of ls -l ~/.ssh is:
-rw------- 1 lamtakam lamtakam 81 Jan 17 10:27 authorized_keys
I guess it is not 700
 
that's the file
so it has 600
 
however apparently that's not the directory
@tereško yes yes
how can I see the permission of .ssh directory?
 
so, what is the problem?
 
9:38 AM
ls -la ~/
 
ls -al ~/.ssh works too
 
oh .. yes, -a flag is what I was looking for (to see hidden directories)
 
.. is the parent directory, . is the current directory
 
@FlorianMargaine Do you know who are you talking to? :P
 
@Shafizadeh a linux noob?
 
9:40 AM
@FlorianMargaine not noob anymore ;-)
 
:)
It is 700, right?
drwx------ 2 lamtakam lamtakam 4096 Jan 17 10:27 .ssh
 
oh speaking of
I have a commit in linux kernel \o/ lkml.org/lkml/2018/1/14/210
6
 
:) good for you
 
@Wes No worries
 
9:55 AM
is that really the best way? stackoverflow.com/a/2098689/851498
 
@Ocramius not my choice though if some lib thinks it needs to expose its version though. Just give me an arbitrary string like "dev", if there's nothing to interesting
 
@tereško Ouch, wtf
Good thing I'm waiting
(for the gfx cards)
 
mining
 
Well I thought that
But there's a bang-for-buck ratio that's being ignored
Like the GTX 1070 was best bank for buck, you wouldn't buy a 1080TI for mining as it's not worth it for the extra
 
10:12 AM
Just for my information, is it possible to disable accessing a server using SSH protocol?
If yes, should I modify what configuration file on the server?
 
@Shafizadeh Yes, you need to edit the sshd_config file
 
@Shafizadeh you mean - disable SSH entirely ?
why would you want to do that?
 
Then once you've made your changes, you reload sshd
But, you lock yourself out, you're fucked!
 
@bwoebi not gonna happen. If I cannot retrieve a version, you will get an exception, as you should be.
 
Hello.
 
10:20 AM
morning
 
@Wes Not so much, Bristol is protected from the NW by the 'mountains' in Wales.
 
Wes
this wind thing is getting ridiculous
 
10:35 AM
hi
anybody expert in fpdf library here
I am stuck at one point where I need to print comment in pdf
if string is big then it will get divided and print in next page
 
@bwoebi Which might be wrong, rather unknown might work.
 
@Jimbo ah
 
@Exception If anything is big enough, it will be printed in next page. :)
 
@Tpojka yes Indeed
 
@tereško yes, entirely ... in my company, there is a server which only is used as a VOIP server, so it doesn't need SSH access, I want to disable it as a security layer
 
10:42 AM
@Tpojka but I have rectangle to that comment and hence its hard to get last character/word of the string and then from that get remaining string
 
@kelunik or that, I totally don't care as long as it doesn't fail
 
Wes
\o
 
@Exception Can you exclude dashes (trim or such) that form rectangle and check last word?
 
@Tpojka the question is how?
 
Until seeing your question with current code and current output and wanted output, how remains.
 
10:48 AM
okay I will provide you my code..wait
 
@Exception Just pass the link to your question, here.
 
Form well question on Stackoverflow, please. So you can expect solution very soon from numerous experts.
 
I am having following message at my "ask question" page.
Wait! Some of your past questions have not been well-received, and you're in danger of being blocked from asking any more.

For help formulating a clear, useful question, see: How do I ask a good question?

Also, edit your previous questions to improve formatting and clarity.
 
Read this article, ask accordingly and don't worry for your question.
 
11:02 AM
In the prerequisites part of this tutorial, it says I have to make an user and give it root privilege for installing software. Well what's wrong with root user?
 
Wes
php should have weak refs in core :\
 
@Shafizadeh Using root by default is the way accidents happen. Also, best practice says that you shouldn't be able to log in as root directly for security reasons (helps mitigate brute force attacks on ssh, for one).
 
I see, ok .. However I mean, why not installing software using root user (not login directly, login using su root) than making another user with root privilege ?
 
@Shafizadeh Since you didn't click link just few letters away, this is what is explained there.
 
@Tpojka I read it, but still I don't know what's wrong with accessing root using su root command (and then installing any software)
 
11:11 AM
Even if user has administrative privileges, there are some actions that just root user can execute. Those actions are rather rare and root user should be used just then.
 
ah ok .. So I understand the answer is for "security reasons"
 
@bwoebi You can just catch the exception then.
But we'll just remove the constant, but I'll do that once @Trowski finished his refactoring.
 
@Shafizadeh I think explanation on image I posted is very clear. Pay attention on this part too.
 
it is , thx
@tereško one thing, that private-key can be used also for another user, right? (though doesn't work for another user)
@Tpojka thank you buddy .. I read it twice :-) noted that I think copy/paste that sentence here is much more easy that taking a screenshot of that :-)
 
Not a problem.
SSH connection is made between two keys. Public and private. Public key is on one computer (let's call it online server) and private on another. Which ever computer has private key, can establish connection with public server (or machine where public key is).
So if you would copy private key to second computer you would be able to establish connection.
 
11:22 AM
hello all.
 
Wes
@bwoebi @NikiC @kelunik thoughts? 3v4l.org/eMCfj
i would have expected that to work...
shouldn't it do isset() first, before calling __get?
 
Wes
yes but function __isset($o){ return isset($this->{$o}); } isn't the default implementation already? :P why do i have to explicitly define it?
 
Probably because @NikiC's fix for 7.0.6 was incomplete when I first reported it.
 
Wes
what's that?
 
11:30 AM
hm?
 
Wes
i pinged you not because i'm aware of that :P
did you report the bug it already?
 
I reported that __isset isn't used and it was fixed in 7.0.6 as you can see in the link I sent you. That it doesn't do the same as isset(...) is another issue.
 
Wes
reported btw
waitforit....
do you hate your vegetarian friends? make them a present! gamiss.com/hoodies-11571/product1382454
!!uptime
 
11:54 AM
errrrr
What did you do?
:P
 
lol
 
Wes
:(
 
lemme check if he is still up at the playground
he dead dead
 
Wes
 
websocket error
 
11:56 AM
paralipsis Rhetoric. the suggestion, by deliberately concise treatment of a topic, that much of significance is being omitted, as in “not to mention other faults.”
 
!!dad
 
@PeeHaa Why did it not reconnect?
 
What does an annoying pepper do? It get’s jalapeño face
 
@Shafizadeh if you disable SSH, how will you administrate it?
 
@Wes I walked into a butcher's shop and said "I bet you £1000 you can't reach those cuts that are hanging from the ceiling". He said "I won't take that bet, the stakes are too high."
7
 
11:57 AM
@kelunik I don't know tbh. IIRC @DaveRandom built reconnect logic but half assed or soemthing
 
that probably works better when not written down
@PeeHaa it's a DNS problem of unknown nature
 
@tereško I want to disable SSH for another server (my company server) ..
 
Evenings o/
 
ah
 
@PeeHaa Just exit(1) and let it respawn. :P
 
11:58 AM
porting to ampv2 might help
 
@Wes because, well, there's no public property $o
 
@kelunik That's actually not bad :)
@DaveRandom It will
 
@Shafizadeh and how will your company be able to administrate it then?
 
I don't think I have seen that many problems in gitamp anymore
 
@PeeHaa maybe, depends where the problem is
 
11:58 AM
kk
 
@tereško It uses ppptp protocol (tunneling, in other word, using VPN)
 
How's libdns v2? :-)
 
@bwoebi But it should probably default __isset() to the default implementation @Wes suggested.
 
silence
:D
 
@PeeHaa Fine.
 
11:59 AM
@kelunik Do you maintain it now?
 
@PeeHaa No.
 
@Shafizadeh that does not answer my question. Do you intend to administrate it using some type of remote desktop? Or do you intend to administrate it by accessingthe computer in-person?
 
But LibDNS didn't change much, amphp/dns for Amp v1 is rather faulty.
 
oh I thought the issues were mostly on @DaveRandom
Just say yes
or nod
 
@kelunik so, you mean if (method_exists("__get", $this)) return $this->__get($key) !== null?
 
12:00 PM
Or blink your eyes
 
@tereško ok, lets forget about my company server .. now, I want to access my server using that private key (which works for an user) for another user. is it possible?
 
@PeeHaa actually, progressing a bit
kinda firefighting at work rn, bbiab
 
!!horoscope pisces
 
> ♓ Pisces
Thanks to the events of this week, when people think “fish sticks,” they’ll think of you. Then they’ll throw up, especially if they’re eating fish sticks.
https://www.theonion.com/your-horoscopes-week-of-january-16-2017-1822116431
 
12:01 PM
@DaveRandom Good luck bruv
 
@Shafizadeh if a user has in the authorized_keys file a public key, then you can log into that user using the matching private key
 
no progress for a few days because life, but shit is actually happening
/out
 
@kelunik yeah agree on that
 
@Shafizadeh you can use the same key paid on multiple servers and for multiple users
 
@tereško Can I give the same PK to multiple users?
ah ok
 
12:03 PM
@Shafizadeh yes, you can, but that's a terrible idea
 
You sexy beast you
 
you can set multiple public keys in the authorized_keys file for each person who you want to access that account
then, when the person leaves that job/project, you can delete his/her public key
@Shafizadeh otherwise, each time a person's access is removed, you would need to make a new key pair and re-send them to everyone ... that's a really bad way of doing things
 
@tereško You know, I want to install mysql, php etc and Digital Ocean (the tutorial I'm following) says I have to make another user and do installing with it, not root
So, the old user I made, doesn't have root privilige
 
link?
 
Wes
please update windows before updating visual studio
 
12:06 PM
I guess using su root and installing software is fine, isn't it? @tereško
 
@Shafizadeh if you created the SSH access for a user on that machine, then you already have a non-root account
@Shafizadeh no, it is not (at least, not in the context of that tutorial)
 
@tereško Yes, but that user doesn't have root priviliges
 
please, READ THE FUCKING MANUAL
5
it says "sudo privilages"
 
Wes
bitcoin is still plummeting
 
still?
 
12:09 PM
*again
 
@Shafizadeh I will not play your system administrator
you are on your own
 
Wes
still, just briefly it went up
 
@tereško :popcorn:
 
Wes
what exactly happen when i disable gc in userland, and i enable it back? the objects created in that period of time will never be destroyed?
 
Their destruction is potentially delayed
When I say potentially, if they wouldn't have been destroyed in the period GC was disabled, then duh, no delay.
Tracking still happens, the cleanup doesn't
 
Wes
12:16 PM
tracking = refcounting, right?
 
Segmentation fault after preg_match w/ utf8 (or extended ascii?) – #75832
 
@Wes Hmmm, seems I might only be half right, tracking still happens til you hit a limit
Iunno, I'm probably badly informed
 
Wes
@FélixGagnon-Grenier i just remember others (danack is one) complaining about the crazy wind :B
 
hmm... now that I'm back home, need to finally report the issue/bug for pthreads...
 
@Wes they may or may not be destroyed
 
Wes
12:31 PM
schrodinger's objects :P
@bwoebi like, if you remove __get it works. i don't think one should affect the other
means that it must always call isset() (regardless it's user defined or not) and only if true, it must call get()
 
morning
 
Wes
\o
 
12:50 PM
I was in at work at 7AM for the better part of last year, but right now I'm going in at 7:30... 15 minutes ago I kept thinking, "Oh god, I'm going to be late!" before remembering that I still have like half an hour.
 
that's the nice thing about my company… I cannot be late. we all come and go as we like.
 
@Gordon it would be my dream to work somewhere on third shift
I really need to print something out that states which Linux folder is which, because I can't remember for the life of me
 

« first day (2650 days earlier)      last day (2305 days later) »