computer science: environments

All material and examples comes from UC Berkeley. Synthesis & inaccuracy is fault of my own, not that of UC Berkeley’s EECS Department. Note that I have not formally taken a CS class, rather do self synthesis. These posts are more so for me to explain it out in a way that I have come to understand and can referrence to later on rather than trying to make it a tutorial.

Computer science programs operate in different series of interrelated environments, which is a mapping from names to values. Global is the encompassing environment frame. Global is often referred to as Parent as well. Subexpressions are evaluated in expressions within its environment. Once evaluated, calls to user-defined functions must evaluate the expressions and statements from the definition of those functions.

If you had code that read:

from operator import mul

def square(x):

return mul(x,x)

x = – 2

Your global would be: mul, square, x

Your expression evaluation would be: square(mul(x,x))

Replace x with -s, so square(mul(-2,-2))

square(-2 * -2)

square(4)

16

 

I’ve been trying to tackle various coding projects and ways to learn and I’ve been overwhelmed by everything. So here’s to a new system! I’ve discovered how useful and patient Berkeley’s resources are for an online self-learner. So here’s a rough outline of my summer learning list–which may or (much more likely) will not get completed. But you can’t complete goals if you don’t have any in the first place.

  • Coding
    • CS61A
    • CS61B
    • Eloquent JavaScript
  • Thesis
    • Outline plans for American Studies & Geography Thesis’s
    • Begin research
    • Outline essays

javascript: javascripting

I finished this program the other day from nodeschool that teaches you the basics of JavaScript. The very first one ‘javacripting’s is great for ultimate beginners. If you know nothing of code, this is a good way to delve into a test-driven method for learning JavaScript. If you already know the basics of coding, you’ll find this a breeze. All the same, it’s a good way to learn JavaScript syntax. If you’re totally new to coding and want to check this out, here’s a simpler step-by-step for you.

 

What you’ll need:

  • Terminal open (Finder>All Applications>Terminal)
  • A text editor (I use Sublime)
  • Download this (which makes nodeschool work)
  • The ‘javascripting’ will redirect you to this GitHub, but if GitHub makes you auto-delete the tab and give up on the spot, do not worry
    • type this into your terminal:
    • npm install --global javascripting
    • then type ‘javascripting’ into your terminal and run it

Getting Started

For orgizational purposes, it’s suggested you make a new directory for these exercises. Let’s call it: javascripting. To do this from you terminal type the following:

  • mkdir javascripting, hit enter (make a directory called javascripting)
  • cd javascripting, hit enter (changes your directory to javascripting, meaning that you are working and creating in this directory from the terminal; so when you save your programs from the text editor, make sure that they’re being saved into this folder)

The First Program

The first program has you print out ‘hello’ from your text editor to your terminal– sounds totally crazy. The code has been given to you // console.log(‘hello); // . Then save this file (into your javascripting folder!) as something simple, like javascripting.js. The .js is super important so that your text editor knows it’s running a JavaScript file. You should also get some pretty cool colours in your text editor! Once you’re all saved, type //javascripting verify javascripting.js // into your terminal and press enter. You’ve finished the first program!

 

This was a very brief introduction to a nodeschool program and how to set everything up, in case you’re one who feels discouraged just at the sight of GitHub or perhaps didn’t know what the terminal was. Well, now you do! I’ll get more into other node schools later and explain more thoroughly just what the code is actually doing, aside from syntax.

 

finals are over

After a long and much needed break for and also of studying and final examinations, I am ready to post again daily. I will focus on maps when I have the available technology and datum. But I will also be going through various JavaScript tutorials, more or less. Returning fully tomorrow. Best.

physical geography: chemical weathering

Weathering is this crazy concept that makes things change. We already went over some basics of physical weathering, now let’s review chemical weathering, which involves compositional changes or dissolution. Thus, the pH is the crucial factor here. Simplified, pH is the concentration of H+ ions. Most of what is going to be weathered chemically are metal cations, Silicates, Carbonates, etc. Chemical weathering primarily happens in the following three processes:

  • Acid Attacks
  • Oxidation
  • Chelation

Acid Attacks

Acid attacks involve water and acidity to act upon the soon-to-be weathered material (eg rock). Foremost, acidity is mostly generated via biota. Plants and animals release a lot of CO2 into the ground. This happens because plants breakdown animals as they decompose, which releases a lot of CO2. The climate connection here is that with greater tropical climates and flora/fauna, the greater the soil’s acidity. There are a few types of acid attacks. Solution is essentially dissolving (think salt into water, sugar into coffee, etc). This is mostly important for carbonate rocks, as their solubilities change with pH. Hydrolysis is the replacement of H+ ions with other metal cations. Cations have a positive charge, making them easy to substitute H+ ions. However, this greatly weakens rocks structure. It turns silicates (granite, basalts, etc) into clays. As a byproduct, it also releases OH. Carbonation mixes water with carbon dioxide to make carbonic acid. Fundamentally, that is the release of metal cations and HCO3- (bicarbonate). It converts silicates to clays and also dissolves the carbonate. This process is important in the formation of caves.

Oxidation

This occurs via dissolved oxygen in water. This reaction with oxygen causes the cation to give up an electron to oxygen. In example, Fe+2 –> Fe+3 as it bonds with oxygen. The product of this is that oxide minerals are formed. A common oxidation is rusting. For rocks, clays are also produces with oxides.

Oxidation potential is measured in Eh. Eh = log{oxidants/reductants}. Simplified, this is a measure of the prevalence of O2.

Chelation

Organic chemistry allows a large and complex range of decomposing reactions to take place. These chelation agents are organic compounds that do the job. They form ring-like structures around the metal ion in order to make it soluble. These agents come from leaf litter and other organic compounds.This make the metal ions soluble. The metal ions are carried away from the upper soil.

physical geography: physical weathering

Physical weathering is the mechanical breakdown of a material (broadly rock in this example) that fractures the material for natural pulverisation. Physical weathering makes a good catalyst for chemical weathering as well. There are a number of ways that material can be weathered in this way.

  • Ice Wedging
  • Ice Lens Growth
  • Expansion & Contraction
  • Exfoliation
  • Biological Activity

Ice Wedging

Imagine you have a rock that has a few cracks in it, but it’s still solidly your rock! But you left your rock out in the cold, cold winter. Rain dropped onto your rock and found itself deep in the cracks. As the night progressed and the temperature dropped, the ice froze. Ice takes up more volume that water, so it pushed outwards against the cracks’ walls. Although this function isn’t initially catastrophic to the rock, it further weakens the material and increases its susceptibility to other weathering events.

Ice Lens Growth

Let’s say underneath your lawn there’s ice. This ice is surrounded by low pressure water because the ice pieces and rock are repulsive of each other. This low water film attracts more water, which grow the ice shards. This outwards pushing fractures your lawn. You should probably consider moving if this process continues!

Expansion & Contraction

This is a daily process, but it’s also intensified with large fires and snow storms. This is a volume change in the material. This process is dependant on wetting , drying and temperature.

Exfoliation

So you have a rock that’s buried deep below the regolith, bedrock, etc. On all sides of the rock, there is a strong pressure that densifies this by pushing it inwards strongly. With a long series of erosion, the regolith and bedrock have disappeared, but now that rock is beginning to surface. However, the intense central push inward is no longer being applied to the top, so it expands upwards. This, in turn, fractures rock.

Biological Activity

Things like animal burrows and plant roots cause hillslope hollowing. This loosens the regolith mantle.

Next will be chemical weathering.

 

physical geography: “landslides”

So I’m deeply interested in what we call “natural” “disasters.” I could spend a whole blog post explaining why I quoted these words (in fact, that’s going to be an entire thesis of mine! Stay tuned!). But let me just explain a few things about “landslides.”

Landslides is a very general term, but has a much deeper meaning in the world of geomorphology (tldr, basically how the earth’s landforms work). We have a few different types of ways that land material fails, but which are all umbrella-termed “landslides.” All of these processes are different in their mechanisms, processes and impacts. They all share basic characteristics that when stress exceeds the strength of the regolith or bedrock underneath, something has go to give.

  • Debris Flows
  • Rockfall
  • Rockslides
  • Slumps
  • Earth Flows
  • Sapping/Undercutting

Debris Flows

Think of a giant mess of mud, rock, vegetation traveling at a great distance at a high speed– or don’t because that’s kinda terrifying, right? Now that kinda sounds like some landslide-avalanche hybrid. Honestly, that’s not a bad way to think about it. Debris flows happen on steep rocky terrain. They happen because a channel was incised too much, so it left deposits that eventually turned depression. Debris flows can turn into debris flow fans– incredible. These are essentially debris flows coming out in different directions but from the same source.

Rockfall

These are triggered by earthquakes, snow melt, even mountain goats. These mechanisms dislodge rocks, which when falling, dislodge more rocks. The damage is determined by the source of stress and the size of the material dislodged. An example in the US is McGee Pass.

Rockslides

This occurs when bedrock fails on a surface and forms a tongue-deposit. Some examples on regolith-mantled slope include Mt. Cook and Mt. Rainier (Emmon’s Glacier). But on a planar slope with bedding and jointing at an angle, the Himalayas also experience this.

Slumps

Imagine a mass amount of land just slumping downwards– but like in a hundred years. Stronger rock masses maintain steeper slopes, and weaker bedrock masses tend to be strongly jointed and bedded and have weathered voids. Slump’s stresses and transport and proportional to the slope.

Earthflows

These are slow process that can take a century or so long.  They typically happen on marsh lands or ponds. They leave a very rumpled topography. Mudflows are much faster versions of this.

Sapping/Undercutting

In an odd sense, this one is my favourite. Imagine you have a cake with that thick matte frosting on the top and then this softer, moist cake below it. There’s only a few people in front of you in line for this beautiful cake. Everything is fine, you’re patient. But then the guy right before you decides he doesn’t want any frosting and only cuts out the cake under the matte frosting. You quiver as you watch the heavy, strong frosting fall because what previously supported it is now gone. Going back to geomorphology, you now have a hill. The bottom part is of a weaker rock material and is eroded away faster than the overlying material. Just like your cake, once the supporting bottom material is gone, the top falls over.

 

All of my posts are going to be physical geography/geomorphology based until after my exam! But I’ll try to relate the concepts with mapping!

physical geography: connecting maps & ideas

Geography is a very interdisciplinary field by nature (haha!). The reason why I like maps so much is because it visualises and connects the other phenomena that I’m passionate about. Maps give life and meaning to the concepts I know are interrelated. They make a great communicative device as well.

My upcoming examination is in geomorphology. That’s a really fancy way of saying of saying how our landscapes form through endogenic and exogenic processes. Endogenic processes involve geo-related events, eg plate tectonics, volcanoes, etc. Exogenic processes encompass external factors, like precipitation, glaciers, rivers, etc.

This is a really interesting bitcon-looking runoff rate map map, divided by what appears to be states/territories within a state. So let me pitch something kinda crazy with this map. Runoff rate is the Look at the northern hemisphere, look at the southern hemisphere. The planning term “Global South” often categorises third world and developing countries, as they tend to be in the Southern Hemisphere. The Global North being developed countries that tend to reside in the Northern Hemisphere. From this map alone, one could argue that the runoff rate and county development is related. How? Precipitation for agriculture? Accompanying flora? Although I can’t say for certain, I think this is a good example of at least being able to depict spatial and social-spatial patterns.