• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

test please delete

Collapse
This is a sticky topic.
X
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Links are up

    Comment


      Lunch has been some Popeyes hot wings

      I came across a classic bug this morning. Some data that was supposed to be saved in a cache for two months wasn’t there, and my colleague had hunted fruitlessly on Friday for the reason it had gone astray. I didn’t know the code involved so started working out what it did, whereupon I encountered this line:

      Code:
      cache_stuff(cache_timeout=60 * 60 * 24 * 20)  # 2 months
      Now, as any fule kno, if you’re dealing in seconds then 60*60*24 gets you to one days’ worth. Then multiplying by 20 gets you twenty days… so why does the comment say 2 months?

      And that was it! The problem is that a month is approximated as 30 days, so two months is 60 days, and when you look at this line, you see the “2 months” comment at the end and you see 60 appearing, not once but twice, in the calculation, and you think it seems OK and you go off and start looking at another place where you think the bug might be. I spotted that the 20 at the end was the culprit almost immediately, because I didn’t know the code so I had no idea of where else I might look

      To add to the fun, this data is generated at the start of the month, so it might not even have been noticed that there was a problem if somebody hadn’t happened to be looking at it after the twentieth of November

      Comment


        Just put the breadmaker to work on a wholemeal loaf

        After lunch, I noticed that my upstairs neighbour’s van’s lights were on, but he might have been on his way out so I didn’t pay much attention. About an hour later, I noticed they were still on and the van hadn’t moved, so I popped up and let him know, and he went out and turned them off. That’s the second time I’ve done that for him

        It’s only a small van but it’s equipped as a camper in the back and has a solar panel on the roof. But I don’t know if that would have saved him from a flat battery, so it’s probably better to let him know

        Comment


          Last of the Popeyes leftovers with chips for tea. I should order less, as I’m bored with it by Monday. Nice enough though

          This was accompanied by The Crash Detectives on iPlayer, telling the dismal story of a cyclist killed by a careless van driver

          I treated myself to an Advent Calendar this year! Last time I had one of these, all you got for opening the door was a little picture of a candle or a star, but this one is from a French company and contains fancy liqueur chocolates. So I now have a little bit of chocolate containing a tiny quantity of Armagnac to enjoy

          Comment


            Busy night of Christmas shopping done, i.e. spending five minutes buying a load of Amazon gift cards and some bags

            I have shedloads of wrapping paper, some of it dating back years, due to having often finished up in Sainsbury’s on Christmas Eve when it’s all "buy 5 get 5 free" for stuff like that

            Comment


              Tonight in The Forgotten Soldier things were going quite well for a change… oh wait, here comes the Red Army and suddenly everything was going dreadfully; even worse than last time, if anything

              The bread seems to have turned out OK

              It still sounds extremely windy outside, though the rain has stopped

              Goodnight all

              Comment

              Working...
              X