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 

Friday, January 25, 2019

Experiment 1901 Sending Packets around the Earth

  see http://wiki.obrienlabs.cloud/display/DEV/Experiment+1901%3A+Sending+Packets+around+the+Earth

   I know this sounds weird but not to someone who lives science as a normal part each day.  I would like to make sure my REST calls propagate around the globe - not just to a server on the other side of the earth and back again like from us-east-1 to the Singapore region but through us-west-2 through singapore - to europe and back to us-east-1.
    Sort of when I fly - in order to maximize the number of takeoffs and landings - I try to get the most number of stops - a direct flight is not the best way to get somewhere when testing latency - as in packets on the cable from Oregon to China are better routed through Hawaii.
    I liked Andrew Blum's "Tubes" book - which include details on the endpoints for sub-marine cables - https://www.amazon.com/Tubes-Journey-Internet-Andrew-Blum/dp/0061994952  - I also ran into a bit of this propagation delay working at Nokia.

    First principles will be install proxies at several regions in Amazon EC2 - https://aws.amazon.com/about-aws/global-infrastructure/

    see https://www.submarinecablemap.com/
This is the path we will take - hopefully no backtracking and ideally it is roughly valid - as we do not actually cross the equator - I will also try through Sau Paulo.
 
through the following Amazon regions

  AWS Regions

Propagation order

Total Pageviews

Followers