The Lightbulb Audit

For the past few months, I’ve been devoting a fair chunk of my “free time” (which is to say, very little time at all… I have a baby and a toddler, neither of whom sleep) to learning a bit of Java. Specifically, Java for Android. This has been… less fulfilling than expected. I’ve learnt a fair bit since the middle of the year, but not as much as I’d hoped. I do a little recreational programming in a few different languages, mostly Visual Basic and C++ derivatives, and while all languages and coding environments have their challenges, none of them compare the the peculiarities of android app development. I won’t wax poetic here, because this post isn’t actually about Java; this post is about results.

Finally, I have got my first Android app ready for public consumption (which is to say, I lowered my standards until they matched where my app was at). I think it’s pretty reasonable, in terms of presentation, but the important thing is that it’s useful. And that pretty much sums up my standards for anything.

The app is a light bulb tracking program, which I affectionately call The Lightbulb Audit. This app is designed to be a list of every light fitting in your house, and every bulb installed in those fittings, which can be carried in your pocket. That way, the next time you see LED lightbulbs on sale, instead of thinking to yourself: “Gee, that seems cheap. I wonder if I actually need more lightbulbs?”, you will check your phone and say “Wow, I actually have three blown lightbulbs that I haven’t replaced yet, no spares, that one dim bulb in the bathroom that really needs to be replaced with something more powerful, and most of my bulbs are ye-olde incandescent lightbulbs. What are we savages? time to upgrade!”… or something very much along those lines.

So, here is a link to my app on the Google Play store (sorry Apple users, after the experience I just had learning to program for Android, it’s unlikely I’ll get to you any time soon. Also, I don’t have an iPhone to test on. Also: *sound of me blowing a raspberry at you*):

https://play.google.com/store/apps/details?id=teslaandi.wordpress.com.lightbulbaudit

(Please see “important” note below!)

I appreciate feedback, comments, suggestions, and bug reports, so please feel free to leave comment on this blog post to let me know what’s on your mind (regarding the app).

But! Because I’m such a nice guy, I’ve also put up a copy of my Lightbulb Audit spreadsheet (which is how this thing originally started life). Not only can non-android users access this, but you can also export a CSV file from the app and paste it into this spreadsheet:

the-lightbulb-audit

Please, feel free to modify the spreadsheet, add colourful graphs, add features, etc. And please share your updated version if you do! Sharing is caring.

IMPORTANT!!!! – Because I’m such a nice guy and put my app up for free, I don’t make money off it just from you downloading and using it. Where I can make a few cents is from you clicking on the ad banner at the bottom of the app (which I’ve tried to make as unobtrusive as possible, because the afore mentioned niceness). So, if you see any ads that are even vaguely interesting: please, click on it. At the time of writing, my revenue is up to about $2.06… sigh… Oh well, I do it because I enjoy it, not to make money. Also because I’m just such a nice guy and want to help you and your lightbulb situation… Which is a mess, right? Be honest.

ALSO IMPORTANT!!!! – Please don’t leave poor reviews. Any comments, questions, queries, or suggestions: Please leave a comment here, and I’ll do my darndest to look after you…

…On account of being such a nice guy.

Advertisements

If people just designed things right to begin with… #2

I am normally relatively compassionate. Well, I am if you haven’t done anything that displeases me. So I prefer not to harm anything unless I have to. For example, if I can step over a trail of ants to avoid hurting them, I will. However if you’re a little ant bastard who is crawling all over my chicken wing just because I put down my plate at the picnic for half a second, you can expect a pretty stern talking to.
So when we moved into our house, I did my best to remain mouse-free without having to get nasty: keep food in sealed containers, don’t leave any friendly hiding places, etc. In fact, when I first started seeing signs of mice (chewed packets, and poo, all the poo), I just tried to hide the food chase them out. When this failed, and the mouse poo started spreading into more areas, and I started hearing mice scratching around in the pantry… while I slept… well, the mice were no longer on my christmas card list.
I didn’t want to put down poison, because then I have poisoned mouse corpses laying around (I have kids and dogs, and there is plenty of native wildlife outside my house which may like to eat a slow moving mouse if they ventured outside the house). Also, poisoning sounds slow and painful; a trap is quick, over before the mouse knows what’s happening.

So I went for traps. However, the traps didn’t work! I kept finding mousetraps with no bait on them. I tried a number of attractants, none of them caught the mouse. They all got eaten, but the trap didn’t trigger. I tried:

  • Cheese
  • Peanut butter
  • Ham
  • Raspberry liquorice
  • Mouse attractant paste from Bunnings

The baits got eaten, but the trap didn’t trigger, the mouse wasn’t pushing on the lever hard enough while eating. That’s why I tried the liquorice, I could wedge it under the catch on the lever (this worked once, but that’s it). I straightened the retaining rod, and even used some PTFE sleeve to reduce friction. The problem is that in order to get the required activation force so low that the mouse would trigger it, the trap because so sensitive that I couldn’t set it. It’s a very fine line to walk.

So what’s the solution? If the activation force needs to be above a certain threshold to be useful, then the mouse needs to push harder. How do we convince the mouse to push harder? Well, have a look at this:

I designed an 3D printed small cages that slide onto the trigger plate, into which you place some cheese. If you’re feeling keen, also smear some attractant paste into the gaps in the cage.

This meant that the mouse tried to squeeze it’s nose through the bars of the cage, triggering it. These worked really well, and after just half a dozen uses, we appear to be mouse free! I can see why the original traps weren’t working, because our mice were tiny, so small I could barely feel the weight of it in my hand.

I don’t feel good about killing the mice, but they had to go.

The design for the cage is here, and should fit most standard 50 cent mouse traps (the design opening is to fit 10 mm wide x 1mm thick mousetrap levers):

http://www.thingiverse.com/thing:1720799

I hope this helps your rodent problems!

Salt and Pepper Chickenwings

image

Here’s a tasty recipe for chicken wings, based on a tasty salt and pepper squid recipe. Let’s face it, you could do this to any meat and it would be great.

Ingredients:
   1.5kg chicken wings
   Plain flour for coating
   2 tsp ginger powder
   2 tsp salt
   2 tsp chicken stock
   2 tsp ground celery seeds
   2 tsp chinese five spice
   Oil for shallow frying (I used rice bran oil)

Method:
   Cut chicken wings in half (separating at the elbow joint), to get lower wings and drumettes.
   Coat wings in flour.
   Heat oil in pan over a high heat (enough to shallow fry, a few millimeters deep).
   Fry chicken wings until golden brown and cooked through.
   Place wings in a bowl, sprinkle with seasoning to taste (you shouldn’t need all of the spice mix), and toss to mix through.
   Serve and eat.

Portions listed serve one (if you are doing it right!)… or appetizers for a dozen people.

VR Box 2.0 – QR code and vague review

Before christmas I bought myself a smartphone VR viewer (a la Google Cardboard, just fabricated out of plastic instead of cardboard). I spent ages pondering whether I should buy one or not, since I didn’t actually NEED one, and it would just open up a world of new projects that I don’t have time for. In the end I did it, because the $30 or so that it cost would be offset by not being drawn to eBay and Aliexpress all weekend trying to find the best deal and then talking myself out of it. I bought the VR Box 2.0:

vr box 2.0 image

The reasons I picked this unit were fairly simple:

  • No particularly bad reviews
  • Adjustable lens position for both pupillary distance (distance between the centre of your eyes) and focus (distance from lens to eye)
  • Low cost
  • Moderate specs, enough for my purposes
  • Sliding panel for exposing camera
  • Openings for power and headphones

Overall it functions, and you can get a reasonably good VR experience. Some people will complain about the cheaper VR sets not having an immersive enough experience, but I don’t think that a few degrees extra Field Of Vision will really fix that.

Yes, the headset can get a little heavy on the nose, but that’s nothing that can’t be fixed by adjusting the straps or adding a little extra padding.

This headset doesn’t have the built in magnet switch for interactive with applications, so I made up a little dongle with a small rare earth magnet inside. When I bought the headset, it also came with a miniature bluetooth gamepad, and while many apps don’t accept gamepad inputs (for some bizarre and stupid reason), quite a few do.

In fact, the main issue I had with this purchase was dealing with the seller on Aliexpress. See, when the VR Box 2.0 arrived in the mail, I had a look at the sparse documentation, and it didn’t have a QR code for calibrating the Google Cardboard apps to the headset. There was a shrunk down image of a QR code in the pamphlet (which in itself looked like it had been photocopied onto glossy paper, so the image was blurry), but it wasn’t readable by the phone. Naturally I contacted the seller, asking if they could send me a copy of the QR code required. After a several responses along the lines of “the QR code is in the documentation” (which is wasn’t), and “please see the manufacturer’s website” (which could not be found, nor would the seller give me the URL), I told them that I’d have to leave a negative feedback if they didn’t help. They didn’t, so I did.

In the end, I used the Google Cardboard QR Generator: https://www.google.com/get/cardboard/viewerprofilegenerator/

I use a Samsung Galaxy Note 4 (which has a 145mm screen), and set up the QR code to suit my lens position, so your inputs relating to screen and lens position might be a little different, but the rest should be okay. Here are the values I used:

Primary button type: Magnet

Screen to lens distance: 44 mm

inter-lens distance: 61 mm

Screen vertical alignment: Centre

Distortion coefficients – k1: 0.1

Distortion coefficients – k2: 0.02

Field of View angles: all 50°

Note: if setting up your own QR code for this or another viewer, the fiddliest bit is getting the distortion coefficients set up correctly. These coefficients determine the adjustments for distortion, and need to be set up to ensure that vertical and horizontal lines stay straight, and don’t curve in or out at the edge of the screen. There isn’t a written description of these coefficient, but if you increase/decrease the values significantly you’ll see what they do in the little diagram on the right. k1 I believe sets the distortion for the 2nd power, and k2 sets the distortion coefficient for the 3rd power. For you, this means that if you look at the vertical lines in the VR grid preview (while setting up the QR code parameters), and they are curving in or out, adjust the k1 input until they look pretty straight, particularly in the centre 2/3 of the screen. Then, if the lines are still distorted near the edge of the viewing field, adjust the k2 coefficient in the same direction. If the ends of the lines have distorted too far, just take k2 back the opposite direction instead.

Here’s the QR code that I came up with, and it looks significantly better than the one I used just to test out the headset:

qr_viewer_profile take 2

Overall, I’m happy with it! but… Now I have to figure out how to write a VR app… Yet another project. Sigh.

If you found this blog post useful at all, I encourage you to check out my first android app: The Lightbulb Audit . As I said, it’s my first app, so please leave positive reviews. If you have any criticisms, comments, bugs or suggestions, please leave them as a comment on my corresponding post on this blog: here.

Maths is fun

Everyone likes different things, and that’s okay.

The important thing is to recognise that some people will find things interesting, which you have no interest in whatsoever, and vice versa. This is important, and probably very advantageous from an evolutionary point of view. No-one can be an expert at everything, so it helps if we specialise, and if we all liked the same things, no-one would do the other stuff.

All of the foregoing is so that when I say that on my recent holiday I did some recreational maths, you won’t give me a hard time about it. The maths I did is here: Time required to drain a tank

While there are plenty of references for the simplest form of this calculation, what you get here is:

  1. A complete derivation
  2. Inclusion of friction losses through fittings and valves
  3. Consideration of non-atmospheric (pressurised) tanks
  4. Not having to wade through forum posts of vague queries, unhelpful half-answers, and opinions from people who don’t really understand physics (and probably shouldn’t be on that sort of forum to begin with).

I’ve also updated my menu bar at the top of the page, to try to make some of my questionable content easier to access.

Hopefully soon I’ll make time to do a few more posts, but since that involves actually finishing some of my projects so that I have something to blog about, it might be a couple of weeks before I have anything really interesting to say.

Graph of the Week: The Bagel Graph

There are many traits that are prevalent amongst engineers (there are plenty of jokes about this, normally told with glee by lesser humans), but i think there is possibly only one which appears to be universal:
We love free food.

Most engineers are honest people, who are not open to corruption, but they will do things for food that they would never do for money. As a result, it is common practise for equipment suppliers to come in to our offices to present “lunch and learn” sessions. While these sessions aren’t going to sway us to use a certain product (we are generally, after all, technophiles, and will always go for the technically superior product), the mention of a free lunch does ensure that the vendors get a room full of engineers who are too busy eating to ask annoying questions.

After these lunch and learns, we will discuss the merits of the presentation amongst ourselves: starting with the quality of the food, then on to the quality of the equipment being demonstrated.

But when you get engineers doing technical evaluations on food… weird things happen…

I was telling my wife about one such Lunch-and-learn, and the duck & coleslaw bagel that I ate:
“You know what the best thing about a good bagel is?” I asked her, as we ate dinner.
“What?” She asked, and really should have known better.
“The bit in the middle where there is a hole in the bagel, but the filling continues… actually, there’s probably a graph for that…” I mused.
“You don’t need to graph it, baby” she said, wishing she wasn’t just dead wrong.
“Oh yes, my little turnip. Yes I do…” I turned to the whiteboard on our kitchen wall…

I present to you… The Bagel Graph

image

(Filling as a ratio to bagel bread. Apologies for the quality of the graph, I tried to sketch it as neatly as I could on my smartphone).

Steak – Sous Vide done cheap, but done right

Here’s a good technique for cooking steak to exactly the level of doneness that you want. Not only that, but this technique will make dinner parties a LOT easier.

A couple of important pieces of information:

  1. If you leave meat in a water bath at constant temperature, eventually the meat will reach that temperature the whole way through.
  2. When cooking meat, the doneness is dependent on temperature, not time.
  3. Food safe temperature for cooking/maintaining hot food is 60°C or greater (Australia, different rules may apply elsewhere).

The practical upshot of this, is that you can sous vide a steak for an extended period of time, and as long as you can maintain the minimum temperature above 60°C, and ensure that the maximum temperature doesn’t go above that required for the level of doneness that you want, you won’t get food poisoning and the meat will be perfectly cooked all the way through.

According to my friend Adrian Richardson (okay, we’re not friends, but he’s got a good book, a good TV show, and we share a lot of the same feelings about butter and cooked meat), the doneness of meat versus temperature is as follows:

  • Rare                 35°C
  • Medium-rare    45°C
  • Medium            55°C
  • Medium-well     65°C
  • Well done         75°C

So if you sous vide your steak at 60°C (individually, or in the form of a big old slab of meat), you can put the steak into the water bath several hours before dinner is due. Then 5 minutes before dinner, get your frying pan very hot, and sear both sides of your steak. Ideally this searing should be as hot and quick as possible, to avoid cooking the rest of your steak any further. That is, of course, unless some of your guests prefer their meat more cooked; in this case, the majority of the cooking is already done, and you can just cook these steaks a bit further through. If ALL of your guests like their steaks cooked further, simply set the water bath at a higher temperature so that this level of doneness is your starting point.

The best thing about this technique is that you can have all of your steaks ready to go, with only finishing required to serve them up. This is great for when you are expecting guests who are known to be tardy.

Now, how do we sous vide cheaply? Buy a cheap deep-frier (check that it’s safe to use with water instead of oil – I take no responsibility for anyone doing this using the wrong type of equipment and something bad happening). Set the deep frier to very low, and monitor using a digital thermometer. My deep frier can achieve accurate control with +/-2.5°C precision. This allowed me to cook a chunk of meat at 60°C with some excursions down to 55°C (yes, I should have probably gone 60-65°C, for food safety, but… Meh)

Here’s an example of some awesome wagyu rib fillet that I cooked last weekend:

20150207_130501

My meat – Wagyu rib fillet, vacuum sealed

20150207_130816

almost 1.4kg for four people. mmmmm

20150207_225245

$25 deep frier

20150207_134721

Set the frier to very low temperature and use a digital thermometer to monitor

Note: If you’re going to use a deep frier as a sous vide machine, first MAKE SURE IT’S SAFE TO PUT WATER IN. In my machine, the heating element is inside stainless steel tube and it’s water tight.

20150207_190154

Meat cooked to 60°C

20150207_190240

perfectly cooked to Medium, all the way through

20150207_190939

A quick sear in a very hot pan on my induction cooktop’s highest heat setting

20150207_191447

Mmmmmm

20150207_191459

mmm mmm mmmmmmm