Android atomics

So today I was looking at the atomic problem again which I spotted yesterday. I traced it in the end on the PC version, it was due to a unsigned int32 being shifted right 32 times, which I would have thought would have made it 0, on PC it doesn’t it seems to shift by the modulo of 32, so 33 would shift 1 etc. After 25 years I still get the odd annoying surprise. Then it was back on to Android, which has no 64 bit atomics. Found a nice big bug in my emulation for them which wasn’t locking the atomic properly. That’s now all working on Android but I want to play around with spinlocks a bit more as it’s a little bit thread happy.

Good news on the mobile game front, it’s been set as ‘ready to publish’, which means it’s been approved by Apple, the only thing stopping it from appearing on the app store is pressing a button and a large room full of lawyers. Wait until Friday then I’ll finally announce what it is.

Walked the dog, went to the gym. She’s off to doggy day care tomorrow. Cleaners coming tomorrow.

Then spent a bit of time pissing around with my favourite subject, pfSense. Jamie was trying to connect 360 to XBox live, of course it’s set to strict NAT. I did try and set it upo for UPNP, it managed to open one port and passed the tests but failed to work correctly. In the end I just set it up with it’s own IP address which worked, but I do really need to revisit it again at some point.

Live fast and die hungry

Started the day with fixing an annoying issue with WAV files. It’s a RIFF file format so the data chunk can be anywhere. The normal thing with WAV files is that you can load the first 128 bytes or so and find everything useful in that. Al of course managed to find a WAV file that contains a nice load of meta data right at the beginning which buggers all that up. So fixed that.

Then started tracing into an issue on Android, I spent many hours convinced it was a problem with string processing but after much digging it’s actually the command queue running out of reservation slots. This is a bit of an odd one as it can only really be added to in two places so it would have to have some seriously odd thread behavior to cause this problem. I’m suspecting some seriously odd thread behavior.

Walked the dog, weather was actually fairly pleasant considering. Went to gym and did combat.

Now this is week two of this fasting test thing. Friday of course got cocked up due to stupid traffic levels so I missed pump. But by this morning my weight had returned to what it was last weekend plus a pound. So basically gained weight. I’ll give it another go this week and monitor it. Today is one of the fasting days, missed bread out of lunchtime sandwich and I’ll miss the sausage roll out of my salad. I have worked out though that I can squeeze in a banana (no sniggering). The only thing I’ve achieved so far though is to become hungry. You may well live longer, but whats the point when you’re starving. So tomorrow I’ll eat the same as today, except for the bread and the sausage roll. I think I’ve got some fruit cake as well. Then Wednesday will be fast day again and Thursday will be a repeat of Tuesday, except that it’s torture porn night, so cheese & biscuits and wine. Exercise wise I will try and keep a fairly constant 600 calories, so on fast days it will exactly cancel out the food intake.

Ever since I bleached the bathroom tiles weeks ago, my nose has been sore and won’t heal, I’ve now resorted to jamming Germaline up it, so now have pink splodge dripping out of it.

It’s a washing machine, it washes clothes, move on

So started off this morning with walking the dog (actually I started off the morning with quite a big poo, but that’s may be a bit too graphic). It rained, it was miserable. Did the shopping. Jamie failed to get me his shopping list by the deadline so he has nothing.

Then I went over mothers as she wanted to get a new washing machine. We went to a place on Gloucester road, they had washing machines. There was also a very annoying young girl there, she must have been about 8, she was going up and down all the machines and opening everything and slamming it shut. I wanted to just beat her to a pulp, then find her parent(s) and beat them to a pulp, they of course weren’t around as they were probably arranging some crack cocaine deal or buying an expensive tea-pot. Mother told her that’ll she’ll break something in a minute, I just glared at her until she looked scared shitless. She’ll have nightmares about that until she’s about 45 and even then she’ll think twice about ever closing a washing machine door. We failed to buy one there. We moved on….to Comet, which was of course closing down. They had stack loads of washing machines at silly 30% off prices, there was a half reasonable one for £180 rather than £300. They would bung it in the car for you. All she had to arrange was getting it out of car and moving in house, now half of the heavy handed brigade was already there. But oh no, rather than save about £150 she just stood there and moaned about how problematic it all would be and that it would have to be plumbed in, and it’s cold fill only and her old pipe might leak….at this point I just walked out. Then on to Curry’s. Where we found a washing machine, amongst about 700 washing machines. They all looked pretty much the same to me. You bung stuff in, add stuff in various drawers, leave it for 3 hours to talk to itself and then remove all the stuff which is now just as dirty as it went in, but smells a bit less like dog. She bought the machine, it’s being delivered next Sunday, they will install it and remove the old one. She will no doubt poor the bastard who delivers it with “I’ve had a Hoover for ten years and never had a problem with it.” By this time the fitter will be diving into his tool box to get a wrench to remove his own kidneys to protect his dignity from listening to so much anal drivel.

I fixed her fucking curtain rail.

Came back, did the accounts. Looked at various Christmas present lists, decided I have no money so didn’t buy anything. Tomorrow I have a fun day of unblocking drains and adding boiler wiring. I may have to reach for that wrench myself. Tonight I’m cooking chicken garlic chilli masala, I need to build up a bit of internal power for the drain cleaning. Nothing like being up to your armpits in the contents of your own intestines, unless you are into self fisting of course.

Holly Hedge

Here’s a really sweet video for Holly Hedge animal sanctuary.

Holly Hedge Animal Sanctuary

Most of today was taken up with finishing off the Android unity files and iOS/Windows PCH for the audiolib. Fixed a couple of other bits along the way.

Walked the dog, she was quite well behaved. Did the washing. Attempted to go to the gym for pump, but failed just at the end of the road as the traffic was backed up everywhere. It appears the M5 was shut due to an overturned lorry and they were diverting all traffic through Bradley Stoke to head to the M32. Cheers. So gave up and came home and finished off my work. The advantage now being that I’ve actually finished by 10 and not 11 ish. Oh well, time for a bath and Friday night wine. Jamie’s buying me pizza tonight. I’m having a ‘Sizzler’, yes I am feeling okay. Tomorrow I’m going washing machine shopping with mother, that will be thrilling.

Rain, Rain, ah just fuck off

Started the day with the news that the mobile game has finally been submitted to Apple. Hopefully be released December 2nd. Fixed an oversight in the audiolib, oversight being that I completely forgot to write a big chunk of code. Then I was working on the Android build tool chain, I think I’ve gone about as far with that as I can, so just need to sort it in all the configs now.

Al asked me to put pre-compiled headers into the audiolib, which is fine, except it’s not a five minute task, 3 hours later and I’m still at it, never mind, gives me a bit of a purpose for tomorrow.

Caught up with my radio consumption for the week, just some serious bangy Dance to get through now. Electrical stuff has turned up for the heating, so now have a queue of jobs for the weekend. Heating electrics, drain unblocking and radiator balancing. Oh, I get all the fucking fun jobs. I’m sure Jamie has some important fapping to do.

Walked the dog, wet route as it was blowing a gale and spitting with rain, which was about as good as it got all day. Went to the gym, ran. Did a home check for a kitten. Ate, caught up with a bit of telly. Now I think I’m going to have a glass of wine and watch some torture porn.

Doggy day care via Venice

The dog actually woke up at about 6:15, so beat the alarm by 15 minutes. She went out and had a poo and got very excited that I poured her breakfast out. Then she annoyed me continuously while I was trying to get dressed. We got in the car be 6:45 and were there by 7. The back road was bloody awful but no sign of massive flooding. Back in bed by 7:15.

Spent the day working on Android debugging with GDB. I now have a batch file which is created during the build stage, which when I run starts up the debugger with full source debugging. So pretty good in the end. Tried a few graphical front ends for GDB, but can’t really get any of them to work reliably.

Lunchtime I went out and ran, which was a first for a hell of along time. All of the nature reserve was flooded up to about 4 feet high. Before I knew it (and after having lunch, it’s a no bread day again today), it was time to pick the dog up. I left at 16:15, by 16:30 I already turned back at the end of the main road due to traffic. By 16:45 I’d turned back again as the back road was now completely flooded. Then sat and queued on the roundabout for what seemed like hours. Finally got there and picked the dog up. Thought I’d avoid the motorway junction by going via Iron Acton, that bit was fine, then joined another queue and then another one. Then got back into Bradley Stoke, had to go from one end to the other in more stop start. Finally got home at 17:50. That’s a journey I won’t forget in a hurry and certainly don’t wish to repeat.

Went to the gym after doing a re-check, quite an odd one that. Then had to spend the evening catching up with work. It’s now midnight and I haven’t even eaten yet. So time for salad with no sausage roll….

pfSense – NAT reflection

Didn’t sleep at all last night, didn’t help when Jamie decided not to go to bed until around 5AM and the dog was busy throwing up. Then the phone went, it was mother, ignored. Got up and spent the bulk of the very horrible day working, well testing the mobile game, I think that’s the last day on that now, back on Android tomorrow I think.

In between testing on iPod I was installing the new pfSense box. Pain in the ass part one. So the pfSense box has no drives, all it has is a compact flash card. So to install pfSense on to it is quite a challenge. So I installed Ubuntu desktop edition to a USB stick, using Ubuntu desktop edition, which is full of bugs as far as writing out an image is concerned. You select the image name in the file selector and then it ignores you and uses whatever it can find. Anyway after getting the bootable image the next thing to do is copy an uncompressed CF image of pfSense to the stick as well. Also copy over GAG boot loader as it doesn’t suffer the PXE boot problem to do with wake on LAN (look back a few months in the blog). So when you have your image, now plug stick into pfSense box and boot it, allow about ten minutes for it to boot. Struggle to find a bash shell, open it and then block copy over the pfSense image over to the CF card using linux DD command. Once that’s done, install GAG and run the install on the CF card, it will moan about GRUB needing installing but it’s already there. Remove stick and reboot. Hopefully you will get the GAG startup screen, add the pfSense partician to the loader and set the timeout to this partician. Once that’s done let the bloody thing boot. Hopefully all will be okay and you can assign the first couple of NIC’s to WAN and LAN. Once that’s done, take your old pfSense config XML file and do a search and replace for all the interfaces and replace all the bge0/re0 stuff with the correct interface assignments. Then restore that file over to the new pfSense box and reboot. Hopefully all will come up and be working, well it was for me….except one thing, there’s always the one bloody thing….

I couldn’t connect to my server on the DMZ from the LAN side, no matter what I did, it just wasn’t happening. It’s all to do with NAT reflection, basically if you try and connect to the web server from inside the LAN it has to send out a request from the LAN IP, via the gateway, out of the WAN interface, then back in the WAN interface, through NAT and then to the server, it then has to make the whole trip back. The only way I could get it to work was to use port forwarding for each of the ports on both server IP’s and then only worked if I used the proxy to do reflection, which basically runs a deamon to ram the packet request back down the same port it came from. This worked, but I wasn’t happy about it.

So went to the gym. Came back after thinking about it, a lot. So I added a firewall rule to log packets from the netbook, just to see where they were going. With the port forwarding and proxy reflection nothing showed up in the firewall log. So I disabled the port forward and I could see the request then going out to the WAN IP address and promptly getting lost in the either. So I enabled normal reflection on the 1:1 NAT, then on the log I could see the WAN IP being translated to the internal LAN IP….and getting lost somewhere in the internal LAN. So had to think about it…there was some guff in the advanced settings about reflection only working if the rules could determine the source interface on rule loading. So then, when the request is generated LAN side it then translates it to the LAN IP from the WAN IP via the NAT 1:1 translation, it then sends it via the gateway, which is the load balancing gateway, so it could potentially send it via either WAN1 or WAN2, then it really is going to have a bit of an issue trying to work out well the hell to reflect it to. So I added a rule to the LAN which was to send all packets destined for the internal LAN IP’s of the server via the default gateway. Bingo. That worked a treat, and thinking about it, it’s the correct solution. So now when a request is set from an internal LAN IP to a WAN IP on the server, it takes the source IP, looks at the destination as that’s a 1:! NAT mapping it translates it from the WAN IP to the internal LAN IP, it then sends that via the default gateway, which then goes through the default WAN (I’m not sure it actually ever gets that far as it really doesn’t need to), goes to sever, server then replies back via the default gateway and gets translated back to the correct IP. Job done. Hours of fun, for which I didn’t have hours for.

Mother sent an email, apparently her curtain rail has fallen down. Sorry, but during the week I have 24 hours in a day, excluding the ones I’m asleep for I still have 37 hours of stuff to cram in. Your curtain poll is not high on my to do list. I still have a load of home checks to do as well. The dog didn’t even get a walk today, as the only breaks I had it was absolutely pissing down. We did have a play with her ball though when I came back from the gym. But she’s off to doggy day care tomorrow, so that’ll make up for it. She’s actually been very good considering, I don’t think she was overly keen on venturing out anyway.

My drain cleaning attachment has turned up for my pressure washer.

Right, well hopefully that’s the last about pfSense now. Incidentally it uses around 17 watts considering the old box was around 85, so that’s a hell of a power saving. Also it’s performance appears to be very good, I was getting some pretty good speed tests results. Right, I’m now finished for the day, it’s twenty to one and I need to be up at 6 to take the dog to paw stretchers. Fun fun.

pfSense – the revenge

So started of this morning with one more tweak to the mobile game, not sure if it’s been submitted to Apple or not yet. Anyway, spent the rest of the day play testing it. No real significant issues that I could see. Thoroughly enjoyed playing it as well.

Decided to try this fasting diet thing, as the only change I had to make to my existing diet to get under the 600 calories was to remove the sausage roll from my salad and the two slices of bread from my lunchtime sandwich, and that was it.

Walked the dog, we did the wet route today as it wasn’t particularly nice.

Went to the gym and did combat. Came back and started to do battle with the new pfSense box. New box is built, this is this nice Jetway board with quad lan. The version of pfSense already on the flash card is the release version and that doesn’t appear to support the new network nics. So I’m now trying to get a version of the nano pfsense on to the flash card. This is turning out to be somewhat problematic. I don’t actually have a machine with a compact flash card interface on it, except for one linux box with one mounted as a sata drive and another one on the new Jetway board. So I’m now trying to install it off a USB flash drive. The good news is the new version does seem to support the NIC’s, the bad news is it won’t actually mount as a file system. So what I’ve done now is install a bootable version of Ubuntu on to the flash drive, I’ll then copy over the cf image to it and then try and write that to the flash card. I still then have to update the boot block as it will no doubt have the old issue with being unable to boot properly from the wake on lan. So lots of fun things to play with ahead.

Wine tasting and drain cleaning, don’t get the two confused

Ok so yesterday started off with the usual process of getting up late. The proceeded to do just about everything backwards. Had lunch then took the dog for a walk. Then did the shopping, on the way back went to John Lewis and bought a posh cheese board.

We went out this evening to Lisa & Andy’s with my sister and Shaun. Shaun has just passed his driving test. Anyway, we were going for a wine tasting which I bought on a Groupon months and months ago. So little fat man turned up with two very large luggage type cases full of wine. I got given a bottle of red for the booking (which wasn’t bad as the whole thing only cost £19). He asked us all what sort of wine we drank then we proceeded to sample 13 bottles, it was all very educational and we all got merrily pissed. At the end of it I ordered for hundred quids worth, which I’m sure pleased little fat man no end, as he then left all the sample bottles for us to kill off, including a rather nice New Zealand white at 20 quid a bottle that I was rather partial to. Shaun drove home, I think he drove fine, I really can’t remember.

Now this morning as usual after a fairly heavy session I was up like a shot at 6AM. Couldn’t really get back to sleep so watched the X-Factor at 7:30 then pottered around a bit doing various dull things. I then ventured out into the garden where I spent the next three hours chopping the bits of tree that I felled last week into the wheelie bin. Then I decided it was time to check the drains again as the kitchen sink is running slow. Shoved a hose pipe up from the outside towards the kitchen, gummed up with shit (literally), so spent the next three hours jetting raw sewage all other the place, I still haven’t got it completely unblocked but it’s certainly running better than it was. I’ve poured a load of drain cleaner down it, but I imagine it’s going to need another pretty serious session. That’s Jamie and his bloody fried food.

Mother turned up (she was invited) when I was covered in shit (again literally). I washed off then presented her with various different coffees. I wasn’t overly in a social mood at this point, so she didn’t hang around long. But did delivery fruit cake.

Then did the accounts and paid everyone. Trying to work out how I’ve knocked up three grand on my credit card this month and then decided it was because I keep buying stuff. So then sat down and bought some more, mainly Jamie’s Christmas presents. Got a few more to get but at least I made a start.

I need to order all the heating electrics next week and get a start on that, or the fitting date will be round before I know it. Anyway now its wine and bath time, then the US Grand Prix I think.

Give a toddler a bone and that’s child cruelty, give a dog a bone and she thinks it’s Christmas.

Busy day today with trying to finish off the mobile game. Fixed various problems in routing tables. Also had a lot of other minor stuff to fix and found a couple of crash issues. Only just finishing up now, so will keep this brief. There was actually a post on our internal work forum to do with depression and coping day to day, so I thought I’d add to it with my thoughts. I’ve removed some of the names, but it’s pretty much verbatim.

I know you’ve already taken my advice and got a dog X and I hope that it’s brought you and your family some happiness. Here are a few other tit-bits for managing day to day (just my opinions).

1) Get a dog. Dogs are great. But if you are considering one then please go to an animal shelter rather than a breeder or puppy farm. There are loads of really lovely dogs looking for a new home, and like marrying an ugly woman they will always remain grateful. If you need a change of scenery take the dog for a walk, if you want a quick break throw a ball round for a bit, when you’re done, dog will curl up and go to sleep. They are energy efficient and cheap to run (A* energy rating), I have a self cleaning model, she goes to sleep muddy and wakes up clean (unlike my self cleaning oven, which I’ve never once seen attempt this feat). You no longer require a doorbell. There is no need to remove crumbs off the kitchen floor. Unlike children they do not require clothes, education, their own room or a mobile phone. Give a toddler a bone and that’s child cruelty, give a dog a bone and she thinks it’s Christmas.

2) Get a good wine supplier. I recommend NakedWines.com (I always have vouchers available). Whether it’s red or white, independent vineyards always come out on top.

3) Get a cheap wine supplier. I recommend TescoWines. When you’ve had a bottle of the above and really appreciated the fine taste, you can then move on to the Isla Negra as you no longer care.

4) Get a good coffee machine and good coffee (I recommend talking to X about this). Fine wine is good, but at 10AM when you have a dozen walk grids to hand edit then reaching for a bottle of Chardonnay is not the answer, getting a large mug of fine arabica is though.

5) Get a gym membership and use it. Being stuck behind a desk all day isn’t good for you. Get some good exercise. If a treadmill is not your thing then try a class. I do ‘Body Combat’, it’s great fun.

6) Steer clear of anything like ‘living life to the full’, been there, done it, it’s shit. I don’t want to know about how to eat an elephant (Answer, One chunk at a time). I find self help books and courses do not work for me at all, others may have had success though.

7) If you require it and a lot of people do at one time or another, choose your medication carefully. Citalopram, Sertraline and Fluoxetine, all good (Citalopram made me sweat a lot). You get amazing dreams. Steer well clear of Amitriptyline, your head will be on a different planet to your body and you’ll spend all day poking your mouse wondering why it doesn’t squeak. To get off antidepressants see 1.

8) Avoid fad diets. You’ll stick to it for a couple of weeks then you’ll see a cream cake in a shop window and that’ll be the end of it. Just eat sensibly and do a bit of exercise now and then. I’m currently addicted to cheese.

9) Life’s too short, so get somebody else to do the stuff you don’t want to do. DIY is great if you enjoy it, but if you haven’t got round to painting the bathroom in 3 years, it really is time to get someone else in.

10) Get a cleaner. (See 9.)

11) Get a pool boy. (Even if you don’t have a pool, this may only be applicable to me though.)

12) Avoid render.