Sunday, 3 February 2013

annoying computer stuff

This morning I found that networking (internet connection) wasn't working on my Ubuntu VM. Eventually (by the afternoon) I managed to fix it by using Synaptic to uninstall open-vm-tools (and similar packages), then restarting. After I had it working, I installed them again and networking went down again, but then after restarting again, it was okay. Strange.

I'm not sure what they do anyway, as copy / paste still doesn't work between the VM and the host OS.

In the afternoon I did a little work on my pog website. I had an error like:

Warning: require_once(mynamespace/Exception.php): failed to open stream: No such file or directory in /path/to/files in file.php on line XX

I had decided to try using namespacing when rewriting a bit of my site's code into classes. But what I hadn't thought of / realised is that of course when you are in that namespace, any new objects you try to create will be resolved relative to the current namespace, unless you specify an absolute path, e.g.

namespace mynamespace;
class myclass{
 public function wrong(){
  //tries to create a new /mynamespace/Exception object
  throw new Exception();
 }
 
 public function right(){
  //will create a new global namespace (normal) Exception object
  throw new \Exception();
 }
}

I did some reading, and it seems that namespaces are only really a good idea for frameworks, classes you might want to use in multiple projects, or large projects. I also didn't realise that all constants and functions will attempt to resolve to the current namespace, and then fall back to the global namespace. So I would guess this should be slower than just working in the global namespace. So I think I'll change my code back to not using a namespace.

Saturday, 2 February 2013

Not much

I spent a lot of this morning just reading a forum thread Is Street Photography an Invasion of Privacy?.

I also fixed the manual adapter for my OM10, which was previously very stiff. I found some very good instructions on how to do it here: MANUAL ADAPTOR... ARRRRRRGGGGHHHH!!! It's very simple really:

  1. Make a note of current setting on the adaptor
  2. Undo the screws on the back of the adaptor then pull in half.
  3. Squirt WD-40 on the rear of the front-half of the adaptor
  4. Turn dial a few times, then clean up WD-40.
  5. Put dial back to previous setting, then put the adaptor back together again.

Works really well.

In the afternoon I went out on a walk with Mauser and Bo. We got stopped by a policeman who said there had been a incident in Lubenham, so he wanted to take our details. So I gave him my details and took his collar number.

In the evening I watched an episode of Idiot Abroad and David Roberts with Billy and Bo, then did an Island Lap with them.

Friday, 1 February 2013

Now how did that fit in?

This morning I prepared my pog website update for Sunday.

Then I started reading the OM10 manual and cleaned the camera. When I took the lens off to clean it, there was a big bit of black stuff inside it (like a small flake of paint or plastic that had peeled off. So I started to take the lens apart to clean it.

After lunch I carried on with my lens cleansing operation, but realized that actually the dirt appeared to be nearer the front of the lens than the back (which is what I was dismantling). Looking carefully at the front of the lens, I saw two small slots that looked like you were meant to put tweezers in them to be able to unscrew the front.

After doing some googling, it did appear that the front of the lens could be unscrewed. However, when I picked up the lens I noticed an aperture blade was now loose inside the lens. Oh dear...

After a bit I managed to get the front of the lens open and take all the aperture blades out, then fit them, and put the different bits together again. Putting each bit together again too me ages as I always couldn't remember how bits fitted together.


Pretty sure the aperture's not meant to look like that

Dismantled lens

Putting the aperture back together

By the end of the afternoon, I had managed to successfully put the lens back together again. There were a couple of issues though. One was that the DOF preview button would stay stuck down (and the aperture stay closed) when the rear of the lens was screwed on tightly.

The other issue was that a couple of bits had fallen out of the lens while I was taking it apart. They were used for the aperture click stops, so I thought Never mind, I'll get a stepless aperture lens as a bonus. But when the lens was mounted on the camera, the aperture would always drift to f/16.

So I had to undo the lens again, put the aperture click bits back (very fiddly), then put the lens back together again. At least if I want a stepless aperture 50mm lens in the future I know how to get one.

In the evening I watched An Idiot Abroad, David Roberts, and did an Island lap with Mauser and Bo.

Thursday, 31 January 2013

I am very slow at article writing

The last two days I spent just writing two articles for my photo tips website. And I didn't even finish them!

I spent this morning finishing them off and scheduling the posts.

In the afternoon and part of the evening today I made some chocolate cupcakes. I haven't tried them so I don't know if they're any good yet.

I also caught up on my email a bit and watched the first episode of An Idiot Abroad with Mauser and Bo.

Friday, 25 January 2013

Workity work

Yesterday I wrote a javascript to add umlauts to text. I had a few issues. One was that the umlauts were appearing next to the letters instead of on top of them. I found this was a bug with the Courier New font, which is used as the default font for textboxes (on Chrome in Win7 anyway): Re: problem with combining diacritcs in HTML5

Next I had a problem with getting an error message about

$ is not defined
(I was using jQuery). But when I paused the script in the console just before the error, I checked the value of $, and it was defined. This had me stumped for a while.

The error actually was correct, it seems that the default wordpress themes (twentyeleven and twentytwelve themes) don't include jQuery. (Quite sensible not to include a js library if its not needed). The reason that $ appeared to be defined in Chrome's console is that the console has some built-in js it loads, which includes $ for selecting elements (with jquery style syntax I think). So $ was defined in the console, but not in the actual page (and $ wasn't jQuery). The solution was simply to create a child theme that enqueued jquery in the functions.php file.

Another problem (that I haven't fixed) is that Korean, Chinese characters etc. don't appear to have the umlauts added correctly. I am pretty sure that this is another issue to do with the textbox or font used.

Today I was mostly working on an article for my photo tips website. (I was doing some of that yesterday as well).

Wednesday, 23 January 2013

Writing

Last few days I have been mostly just working on blog posts for my photography tips website. It takes me so long to write an article and then find photos to illustrate it!

I also took some photos of birds in the garden a few days ago. I tried arranging the wheely bins and then hiding behind them as a hide. But the gap between the two bins was too large. The birds would fly down to land, spot me between the bins, and then change their mind and fly off.

I got this photo of a sparrow sitting in the hedge while I was just standing up normally. It's the best photo from that day, but has also been cropped quite a bit to make the sparrow larger.

From 2013-01-21 Garden birds in the snow

Friday, 18 January 2013

Watching and feeding birds

It started snowing this morning around 9.30-10.00am, and then snowed most of the day. It was only very fine snow (not large flakes), but managed to build up throughout the day. Other areas of the country got a lot more snow, and I think even around us the hills got more snow (we are in a valley). But we must have had at least a couple of inches worth.

In the morning I wrote an article for my photo tips website. Unfortunately I still need to take some photos to illustrate it, so it is only really half finished.

In the afternoon we ran out of bird food, so I went down to the shops in the snow. Mealworms are really expensive, £2.50 for 100g - i.e. £25/kg. When I got back I gave some more food to the birds, and they ate it pretty quickly.

We have lots of blackbirds, sparrows, and starlings. The blackbirds are almost constantly in the garden, while the sparrows and starlings alternate between the garden, the hedge, and next door's garden. Wood pigeons and collared doves visit a few times a day. Today we saw two redwings as well.

I mixed up the different bird foods I'd bought then put some out for them, but they didn't seem very interested after that. So I brought the saucers back inside to avoid them becoming covered with snow. I'm sure they'll be happy to have them out again for breakfast tomorrow.


Different bird foods

Put bits of different ones into a tub

Mix around and it's like a posh birdfood, but cheaper

The mixed birdfood is popular with all the birds. It has mealworms and sultanas in for blackbirds and other fruit / meat eaters, and seeds for sparrows and other seed eaters. I think the pigeons and collared doves probably eat anything.

In the evening I watched an hour of Mahabarat. The king of Indraprast (can't remember what his name is) was a total maniac and gambled everything away even when it was obvious that he would loose. Then the king of Hastinapur gave it all back to him. Indiantastic.

For the rest of the evening I did a little bit of work on the CTH website, and some more debugging of why wp_cron wasn't working on one of my wordpress sites. I also watched Ray Mears' Wild Britain.