Javascript: works up there, too!
I also learned that there's drag-n-drop support in some of 'em, but it replaces the entire page as well.
Javascript: works up there, too!
I also learned that there's drag-n-drop support in some of 'em, but it replaces the entire page as well.
^ Whoa, now thats interesting!
Apparently more and more young folks don't know how to use regular keyboards.
TIL I learned you can dislocate your patella so badly it slips between the femur and tibia. (Fortunately I learned this third-hand.)
I'd say "glad to hear that", except that wouldn't be nice to your friend/acquaintance. Sounds like quite a fall ....
Rugby is a tough game...
But TIL what coddled eggs are. Take the egg out of the shell and put it in a cup (a "coddler"). Put the cup in hot water for a while.
Can't think of a practical benefit - poach it or boil it, just make up your mind it will be faster either way - but there it is.
Sounds like what my mother called "poached eggs", though the cup was a purpose-built teflon-lined metal cup just right for one egg, with a thingy that held 3 such cups in a shallow pot/pan of boiling water (so that the cups were not in contact with the bottom of then pan). [shrug]
TIL my scripts would be running a lot faster than they are if someone had remembered to turn off automatic execution tracing a couple of weeks ago. D'oh
TIL that in PostgreSQL you can use the MAX() aggregate function on non-numeric column types. (I didn't bother to test what it considers to be "max", as I just needed it to pick one of the possible several matches.)
At least there was a switch. What I hate is finding hard-coded debugging during a re-factor.
Of course I have never done that ....
TIL that a trailing newline character can sneak through this regex:
// outputs YES
if (preg_match('/^[a-zA-Z0-9\-_]+$/', "hello-dolly\n")) {
die("YES");
} else {
die("NO");
}
You have to add the /D modifier to exclude a trailing newline. Very sneaky grrrr.
// outputs NO
if (preg_match('/^[a-zA-Z0-9\-_]+$/D', "hello-dolly\n")) {
die("yes");
} else {
die("no");
}
dalecosp
Not to mention how I found it. See, some of them were long-running to begin with, so the fact they were taking a long time to complete wasn't itself odd. The process was:
"Low disk space? Why? How?" [a couple of minutes later] "What's with all these 150GB logfiles here?"
Still, another thing I learned was that I really do need to clean up around here. Anyone interested in a bunch of Indiana University Computer Science Department Technical Reports circa 1978?
w00t! Class of '78! (OMG I'm old.)
...that C.O.D. means Collect On Delivery.
The thing being collected being the payment.
The form of the payment being unspecified.
That might just show how often I deal with anything "COD"; I guess back in the day cash was the only way it could be collected.
TIL: PDOStatement implements Traversable. In theory I should be able to clean things up a little bit with a foreach($stmt as $row)
instead of the while($row = $stmt->fetch())
sort of thing I've always done, I think.
Yeah, not earth-shaking -- just surprised I never knew this after using PDO on a pretty much daily basis for 7+ years now.
Today I learnt the importance of rest, the highlands are breathe taking
Today I learnt
<p id="geo"></p>
<script>
var x = document.getElementById("geo");
function getLocation() {
if (navigator.geolocation) {
navigator.geolocation.watchPosition(showPosition);
} else {
x.innerHTML = "Geolocation is not supported by this browser.";
}
}
function showPosition(position) {
x.innerHTML="Latitude: " + position.coords.latitude +
"<br>Longitude: " + position.coords.longitude;
}
</script>
This first draft of a site is going to be so badly done lol
That's nice. FWIW, I wouldn't use 'x' ... too much chance of collision in the global/window scope.
I spent part of yesterday trying to figure out how to make a rough duplicate of a PHP class in JavaScript.
It's not done yet, to say the least ...
Well I'll admit I don't fully understand it yet but I learned this today..
SELECT postcode, town,
lat, lon, distance
FROM (
SELECT z.postcode,
z.town,
z.lat, z.lon,
p.radius,
p.distance_unit
* DEGREES(ACOS(COS(RADIANS(p.latpoint))
* COS(RADIANS(z.lat))
* COS(RADIANS(p.longpoint - z.lon))
+ SIN(RADIANS(p.latpoint))
* SIN(RADIANS(z.lat)))) AS distance
FROM shopAddress AS z
JOIN (
SELECT 57.11149510000001 AS latpoint, -3.157924900000012 AS longpoint,
50.0 AS radius, 111.045 AS distance_unit
) AS p ON 1=1
WHERE z.lat
BETWEEN p.latpoint - (p.radius / p.distance_unit)
AND p.latpoint + (p.radius / p.distance_unit)
AND z.lon
BETWEEN p.longpoint - (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint))))
AND p.longpoint + (p.radius / (p.distance_unit * COS(RADIANS(p.latpoint))))
) AS d
WHERE distance <= radius
ORDER BY distance
Heh...I was just playing around with this a few days ago in a very preliminary look into a tool we're thinking of building (that I doubt will be in PHP, but it's still what I think in):
$miles = rad2deg(
acos(
sin(deg2rad($loc['from']['lat'])) * sin(deg2rad($loc['to']['lat'])) +
cos(deg2rad( $loc['from']['lat'])) * cos(deg2rad($loc['to']['lat'])) *
cos(deg2rad($loc['from']['long'] - $loc['to']['long']))
)
) * 60 * 1.1515;
NogDog I'd prefer miles too, I don't get KM but that's what the tutorial was in