DIY: ventilate room for cheap

=== Warning: electricity is dangerous!!! Make sure you know what you’re doing. The author cannot be in any way held responsible for anything that may happen if you follow the below instructions ===

I have a room in my basement that I feel doesn’t get enough air. Obviously, the best would be to have a window, but since this is the basement it wouldn’t be practical.

Having a ventilation removes dampness and ensures air is always renewed in the room.

So I decided to make one for cheap. Here’s the bill of materials:

  • a PC cooler. I spent maybe 10 euros on it. It’s cheap and it doesn’t have PWM (there’s just a 3 wire cable, 2 for powering the fan and the third is the “tach” which caries back the speed of the fan. I don’t use the last one). I don’t remember exactly which of the three wires carry power, you need to experience by yourself;
  • a 12V power source. This comes from LIDL, costs around 5 euros and the voltage is also configurable between 3/6/9/12V which is awesome;
  • a hinge. This is optional, but since my fan is installed inside the room without this I wouldn’t be able to close the door anymore. With this, the fan rotates upwards and I can close the door shut;
  • two pairs of jack male female connectors so that connecting the electrical wire to the power source and then to the fan is properly done; you can see two of them in the image below
  • some electrical wire.

It’s pretty obvious to make. First of all, cut the hinge so that it matches your fan size. Most hinge holes will probably not match the fan holes, so you may want to drill some new in the hinge. Attach the hinge to the fan and then, the other side of the hinge, nail it to the wall. Plugin the fan to the power source and hopefully things will start moving ;).

And the final result buzzing happily.

TimerManager is in STOPPED state

Did you ever encounter the exception below?

I found that just removing the caches from your weblogic solves the problem. So go to $SERVER_ROOT/servers/AdminServer/cache and remove all the files in that directory.

Inject data to nested serializers in Jackson

We sometimes need to tunnel information to a nested serializer and do it from the top level.

Let’s take the following example of some Shape objects which are nested in a Drawing object.

We will be serializing the drawing object using Jackson, so let’s define the appropriate serializers.

Now, let’s say that from the Drawing serializer we would like to inject some information into the Shape serializer. But, as you see Jackson never gives us an instance of the Shape serializer so it won’t be possible to change its members.

So how do we do this? Here come the attributes. These ones are set on the SerializerProvider object and can be later retrieved from a more nested serializer.

As example, let’s say we want to inject an attribute, that, when true, will make the Shape serializer output the name as upper case.

We inject the attribute in the Drawing serializer.

Now from the nested serializer we can retrieve the value of the attribute which was injected at top level.