Monday, March 25, 2019

Sunday, March 10, 2019

Java 8 Lambda Parallel Streams :: Use thread safe collections

see http://wiki.obrienlabs.cloud/display/DEV/Design+Issues+-+Case+Studies#DesignIssues-CaseStudies-Java8LambdaParallelStreams::Usethreadsafecollections

Changing code to use parallelStream from stream is not as simple as it looks - there are several design principles that need to be accounted for.

The parallel stream code in the lambda libraries wrap the ForkJoin framework from Java 7.  There are several issues that will affect performance and accuracy of your code.

Using non-threadsafe collections - this will show up as randomly varying results and modifications of Lists and Maps if they use out of the box non-threadsafe implementations like ArrayList and HashMap.  Stick to CopyOnWriteArrayList and ConcurrentHashMap.



For example


Using a small dataset for parallel operations may be slower than sequential code because of the parallel framework overhead.  Try to use data sets that are at lease 10k in size

For example - filtering on 10 Million biometric records.



Friday, March 8, 2019

Testing for Radon 222 radioactive gas levels above 100 Bq/m3 in the home as a result of the U235-Ra226-Rn222 decay chain

http://wiki.obrienlabs.cloud/display/DEV/Science#Science-Radon

I have been meaning to test the radon(222) levels for a while - it looks like we have elevated gas levels in the lower airspace in the basement.  I just started preliminary testing before placing 6+ month laboratory grade sensors.  The results from the Airthings sensor even after 3 days is interesting.  The plan is to move the meter around daily to get a 3d view of the house before winter ends.

Have an ERV running.

The issue is unventilated confined lower spaces - we are looking for a number lower than 100 Bq/m(3) - but any level is bad.  A Bq is defined as 1 alpha particle (helium nucleus) per second per cubic meter.

Results:

20190307:0823 - bedroom 1st floor 1m above floor (12h)
79
20190307:2240 - basement by work area - 50cm above floor
67
20190308:0858 - basement back by furnace by crack in floor - right on the floor
666
20190308:1243 - basement back by furnace by crack in floor - on 30cm box
732



highest link

Canada specific

we need to be below 200 Bq/m(3) but even 50 is still dangerous

getting these (2) from Canada - to send in for a 90+ day check
and likely this one for continuous monitoring

causes:
Since we life on bedrock - we have a couple sources.
The cracks in the basement are over crushed stone
The water around the basement
The soil around the house - origin - and the rocks like the stepping stones.
Ventilation is critical - we should be good with floor vents on the 1st floor - it is the basement ventilation that may be an issue - our unfinished basement.


some 5 min science.
Because I always hear about how old the canadian shield is here - good for earthquake stability and no shifting of the ground - but bad for having Uranium and Gold - 
we are on 4.5 billion year old bedrock
map of ottawa - see purple, blue

Radon comes from Uranium - which is mostly made in merging neutron stars when parts of the neutron star pieces up to 1km wide (essentially a large atomic nucleus) are released from the main 10km wide star.  These pieces because they are under a lot less gravitational force form normal atomic matter - they condense into less dense isotopes like U235 and even gold/silver.  A smaller portion of elements higher than iron are made during the bounce off the core of the collapse of a supernova in the last minute of a large > 20 solar mass start stops burning silicon.  

Radon https://www.radon.com/radon_facts/ turns into lead slowly - https://www.researchgate.net/figure/The-Basic-Radon-222-Rn-Decay-Chain-The-isotopes-and-their-atomic-masses-are-shown_fig1_51026112 is 9 times heavier than air and accumulates at the bottom of anything - it comes not necessarily out of the basement cracks - more from the sides of the basement from the dirt
Cause of radium in the soil
Radon (originally from decayed Uranium) is released during the recoil of an alpha particle decay (essentially a helium nucleus) from Radium 226 - the alpha particle itself is destructive radiation for cells - but it is the ejected radon atom as it moves from radium 226 through radon 222 (ejecting a helium atom) that causes issues for us - until radon 222 decays with a half life of 4 days into Polonium (very toxic). Polonium decays within 3 min into ordinary lead.  Even though Radon 222 has a small half life of 4 days - it is under constant replacement because it is a gas and being ejected at a rate of 10-50 percent from the pores inside soil when the ejected radon is near the surface and the vector of the alpha particle emission is in the right angle - https://certmapper.cr.usgs.gov/data/PubArchives/radon/georadon/3.html




Links
https://davidsuzuki.org/wp-content/uploads/2017/09/revisiting-canada-radon-guideline.pdf 

Total Pageviews

Followers