Coding again... It's just over a year since the last time I wrote any Java code. Today I wrote a short little program, doing a little web scraping – and it works. I've forgotten tons of details, but I know the concepts very well (I should, after 15 years of Java experience!), so I'm picking those details up very quickly. Before I could start writing code, I had to renew my subscription for my IDE (JetBrains' IntelliJ IDEA – I love the darned thing). Then I discovered that IDEA doesn't like the default OS X 10.10 Java version – it wants a down-rev (Java 6) because of problems in the later JRE libraries. So off I went to downgrade my Java. That made all sorts of other things complain, and my log was growing at a prodigious rate – had to track down three hateful apps and figure out how to make them shut up. Finally I could try writing some code!
My dumb little program reads a URL to get the HTML content, then parses it with a regular expression to get the three particular parts that I wanted. It took a while, but I got it all working. One of these fine days it will be part of something I want on my new blog: the ability to present third-party content that lives at a URL that varies (typically daily or more often). JavaScript running in the browser is not permitted to look at the HTML of any site other than the one being browsed, so it can't do things like this. My plan is to have a program that runs a few times a day on a server, finds all these content pointers, and then updates an assets file on the blog's server so that information is available to the code running on the reader's browser...
Sunday, January 25, 2015
Progress report...
Progress report... An electrical day. I raided Home Depot for a couple additional ceiling boxes and some LED lamps. Then Debbie and I put up the last two lighting fixtures in the cattery. Those two had the same junky boxes as the first two, totally unsuitable for hanging lamps from. In the process of installing the last two (which are controlled by the same wall switch), I discovered that the switch was miswired – and that it was (like many others in the house) a cheap piece of crap that was only working intermittently. I fixed the wiring and replaced the switch. Then I did the same exact thing in our bedroom, replacing two cheap switches that were operating intermittently. One of them made a delightful sparking sound every time you turned on the lights. Fixed now.
So now the cattery has beautiful bright white (daylight color temperature) lighting, even and mostly free of shadows. Extra bonus: the switches work correctly, both there and in our bedroom. I only have about 150 outlets and 60 switches to go...
So now the cattery has beautiful bright white (daylight color temperature) lighting, even and mostly free of shadows. Extra bonus: the switches work correctly, both there and in our bedroom. I only have about 150 outlets and 60 switches to go...