The extended or derived class has all variables and functions of the base class (this is called ‘inheritance’ despite the fact that nobody died)
From the PHP official documentation
The extended or derived class has all variables and functions of the base class (this is called ‘inheritance’ despite the fact that nobody died)
From the PHP official documentation
Monday morning. I’ve just arrived at the office, and I see my first task to do: fix a bug in a calendar from one of our websites. Actually there are 2 calendars, and one calculation to show the difference in days between the two dates. Somebody discovered a weird behaviour when you select a range of days in the end of March… the difference of days is not an integer number, but a float one!
I isolated the problem, shortening the range of days, until I discovered that the problem is in the last weekend of March. From Friday 23rd to Monday 26th of March, there are 2.95 days (instead of just 3 days). What’s happening that weekend? Why is the last weekend of March somehow weird? Any idea?
If you want to know the solution, see the first comment of this post. Tip: I use a PHP function to convert the dates into integer timestamps (seconds), I substract these integers, and finally I divide by 3600*24, to know the difference in days.
…as nature does. Create something from random numbers.
Here are a couple of examples, from a Sunday morning programming session (plus 1 extra hour from the daylight savings change):
– Random bubbles
– Random trees
Each time you reload the page, a new drawing appears.
To see them correctly, you need Firefox or Opera, because the images are SVG (Scalable Vector Graphics).
Have fun!
A morning office conversation:
Tony (a workmate): Is there a PHP function to stop for a moment the execution of a page?
Me: Yes, it is “sleep()”.
Tony: Just what I need, to sleep a little bit. Does it work with microseconds?
Me: No, it works with seconds. For example, if you write sleep(1), it is going to stop for 1 second.
Tony: Ok, thanks, you are a crack.
Me: And, even more, if you write sleep(2), it’ll stop for 2 seconds.
Tony: Why don’t we use it with a negative value? Probably we will speed up our websites!