14 December 2010

chronicling something strange

I've been trying to get to Google Maps but keep getting flipped to Yahoo Maps. Trying to capture what happened in case others have experienced this in the past or are experiencing this now.

First off, this looks odd:

$ traceroute maps.google.com
traceroute to maps.l.google.com (98.136.42.132), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 10.414 ms 0.979 ms 1.009 ms
2 73.220.38.1 (73.220.38.1) 8.990 ms 8.228 ms 7.975 ms
3 ge-4-13-ur01.seattle.wa.seattle.comcast.net (68.87.207.65) 8.295 ms 7.303 ms 8.122 ms
4 be-70-ar01.burien.wa.seattle.comcast.net (68.85.240.101) 9.642 ms 11.061 ms 8.976 ms
5 be-40-ar01.seattle.wa.seattle.comcast.net (68.85.240.94) 10.064 ms 10.512 ms 9.978 ms
6 pos-0-0-0-0-cr01.portland.or.ibone.comcast.net (68.86.93.105) 14.582 ms
68.86.95.185 (68.86.95.185) 18.711 ms
pos-0-1-0-0-cr01.portland.or.ibone.comcast.net (68.86.93.109) 14.648 ms
7 pos-1-7-0-0-cr01.seattle.wa.ibone.comcast.net (68.86.85.109) 14.971 ms 13.591 ms 13.087 ms
8 te-3-2.car1.seattle1.level3.net (4.79.104.105) 14.353 ms 14.662 ms 14.563 ms
9 ae-31-51.ebr1.seattle1.level3.net (4.68.105.30) 25.328 ms 20.115 ms 17.439 ms
10 ae-7-7.ebr3.sanjose1.level3.net (4.69.132.49) 37.199 ms 38.963 ms 35.658 ms
11 ae-73-73.csw2.sanjose1.level3.net (4.69.134.230) 35.853 ms 41.441 ms 35.956 ms
12 ae-33-89.car3.sanjose1.level3.net (4.68.18.133) 32.992 ms 35.116 ms 34.360 ms
13 yahoo-inc.car3.sanjose1.level3.net (4.71.112.14) 33.677 ms 35.309 ms 35.993 ms
14 ae-0-d161.msr1.sp1.yahoo.com (216.115.107.59) 33.408 ms
ae-0-d171.msr2.sp1.yahoo.com (216.115.107.83) 80.014 ms
ae-1-d161.msr1.sp1.yahoo.com (216.115.107.63) 34.297 ms
15 et-17-1.fab3-1-gdc.sp2.yahoo.com (67.195.128.73) 37.080 ms
et-17-1.fab4-1-gdc.sp2.yahoo.com (67.195.128.77) 35.420 ms
et-17-25.fab3-1-gdc.sp2.yahoo.com (98.136.16.27) 35.792 ms
16 te-8-1.bas-c1.sp1.yahoo.com (67.195.130.112) 36.362 ms
te-9-1.bas-c1.sp1.yahoo.com (67.195.130.116) 34.918 ms
te-8-1.bas-c1.sp1.yahoo.com (67.195.130.112) 34.479 ms


Here's what an HTTP request looks like:

$ telnet maps.google.com 80
Trying 98.136.42.132...
Connected to maps.l.google.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: maps.google.com

HTTP/1.1 200 OK
Date: Wed, 15 Dec 2010 05:10:15 GMT
P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
Expires: Wed, 16 Mar 1966 12:00:00 GMT
Cache-Control: must-revalidate
Pragma: no-cache
Set-Cookie: _ygms=deleted; expires=Tue, 15-Dec-2009 05:10:14 GMT; path=/; domain=.maps.yahoo.com
Vary: Accept-Encoding
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

10dd
(html escaping by me) HTML/HEAD/TITLE: Yahoo! Maps, Driving Directions, and Traffic.. and the rest of the HTML...


Will keep digging.. Wonder if the DNS address is right from where I am, or if my DNS server has been rogered.

$ nslookup
> maps.google.com
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
maps.google.com canonical name = maps.l.google.com.
Name: maps.l.google.com
Address: 74.125.127.104
Name: maps.l.google.com
Address: 74.125.127.106
Name: maps.l.google.com
Address: 74.125.127.103
Name: maps.l.google.com
Address: 74.125.127.99
Name: maps.l.google.com
Address: 74.125.127.105
Name: maps.l.google.com
Address: 74.125.127.147

[Update- back to normal]

nslookup says:
> maps.google.com
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:

maps.google.com canonical name = maps.l.google.com.
Name: maps.l.google.com
Address: 74.125.127.106
Name: maps.l.google.com
Address: 74.125.127.104
Name: maps.l.google.com
Address: 74.125.127.103
Name: maps.l.google.com
Address: 74.125.127.147
Name: maps.l.google.com
Address: 74.125.127.105
Name: maps.l.google.com
Address: 74.125.127.99

which looks like the original nslookup.

And now this works fine too:

$ telnet maps.google.com 80
Trying 74.125.127.99...
Connected to maps.l.google.com.
Escape character is '^]'.
GET / HTTP/1.1
Host: maps.google.com

HTTP/1.1 200 OK
Date: Wed, 15 Dec 2010 06:50:42 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=0b3839d36a39775f:TM=1292395842:LM=1292395842:S=ogeImsmEEtA3UI9c; expires=Fri, 14-Dec-2012 06:50:42 GMT; path=/; domain=.google.com
X-Content-Type-Options: nosniff
Server: mfe
X-XSS-Protection: 1; mode=block
Transfer-Encoding: chunked

1000


I wonder if I ran my nslookup query too late on the first sequence to catch the glitch.

25 November 2010

onward

My job at Gallup moved me to Omaha in 2003. Perhaps most importantly, I managed to find my wife here. My job treated me well. We found a great place to live: out away from everything, on a lake, with no neighbors, and 20 acres of wooded hills.





Earlier this month, I resigned from my job and accepted one in Seattle. So, now we begin our move..



09 August 2010

I think I got it right..

In my post "How exactly did Comcast win?", I concluded with:

It seems clear, from both the court ruling and the political stance, that the FCC is a operating from a position that needs to be revisited. Ironically, even Comcast seems to think so.


From Google and Verizon's recent joint policy proposal on an open internet, there's a clear push to get the FCC to have the authority to do exactly what they could not do with Comcast:

..because of the confusion about the FCC’s authority following the Comcast court decision, our proposal spells out the FCC’s role and authority in the broadband space. In addition to creating enforceable consumer protection and nondiscrimination standards that go beyond the FCC’s preexisting consumer safeguards, the proposal also provides for a new enforcement mechanism for the FCC to use. Specifically, the FCC would enforce these openness policies on a case-by-case basis, using a complaint-driven process. The FCC could move swiftly to stop a practice that violates these safeguards, and it could impose a penalty of up to $2 million on bad actors.

05 August 2010

An (old) term paper regarding Tor

If you value free speech, you should read about Tor.

After becoming enamored with it, I wrote an acceptable term paper on the project.

15 July 2010

Mailbox 2.0


Our new (custom built) mailbox, replete with paint. And yes- its a leaping dog, all this courtesy of Bruce.

Posted by Picasa

13 June 2010

Panoramic Experiment


Six different pictures shot with a Canon XSi, and an EF 50mm prime lens. White balance set to 6000K (cloudy). Net result, stitched with Hugin.

Organic things (like grass, and flowers and such) that tend to move here and there or have tiny edges that recast shadows in variant ways tend to cause a little bit of trouble, but Hugin does a great job in overcoming them.




16 May 2010

How exactly did Comcast win?


On April 6th 2010, a US Court of Appeals found that Comcast could not be held accountable for a ruling made by the FCC. For some following the whole process, this seemed pretty odd.

As a quick recap, here's how this began:
Initial reports of users having trouble with BitTorrent connections began to circulate on discussion forums around May 2007. Those affected appeared to be Comcast subscribers, and observers began speculating about the causes. A Comcast subscriber named Robb Topolski ran a tool called a packet sniffer3 while attempting to "seed" (i.e., offer to others for download) files on BitTorrent and discovered unexpected TCP RST packets that were causing inbound connections to his computer to die.

The EFF proved that Comcast was injecting packets into sockets that were crucial to BitTorrent traffic. If you've written code that worked over sockets, consider how much overhead you'd require to validate that the transport layer wasn't screwing you. The FCC got involved next:

The FCC determined that Comcast had violated the agency's Internet Policy Statement when it blocked certain applications on its network and that the practice at issue in this case was not "reasonable network management."

What happened next was quite interesting. Here's how Comcast came back (from the same Open CRS document above):

Comcast argues that the FCC does not have the authority to enforce its Network Management Principles and the Commission's order was invalid for that reason.

We now had the following scenario:
  1. The FCC called out a major ISP and said that they were in violation of reasonable network management practices
  2. Comcast responded by saying that the FCC had no jurisdiction to make such a claim and appealed the ruling from the FCC

Here's what Comcast's PR machine signed off with as they went to court with the FCC:

It’s truly sad that the debate around “net neutrality,” or the need to regulate to “preserve an open Internet,” has been filled with so much rhetoric, vituperation, and confusion. That’s gone on long enough. It is time to move on, and for the FCC to decide, in a clear and reasoned way, whether and what rules are needed to “preserve an open Internet,” and to whom they should apply and how. In launching the rulemaking, the FCC said that greater clarity is required, and we agree. Comcast will join many other interested parties in making comments to the FCC this week regarding its proposed open Internet rules. Our goal is to move past the rhetoric and to provide thoughtful, constructive, and fact-based guidance as the FCC looks for a way forward that will be lawful and that will effectively balance all the important interests at stake.
Comcast, the FCC, and "Open Internet" Rules: Where We Stand

Nonetheless, this went to court, and a US Court of Appeals found that Comcast was indeed legitimate in its challenge:

..the Commission relies on section 4(i) of the Communications Act of 1934, which authorizes the Commission to “perform any and all acts, make such rules and regulations, and issue such orders, not inconsistent with this chapter, as may be necessary in the execution of its functions.” 47 U.S.C. § 154(i). The Commission may exercise this “ancillary” authority only if it demonstrates that its action—here barring Comcast from interfering with its customers’ use of peer-to-peer networking applications—is “reasonably ancillary to the . . . effective performance of its statutorily mandated responsibilities.” Am. Library Ass’n v. FCC, 406 F.3d 689, 692 (D.C. Cir. 2005). The Commission has failed to make that showing.


It seems like a US Court just ruled that the FCC doesn't have the authority to tell an ISP not to tamper with subscriber traffic. I hope you're as stunned as I am.

On May 6th, Congressman Jay Rockerfeller and Representative Henry Waxman wrote to the FCC Chairman. Here's an excerpt from their letter [PDF] :

We believe that it is essential for the Commission to have oversight over these aspects of broadband policy, because they are vitally important to consumers and our growing digital economy. For this reason, in the near term, we want the agency to use all of its existing authority to protect consumers...

To accomplish these objectives, the Commission should consider all viable options. This includes a change in classification, provided that doing so entails a light regulatory touch, with appropriate use of forbearance authority.

In the long term, if there is a need to rewrite the law to provide consumers, the Commission, and industry with a new framework for telecommunications policy, we are committed as Committee Chairmen to doing so.

It seems clear, from both the court ruling and the political stance, that the FCC is a operating from a position that needs to be revisited. Ironically, even Comcast seems to think so.

As a populace, it seems like a great opportunity for American citizens that care about their network (which is part of a bigger network) to write their political representatives. Consider for a minute how similar these two are:
  • an ISP that has a monopoly on a subscriber base that chooses to manage traffic sending malicious packets down sockets to disrupt traffic
  • a country that chooses to regulate where your sockets can connect to
A democracy is only as strong (and smart) as the people that participate in it. Now is the time to learn and take a stance on what you think broadband rights, net neutrality and the regulation of the internet should look like. Get educated, start talking about it, and write to your representatives. New laws are going to be made and you've got a ringside seat in being able to shape them.

22 October 2009

Panoramas from Ljubljana and Dubrovnik

Dubrovnik Coast (4 images stitched in Hugin):

Ljubljana, on the river (6 images stitched in Hugin):

01 October 2009

Public/Private Key Math

Heavily sourced from: Cryptography and Network Security, Fourth Edition by William Stallings.

Key Generation

Pick two prime numbers: p and q
p = 7
q = 13
Compute n=p.q
n=p.q
n=7 x 13
n=91
Compute the Euler Totient of n: Φ(n) = (p-1)(q-1)
Φ(n) = (7-1)(13-1)
Φ(n) = 6 x 12
Φ(n) = 72
Pick an integer e, such that the greatest common denominator between Φ(n) and e is 1, and e is greater than 1 but less than Φ(n)
gcd(Φ(n),e)=1 and e>1 and e<Φ(n) gcd(72,e)=1  Choosing e: 5 
Determine the value of d using the formula:
de mod Φ(n) = 1
dx5 mod 72 = 1

Possible values for dx5 need to be 72*(some integer) + 1:
73 (won't work)
145 (that will work)
145/5 = 29

Plugging into:
dx5 mod 72 = 1
29x5 mod 72 = 1

d = 29
With d, e, and n computed, we have our keys:
Public Key:  KU = {e, n} = {5, 91}
Private Key: KR = {d, n} = {29, 91}
Encryption and Decryption

Now, we're ready to encrypt. Assuming plaintext M, we compute ciphertext using the formula: C=(M^e)mod(n)
Assuming plaintext M=10
C = (M^e) mod(n)
C = (10^5) mod(91)
C = 82
Compute 10^5 mod 91 via wolframalpha.

Decryption uses the formula: M=(C^d)mod(n)
C = 82 (from above)
M = (C^29)mod(91)
M = (82^29)mod(91)
M = 10 (that worked!)
Compute 82^29 mod 91 via wolframalpha

What's remarkable is how monstrous the math gets using relatively tiny prime numbers to start with. We started with 7, and 13 to create our keys, and our final computation (the decryption) required us to compute 82^29, which is:
31666620625027474232451213268613396669946986162166956032
Our keys, were of a really trivial bit-length {5,91}, and {29,91}. Consider that most asymmetric algorithms talk about keys that are of lengths greater than 1000 bits. Now consider what the size of the exponents may look like, and the corresponding products which need to be modulo divided.

10 August 2009

Dilbert meets Hobbes

Today (sadly), I was forced to use a laptop running Windows.




  • I connected a mouse to it (using a USB port)

  • The hardware drivers kicked in and the mouse started to work

  • I used the mouse to move, and click on a window

  • Windows informed me that a mouse had been detected and installed (after I used the aforementioned mouse to move and click on something)

  • This informative dialog stole the focus from the application I was using, after I used the mouse it so eagerly wanted to let me know it had found

  • I have dogs that are better behaved, and far, far more intelligent



Sigh. Pull my teeth out with rusted pliers and pour some salt on whatever is left. If you love eating shit, then..

08 June 2009

Constant Time Add Operations

I had to write a paper recently, and I opted to analyze the seemingly trivial constant time add operations on two different Java list implementations. Guaranteed to bore you to death: List Add Operations.



Updated (18 June 2009) link above should work.

05 April 2009

insert performance variance

Disclaimer: I've done some research here based purely on measurement and assumed use cases. The performance discrepancies shown are on very large data volumes (1 million elements), so the findings may or may not be applicable.



Here's the premise under which I started searching for measurement:



  • I see Sorted collections, specifically TreeSet objects being used rampantly to maintain an ordered set of data

  • Typically, the ordering is comparison based (driven by the object implementing Comparable)
  • Often, the contents of the collection, once populated, are not tampered with

  • A frequent use of the contents of the collection is to iterate over it in sequence



Considering the above, it seems like we (I know I've done this) generally feel comfortable incurring some cost upon adding elements to a collection in order to be able to recover them in sorted fashion quickly. The specific cost of insert time is log(n) where n is the number of elements already in the Set. For a clean explanation about why the cost is log(n), read about Binary Search Trees.



Here's what my dilemma is though: add operations on lists cost very little (a constant for all practical purposes). And sorting on a list that can manage a swap operation quickly is likely to be very fast too. A simple QuickSort should theoretically be able to accomplish n(log(n)) performance if the data is reasonably well distributed.



So the question that I wanted to tackle was: For large enough data sets, would it be quicker to get a sorted collection by adding data to a simple list and then sorting it, or would it be quicker to work with a data structure that sorts with each insert? I decided to play with the ArrayList and TreeSet to dig into this.



Here's the ArrayList code:



ArrayList<Long> arrayList = new ArrayList<Long>();
Random r = new Random(1l);
long start = System.currentTimeMillis();
for (int x = 0; x < 1000000; x++) {
long l = r.nextLong();
arrayList.add(l);
if (arrayList.size() % 10000 == 0) {
long now = System.currentTimeMillis();
System.out.println(now - start);
}
}



Here's the TreeSet:



TreeSet<Long> treeSet = new TreeSet<Long>();
Random r = new Random(1l);
long start = System.currentTimeMillis();
for (int x=0; x<1000000; x++) {
long l = r.nextLong();
treeSet.add(l);
if (treeSet.size() %10000 == 0) {
long now = System.currentTimeMillis();
System.out.println(now - start);
}
}



Here's a graph of the performance:





Not surprisingly, the ArrayList is way quicker. Looking at the cumulative cost though, you get a better picture of the total time it takes to add a lot of data to a sorted vs unsorted collection:





Again, not terribly suprising. But, now let's try and equalize the game a bit. Let's transcribe the QuickSort Algorithm to code, and then run it on the ArrayList after we've added everything to it. Here's the QuickSort:




private void sort(List<Long> arr, int start, int end, int d) {
if (start < end) {
int pivot = start;
int newPivot = partition(arr, pivot, start, end);
sort(arr, start, newPivot - 1, ++d);
sort(arr, newPivot + 1, end, ++d);
}
}


private int partition(List<Long> arr, int pivot, int start, int end) {
long pivotValue = arr.get(pivot);
swap(arr, pivot, end);
int newPivot = start;
for (int x = start; x < end; x++) {
if (arr.get(x) <= pivotValue) {
swap(arr, x, newPivot);
newPivot++;
}
}
swap(arr, newPivot, end);
return newPivot;
}

/**

* Helper to manage a 3-op swap
*/

private void swap(List<Long> arr, int from, int to) {
long tmp = arr.get(from);
arr.set(from, arr.get(to));
arr.set(to, tmp);
}

public void sort(List<Long> arr) {
sort(arr, 0, arr.size() -1, 0);
}



And, tweaking the ArrayList insert code to leverage the sort:



ArrayList<Long> arrayList = new ArrayList<Long>();
Random r = new Random(1l);
QuickSort qs = new QuickSort();
long start = System.currentTimeMillis();
for (int x = 0; x < 1000000; x++) {
long l = r.nextLong();
arrayList.add(l);
if (arrayList.size() % 10000 == 0) {
long now = System.currentTimeMillis();
System.out.println(now - start);
}
}
qs.sort(arrayList);
long now = System.currentTimeMillis();
System.out.println(now - start);



Our performance numbers are:



Even with the separate sort, costing n(log(n)), the ArrayList won handsomely (a factor of approx 20%). Granted, the quicksort wasn't very general, but this does seem to raise a few questions. Perhaps for large volumes, this is a viable strategy?

Mailboxes and Dogs

From a few weeks back:



It appears that someone decided to drive over our mailbox. I'm not sure what the state of their vehicle is currently, but it can't be great. Bruce (our neighbor) has set about building a brand new mailbox (post included), and from what I can tell, there's no wood involved- just loads of metal.



Party on..



A few weeks back, when the weather was better, we had our neighbors over for brunch. Dogs are always welcome.

12 January 2009

Mowgli

Read this news article first: Omaha Woman Rescues Dogs from Streets of Mumbai



Mowgli is one of the four puppies from the trash bag, and he now lives with us:


06 August 2008

Radiohead rules

Like many other people, I saw that Radiohead had created an interesting music video for House of Cards with all sorts of visualizations. From what I read, they had sampled visual data using Lidar. Substantial portions of the data used in constructing the video are available (as is the music) to the general public. The House of Cards group on YouTube showcases how a number of people have re-run the data through various visual engines.



As you may notice, most of the videos on YouTube use some form of 3D engine to visualize the data. The data is structured fairly simply in the CSV files with x, y, and z coordinates, as well as an intensity level for each point.



Problem: I'm not adept (at all) with anything 3D based. So, I decided to see if I could kludge my way into trying to create a visualization of my own using what I know. Er.. All I know is Java and Graphics2D.



For rendering data, I just used a simple linear scale to position the x and y points. Each point was merely a filled circle. I plotted all points in white. The intensity value on each point drove the alpha values on each point. Lastly, I used the z value to control the size of the point- closer z values got larger points. Here's what I got for starters:





Some tuning in point size, and changes in colors to prevent it from looking too scary:





Anyone know an easy way to sequence some 1000 images into a decent video? I can't seem to get iMovie to have a delay between images of less than .3s, and the actual frames need to be rendered out at 30 frames per second.



*Follow up:* Meant the attach a larger copy that shows the patterns generated by the circle size and alpha variations:



04 August 2008

Broader thinking

Steph decided to take a horizontal sequence of pictures on her camera when we were up in the Rocky Mountain National Park. The goal was to stitch the images into a panorama. The last time I did this, was back in 2001, gluing together the Manhattan skyline (World Trade Center buildings included). That was done mostly with gimp, if I recall right.



Meet Hugin- a gem of a tool that does all the hard work needed to assemble a panoramic blend of pictures. The image below, cobbled from some 7 shots took around 3 minutes. Just be sure to preserve your Exif information as you get your pictures together since Hugin can use them to drive a massive amount of automation.





Hugin is an open source application, and it leverages the libpano suite. The value it provides is really outstanding. Moreover, the community behind Hugin seems to be adding value in raw photographic know-how on their blog: panospace. Kudos to a great app, and the community that powers it.

13 July 2008

Need bicycle porn?

Or a house? Look no further.

Lightning and a Moth

Some of the storms in early June had such a high density of lightning strikes that it turned out to be easy enough to catch a couple of strikes. My location left a lot to be desired, and I kind lacked the courage (or funds) to subject myself and the camera to the worst of the storm. Here's what I got:





Towards the latter part of June, Steph saw this moth and took some photos of it. Note the fur all over it, and the fern like antennae. Does anyone know kind of moth it is?