Trisphee

Trisphee (http://www.trisphee.com/forums/index.php)
-   Central Square (http://www.trisphee.com/forums/forumdisplay.php?f=9)
-   -   Tutoring and Teaching on Trisphee (http://www.trisphee.com/forums/showthread.php?t=22096)

Coda 12-07-2016 01:22 AM

The verbal pronunciation, at least in American English, is the same as "Columbuses," yes. There seems to be some disagreement over whether the version without the trailing s is pronounced that way or pronounced as just "Columbus."

There is no time where "Columbuses's" would be valid. If they were the ships that belonged to the collective members of the Columbus family, then that would be "Columbuses'" and that is consistent across dialects.

Potironette 12-07-2016 01:33 AM

Ohh okay, so when a thing's singular and ends with s, it can be "s's" and pronounced "ses" and when a thing's plural and ends with s, it becomes "s'" and is pronounced as is?

The bus's wheels: pronunced --> The "buses" wheels ?
The buses' wheels: pronounced --> The "buses" wheels ?

Coda 12-07-2016 01:41 AM

That is correct. And yes, this means there's an ambiguity in spoken English.

Potironette 12-07-2016 01:56 AM

Thanks! I read about singular/plural once but didn't really understand it, this clears it up :D

Potironette 12-11-2016 07:16 PM

Studying for a physics test, and a questions said:

"a block is on an inclined plane where the coefficient of static friction is equal to 1.0 between the block and the plane. What is the maximum angle the inclined plane can be before the block slides down?"

I don't think there's a maximum angle though '~', so long as it's less than 90 degrees, but that's not a maximum.

Coda 12-12-2016 11:30 AM

Don't worry, there is in fact a maximum angle. Your homework has an answer.

Since I'm not going to actually do your homework for you :P let me direct you to a few things that you should already know (or are at least in your book) that should help.

First, you should know the formula for static friction: F_s = μ_s * N. This means that the force of static friction equals the coefficient of static friction times the normal force. It should be noted that this is actually a MAXIMUM value, not a CONSTANT force, because friction only acts in reaction to another force.

The normal force is the force exerted on the object by the surface it's resting on. This is a consequence of Newton's Third Law, which states that every action has an equal and opposite reaction, and the object's weight applies a force on the surface due to gravity. On a level surface, this force is the object's mass times the acceleration due to gravity, but on an inclined surface, gravity doesn't point directly into it.

You should have the formulas for getting the horizontal and vertical components of a vector based on its magnitude and angle. I'll reproduce them here:
F_x = cos(a) * |F|
F_y = sin(a) * |F|
Where |F| is the magnitude of the force (mass times acceleration, remember) and a is the angle of that force relative to the surface you're considering. And remember that arcsin and arccos are the inverse operations of sin and cos, respectively.

When you're setting up these kinda of problems, it helps to draw a diagram. Draw the slope, draw the box on the slope, draw the perpendicular and parallel force vectors acting on the box, and identify which of those is equal to the normal force. Then reason about the force of friction -- if the assertion is that the box isn't sliding, then that means that the net force on the box must be zero. So look at what the force vector for friction would have to be in order to cancel out the remaining forces on the box.

With this diagram, then, you should be able to set up an equation that sets the force of friction equal to some other force, and then you solve that for the angle.

That said: This PARTICULAR one can be solved without having to actually do any math, because the coefficient is 1.0, so there's an insight that can give you the answer by inspection if you happen to think of it. But again, because I'm not going to do your homework for you, I'll let you work through this first before I spoil the answer.

Potironette 12-12-2016 07:26 PM

Thanks for the answer! And thanks for not spoiling it--that wouldn't be as fun X'D.

I think it's 45 degrees? Also, should I have not made F_x' an arrow in the diagram?
http://i.imgur.com/QDrpYA0.png

Coda 12-12-2016 08:30 PM

You found the by-inspection solution! Good job! Yes, you are correct: It's 45 degrees because a 1.0 coefficient of friction means that the (magnitude of the) force of friction is equal to the (magnitude of the) normal force. And the only angle where the horizontal component and the vertical component of gravity are equal is 45 degrees.

Nothing wrong with F_x' being an arrow. Arrows mean vectors, and F_x' is certainly a vector. (I mean, yes, it's just a mathematical construct for the purposes of analysis and not a representation of any individual force, but that doesn't mean it's not a vector.)

Is M used for the coefficient of friction in your textbook or something? I had to figure it out by context because I'm used to seeing mu being written as "u" if you can't actually write "μ".

Your math looks pretty good there. Try solving the problem with a coefficient of 0.5 and see if your strategy is sound. (Preliminary thing to think about: Does a lower coefficient mean it starts sliding on a higher angle, or a lower one?)

Potironette 12-13-2016 12:01 AM

No.... M isn't used for that--I just got lazy and put "M" for mew. I think my science teacher might have used it once, but I should have used μ, and maybe it was actually μ but written so it looked liked "M". I've never seen it written as "u" yet though.

http://i.imgur.com/SxYMtSA.png
I think I forgot the force balancing f_smax on the first diagram existed, woops. Thanks for the answer again! Doing the one with .5 makes it make more sense, I think.

Coda 12-13-2016 12:38 AM

Glad to help! Looks like you've got a handle on it.

Potironette 12-14-2016 11:57 PM

What's the difference between Work and Kinetic Energy in physics?

I get that Work is Force times distance. Kinetic Energy is somehow mass in motion? (Not really sure what KE is).

I learned today that Net Work was somehow equal to final Kinetic Energy, but I'm not sure how that works either.

Coda 12-15-2016 01:32 AM

You're not wrong to find the two concepts confusing. They're measured in the same units, and they measure different aspects of the same thing.

The short version is that energy is the ability to do work. In order to do X joules of work, you have to have X joules of energy. Kinetic energy is always positive. (You can see this in the math -- the velocity is squared, which means if you had a negative velocity it would still end up as a positive answer.)

Conversely, work is a measurement of how much energy is transferred. It represents a net change in kinetic energy. Saying "final" kinetic energy is only true if the initial kinetic energy was zero. It could have already been moving and ended up moving faster, or it could have been slowing down instead of speeding up (though in that case, the work is negative, which means the force was applied in the opposite direction of motion; equivalently, it means that energy was taken away).

The reason you have to say "net work" is because you might be dealing with multiple forces. For example, if there's a box sitting on the floor, and you push it, you did positive work on the box, because you applied a force over a distance. But the box isn't moving at the end, so its kinetic energy before and after is zero, so the net work must also be zero. The resolution to this is that friction was performing negative work on the box -- an opposite force over the same amount of time.

Potironette 12-15-2016 01:58 AM

Thanks for answering!

So..
Energy is the ability to do work, and this is measured in Joules (Nm)
Kinetic energy is one form of energy (the other being potential energy). And this always positive, as KE = 1/2 * mv^2, and the only variable that can be negative is v, but v is squared so Kinetic energy is always positive.

What does "transfer of energy" mean..?

In measuring the "transfer of energy," work is what measures the difference between the final state of kinetic energy from the initial state of kinetic energy as KE_f - KE_i. If KE_f is greater (by having greater speed, v), then work is positive because energy was gained through the "transfer." If KE_f is the same as KE_i (by having same speed, v), then no work has been done because no energy was lost or gained. If KE_f is less than KE_i (by having slower speed, v), then negative work was done because energy was lost in the "transfer."

Is "transfer of energy" just related to the speed of an object and thus it is measured by comparing the final state of kinetic energy to the initial state of kinetic energy?

Work itself measures kinetic energy focusing on how one force acts with a distance, or on how one force changes an object from one speed to the next (or does this have nothing to do with speed?) while net work measures how multiple forces are acting with distances...and that can be measured too from the difference between KE_f and KE_i?

Coda 12-15-2016 02:17 AM

There are way more kinds of energy than just kinetic and potential. Electrical energy can do work too (motors!) and heat is a form of energy that isn't doing work. But yes, for these basic mechanics questions, kinetic and potential are the only ones you're going to be concerned with.

"Transfer of energy" isn't jargon; it's not a piece of scientific vocabulary that always has to be used a certain way or you're wrong. When I say that, I really just mean that energy is moving from one place to another, or from one state to another. (Converting potential energy to kinetic is work, done by the force of gravity.)

It sounds like you've basically got everything straight here.

Potironette 12-15-2016 02:28 AM

Quote:

"Transfer of energy" isn't jargon; it's not a piece of scientific vocabulary that always has to be used a certain way or you're wrong. When I say that, I really just mean that energy is moving from one place to another, or from one state to another. (Converting potential energy to kinetic is work, done by the force of gravity.)
Ohh, okay. I wasn't too sure what transferring energy referred to ^^;;.


I'm doing homework again, and I'm stuck on a question that reads: "A 2.1E3 kg car starts from rest at the top of a driveway that is sloped at the angle of 20.0 degrees with the horizontal. An average friction force of 4E3 N impedes the car’s motion so that the car’s speed at the bottom of the driveway is 3.8 m/s. What is the length of the driveway?"

I actually did find how to solve for my homework problems here,
but I don't really understand what I'm supposed to be thinking, and I don't understand how or why I'm meant to relate net force to kinetic friction...I think I just don't understand what there is to understand about work and kinetic energy :/

Coda 12-15-2016 02:51 AM

So... the car is accelerating down the hill, right? Its acceleration is the result of the sum of all forces acting on it. You know that gravity is pulling it downward, and you can calculate how much force it exerts in the direction of motion. You know how much force friction is applying in the opposite of the direction of motion (which saves you the effort of calculating it, since they didn't give you the coefficient of sliding friction). That means you can find the net force causing it to accelerate.

Once you know the net force, you can find the actual rate of acceleration.

You know the car's velocity at two points in time (one of which is v=0 at time=0). That combined with the acceleration will allow you to determine how long it takes the car to get up to that speed.

Once you know the time, you can plug it into the whole position equation, which you now have all the variables for, and find out where the car is after that amount of time.

Potironette 12-15-2016 03:22 AM

m = 2.1 * 10^3 kg
angle = 20.0 degrees
F_f = 4.0 * 10^3 N
v_f = 3.8 m/s

F_g = mg
F_g = (2.1 * 10^3 kg) * 9.81 m/s^2 = 20601 N = 2.1 * 10^4 N


F_N = cos(20.0 degrees) * F_g
F_N = cos(20.0 degrees) * (2.1 * 10^4 N)
F_N = 19733.5 N = 2.0 * 10 ^4 N
don't need this because I'm not calculating for friction related things, I think.

F_x' = sin(20.0 degrees) * F_g
F_x' = sin(20.0 degrees) * (2.1 * 10^4 N)
F_x' = 7182.42 N = 7200 N

F_net = F_x' - F_f
F_net = 7200 N - 4.0 * 10^3 N = 3200 N

F_net = ma
F_net/m = a
3200 N / (2.1 * 10^3 kg) = a
a = 1.5 m/s^2

a = v/t
t = v/a
t = 3.8 m/s / 1.5 m/s^2
t = 2.5 s

d = d_i + v_i*t + .5at^2
d = .5at^2
d = .5(1.5 m/s^2)*2.5^2
d = 4.7 m


This way is simpler :o! So, ultimately I can use the position equation because I can solve for the acceleration, initial velocity and time? Is this something that I just need to do a lot of problems for before recognizing a sort of pattern :/ ?

Thanks for helping me with this!

Coda 12-15-2016 11:36 AM

Quote:

Originally Posted by Potironette (Post 1738793)
This way is simpler :o! So, ultimately I can use the position equation because I can solve for the acceleration, initial velocity and time? Is this something that I just need to do a lot of problems for before recognizing a sort of pattern :/ ?

Thanks for helping me with this!

Pretty much, yep. There are two general strategies to the pattern:

1. Look at what you're trying to figure out and identify what information you lack to determine it, then figure out how to get that information.
2. Look at the things you know and see what you can figure out using that to try to manipulate it into a form you know how to solve.

I saw that I was looking for a distance, so I knew that either I'd be using the position function, or I'd be using the work formula, since both of those have distance as a term.

In this particular case, either of those choices would work out just fine. It would be good for you to figure out how to solve it using work -- it's actually several fewer steps to do it that way; I'm just used to solving the acceleration route because it doesn't involve mass, and 2D video game physics don't care much about mass.

Happy to help!

Potironette 01-02-2017 03:54 AM

What's the difference between text/javascript and application/javascript?
I was trying to figure out what the canvas thing was and mozilla showed me both in their examples here: https://developer.mozilla.org/en-US/...al/Basic_usage.

Uh, I don't know anything about javascript and mostly nill about html--I was actually trying to make a moveable character after I bumped across this (http://www.williammalone.com/article...e-character/1/) while internet surfing x'D. After I couldn't get it to work, I figured I might as well try to figure out what this "canvas" thing was...and then there was the whole text/javascript and application/javascript difference.

From what I gathered online it seems like there really isn't a difference except sometimes the application one doesn't work..?

Coda 01-03-2017 01:22 PM

Heh. What an interesting question.

Use "text/javascript".

The story goes that "application/javascript" was introduced in 2006 in an attempt to standardize the MIME types of executable content, and "text/javascript" was deprecated. Most browsers supported it right away because they didn't pay a whole lot of attention to the MIME type of scripts, because they only supported Javascript anyway. Mozilla picked up the change and updated all of their examples to match it, because that's what the standards said to do.

Unfortunately for the standards committee, Internet Explorer didn't pick up support for it until 2011. (IE had support for other scripting languages in the browser, most notably VBScript.)

Five years is a LONG FREAKING TIME on the Internet, and when one of the most well-known browsers in the world doesn't support something, that basically means you can't use it. And by then, pretty much everyone but standards purists had forgotten about "application/javascript". As a result, the HTML5 standard requires support for "text/javascript". It has this to say:

Quote:

Originally Posted by HTML5 spec
Note: The term "JavaScript" is used to refer to ECMA262, rather than the official term ECMAScript, since the term JavaScript is more widely known. Similarly, the MIME type used to refer to JavaScript in this specification is text/javascript, since that is the most commonly used type, despite it being an officially obsoleted type according to RFC 4329.

EDIT: As for <canvas> itself, I'm pretty good with it if you need any help. Gravity Runner (in the thread linked in my sig) is canvas-based.

Potironette 01-03-2017 11:12 PM

Oh, wow. So application/javascript has a history :o
Thanks for the answer!

How do I use images from my computer on canvas instead of drawing boxes and things with javascript? Also, based on the Mozilla tutorial, I keep using: <body onload="aasdf();">
What's something else I can do? Do I just put onload somewhere else somehow..?

Coda 01-03-2017 11:28 PM

Using the "onload" attribute like that is old-school Javascript and while it's still supported it's not recommended because it has a LOT of limitations.

<script> tags get executed immediately, as soon as they're encountered by the browser, before the rest of the page is allowed to load. This is true even if the script has to be loaded from another URL, in contrast to CSS files in a <link> attribute, which are loaded in the background.

The "load" event (which is what causes the "onload" attribute to execute) happens when all content on the page is finished loading. If you don't actually NEED all of the content on the page to have finished loading, you can just put your <script> tag near the bottom of the file and all of the document above it (but not necessarily CSS files or images) is guaranteed to already be ready.

If you DO need to wait for the "load" event (for example, if you want to work with image files, like you described) then the recommended way to do it is like this:

Code:

document.body.addEventListener('load', aasdf);
Notice that there's no () on "aasdf" there; this is intentional -- you aren't invoking the function; you're passing the function AS AN OBJECT to the addEventListener method, which will invoke it when the "load" event is triggered.

As for actually drawing images, it's not too hard. Put the image you want in an <img> tag on the page (you can hide it with CSS if you want), grab it from the page with "document.getElementById", and draw it to the canvas using "drawImage".

The code might look something like this:

Code:

<img src='example.png' id='exampleImage' />
<canvas id='workCanvas' />
<script type='text/javascript'>
function startup() {
  var context = document.getElementById('workCanvas').getContext('2d');
  var imgData = document.getElementById('exampleImage');
  context.drawImage(imgData, 10, 10);
}
document.body.addEventListener('load', startup);
</script>


Potironette 01-04-2017 05:47 AM

Thanks for the detailed answer and especially the examples!


Why is it that with
Code:

document.body.addEventListener('load', aasdf);
nothing shows up? Although, it does show up if I replace "document.body" with "window"?

Also, what is context? And what does something.somethingElse() mean? (as in document.getElementById('workCanvas') and context.drawImage(imgData, 10, 10)
Actually, what's a period?

..And what's loading?

Coda 01-04-2017 01:18 PM

Doing some research... It looks like document.body.onload is a very old function that's only retained for compatibility, and it was never updated to the new addEventListener-based mechanisms. (I had assumed that it followed the upgrade path that everything else did.) Use "window" because that's supported.

Loading is the process of downloading the content and converting it into internal structures that the browser can use to render on the screen. The "load" event on the "window" object is triggered when everything on the page -- the page itself, images, stylesheets, and scripts -- have finished this process. <img> tags have a "load" event too, so you can specifically respond to a single image finishing its load process; this is especially useful when you're adding new images after the page is loaded.




In general, a "context" is a fairly nebulous concept in computer science. One thing that various uses of the word "context" have in common is that you have an object or handle that allows you to operate on a single instance of some resource. (It was hard for me to write that sentence; it's the kind of thing you just sort of treat as jargon until you start picking up an intuition for it.)

In this specific case, you're looking at a 2D rendering context. It's an object that gives you a bunch of functions to do stuff with the canvas.




I'm not sure I'm the right person to talk to about periods; I'm pretty sure you have more experience in that regard than I do. A dot, on the other hand, is a member accessor. (Some languages use an arrow -> instead.) "x.y" means that x is an object, and y is one of the things stored in that object or one of the methods defined on that object. In those examples, "getElementById" is a function defined on the "document" object, and "drawImage" is a function defined on the "context" object.

I cannot underemphasize just how fundamental this concept is to modern software development. I've been in the industry long enough to remember trying to write code WITHOUT objects, and it is VERY difficult to keep things organized without them. (I also remember trying to write code without functions. Those were the dark ages.)

One bit of jargon: A "method" (sometimes "member function") is a specific kind of function. When an object contains a method, that method knows what object it belongs to when you call it. In Javascript, if you call "x.y()" then inside y, the special variable "this" is x. If z is another object of the same type as x, z.y() is the same function but "this" means z inside.

Potironette 01-05-2017 01:34 AM

Thanks again for the detailed answers!

Hmm, so for images, would it be window.img.addEventListener('load', aasdf); ?

I'm sort of fumbling around looking at javascript and copying them down in hopes of understanding enough to make my own moving things eventually. In general, when one uses javascript..is it that they make "function"s and put variables in them with things that get done to those variables? And then I just need to learn the jargon?

What's an object? That is, what's the difference between an object and a variable..?


So, a method/member function is a function that has it thing it's inside? And "this" means the thing it's inside? So window.addEventListener('load', somefunction) means addEventListener is a function inside something that's a "window"? And for some reason the window is whatever a "this" is..? Also, why is it that 'load' is in quotes? And does addEventListener basically waits/listens for 'load' of the "this" then the comma means after the comma it does somefunction?
Why is somefunction an object..? Or what does it mean that the function is an object..?

Defined on..means it's based on..?
To invoke is to have something done..?

Coda 01-05-2017 03:25 AM

Seems I need to back up a level -- overestimated your past experience. I'm going to rearrange my response instead of answering your questions in order, so that I can build on what I'm saying.

So... First off.

A variable is a name you use to refer to something. What is that something? Anything you assign to it. When you say "x = 1" you're saying "from here on, when I say 'x', I really mean '1'." When you say "y = x" you're saying "whatever thing I was calling x before, I also want to be able to call it y (feel free to go ahead and use x to refer to something else if you want)."

There are some nitpicky details that vary from language to language about what the = there actually DOES. I'll stick to Javascript for this post, and I'll try to be as general as possible so that it DOES apply broadly, but you should be aware that there are other ways that things happen that do in fact come up in some modern programming languages.

In Javascript in particular, variables are references to values. If you change part of that value, then you can see that change through every variable pointing to that value. Of course, you can't change the value of the number 1, so it's irrelevant there, but if the value is an object, it matters. More on this below.

It's... actually really hard to explain what an object is in concrete terms because there are several different definitions with a lot of overlap that get used in a fuzzy way. The simplest definition of "object" that I think I can give is that it's a value made up of other values in a structured way. This definition jives with most (but not all) of the ways the term "object" gets used.

In particular, when I referred to treating a function as an object, that's one of the definitions that doesn't jive. *sweatdrop* In THAT case, "object" means any value that can be referred to and moved around as a single entity, regardless of what it's made of. In many languages, functions and values are completely different and you can't give one function to another function for it to use; in Javascript, you can store a function in a variable just like any other object.

In Javascript, you can create a new plain object using {}, and you can access parts of an object using the . operator.

Code:

var x = {};
x.a = 1;
x.b = 2;
x.a + x.b  // 3

There's also a shorthand way of creating objects and things that you immediately want to put inside:

Code:

var x = { a: 1, b: 2 };
x.a + x.b  // still 3

When I say "a is defined on x" this is what I mean -- the object "x" has something named "a" inside it (if it didn't, "x.a" would be said to be "undefined"), and the place where it's specified what "a" is is called the definition.

Some kinds of objects have stuff preloaded onto them. For example, the "document" object that a web browser gives you has "body" and "getElementById" preloaded into it. Usually you can add new stuff. Sometimes you can't. At your level, best to assume you can't, because adding stuff to objects you didn't make can make things confusing to reason about.

So basically, the difference between a variable and an object is that an object is a concrete thing that has some value to it, and a variable is a name that points at one (or possibly zero) of those concrete things.

EDIT: I said I'd come back to it, and here it is. A variable can only point at one object, but you can have multiple variables pointing at the same object. A quick demonstration:

Code:

var x = { a: 1, b: 2 };
var y = x;
y.a  // 1
y.a = 3;
x.a  // 3 now


Invoke is a jargon term that's basically synonymous with "execute"/"run"/"call". The specific meaning of invoke is that you're intentionally and directly pointing at a function and telling it to do its thing.



A method is a function accessed through an object that does things with that object. In Javascript, a function that you invoke as a method has the special variable "this" refer to the containing object.

In your specific example: Yes, "addEventListener" is a function inside the object called "window", and so you can say that it is a method of "window". If you could look at the code inside "addEventListener" (you CAN'T, but if you COULD) you would see that it would be using "this" inside, and when you call it as "window.addEventListener" then "this" would be the same as "window". If, on the other hand, you had taken a button from the page and called "button.addEventListener" then "this" inside would be the same as "button".



The reason "load" is in quotes is because events (a jargon word meaning "things that happen from outside of your code, and you can do something when they occur") in Javascript are referred to by string names. There's nothing particularly magical about it. The browser just says "okay, everything on the page is done loading, so I'm going to see who added event listeners for the event named 'load' and invoke them."

For "addEventListener" in specific, the first parameter is the name of the event, and the second parameter is the function (not the name of the function, the function itself) that you want the browser to invoke when the event "fires" / is "dispatched." It should be noted that this function doesn't WAIT for anything -- the code below it keeps running. When an event happens, the browser dispatches it as soon as there isn't any other Javascript code running.



Your description of writing Javascript code is... well, it's not WRONG. A function IS, at its core, a list of instructions of what to do to the variables the function can see.



I think that covers everything you were asking for?

EDIT: Oops, forgot to go back and touch on my "more on this below". Editing that in with a second edit...

Potironette 01-05-2017 03:37 PM

Yep! That covers everything! Thanks a lot!

My so called past experience is basically nothing xD. I just like to mess around and I find this interesting but confusing.

The var x = {} reminds me of learning about sets in math. Is var x = {} basically that the set that's x is currently empty?

Out of curiosity, when you have var x = { a: 1 } can you only get the a from x? That is, var a = { x: 3 } isn't going to affect anything?

Coda 01-05-2017 05:05 PM

Yes. That's the whole fundamental point of objects -- every object is self-contained. Two distinct objects won't have any effect on each other, and the stuff inside an object is unrelated to the stuff outside the object.

It should also be noted that names have scopes. That is, a given name is only applicable inside a certain region. If you define a variable outside of any functions, that variable is global and everything can see it, unless you declare a new variable inside a function (with the "var" keyword) then that one will hide the global one. If you have a function defined inside a function (way more common than you might expect) then variables in the outside function are visible to the inside function, but not vice versa.

Names in objects are the same way -- the names of the properties are scoped to the object. The name has no meaning anywhere except when referring to a property of that specific object.

Every "a" in this example is distinct and unrelated to the others:
Code:

var a = 3;
var b = 'b';
var x = { a: 1 };
var y = { a: 2 };
// you can only see b here
function foo() {
  var a = 4;
  var c = 'c';
  // you can see b and c here
  function bar() {
    var a = 5;
    var d = 'd'
    // you can see b, c, and d here
  }
  // back outside of the definition of bar, you can only see b and c here
}
x.a = 6;
// y.a is still 2, because they're separate objects

The main thing to watch out for is that it's possible to have two objects that LOOK the same but are actually separate objects, or two objects that you think might be separate objects that are actually the same. You can actually check for this in code -- two objects only evaluate as == to each other if they're the same concrete object, even if all of their properties are equal.

As far as the syntax... Yes, it's probably inspired by set notation historically. No, you probably shouldn't try to think of them as sets, because they don't really act like sets -- you can't easily see how full an object is or if it's empty, and two empty objects aren't equal to each other. It's better to think of them as dictionaries -- if you have a name, you can look up what it means inside.


EDIT: It occurs to me that you used "window.img" in an earlier post and I forgot to respond to that.

Accessing images on the page... doesn't work like that. :P But you can put an "id" attribute on an <img> tag and use "document.getElementById" to get that in your script, then store that in a variable.

Potironette 01-06-2017 02:54 AM

Thanks, that makes a lot of sense! As of now I don't have another question xD

Potironette 01-07-2017 12:35 PM

"While horizontal integration sometimes brought economies and greater profits, monopolistic control over prices did boost earnings."

^A sentence from my US history textbook. I'm guessing economies means not cost efficient, but I can't fathom why greater profits deserves a "while."

I guess this question might fall outside the category of English though :/. It's probably important for me to understand it for school, at least.

Coda 01-07-2017 01:31 PM

No, on the contrary, an economy in this context means something that IS cost-efficient -- things like discounts for buying in bulk ("economy-size").

What that statement is saying is that being a monopoly made money for the company by reducing operating costs, but monopoly companies could also make money by controlling how much they charged for things, because customers couldn't just go to a competitor for a better deal.

In your defense, that's a REALLY poorly written sentence.

Potironette 01-07-2017 01:43 PM

Ohh, okay, that makes sense. The textbook also said:

"Companies that integrated vertically frequently achieved economies of scale through more efficient management techniques."

So is "economies of scale" and the "economies" of the horizontal integration the same thing..?

Coda 01-07-2017 01:55 PM

Economy of scale is a specific kind (possibly the most common kind) of economy. A business could also derive an economy from, for example, being able to choose among providers.

In vertical integration, controlling the whole supply chain means you spend more money up front to get a system set up that does EXACTLY what you need it to do and nothing else, so that you save money in the long run. This is an economy of scale because that kind of setup only works if you need a WHOLE BUNCH of the same thing for a long time.

EDIT: Also, vertical integration means that it's okay for individual components of the supply chain to operate at a loss if the profit of another component makes up for it -- you don't have each business in the chain marking up the prices a little in order to make a profit.

Potironette 01-08-2017 06:18 AM

Ohh, so the difference between Andrew Carnegie and Rockefeller was that Carnegie used a ton of money to get things set up and Rockefeller used a ton of money to drive out competitors (the textbook had been using them a lot as examples).

I'm guessing that economy is just a term referring to how business is managed then..?

Coda 01-08-2017 12:15 PM

It's a term referring to a way to save money.

And yeah, that's probably a reasonable way to look at it.

Potironette 01-08-2017 03:07 PM

Ohh, so that's what the "economy"'s supposed to be for. It kind of became a word to throw around in history class for me :x.

Thanks a lot! I would have just given up on actually understanding that part of the text otherwise ><'

Potironette 01-12-2017 06:00 AM

Where does
Delta x = 1/2(vi + vf)Delta t
come from?

We were learning about momentum, and something about impulse(?), but I'm not too sure because I was half-asleep that day.

Coda 01-12-2017 11:34 AM

Δx = 1/2(vi + vf)Δt

The change in position equals the average velocity multiplied by the change in time. In this case, you're using constant acceleration, so the average velocity can be found by averaging the initial and final velocities.

Impulse is a measurement of the change in momentum caused by a force applied over time. A big force over a short time can have the same impulse -- that is, the same change in momentum -- as a small force over a long time. In the case of a constant force, it's just F*Δt.

Potironette 01-13-2017 05:35 PM

Δ Huh, that's odd. Wherever I got the triangle from (I forget), it turned into a capital "D"

Ohh, so when velocity changes constantly, the velocity of that total time is just the average of the velocities at time 1 and time 2 then it just so happens that velocity is distance over time and so the total distance over that time is Δx = 1/2(vi + vf)Δt ?

Oh wow, that's really cool. I wonder why it works out that change in momentum is the same as a constant net force multiplied by the change in time?

Why is mv called "momentum" and why is change in momentum called "impulse"? Or is that something I just need to remember..

Coda 01-13-2017 06:24 PM

It was probably using a Greek font with the letter D instead of using the Unicode uppercase delta symbol.

If it helps a light bulb turn on in your head, consider this: If you know how far the object moved in a certain span of time -- that is, if you know Δx and Δt -- then you can use the formula for velocity you already know: velocity = distance / time. This is actually measuring the average velocity. No matter what path the object took, whether it was moving at a constant speed or if it sped up or slowed down or even went two-steps-forward-one-step-back the whole time, as a whole, the velocity balances out to this value.

So OF COURSE if you go for that period of time averaging that velocity you'll go that distance!

So that just leaves the special case of constant acceleration. The assertion is that the average velocity under constant acceleration is the average of the initial and final velocity (that is, (vi + vf)/2). "But Coda," someone might ask, "what about all of the velocities in between? Why don't they count?" To which I say: Consider any two points in time equidistant from the middle. The initial and final velocities are obviously such a pair, but you might look at 25% into the time span and 75% into the time span, or 10% and 90%. No matter what pair you pick, because it's constant acceleration those two points will always average to the same value -- the velocity at exactly 50%.

As for why mass * velocity = change in momentum = force * time, well, dimensional analysis is a useful tool here. The units of velocity is m / s. The units of momentum is kg * m / s. The units of force is kg * m / (s^2). And obviously the units of time is s and the units of mass is kg. So...

mass * velocity = momentum = force * time
kg * m / s = kg * m / s = kg * m / s / s * s

(If this makes you wonder if these equations can be used to deal with a change in mass, then good on you for being curious -- the answer is "yes, that's what they use for rockets as they burn fuel.")

As for the names "momentum" and "impulse", that's just something you have to remember. "Momentum" is named that because it more or less matches up with the vernacular usage of the word. The term "impulse" was chosen because the common usage of the word means "push" or "drive".


All times are GMT -4. The time now is 04:28 AM.

Powered by vBulletin®