Saturday, March 29, 2014

Bob's Junkmail #227


YesScript, NoScript

It really irritates me when I'm reading something on the internet and a flyover window comes across and blocks my view. I also am not a fan of animated sliders for ads and menus. They can be good as an integral part of a site, such as on Joshnewmandesign.com . However, it's really dumb in a menu or advertisement, when text scrolls away while you're reading it, or if you have to wait on it to scroll away when you're ready for the next page.

Companies use these things a lot because (a) they're easy to implement on a web site, (b) they look cool in a presentation to management, particularly when management doesn't use the site, and (c) some companies don't care what users think because their customers are not their users. Their customers are companies to whom they sell their users' data.

I started to go on a rampage and destroy all the web sites I find offensive. Well, offensive in design, not content. I do have a limited lifespan. But I opted to leave the internet intact and change my web browsers instead.

With Firefox, I use Yesscript. Yesscript gives you a button you can click to disable Javascript on a site. Javascript is the source of most of the over-animated slideshows and flyover windows. Whenever one of those things intrudes onto my screen, I zap Javascript for the site, and it remembers not to load Javascript on that site any more.

Javascript is necessary on some sites such as e-commerce sites, financial sites, and chess.com, so it's useful not to disable it in the browser entirely. In fact, a few months ago Firefox removed that option.

I also use Ghostery and Adblock Plus on both Firefox and Chrome.

These trim down the web traffic considerably and keep the display, for the most part, static. A significant side effect is that web pages load a lot faster when they don't have to load all the extra trash.

I picked a local TV station, channel 6, for a test. When I load newson6.com without any blocking, it loads 156 files and leaves 50-60 cookies on my computer. This is by loading the front page only, and before clicking anything. That's a lot of junk!

You can block the majority of the garbage -- ads, marketing scripts, etc., using the Firefox or Chrome extensions Adblock Plus and Ghostery. I don't use Internet Explorer or Safari, but there is probably something similar for them.

Adblock Plus is particularly useful. I hear people complain about ads on Facebook, for example, but I've never seen one. Slashdot offers me a checkbox to stop ads, as some kind of valued user, but I don't see any ads to begin with.

I don't see ads on the Weather Channel's site, but it's full of Weather Channel links to things like the world's largest prairie dog (?). I've changed to NOAA's weather site. I like it a lot better. Works fine without Javascript, and has no ads.

      http://weather.gov

      http://forecast.weather.gov/zipcity.php?inputstring=74361

      http://forecast.weather.gov/MapClick.php?lat=36.30000...


New Goodyear Airship

      A13_1583.jpg

The new Goodyear blimp flew for the first time on March 17. Except it's not a blimp any more, because it's no longer a balloon. It goes a lot faster, too -- 73 mph.

      http://www.goodyearblimp.com/cfmx/web/blimp/basics/comp...


Project Euler

Do you need some remedial math, or fun with programming and numbers? Check out Project Euler. There are 464 math problems (as I write this), with a new one each week. Most require some programming to solve.

Most also require a little brainwork, although I have been known to use brute force programming alone. It's a little like working on a car -- sometimes there's just more satisfaction using a hammer.

All in all, they're pretty fun. I did over a hundred of them around the first of the year. Then I got distracted with some other stuff.

I decided to try out the Python programming language on some of these problems. It seems like a decent language, but there are some definite weirdities.

for i in range(1,10):
     print (i)

For example, this prints the numbers 1 through 9, not 1 through 10. Indentation is used to designate blocks for "for" and "if" statements. Data typing seems very loose to me. And there are ways to use awful syntax that is incomprehensible to almost any human that didn't write it.

Even so, there are some good math and list handling features. Python is also pretty good for programming internet communications, and has the advantage of being free and somewhat portable.

The execution speed of Python is a little slow. I wrote a simple program with a lot of iteration in Python and VB. The Visual Basic version took about 1 second to run, and the Python version took about 2 minutes. Apparently this is just due to the slow Python interpreter.


We're Here to Protect You

The U.S. Government is here to protect us. In order to do that, they would like to spy on us. Edward Snowden was appalled at this. So was I, but I didn't work for the NSA. Last May Edward publicized some information about spying that the governments of the U.S., United Kingdom, Australia, Canada, and New Zealand are doing on their own citizens. He left the U.S. for Hong Kong in order to avoid prosecution over this, and eventually ended up in Russia.

A leak normally is not be a big deal, but this time there was quite a lot of information. Tens of thousands of classified documents. And it seems to be accurate information.

At first, people were demanding that Snowden be prosecuted for treason. As time passed, though, many people lightened up on that and decided that Snowden was right, at least partially, and some folks at the NSA should be prosecuted for breaking a whole bunch of laws, not to mention the U.S. Constitution.

This has been in the news so long that many people are getting numb to it, and you're probably not even reading this sentence any more. However, the documents keep coming out, and they keep making the NSA and CIA look like they're out of control. I think this may be because they are.

      http://www.techdirt.com/articles/20140327/08140826708/t...

NSA-photo-by-Trevor-Paglen.jpg

Some people in other countries agree. IBM, Microsoft, Google, and other tech companies are taking a big hit because international corporations and governments assume, probably accurately, that anything they do in the U.S. or with a U.S. company will be disclosed to the NSA and CIA.

      http://www.nytimes.com/2014/03/22/business/fallout-from...

I'm not sure whether these two organizations are still part of the U.S. government. They defy Congress, the U.S. Courts, and the executive branch of the Government without being prosecuted or even forced to abide by the law. I'll spare you the details, but I'm not exaggerating.

Anyway, they are here to protect me, along with the U.S. Department of Homeland Security and the FBI. Why the FBI, you might ask? Aren't they a law enforcement organization? Not so much, any more. According to the FBI, the primary mission of the FBI is now national security rather than law enforcement.

Homeland Security, with a quarter million employees and unlimited budget, has begun funding local SWAT teams and equipment.

The FBI is a little new at the national security game. Terrorists are the official threat du jour to us commoners. The problem is that it's hard to find a real, live, legitimate terrorist running around in the U.S. Sure, we get the occasional bomber or mass shooting, but they are technically not terrorists. They're usually mental cases, or recreational pyromaniacs.

The Boston marathon bombing could be called a terrorist attack, but it was just a couple of individuals with no apparent political or revolutionary motive. I think they just wanted to blow up people in the Evil Empire. Oh, wait. Maybe it was the Axis of Evil. No... Was it the Great Satan? It's hard to keep up with who to hate. At any rate, I'm not sure whether these were just two brothers who happened to be religious zealots intent on blowing up infidels, or bona fide terrorists. Was it plain old religious cleansing, or terrorism? It brings to mind the good old days of the Salem Witch trials, the Spanish Inquisition, or the Crusades.

Since terrorism sells the news, news organizations rarely correct a politician who labels anything "terrorism". One U.S. Representative said after a plane crash caused by a defective rudder, "Until we have evidence otherwise, I will consider it terrorism." A few years ago the U.S. Government launched a publicity campaign claiming downloading pirated music is terrorism.

But the terrorist pickings are slim in the U.S. The NSA is happy to claim credit. After all, if they didn't read my email there would be terrorists everywhere!

So the FBI is all fired up to nail some bona fide terrorists, but they can't find any. What to do? They make their own plot and sucker a Moslem zealot into carrying out the fake plot with fake explosives. To quote Mike Masnick, they've done this "over and over and over and over and over and over and over and over and over and over and over."

Meanwhile, the Department of Homeland Security, through its wholly owned subsidiary Immigration and Customs Enforcement, is in the business of taking down web sites and other internet censorship projects, both inside and outside the U.S.

      https://www.ice.gov/news/releases/1312/131202washington...

      http://www.thewhir.com/web-hosting-news/website-owner-c...

      http://www.websiteblocked.com/

      http://www.cnet.com/news/u-s-seizes-sites-linked-to-cop...

Immigration and Customs is also cracking down on people wearing Google Glass in theaters and Child Pornographers.

I am opposed to child pornography, but it is ridiculous the way government spokeshumans use the terms "child pornography", "drug dealers", and "terrorists" whenever they (a) want more money, (b) want to do something stupid, or (c) want to justify breaking the law. Yes, I realize these three activities encompass the majority of government activity.

With Immigration and Customs busy shutting down that part of the internet that Hollywood and the Recording Industry oppose, they seem to have dropped the ball on Immigration and Customs. About 15 percent of the people who try to illegally get into into the U.S. make it. The number is 40-55 percent if you don't include those turned back at the border. 300,000 to 600,000 people (depending on who you ask) move to the U.S. illegally every year.

Mike and I were turned back from Poland once. They didn't like our car. We weren't even trying to immigrate.

      http://www.chron.com/neighborhood/pearland/article/More...

President Obama and the House of Representatives have proposed a major reform that allows the NSA to pretty much keep on doing what it's been doing. But people who don't read past the headlines will never know.

      http://www.theguardian.com/world/2014/mar/25/nsa-house-...

I think this must be part of the President's governmental transparency.

      http://www.techdirt.com/articles/20140317/07234226587/m...

Last month the President announced he would end the bulk collection of phone records.

      http://www.nytimes.com/2014/01/18/us/politics/obama-nsa.html

Now he's asking for a renewal of that program. I get so confused!

      http://www.techdirt.com/articles/20140327/07013326704/o...

Meanwhile, the Department of Justice wants authority to install malware on my computer.

      http://blogs.wsj.com/law/2014/03/27/doj-pushes-to-expan...

The good news is that hundreds of thousands of dangerous people are on U.S. Government "no-fly" lists, keeping us all safe and sound. Exactly one person has been removed from the list in the past seven years, a grad student from Stanford. Probably a former grad student, since she hasn't been to class for a few years. Her student visa was revoked because an FBI agent name Kevin made a paperwork mistake.

      http://arstechnica.com/tech-policy/2014/03/after-seven-...


Email Spies

Google gets in trouble occasionally for using software to scan emails so their customers (marketing companies) can target their products (email users) with applicable ads.

      http://www.theguardian.com/technology/2013/aug/14/googl...

Not to be outdone by Google or the NSA, Microsoft read the email of a reporter who happened to have a Hotmail (Outlook.com) account. This was a Hotmail user, not a Microsoft employee. Microsoft was trying to find out if one of its employees leaked information to the reporter. So they read the reporter's email, without asking or notifying the reporter.

      http://www.techdirt.com/articles/20140320/11315126635/m...

Most people would consider this very bad manners. Microsoft, however, said they can read anybody's email any time they want, and they called the reporter a whiny baby. Actually, one of their lawyers said this. Must have been hired by Mr. Balmer.

      http://money.cnn.com/2014/03/21/technology/security/mic...

Google has been known to abuse its gmail customers on occasion, but they don't act so proud of it.

      http://uncrunched.com/2014/03/21/google-spied-gmail/

      http://www.edweek.org/ew/articles/2014/03/13/26google.h...

In fairness, Microsoft did finally say, "Oops" about their fiasco.

      http://blogs.technet.com/b/microsoft_on_the_issues/arch...


Microsoft Business

Microsoft would like businesses to enroll in expensive, "enterprise" software licenses that allow the businesses to use Microsoft Office and Windows, and that allow Microsoft to audit the businesses for license compliance. Oddly enough, many businesses don't like this arrangement, particularly overseas businesses.

Microsoft has found a new place to spend its political dollars to help with these sales. They find unsuspecting state attorneys general and convince them to file lawsuits against foreign companies who use Microsoft products without paying enough to Microsoft. These lawsuits are filed on behalf of unsuspecting companies in the state.

What kind of state would do something this stupid? You might guess Washington, where Microsoft is located and has considerable clout. You'd be wrong, however. Try Oklahoma. Microsoft pays politicians in states like Oklahoma or Louisiana to file these lawsuits. Maybe that has something to do with the fact that no state has authority over copyright issues, and they've got to find a really ignorant tough attorney general.

      http://www.techdirt.com/articles/20140317/13003426600/m...

Oklahoma Attorney General Scott said of the activity, "This is not a shakedown of foreign corporations. This is not a waste of state resources to further the interests of an out-of-state company (even though we do have plenty of cash from the education budget cuts). This is merely a fundraising venture for my upcoming 2016 political campaign." Or maybe he didn't.


Windows XP

Microsoft will no longer "support" Windows XP. This means there won't be any new updates after April 8 or so, unless you're running XP on an ATM.

So if you've got XP on your computer, you may want to make sure you have installed Service Pack 3. Other than that, it's pretty much a non-issue. Your computer won't become (more) vulnerable to hackers, all of a sudden. After all, hackers have had 13 years to figure out Windows XP.


Oklahoma, Utah, or Germany

Oklahoma, by University of Utah Singers, at the 11th International Chamber Choir Competition in Marktoberdorf, Bavaria, 2009:

      https://www.youtube.com/watch?v=ltQIR5j9984&index=143


Google Docs Scam

Here is an interesting phishing scam. The scammers host a Google phishing site on Google.

      http://www.symantec.com/connect/blogs/google-docs-users...


Commercial Push

"Would you recommend this product to others?" This is a common question for surveys or rating forms. The reason it's so common is that after someone answers "yes" or "maybe", they are much more likely to actually recommend the product. It's a self-fulfilling prophecy. So I always click "never", even if I give something a good rating. I don't like them trying to manipulate me. A few times there have been follow ups wondering why I wouldn't recommend something, as if I'm obligated to advertise their product for them.

I don't mind this. I just think it's interesting. But Best Western takes the ratings business a little too far. I stayed in a Best Western motel a few weeks ago. They emailed me wanting to know if I was happy with the motel. It was a single "yes" or "no" question. I clicked "yes". After all, they had fast internet, wired and wireless, a good desk chair, and a good shower.

It took me to Tripadvisor.com, where I was asked to rate the motel. Odd. I went back to the email, clicked No, not satisfied. It took me to a private site to rate the motel. They only send people to Tripadvisor who will give them a good rating!

So I rated them on Tripadvisor. I said it was an excellent motel, etc. And I gave it a 1-star rating out of 5 for being deceitful in their email, explaining this in the review. Tripadvisor emailed me a few days later asking if I made a mistake and really meant to give it 5 stars. I guess they didn't read my review.

Maybe Best Western got this idea from Electronic Arts. It's probably patented.

      http://www.techdirt.com/blog/wireless/articles/20140209...


How to Steal a Bitcoin

This information is well known, as are other bitcoin vulnerabilities, so you won't make much money at it. But it is interesting from a security standpoint.

      http://www.palkeo.com/code/stealing-bitcoin.html


Weather is not Climate

Also, climate is not weather.

      http://xkcd.com/1321/


Sliding Land

There was a big landslide in Washington a few days ago that unfortunately killed quite a few people. It was not completely unexpected, however. The area has been unstable for quite some time.

      http://seattletimes.com/html/localnews/2023218573_mudsl...

There was a landslide in Alaska on February 16, as part of Mount La Perouse slid down into a glacier. That slide's volume was about 1000 times larger than the one in Washington.

      http://earthobservatory.nasa.gov/IOTD/view.php?id=83195

      http://blogs.agu.org/landslideblog/2014/02/22/mount-la-...


The Size of Russia

Russia is the largest country in the world, by land area. However, Russia is not quite so big in terms of economy, ranking 8th in the world behind Brazil and ahead of Italy. Russia ranks 9th in population, behind Brazil, Pakistan, and Nigeria.

      http://en.wikipedia.org/wiki/List_of_countries_by_GDP_%...

This is a significant drop from the days of the Soviet Union, when the Soviet economy was second only to that of the U.S.

      http://en.wikipedia.org/wiki/List_of_countries_by_population

      http://en.wikipedia.org/wiki/List_of_countries_and_depe...


Pi

Think of a circle. Think of its diameter. How much bigger is the distance around the circle, its circumference, than the diameter?

The circumference is pi times larger than the diameter. In addition to being a Greek letter, pi is a number, in the neighborhood of 3.14159. A physicist got ahold of Homer's Odyssey in its original Greek, and remarked, "That's the longest formula I've ever seen."

In about 250 BC, the Greek mathematician Archimedes figured out that you could inscribe and circumscribe polygons on a circle, calculate the length of the polygon, and get an upper and lower bound of pi. (He didn't use the term pi.)

Archimedes_pi.png

He did this with a 96-sided polygon and showed that pi is between 3 10/71 and 3 1/7, well within 1/1000.

Close to 500 years later, an Egyptian named Ptolemy calculated pi to be 377/120, or 3.141666...

In 263, Liu Hui from China got even closer with 3927/1250, or 3.1416.

Sometime in the 1300's, a guy named Madhava from Sangamagrama, India, came up with an infinite series to calculate pi. Then he calculated the error after a certain number of iterations.

      pi = 1 - 1/3 + 1/5 - 1/7 + 1/9 - 1/11 + ...

This is called the Leibniz series, the Gregory series, or the Gregory-Leibniz series after the Europeans who rediscovered Madhava's formula.

I thought it would be fun to try this out, so I wrote a program to calculate pi with it. It works! It's not a particularly efficient function, though, requiring more than 300 iterations to calculate pi to 2 decimal places.

Madhava improved the formula to make it converge faster and calculated pi to 11 or 13 digits.

piq1.png
In the mid 1700's, Leonhard Euler wrote some famous math books that used the term "pi" for pi, along with "e" for e, sigma for summation, and "i" for imaginary numbers. A guy named William Jones had coined the term "pi" in 1706, but Euler brought it into wide usage in his books.

In about 1665 Isaac Newton used this series to calculate pi to 16 places, 3.141592653589793.

piq3.png
This can be converted to the following using the Euler Convergence Improvement transformation, although not by me. Beeler published this in 1972:

piq2.png
This is pretty cool, because it's good for writing a simple function to find pi. You can calculate the numerator and denominator separately using big integer arithmetic, and only divide once at the end. This is nice, because division is slow, and floating point is not needed. Here's a sample in Visual Basic:

Function pi2(ByVal nDigits As Long) As String

Dim newover, over, under, q1 As IntX
Dim i As long

over = 5
under = 3
For i = nDigits * 1.33 To 1 Step -1
  newover = (i * i) * under + (2 * i - 1) * over
  under = over
  over = newover
  Next i

q1 = 4 * under * IntX.Pow(10, nDigits)
q1 = q1 / over

Return q1

End Function

This is really fast for calculating pi up to about 2500 digits. On my computer, it takes 6 milliseconds to find the first 1000 digits of pi. Here they are, in case you want to check my work:

3.
1415926535 8979323846 2643383279 5028841971 6939937510
5820974944 5923078164 0628620899 8628034825 3421170679
8214808651 3282306647 0938446095 5058223172 5359408128
4811174502 8410270193 8521105559 6446229489 5493038196
4428810975 6659334461 2847564823 3786783165 2712019091
4564856692 3460348610 4543266482 1339360726 0249141273
7245870066 0631558817 4881520920 9628292540 9171536436
7892590360 0113305305 4882046652 1384146951 9415116094
3305727036 5759591953 0921861173 8193261179 3105118548
0744623799 6274956735 1885752724 8912279381 8301194912
9833673362 4406566430 8602139494 6395224737 1907021798
6094370277 0539217176 2931767523 8467481846 7669405132
0005681271 4526356082 7785771342 7577896091 7363717872
1468440901 2249534301 4654958537 1050792279 6892589235
4201995611 2129021960 8640344181 5981362977 4771309960
5187072113 4999999837 2978049951 0597317328 1609631859
5024459455 3469083026 4252230825 3344685035 2619311881
7101000313 7838752886 5875332083 8142061717 7669147303
5982534904 2875546873 1159562863 8823537875 9375195778
1857780532 1712268066 1300192787 6611195909 2164201989

This series doesn't converge as fast as some others, so it is much slower at higher accuracies. For example, it's 100 times slower at 10,000 digits of pi than at 1,000. It takes close to four hours for one million digits of pi, and almost 16 hours for two million digits of pi. But it's still pretty cool, I think.

In 1981, Kanada Miyoshi used a Fujitsu Facom M-200 supercomputer to calculate pi to 2,000,000 digits. It took 137 hours and 20 minutes.

0043_01_l.jpg

Greg and David Chudnovsky used to live in Ukraine. In 1977, after some serious physical beatings by the Soviet KGB for asking to leave, the Chudnovsky family moved to New York. Greg and David do math research for Columbia University. They have written over 100 papers and 12 books, mostly on number theory or mathematical physics.

      http://www.plouffe.fr/simon/chudnovsky.html

One of their hobbies has been the study of pi. Almost as a side effect, they came up with one of the best algorithms for the computation of pi, called the Chudnovsky Algorithm, published in 1989.

piq5.png
This will converge to pi at a rate of about 14 decimal digits per iteration. It does require some things like a single, large, square root operation. This takes as long as the rest of the computation combined for a large number of digits of pi.

Where the example above took almost 16 hours to calculate the first 2 million digits of pi, a function I wrote for the Chudnovsky algorithm took under 12 minutes to calculate the first 20 million digits of pi.

To put this into perspective, the first time anybody calculated more than 20 million digits of pi was on a Cray supercomputer in 1986, and it took 28 hours.

Cray2_019_8Processor_NERSC.jpg

Now you can write a simple program on an ordinary PC and do it in minutes.

Big integer arithmetic is used for arithmetic on numbers with lots of digits. For example, in calculating 1 million digits of pi, I did arithmetic calculations on numbers more than 2 million digits in length. I used the Bigint library with Visual Studio 2008. Later versions of Visual Studio have a Biginteger class built in, but this ran about six times slower than the Bigint library. The Bigint library also works with Python and other programming languages.

I tried several methods for calculating pi, but these two seemed the best. I didn't bother to optimize anything, used only two threads, and didn't worry about getting around limitations.

However, a guy named Alexander Yee has done all this and more. He wrote a program using the GMP math library and the Chudnovsky algorithm, and did some serious optimization on it. He calls it Y-Cruncher, "from a high-school project that went a little too far."

Last December, using Y-Cruncher, Alexander and Shigeru Kondo finished calculating 12.1 trillion digits of pi, their third record (after 2010 and 2011). It took 94 days on an ordinary but high performance PC, running Windows Server 2012, 128gb RAM, and 22 3-terabyte drives. It had two Intel Xeon E5-2690 CPUs running at 2.9 GHz, with 16 physical cores. The limiting factor was the hard drive space, not the computational power.

Shigeru Kondo also set the record for calculating log(2) and log(10) to 200 billion digits in February and March of 2014.

It's worth reading about:

      http://www.numberworld.org/misc_runs/pi-12t/

I downloaded and ran Y-Cruncher. It is just a little faster than my function. Mine took 12 minutes to find 2 million digits of pi. Y-Cruncher took 7 seconds to find 25 million digits of pi, and 13 minutes 12 seconds to find 2.5 billion digits of pi.

Here are 2.5 billion digits of pi, verified correct.

      2.5 billion digits of pi (Warning: This is a large 1.1 gb download.)

Alexander Yee received a Masters in Computer Science from the University of Illinois Urbana-Champaign in 2013, and now works at Google. He's active on Stackoverflow, with 150K reputation.

      http://stackoverflow.com/questions/13313933/what-is-the...

      http://stackoverflow.com/questions/11227809/why-is-proc...

      http://en.wikipedia.org/wiki/Chronology_of_computation_...


Fraudulent Research?

Fraudulent research? Disgraced scientist? No problem! The USPTO will be happy to give you a patent.

      nytimes.com/2014/02/15/science/disgraced-scientist-granted...


It's the Economy...

How is the U.S. Economy? Stocks up, deficit down.

dow.png deficit.png


Behavioral Detection

The Homeland Security's wholly owned subsidiary TSA has paid about a billion dollars to come up with a "behavioral detection" program to spot imaginary terrorists at airports. It's nice to see my tax dollars going to something entertaining for a change. I must be in the category "odd, but apparently harmless."

      http://www.techdirt.com/articles/20140327/12011526713/t...


NSA Logos

You can now use the NSA logo on parody merchandise. Actually, you always could.

Over the past 2-3 years, the NSA and DHS sent cease-and-desist letters to people selling merchandise with the NSA and DHS logos for parody. The letters were so stupid that everybody used them to make fun of the NSA instead of the merchandise.

nsa-parody.png       nsa.png

(The parody is on the left.)

      http://www.techdirt.com/articles/20140218/12531026270/n...


Pictures of Today!

P1370031.jpg P1370033.jpg
Busy Tower

P1420881.jpg
Scotland Tourists

P1430008.jpg
Scottish Castle (retired)

P1430107.jpg
Scottish Nuclear Reactor (retired)

P1570211.jpg
Whatever happened to NAFTA?

P1570318.jpg
Curiosity...

P1570319.jpg
Josh at White Sands

P1570455.jpg
This hand-cranked German calculator was design for missile computations. It was used at White Sands after World War II.

P1570489.jpg
A portrait of Jake Smid hiking in Colorado. He's moving back to Prague this week.

P1570495.jpg
Windswept.


The End

No comments: