Slashdot Mirror


User: parkrrrr

parkrrrr's activity in the archive.

Stories
0
Comments
240
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 240

  1. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 1
    Here ya go, rewritten with some proper spacing and good variable names. The variable scope, even in the original code, was about as small as was reasonable. That is, "not declaring variables until they are needed" was already handled. Again, the lack of proper indention is Slashdot's fault.
    my $strLen = length( $encoded );
    my $index = 0;
    my @coords;
    my $lat = 0;
    my $lon = 0;

    while( $index < $strLen ) {
    my $chunk = 0;
    my $shift = 0;
    my $delta = 0;
    do {
    $chunk = ord(substr($encoded,$index++,1))-63;
    $delta |= ( $chunk & 31) << $shift;
    $shift += 5;
    } while ( $chunk >= 32 );

    $lat = $lat + (($delta & 1) ? ((-1 - $delta) / 2):($delta >> 1));
    push @coords, $lat;
    $shift = 0;
    $delta = 0;
    do {
    $chunk = ord(substr($encoded, $index++, 1))-63;
    $delta |= ($chunk & 31) << $shift;
    $shift += 5;
    } while( $chunk >= 32);
    $lon = $lon + (($delta & 1) ? ((-1 - $delta) / 2) : ($delta >> 1));
    push @coords, $lon;
    }

    for (my $i = 0; $i< $#coords; $i++) {
    print $coords[$i]/1e5 . ', ' . $coords[++$i]/1e5 . "\n";
    }
  2. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 2, Informative

    Yes, it's possible.

    First, multiply all your lats and lons by 1e5.

    Now, take the first lat, and encode it (encode function to be specified later.) Append that to the string. Do the same with the first lon.

    Now, take the DIFFERENCE between the second lat and the first one, and encode that. Append that to the string. Again, do the same with the second lon.

    For each additional lat/lon, encode the difference from the previous one.

    Now, the encoding:

    If the number you have is negative, multiply by two and take the logical not. Otherwise, just multiply by two. Notice that this makes the least significant bit the sign bit.

    Now break the number into 5-bit chunks. Encode the least significant chunk first, by casting to a byte, adding 32 if there are more nonzero chunks to come, and then adding 63. Repeat for each 5-bit chunk. Skip trailing (MSB) zero chunks, but always output at least one chunk for each number. (That's why there are so many ? symbols: it encodes a difference of zero from the previous lat or lon. Note that this means you'll also never see three ? symbols in a row.)

    I haven't played with the 'levels' string yet; I assume it's used for removing details as you zoom out, and based on the characters that appear in it it may use the same encoding method except without the delta compression. The rest of the XML looks self-explanatory.

  3. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 1

    Well, it is THEIR variable names, other than $XX, which is my fault. I assume they used short ones to minimize download time.

  4. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 2, Interesting

    And of course it has bugs (mine, not theirs.) The two places where it says (1-$Fa) should say (-1-$Fa).

  5. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 4, Interesting
    And fortunately for us, Google makes it easy by giving us JavaScript code to decrypt the "points" string, and it does indeed contain latitudes and longitudes. Here's the equivalent Perl code, with almost all the same variable names as their JS code, with leading indentation stripped (thanks Slashdot!) Encoded string in $XX, decoded lat/lon pairs to stdout in CSV format. Feed that output to GPSBabel as "arc" format, and you should be able to simplify it and upload it to your GPS receiver.

    my $Ch=length($XX);
    my $pb = 0;
    my @aa;
    my $Ka = 0;
    my $Pa = 0;

    while($pb<$Ch) {
    my $ub;
    my $oc=0;
    my $Fa=0;
    do {
    $ub=ord(substr($XX,$pb++,1))-63;
    $Fa |= ($ub&31)<<$oc;
    $oc+=5;
    } while($ub>=32);

    $Ka=$Ka+(($Fa&1)?((1-$Fa)/2):($Fa>>1));
    push @aa, $Ka;
    $oc=0;
    $Fa=0;
    do {
    $ub=ord(substr($XX, $pb++, 1))-63;
    $Fa |= ($ub&31)<<$oc;
    $oc+=5;
    } while($ub>=32);
    $Pa=$Pa+(($Fa&1)?((1-$Fa)/2):($Fa>>1));
    push @aa, $Pa;
    }

    for (my $i = 0; $i< $#aa; $i++) {
    print $aa[$i]/1e5 . ', ' . $aa[++$i]/1e5 . "\n";
    }
  6. Re:what about plotting waypoints on the map? on Mapping Google Maps · · Score: 1
    GPS Visualizer piggybacks on MSN Terraserver for some of their imagery. For some reason I can't see MSN taking too kindly to Google doing the same thing.

    According to the FA, the route information is transmitted to the client in some encoded form, then sent back to Google to request a PNG file. If someone could reverse-engineer that encoded form, and if it actually contained usable information, you could probably find someone who'd be willing to write a module for GPSBabel to handle it.

  7. Bad link on Free Open-Source vs. Commercial Security Tools? · · Score: 2, Interesting

    Kismet can be found at http://www.kismetwireless.net/ ; the link above redirects to the no doubt appropriately-named wirelesscon.com.

  8. Re:Can you say "invented"? on HP's Crossbar Latch... Next-Gen Transistor? · · Score: 1
    Intel, the pioneers of the transistor.
    Who volunteers to tell the guys at Bell Labs?
  9. Re:Flops at Apple are predictable on Top 10 Apple Flops · · Score: 1
    I bought an Amiga 500 in 1989. I distinctly remember that the 600, the 2500, the 3000, and the 4000 all came out well after 1990. I'm pretty sure the 4000 was still new in 1993. Commodore was busy driving the Amiga into the ground even then, but they hadn't quite succeeded in killing it yet.

    I wasn't an Atari type at the time, so my memories of that line are less clear, but I'm pretty sure there were one or two STs that weren't too shabby when I was shopping for my Amiga. At the time, the IBM PC and compatibles were still "business" computers and VGA was this new thing that'd just come out. Nobody I knew could afford it, though I do remember I had a rich friend with an EGA card. Those of us with 12-bit 320x400 graphics laughed at him behind his back.

  10. Re:Patents? on A9 Search Engine Launches Yellow Pages · · Score: 0

    They're not the first.

    Heck, they're not even the first to be profiled on Slashdot. There was an insurance company, or maybe a supplier of data to insurance companies, a few months ago doing the same thing, if I recall correctly.

    And then there's The PennDOT VideoLog.

  11. Re:This is an awesome idea, but... on A9 Search Engine Launches Yellow Pages · · Score: 1

    You're not a geek unless you automate the process of using Terraserver to get aerial (not satellite) photos of locations you're going to be.

    Real geeks automate this.

    And if you automate this, you're beyond hope. (It's hard to see, but that's a Terraserver image used as a backdrop in GPSPilot Tracker for the Palm.)

  12. Re:For those who have RTFA issues... on MS To Limit Security Fixes to Legal Copies of Windows · · Score: 5, Insightful

    As long as "work" won't mind losing one of their five activations. Unlike previous versions of Windows, the MSDN copies of XP are only valid for a limited number of installs, and you have to use your MSDN account ID to get the serial numbers from MS.

    And hey, as long as you're using stuff from work, why not just take your printer home, too? They'll never miss it.

  13. Re:Why should I be paranoid? on Just How Paranoid Are You? · · Score: 1

    And of course, being who you are, you told the nice Nigerian man that he should be self-sufficient and get all that money out of Nigeria himself, right?

  14. Re:Not so surprising on Survey Says Internet Users Confuse Search Results, Ads · · Score: 2, Interesting
  15. Re:From the "Duh" department on On The Durability Of Usability Guidelines · · Score: 1

    The programmer who looks in the mirror is not a real programmer.

  16. Re:OK, But... on Make Magazine Subscription Now Available · · Score: 3, Informative

    'twas Ciarcia's Circuit Cellar, I think.

    Circuit Cellar is a magazine in its own right, and it's not too bad (though it seems to be a bit heavy into using microcontrollers for everything.)

  17. Re:argh! Statistical abuse! on Newsy Numbers · · Score: 4, Funny
    How about a different Mark Twain quote, from Life on the Mississippi:

    In the space of one hundred and seventy-six years the Lower Mississippi has shortened itself two hundred and forty-two miles. That is an average of a trifle over one mile and a third per year. Therefore, any calm person, who is not blind or idiotic, can see that in the Old Oolitic Silurian Period,' just a million years ago next November, the Lower Mississippi River was upwards of one million three hundred thousand miles long, and stuck out over the Gulf of Mexico like a fishing-rod. And by the same token any person can see that seven hundred and forty-two years from now the Lower Mississippi will be only a mile and three-quarters long, and Cairo and New Orleans will have joined their streets together, and be plodding comfortably along under a single mayor and a mutual board of aldermen. There is something fascinating about science. One gets such wholesale returns of conjecture out of such a trifling investment of fact.
  18. Re:Here is the dirt on Weatherbug on Who Invests in Spyware Companies? · · Score: 1

    And lest I be accused of trolling or shilling for weatherbug: I don't have weatherbug installed, and I don't want it. I do use ForecastFox, though.

  19. Re:Here is the dirt on Weatherbug on Who Invests in Spyware Companies? · · Score: 2, Insightful

    So the detailed analysis is that weatherbug starts at boot (well, duh, how useful would a program to tell you about weather alerts be if you had to remember to start it each time you logged in?), optionally installs itself in IE, and supports itself with ads and that makes it spyware? (I'm choosing to ignore the 'spybot says it's spyware so it must be' argument-from-authority at the end.)

    Yahoo Messenger does all of those things. Why isn't it spyware?

  20. Re:Umm.... on Security Issues in Mozilla · · Score: 2, Interesting
    But, thanks to the way the Windows runs, everyone pretty much need to be an Administrator to do things like, idk, run a CD-Burning app...
    I've had everyone on my XP SP2 machine running as a "limited" user for quite a while, and so far the only application I've seen that didn't work properly was the latest version of Palm Desktop. (it has to be installed by an admin, but puts all of its settings in HKEY_CURRENT_USER. So it has to be installed by whoever needs to run it. So you have to promote any user who needs it to admin, log on as that user, install the application, then demote the user back to limited. God help you if you have more than a couple users. And we wonder why PalmOS is losing ground to WinCE.)

    I know it was an off-the-cuff example, but Nero's BurnRights handles the CD-burning problem for Nero users. Users of other commercial software should consult their software vendor. Users of the Microsoft CD-burning "solution" are part of the problem. Users of cdrecord and cdrdao should look into the available documentation on Windows services and gin up something equivalent to BurnRights on their coffee break.

    ... so a knowledgable user could change the permissions and look inside.
    You can prevent administrators from changing the permissions on your files. Administrators can still take ownership of your files, giving themselves "full control" permissions along the way, but they can't give them back so there's a fairly obvious audit trail if they go that route. I have a particularly pernicious piece of spyware on my machine that none of the usual tools seem to be able or willing to get rid of (the existence of which is why all of my normal users, including myself, are limited.) I've disabled it by denying all permissions on its directory to everybody, thus prohibiting it from running and even from reinstalling itself if another copy of it should happen to run if some idiot admin (me) should happen to go insane, run IE, and go to an infe[cs]ted website.
    </rant>
  21. Re:Christ on What Do You Believe Even If You Can't Prove It? · · Score: 1

    Weird. How does your neighbor feel about that?

  22. Re:explanations on Online Groups Behind Bulk of Bootleg Films (& Games) · · Score: 2, Interesting
    No crapfloods. None of that "Hur. Hur. Our last OP just lost link -- everyone get out of the room so we can get OPs back!!" madness.
    Clearly you're not trying to use Yahoo Chat... Instead of the above, you get hordes of bots propositioning anything that moves, and nobody has the authority to do anything about it. Yeah, that's an improvement. Give me IRC with some decent services (chanserv, nickserv, what-have-you) any day.
  23. Re:Get out of the left lane slowpoke on Automakers Working on Car-to-Car Ad-Hoc Networks · · Score: 1

    My Science Project.

    Someone else watched that?

  24. Re:You mean "grape juice tasting" on DJB Announces 44 Security Holes In *nix Software · · Score: 1
    We are talking about seniors here. Most students start college at 18 or older; by the time they've been there for three years, they're... lessee... carry the one... ah, there it is, 21.

    My alma mater, the University of Houston, offered a wine tasting class under the auspices of the Conrad N. Hilton School of Hotel and Restaurant Management. My understanding at the time, though, was that only HRM majors were allowed to take it.

  25. Re:Comedy... on IT Practice Within Microsoft · · Score: 1
    C:\>runas /?
    RUNAS USAGE:

    RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
    /user:<UserName> program

    RUNAS [ [/noprofile | /profile] [/env] [/netonly] ]
    /smartcard [/user:<UserName>] program

    /noprofile specifies that the user's profile should not be loaded.
    This causes the application to load more quickly, but
    can cause some applications to malfunction.
    /profile specifies that the user's profile should be loaded.
    This is the default.
    /env to use current environment instead of user's.
    /netonly use if the credentials specified are for remote
    access only.
    /savecred to use credentials previously saved by the user.
    This option is not available on Windows XP Home Edition
    and will be ignored.
    /smartcard use if the credentials are to be supplied from a
    smartcard.
    /user <UserName> should be in form USER@DOMAIN or DOMAIN\USER
    program command line for EXE. See below for examples

    Examples:
    > runas /noprofile /user:mymachine\administrator cmd
    > runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
    > runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

    NOTE: Enter user's password only when prompted.
    NOTE: USER@DOMAIN is not compatible with /netonly.
    NOTE: /profile is not compatible with /netonly.
    There's also a GUI version, on the context menu in Explorer. Yeah, it doesn't always work perfectly (for example, the Flight Simulator 2004 installer locks up if you use Run As) but it is there.