Basically make a class with some private variables then use getter and setter methods (he didn't teach magic methods besides __construct, so definitively manual) to expose the power to see and change the variable. Employee (firstname, lastname, employeenumber) - and then extend the class with like a specific job and add another quality and then use it twice. It's super basic OOP intor
I guess if I was going to allow all you can eat style access with __set and __get (i.e. feel free to change anything) then why bother making the vars private to begin with, eh?
See the Custodian child class only has one property (certification_level) and there I find myself being fine writing
public function setCertificationLevel($value) { $this->$certification_level = $value; }
But I hate the idea of having that functions like it 3 times (that all just do $this->something = bla - without doing anything else when I could have just one function that catches all three... - any more if I later add more...
Yes, but it was vague enough that magic works too... "Add methods to return the properties and methods to alter the propert" -- and it would be my probably only chance to use them since anywhere else (i.e. portfolio work or production ready stuff at work) I couldn't play with such toys :D
If only I could chain __set then the annoyance level would be perfect :) - but yeah, I was considering briefly just doing it as he expected me to ... :D
And that's just for one property... I need 4 across two classes - and yes it's not thaat much more code, but I don't remember it being that bad in JS -- though to be fair it's been a while since I did stuff there with prototype etc.
this. haha! :) - I'm hoping hanging out here a bit will fix me, i.e. here I'm in the minority and psychological stuff (peer pressure or other heuristics) might help shape me to be a tad less lazy...
Optimizing means lots of different things - some do it for speed or file size, I like it when visually too similar stuff doesn't repeat too much and would be to an extent willing to pay on the other two for comfort in typing and thinking
Wait type casting in PHP? I thought here it's all type juggling like in JS? now type hinting mentioned earlier makes more sense... -- strike that, misunderstood what casting means... that's changing to that type?
Ha! You think that's weird? When I was 18 months old, I had been in 18 different countries (I was in Hawaii! and I don't remember anything!) - and as I grew more capable of remembering the frequency of flights / travel decreased drastically.
@trunco Because drawing PDFs (or any graphics) is one of the shittiest tasks in programming, drawing stuff with HTML/CSS is waaaaaay easier, and wkhtmltopdf does a really good job.
plus a lot of the time, people want things to be available as both a web page and a PDF download, and converting HTML to PDF means you only have to build it it once.
@DaveRandom I'm waiting for a letter of invitation or something alike. jrf_nl knows I'm going to do the visa dance soon, she was chasing that, so dunno for now but there isn't any subtle issue (yet).
@WesStark Because people emailing around MSO documents is the number 1 infection vector for badware, I spend a lot of time getting users very specifically to never open office docs that have been emailed to them
@PaulCrovella I understand the diversity of names etc. - I didn't come up with those fields, they were specifically required by the assignment. In Germany we say "firstnames" and it's common to go by any of them (i.e. I'm Hans Julian in vague honor of my Grandpa Hans-Juergen, but without hyphen so I wouldn't have to endure being called Hans at school (very old name) - so I always went by Julian.
In Canada Julian is seen as my middle name and all of a sudden I keep being called out as "Hans" at gov offices etc. was a strange feeling :D )
Basically @Wes if you are in the habit of emailing people MSO docs, you are training people to implicitly trust any doc that look like it has come from you or worse, any word doc
@PaulCrovella Good point. Because the guy's name might actually be John! -- So it should be "Unknown" or something, right? - Nevermind - Null does that just fine. Not sure why the prof had that in the example code.
@trunco it's not about the language, it's about the complexity of the problem. The existing tool has solved the problem. I'm a big fan of wheel reinvention, but PDF is a shit wheel no matter who designs it.
creators.vice.com/en_us/article/qkmeyd/… - there's a whole interview... it's not really an autonomous car, just concept art, but the idea is cool. "If a self-driving car is designed to read the road, what happens when the language of the road is abused by those with nefarious intent?"
Because I've seen in a question on stackoverflow, someone suggested to check if a button is pressed like so but it is not working, which is why I'm asking.
isset() works tho. Just out of curiosity I'm asking.
So I want to run the built-in PHP web server on a vagrantbox. Stuff I've read has said to using php -S 0.0.0.0:80 to make it run. My question is: do I need to add 0.0.0.0 anywhere to the vagrantfile to make it work? like under config.vm.network "private_network", ip: "192.168.33.10"?
@Trowski is there any easy way to create two websockets connections with two dedicated handlers and be able to send messages over both connections from a handler?