Saturday, December 20, 2014

Oh Sure, It Doesn't Look Like Much

... but it took a little effort to parse the text on the California rainfall page into a table with the names of the cities and their percent of normal rainfall totals to date from this year and last. I used PHP Simple DOM Parser to scrape the page and then dealt with the results as a string. It turns out that NOAA didn't make a table of results, the lazy dogs, and instead just used the "pre" HTML tag to create what looks like a table on their page.


CRESCENT CITY9040
EUREKA13136
UKIAH16418
REDDING17031
SACRAMENTO EXEC AIRPORT20536
SACRAMENTO - CSUS1650
SANTA ROSA17318
SAN FRANCISCO20629
SFO INT'L AIRPORT22826
OAKLAND AIRPORT19134
LIVERMORE21152
MOUNTAIN VIEW - MOFFETT26132

Next up - creating a MySQL table and inserting these values into it. Then we'll create a chron job to do it on a daily basis and after that, it's time to look into graphing them.

Friday, December 19, 2014

What Invention Has Made Us More Money Than Any Other?

The printing press because it allows us to print more and more and more money!

Japan is in recession. Europe is in recession. The Ruble has collapsed because oil prices have cratered so Russia will soon be mired in a depression. Does this spook the markets? Only temporarily. As soon as the Fed revs up those glorious machines and shows a willingness to make sure lots and lots of dollars are available to everyone, we can all get back to the business at hand - making money in the stock market.

Oh, sure, in the old days, a share of stock represented partial ownership of a company that made things. If the company did well, you did well. If the company did poorly, then you lost money. That's not so true any more. Now it represents ownership of a piece of paper whose value can go up and up and up because there are so many dollars floating around looking for something to buy to make more dollars which will make people richer, giving them more dollars to buy pieces of paper that will be worth more dollars because there are more dollars trying to buy them. See how it works? It's all about having lots and lots of dollars, thanks to the printing press at the Fed.
Stocks in Japan and Australia led Asia higher for a second day on Friday, as investor confidence continued to be bolstered by expectations the U.S. is in no rush to raise interest rates.

Buying returned to the region despite lingering worries over lower oil prices. The Nikkei Stock Average jumped 2.4% to 17621.40, while Australia’s S&P/ASX 200 closed up 2.5% to 5338.60.

Materials and utilities stocks led in Australia, as the latest indications from the U.S. Fed appeared to overshadow concerns that lower commodities prices would pressure the nations’ producers.
Emphasis mine. Commodities are real things. Chunks of metal, whole cows, containers full of oil and other fluids. Even they cannot stand in front of the power of the printing press. Just when it looks like things will be valued according to their worth, the Fed steps in, shows off its printing press like Vanna White unveiling a new puzzle on Wheel of Fortune and all is right with the world again.

Hooray for the printing press!

Thursday, December 18, 2014

The Best Online Quiz Yet

New blogging friend leucanthemum b from Composite Drawlings, has this quiz displayed on her sidebar. She came out as a daisy. My snapdragon has this description:
"Mischief is your middle name, but your first is friend. You are quite the prankster that loves to make other people laugh."
The best part of this quiz is how well it hides the answer. The questions don't tip off which way the results are going to go. I loved it. 5 minutes of clicking for a smile? That sounds like a good trade to me.

I am a
Snapdragon

What Flower
Are You?

Wednesday, December 17, 2014

Dreamweaver Templates And A Family Home Page

To recap where we are with my project to learn web server creation and maintenance as well as web content creation:
  • There's an Ubuntu server running as a virtual machine on a Windows 7 box
  • Said server runs a LAMP stack (Linux, Apache, MySQL, PHP)
  • We've got Adobe Creative Cloud
  • We've got both the FTP and SFTP connections to the server working in Dreamweaver
The goal is to master creating content with Creative Cloud apps and post them to a web server. Adobe makes this very easy.

Dreamweaver now has site templates that give you a sample site which you can edit as you see fit. It's not the same as creating one from scratch, but as I have no design training, they're great for me. I can lean on their proportions and artwork while I play with creating the content that lives inside.

My current idea is to create a home page on the server, only accessible from within the house, that has various sub-sites which do interesting things. Here are some of my ideas:
  1. Daily scrape the California rainfall totals and plot Percent-of-Normal charts for a couple of California cities
  2. Blend Google Music and our family photos so we can play music while a slideshow runs
  3. Blend Pandora and our family photos to do the same thing
I picked out a template that gives me some basic navigation and have created a site on the server using it. I've stored my files on Creative Cloud so I have access to them everywhere and can edit them from any machine on the Internet. There are so many things to do now that as soon as I uploaded the site and had Dreamweaver working with the server, I sat paralyzed momentarily as to what to do next.

I think the first thing I'm going to tackle is the California rainfall totals chart. I've scraped web pages before with a PHP DOM parser, so I've got a start on that. The project will require me to learn MySQL databases to store the data and some kind of javascript graphing library. Here's the way forward now:
  1. Scrape the rainfall page and create an HTML table with the results for a single day
  2. Design and create the database table for the daily data
  3. Create a chron (regularly scheduled) job on the sever to scrape the rainfalls page and insert the data onto the table
  4. Find a javascript graphing library and plot the data
  5. Profit!
How Step 5 will be achieved is still a bit murky, but I'm sure we'll get there somehow.

Monday, December 15, 2014

Manchester United Is The Best Team In The EPL Right Now

By the time I tuned in yesterday, it was already 1-0 ManU over Liverpool. It ended 3-0 and while there were some freak saves and near misses that kept Liverpool from picking up a goal or three, the scoreline did tell the tale. ManU, after repeated zombie performances earlier this season, is having fun even against top flight sides like Liverpool. Check out the scoring.


Topic change. This morning, I mastered the vsftpd.conf settings that allow Dreamweaver to upload web-readable files to my new Ubuntu server. For security, the default umask setting prevents anyone but the owner from reading uploaded files and a quick change has my sever ready to go for full Dreamweaver experimentation.

Topic change. Yesterday, I pulled the last of my late season tomato plants. They never produced. Instead of throwing the plant away, I dug a shallow trench, stripped off the unripened fruit and buried the rest of the plant so it could rot underground. I'd heard this was a great way to recapture some of the nutrients the plant had ingested from the soil.

Topic change. Meanwhile, over at Trigger Warnings, there's a post about microaggressions. Some socially nearsighted researcher is asking for people to find times in their lives when they've experienced ... oh, what the heck. Just go read it yourself. The study (not Trigger's post) is a complete waste of time. That's probably the saddest part of our obsession with hurt feelings. While I spent the weekend thoroughly enjoying sports and gardening and learning about Linux, these people spent it talking that time when someone asked where they were from.

Sunday, December 14, 2014

Watching MSNBC Is Worth 20 Melanin Points

Last night, I went to a BMW-related party where a guy was sneering at how "white" you were if you watched Fox News. The guy's skin looked like a clean sheet of printer paper and he spent his time crewing on racing yachts around the country when he wasn't jawing about the latest Beemers.

Right.

... but since he votes for liberals, he's not considered "white."