Forgot your password?

typodupeerror

Comment: Re:User's time, not BBC time (Score 1) 487

by stderr_dk (#43932827) Attached to: BBC Clock Inaccurate - 100 Days To Fix?

1) Clock drift in excess of a minute per day is not unheard-of.

I don't think I have ever seen numbers that high myself, but if needed, the time_diff could be recalculated more often. If the page notice a large clock drift between two calculations of the diff, it could schedule the next recalculation to occur sooner.

2) If the AJAX request fails, what do you do?

For the first calculation of the diff, you don't really need to use AJAX since the page already includes the server time in the "clock"-element. If a later AJAX-request fails, you could simply reuse the old diff and schedule a new calculation at a much sooner time that otherwise.

3) If the AJAX request hits a high asymmetric delay (not unheard-of), you'll be off by a good fraction of a minute.

You're right, I don't have a good solution for that problem. Maybe take a look at how NTP deals with it.

4) If the user can't set their computer's clock, what makes you think they can set the computer's timezone?

I don't think I said anything about the user setting the timezone anywhere, so I fail to see your point.

I did mention the "Europe/London"-timezone, but that timezone would be set by the BBC site, not the user.

5) Related to 4, what happens during a daylight savings time shift? You can't count on the local clock changing by an hour, but you also can't count on it *not* changing.

What daylight savings time? There's a reason why I'm using milliseconds since Epoch.

If you know the time in milliseconds since Epoch and you know when the transition between standard time and daylight savings occur (or any other change of offset from UTC), you can calculate the local time. You can find the transition times and offsets in the tzdatabase and do the calculation yourself or you can use the tzdata-javascript library I mentioned.

Comment: Re:User's time, not BBC time (Score 2) 487

by stderr_dk (#43923163) Attached to: BBC Clock Inaccurate - 100 Days To Fix?

What the BBC said was that they would find it difficult and expensive to accurately show the time at the user's location, when the user's time settings were wrong.

This is roughly how I would do it:

  • Make sure the server is running NTP or something similar, so the server time is correct.
  • When the page is requested, include the current server time: <span id="clock">Thu Jun 6 11:29:04 BST 2013</span>.
  • If JavaScript is off, we can't update the time and all we can do is display that static time.
  • If JavaScript is on, we:
    • Find the HTML-element: var clock=document.getElementById("clock");
    • Get the current local time as milliseconds since Epoch: var local_time_1=new Date().valueOf();
    • Use AJAX to get the current server time as milliseconds since Epoch, server_time.
    • Get the current local time as milliseconds since Epoch, local_time_2.
    • Assuming that the delay from the client to the server is the same as the delay from the server to the client, calculate the difference between server time (correct time) and local time: var time_diff=server_time - (local_time_1+local_time_2)/2;
    • Every second, minute, whatever...
      • Get the current local time as milliseconds since Epoch, local_time.
      • Calculate the assumed server time: var assumed_time=local_time + time_diff;
      • Update the HTML-element to display the assumed_time in some "pretty" format.
      • If you don't want to display the time in either UTC or "whatever timezone the user has configured", use something like (shameless plug) tzdata-javascript to convert it "Europe/London".
    • Maybe recalculate time_diff every hour to avoid time drifting. I highly doubt this is needed.

Wouldn't that work?

Comment: Re:nt (Score 0) 128

by stderr_dk (#43677527) Attached to: When Vote Counting Goes Bad

Who the American Idol winner is has no real effect on my life, whereas my local city council does when they decide whether to put money into repairing nearby streets or changing the zoning to accommodate a CVS in my neighborhood.

Your local council decides that? Weird...

When I wanted to have a version control system, I just installed one. I didn't have to get permission from anyone.

Mozilla

Mozilla Named 'Most Trusted Internet Company For Privacy' 70

Posted by Soulskill
from the email-us-your-credit-card-details-if-you-agree dept.
redletterdave writes "Mozilla announced on Tuesday that it has been named the 'Most Trusted Internet Company For Privacy' in 2012, according to a new independent study released by the Ponemon Institute early this morning (PDF). Ponemon Institute surveyed more than 100,000 adult-aged consumers over a 15-week period ending in December 2012; of the 6,704 respondents, representing 25 different industries, Mozilla was ranked the top Internet and social media company. While this is a great achievement for Mozilla, especially considering this was their first year making the list, Mozilla's team took note of the fact that 'Internet and social media' was still the least trustworthy sector out of the 25 total industries listed. 'It means we as an industry all have a lot more work to do,' Mozilla wrote on its blog."

Comment: Re:He has a video up of this exploit.... (Score 1) 106

by stderr_dk (#42070321) Attached to: Researcher Claims To Have Chrome Zero-Day, Google Says "Prove It"

Well, this guy MAY actually have something.

Or maybe the page has a hidden image loaded from a webserver running on localhost. The webserver is configured to start putty when someone connects...

I did something like that 15+ years ago, so it's nothing new at all.

Supercomputing

Cray XK6 Supercomputer Used To Simulate Ice Cream 55

Posted by samzenpus
from the right-tool-for-the-job dept.
An anonymous reader writes "The processing power available inside modern supercomputers isn't just able to help us better understand the universe we live in, develop better medicines, and model complex systems. Apparently it is also helping to make better ice cream. Research has been carried out at the University of Edinburgh to simulate the soft matter that makes up ice cream. More specifically, scientists are trying to understand the complex interactions occurring between the many different ingredients that make up your favorite flavor of the delicious cold stuff."
Earth

Fires Sparked By Utah Target Shooters Prompt Evacuations 709

Posted by timothy
from the dichotomy-not-only-odd-but-false dept.
Hugh Pickens writes "The Salt Lake City Tribune reports that more than 9,000 people have been driven from their homes by a wind-whipped wildfire started by two shooters at landfill popular with target shooters who won't face any charges because they were not breaking any laws. The fire was the 20th this year in Utah sparked by target shooting where low precipitation, dry heat and high winds have hit the West hard, exacerbating the risk that bullets may glance off rocks and create sparks. Despite the increasing problem, local agencies are stuck in a legal quandary — the state's zealous protection of gun rights leaves fire prevention to the discretion of individuals — a freedom that allows for the careless to shoot into dry hills and rocks. When bullets strike rock, heated fragments can break off and if the fragments make contact with dry grass, which can burn at 450 to 500 degrees, the right conditions can lead to wildfires. Utah Gov. Gary Herbert has called on Utahns to use more "common sense" in target shooting urging target shooters to use established indoor and outdoor ranges instead of tinder-dry public lands. "We can do better than that as Utahns," says Herbert, calling on shooters to "self-regulate," since legislation bars sheriff's officials from regulating firearms. "A lot of the problem we have out here is a lack of common sense.""
The Military

Artist's Catcopter Causes a Stir 360

Posted by samzenpus
from the poor-tatse dept.
derekmead writes "I'm not sure that Dutch artist Bart Jansen had political commentary in mind when he created the Orvillecopter — combining a stuffed cat with a quadrotor, and naming it after Orville Wright — but indeed it's art, whose meaning will lie in the eye of the beholder. And for those that say stitching up a dead animal around the guts of a helicopter and flying it around is 'sick,' what of the massive drone industry, which, more than just producing a symbol, actually is creating flying death?"

Even bytes get lonely for a little bit.

Working...