|
|
| Lesson: 44 |
| Hi
everyone its me again with another tutorial. In this one I will be
showing you how to do lens flares by extending the glCamera class. If
you look at a lens flare you will notice that they all share one thing
in common. They all seem to move through the center of the screen.
 The only problem with this approach is
without a z coordinate how do you find out if the camera is looking at
the light source or not? In this tutorial we will be making 3D lens
flares so get ready for a little bit of math. We will need to add a few
things to the camera class in order to pull this off. First off we
need a set of functions to see if a point or sphere is inside the
current viewing volume of the camera. Next we need a set of textures to
use for the flares and finally we need to do this with out killing the
processor!
I'm somewhat embarrassed to admit it but there was a bug in the last Camera class that needs some fixing. Before we get started here is the code that fixes the bug. The SetPerspective function needs to be changed to the following. |
void glCamera::SetPrespective() { GLfloat Matrix[16]; glVector v; // Going To Use glRotate To Calculate Our Direction Vector glRotatef(m_HeadingDegrees, 0.0f, 1.0f, 0.0f); glRotatef(m_PitchDegrees, 1.0f, 0.0f, 0.0f); // Get The Resulting Matrix From OpenGL It Will Have Our // Direction Vector In The 3rd Row glGetFloatv(GL_MODELVIEW_MATRIX, Matrix); // Get The Direction Vector From The Matrix. Element 10 Must // Be Inverted! m_DirectionVector.i = Matrix[8]; m_DirectionVector.j = Matrix[9]; m_DirectionVector.k = -Matrix[10]; // Ok Erase The Results Of The Last Computation glLoadIdentity(); // Rotate The Scene To Get The Right Orientation glRotatef(m_PitchDegrees, 1.0f, 0.0f, 0.0f); glRotatef(m_HeadingDegrees, 0.0f, 1.0f, 0.0f); // Scale The Direction By Our Speed v = m_DirectionVector; v *= m_ForwardVelocity; // Increment Our Position By The Vector m_Position.x += v.i; m_Position.y += v.j; m_Position.z += v.k; // Translate To Our New Position glTranslatef(-m_Position.x, -m_Position.y, -m_Position.z); }
Ok
now we can get down to business. We will be using 4 separate textures
to make our lens flare. The first texture we need is what I call
a Big Glow texture. Our light source will be surrounded with a hazy
glow. This texture will always be located at the light source position.
The next texture is the Streaks Texture. This texture surrounds our
light source with streaks moving outwards. This texture will also be
located at the light source position. The Glow texture (not the Big
Glow) this is the more solid looking texture and will dynamically move
across the screen. The Glow texture is similar to the Big Glow texture
however I have noticed that using a more defined texture here looks
better than simply using the Big Glow. And finally we will need a Halo
texture. These are the hollow looking rings for the flare and will
dynamically move across the screen according to the camera's
orientation and position. There are a few other types of textures you
can use
for lens flares if you like its up to you. See the references at the
end of the tutorial for additional information. Below are some examples
of these textures.
Now that you have an idea of what we will be drawing let's talk about when we need to draw the lens flares. Obviously we do not want to draw the lens flares when we are not looking at the light source so we need to find a way to get the viewing volume or frustum from OpenGL. We could do this by combining the modelview and projection matrices then finding the clipping planes that OpenGL uses. Another approach to detecting if a point is in view is to use extensions. We could use GL_HP_occlusion_test or GL_NV_occlusion_query extensions to find out if a vertex is in view of the camera but not everyone has these extension so we will limit ourselves to the old fashioned way in this tutorial. Below is the UpdateFrustum Function. |
void glCamera::UpdateFrustum() { GLfloat clip[16]; GLfloat proj[16]; GLfloat modl[16]; GLfloat t; // Get The Current PROJECTION Matrix From OpenGL glGetFloatv( GL_PROJECTION_MATRIX, proj ); // Get The Current MODELVIEW Matrix From OpenGL glGetFloatv( GL_MODELVIEW_MATRIX, modl ); // Combine The Two Matrices (Multiply Projection By Modelview) clip[ 0] = modl[ 0] * proj[ 0] + modl[ 1] * proj[ 4] + modl[ 2] * proj[ 8] + modl[ 3] * proj[12]; clip[ 1] = modl[ 0] * proj[ 1] + modl[ 1] * proj[ 5] + modl[ 2] * proj[ 9] + modl[ 3] * proj[13]; clip[ 2] = modl[ 0] * proj[ 2] + modl[ 1] * proj[ 6] + modl[ 2] * proj[10] + modl[ 3] * proj[14]; clip[ 3] = modl[ 0] * proj[ 3] + modl[ 1] * proj[ 7] + modl[ 2] * proj[11] + modl[ 3] * proj[15]; clip[ 4] = modl[ 4] * proj[ 0] + modl[ 5] * proj[ 4] + modl[ 6] * proj[ 8] + modl[ 7] * proj[12]; clip[ 5] = modl[ 4] * proj[ 1] + modl[ 5] * proj[ 5] + modl[ 6] * proj[ 9] + modl[ 7] * proj[13]; clip[ 6] = modl[ 4] * proj[ 2] + modl[ 5] * proj[ 6] + modl[ 6] * proj[10] + modl[ 7] * proj[14]; clip[ 7] = modl[ 4] * proj[ 3] + modl[ 5] * proj[ 7] + modl[ 6] * proj[11] + modl[ 7] * proj[15]; clip[ 8] = modl[ 8] * proj[ 0] + modl[ 9] * proj[ 4] + modl[10] * proj[ 8] + modl[11] * proj[12]; clip[ 9] = modl[ 8] * proj[ 1] + modl[ 9] * proj[ 5] + modl[10] * proj[ 9] + modl[11] * proj[13]; clip[10] = modl[ 8] * proj[ 2] + modl[ 9] * proj[ 6] + modl[10] * proj[10] + modl[11] * proj[14]; clip[11] = modl[ 8] * proj[ 3] + modl[ 9] * proj[ 7] + modl[10] * proj[11] + modl[11] * proj[15]; clip[12] = modl[12] * proj[ 0] + modl[13] * proj[ 4] + modl[14] * proj[ 8] + modl[15] * proj[12]; clip[13] = modl[12] * proj[ 1] + modl[13] * proj[ 5] + modl[14] * proj[ 9] + modl[15] * proj[13]; clip[14] = modl[12] * proj[ 2] + modl[13] * proj[ 6] + modl[14] * proj[10] + modl[15] * proj[14]; clip[15] = modl[12] * proj[ 3] + modl[13] * proj[ 7] + modl[14] * proj[11] + modl[15] * proj[15]; // Extract The Numbers For The RIGHT Plane m_Frustum[0][0] = clip[ 3] - clip[ 0]; m_Frustum[0][1] = clip[ 7] - clip[ 4]; m_Frustum[0][2] = clip[11] - clip[ 8]; m_Frustum[0][3] = clip[15] - clip[12]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[0][0] * m_Frustum[0][0] + m_Frustum[0][1] * m_Frustum[0][1] + m_Frustum[0][2] * m_Frustum[0][2] )); m_Frustum[0][0] /= t; m_Frustum[0][1] /= t; m_Frustum[0][2] /= t; m_Frustum[0][3] /= t; // Extract The Numbers For The LEFT Plane m_Frustum[1][0] = clip[ 3] + clip[ 0]; m_Frustum[1][1] = clip[ 7] + clip[ 4]; m_Frustum[1][2] = clip[11] + clip[ 8]; m_Frustum[1][3] = clip[15] + clip[12]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[1][0] * m_Frustum[1][0] + m_Frustum[1][1] * m_Frustum[1][1] + m_Frustum[1][2] * m_Frustum[1][2] )); m_Frustum[1][0] /= t; m_Frustum[1][1] /= t; m_Frustum[1][2] /= t; m_Frustum[1][3] /= t; // Extract The BOTTOM Plane m_Frustum[2][0] = clip[ 3] + clip[ 1]; m_Frustum[2][1] = clip[ 7] + clip[ 5]; m_Frustum[2][2] = clip[11] + clip[ 9]; m_Frustum[2][3] = clip[15] + clip[13]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[2][0] * m_Frustum[2][0] + m_Frustum[2][1] * m_Frustum[2][1] + m_Frustum[2][2] * m_Frustum[2][2] )); m_Frustum[2][0] /= t; m_Frustum[2][1] /= t; m_Frustum[2][2] /= t; m_Frustum[2][3] /= t; // Extract The TOP Plane m_Frustum[3][0] = clip[ 3] - clip[ 1]; m_Frustum[3][1] = clip[ 7] - clip[ 5]; m_Frustum[3][2] = clip[11] - clip[ 9]; m_Frustum[3][3] = clip[15] - clip[13]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[3][0] * m_Frustum[3][0] + m_Frustum[3][1] * m_Frustum[3][1] + m_Frustum[3][2] * m_Frustum[3][2] )); m_Frustum[3][0] /= t; m_Frustum[3][1] /= t; m_Frustum[3][2] /= t; m_Frustum[3][3] /= t; // Extract The FAR Plane m_Frustum[4][0] = clip[ 3] - clip[ 2]; m_Frustum[4][1] = clip[ 7] - clip[ 6]; m_Frustum[4][2] = clip[11] - clip[10]; m_Frustum[4][3] = clip[15] - clip[14]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[4][0] * m_Frustum[4][0] + m_Frustum[4][1] * m_Frustum[4][1] + m_Frustum[4][2] * m_Frustum[4][2] )); m_Frustum[4][0] /= t; m_Frustum[4][1] /= t; m_Frustum[4][2] /= t; m_Frustum[4][3] /= t; // Extract The NEAR Plane m_Frustum[5][0] = clip[ 3] + clip[ 2]; m_Frustum[5][1] = clip[ 7] + clip[ 6]; m_Frustum[5][2] = clip[11] + clip[10]; m_Frustum[5][3] = clip[15] + clip[14]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[5][0] * m_Frustum[5][0] + m_Frustum[5][1] * m_Frustum[5][1] + m_Frustum[5][2] * m_Frustum[5][2] )); m_Frustum[5][0] /= t; m_Frustum[5][1] /= t; m_Frustum[5][2] /= t; m_Frustum[5][3] /= t; }
| This function is a beast! I'm sure you can see now why there are extensions that do this sort of thing! Although the math is really straightforward the shear length is what makes it nasty. In the above function there are 190 operations (multiplication's, additions, subtractions, divisions) plus 6 square roots. Since we will need to call this function every time we draw the scene it will be worth the effort to optimize it. Below is an optimized version of this function that has a couple of trade off's. As long as we do not rotate or translate the projection matrix the below function will work for getting the clipping planes for the viewing volume / frustum. |
void glCamera::UpdateFrustumFaster() { GLfloat clip[16]; GLfloat proj[16]; GLfloat modl[16]; GLfloat t; // Get The Current PROJECTION Matrix From OpenGL glGetFloatv( GL_PROJECTION_MATRIX, proj ); // Get The Current MODELVIEW Matrix From OpenGL glGetFloatv( GL_MODELVIEW_MATRIX, modl ); // Combine The Two Matrices (Multiply Projection By Modelview) // But Keep In Mind This Function Will Only Work If You Do NOT // Rotate Or Translate Your Projection Matrix clip[ 0] = modl[ 0] * proj[ 0]; clip[ 1] = modl[ 1] * proj[ 5]; clip[ 2] = modl[ 2] * proj[10] + modl[ 3] * proj[14]; clip[ 3] = modl[ 2] * proj[11]; clip[ 4] = modl[ 4] * proj[ 0]; clip[ 5] = modl[ 5] * proj[ 5]; clip[ 6] = modl[ 6] * proj[10] + modl[ 7] * proj[14]; clip[ 7] = modl[ 6] * proj[11]; clip[ 8] = modl[ 8] * proj[ 0]; clip[ 9] = modl[ 9] * proj[ 5]; clip[10] = modl[10] * proj[10] + modl[11] * proj[14]; clip[11] = modl[10] * proj[11]; clip[12] = modl[12] * proj[ 0]; clip[13] = modl[13] * proj[ 5]; clip[14] = modl[14] * proj[10] + modl[15] * proj[14]; clip[15] = modl[14] * proj[11]; // Extract The Numbers For The RIGHT Plane m_Frustum[0][0] = clip[ 3] - clip[ 0]; m_Frustum[0][1] = clip[ 7] - clip[ 4]; m_Frustum[0][2] = clip[11] - clip[ 8]; m_Frustum[0][3] = clip[15] - clip[12]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[0][0] * m_Frustum[0][0] + m_Frustum[0][1] * m_Frustum[0][1] + m_Frustum[0][2] * m_Frustum[0][2] )); m_Frustum[0][0] /= t; m_Frustum[0][1] /= t; m_Frustum[0][2] /= t; m_Frustum[0][3] /= t; // Extract The Numbers For The LEFT Plane m_Frustum[1][0] = clip[ 3] + clip[ 0]; m_Frustum[1][1] = clip[ 7] + clip[ 4]; m_Frustum[1][2] = clip[11] + clip[ 8]; m_Frustum[1][3] = clip[15] + clip[12]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[1][0] * m_Frustum[1][0] + m_Frustum[1][1] * m_Frustum[1][1] + m_Frustum[1][2] * m_Frustum[1][2] )); m_Frustum[1][0] /= t; m_Frustum[1][1] /= t; m_Frustum[1][2] /= t; m_Frustum[1][3] /= t; // Extract The BOTTOM Plane m_Frustum[2][0] = clip[ 3] + clip[ 1]; m_Frustum[2][1] = clip[ 7] + clip[ 5]; m_Frustum[2][2] = clip[11] + clip[ 9]; m_Frustum[2][3] = clip[15] + clip[13]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[2][0] * m_Frustum[2][0] + m_Frustum[2][1] * m_Frustum[2][1] + m_Frustum[2][2] * m_Frustum[2][2] )); m_Frustum[2][0] /= t; m_Frustum[2][1] /= t; m_Frustum[2][2] /= t; m_Frustum[2][3] /= t; // Extract The TOP Plane m_Frustum[3][0] = clip[ 3] - clip[ 1]; m_Frustum[3][1] = clip[ 7] - clip[ 5]; m_Frustum[3][2] = clip[11] - clip[ 9]; m_Frustum[3][3] = clip[15] - clip[13]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[3][0] * m_Frustum[3][0] + m_Frustum[3][1] * m_Frustum[3][1] + m_Frustum[3][2] * m_Frustum[3][2] )); m_Frustum[3][0] /= t; m_Frustum[3][1] /= t; m_Frustum[3][2] /= t; m_Frustum[3][3] /= t; // Extract The FAR Plane m_Frustum[4][0] = clip[ 3] - clip[ 2]; m_Frustum[4][1] = clip[ 7] - clip[ 6]; m_Frustum[4][2] = clip[11] - clip[10]; m_Frustum[4][3] = clip[15] - clip[14]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[4][0] * m_Frustum[4][0] + m_Frustum[4][1] * m_Frustum[4][1] + m_Frustum[4][2] * m_Frustum[4][2] )); m_Frustum[4][0] /= t; m_Frustum[4][1] /= t; m_Frustum[4][2] /= t; m_Frustum[4][3] /= t; // Extract The NEAR Plane m_Frustum[5][0] = clip[ 3] + clip[ 2]; m_Frustum[5][1] = clip[ 7] + clip[ 6]; m_Frustum[5][2] = clip[11] + clip[10]; m_Frustum[5][3] = clip[15] + clip[14]; // Normalize The Result t = GLfloat(sqrt( m_Frustum[5][0] * m_Frustum[5][0] + m_Frustum[5][1] * m_Frustum[5][1] + m_Frustum[5][2] * m_Frustum[5][2] )); m_Frustum[5][0] /= t; m_Frustum[5][1] /= t; m_Frustum[5][2] /= t; m_Frustum[5][3] /= t; }
| It's still a beast but this function has roughly half as many operations as the first function (102). The optimization is a simple one. I just took out all the multiplication's that are usually zeroed when combining the projection and modelview matrices. If you really want to optimize this function then use an extension in its place. The extension will do the same thing but will do it much faster because the calculation will more than likely take place in the video hardware. Anyway calling either of the UpdateFrustum functions every time we draw the scene is going to give us a performance hit but we will gain one nice advantage from it. We can now tell if the camera can see an object or point. If you have several different objects in your scene it will be to your benefit to only draw the ones that are currently in the viewing volume. This is useful when you have a lot of terrain to draw so you don't bog OpenGL down by sending it every single vertex. Below is a function that checks to see if a point is in the viewing volume. There is also a SphereInFrustum function in the class but I will not list it here because the two functions are almost identical. |
BOOL glCamera::PointInFrustum(glPoint p) { int i; // The Idea Behind This Algorithum Is That If The Point // Is Inside All 6 Clipping Planes Then It Is Inside Our // Viewing Volume So We Can Return True. for(i = 0; i < 6; i++) { if(m_Frustum[i][0] * p.x + m_Frustum[i][1] * p.y + m_Frustum[i][2] * p.z + m_Frustum[i][3] <= 0) { return(FALSE); } } return(TRUE); }
| Now we will ask OGL to project some geometry for us using the gluProject function. Practically we ask OGL to guess where a point in space will be projected in our current viewport, using arbitrary viewport and transform matrices we pass to the function. If we pass to the function the current matrices (retrievede with the glGet funcs) we will have the real position on screen where the dot will be drawn. The interesting part is that we also get a Z value back, this means that reading the REAL buffer for Z values we can discover if the flare is in front or if it's occluded by some objects. |
// ########## New Stuff by rIO.Spinning Kids ########## bool glCamera::IsOccluded(glPoint p) { GLint viewport[4]; // Space For Viewport Data GLdouble mvmatrix[16], projmatrix[16]; // Space For Transform Matrix GLdouble winx, winy, winz; // Space For Returned Projected Coords GLdouble flareZ; // Here We Will Store The Transformed Flare Z GLfloat bufferZ; // Here We Will Store The Read Z From The Buffer glGetIntegerv (GL_VIEWPORT, viewport); // Get Actual Viewport glGetDoublev (GL_MODELVIEW_MATRIX, mvmatrix); // Get Actual Model View Matrix glGetDoublev (GL_PROJECTION_MATRIX, projmatrix); // Get Actual Projection Matrix // This Asks OGL To Guess The 2D Position Of A 3D Point Inside The Viewport gluProject(p.x, p.y, p.z, mvmatrix, projmatrix, viewport, &winx, &winy, &winz); flareZ = winz; // We Read Back One Pixel From The Depth Buffer (Exactly Where Our Flare Should Be Drawn) glReadPixels(winx, winy,1,1,GL_DEPTH_COMPONENT, GL_FLOAT, &bufferZ); // If The Buffer Z Is Lower Than Our Flare Guessed Z Then Don't Draw // This Means There Is Something In Front Of Our Flare if (bufferZ < flareZ) return true; else return false; }
| Now we need to address another problem that we are going to have. Since we are creating 3D lens flares if we draw our flares on texture mapped quads they may not always be facing the camera. This is bad because our flares can appear flat if we are looking at the light source from the side. Instead of using texture mapped quads we could use point sprites. Point sprites are nice because instead of sending OpenGL four points with texture coordinates you only have to send a single point and you don't have to specify the texture coordinates. Point sprites are great for particle engines and they are equally great for lens flares. Since we only have to keep up with a single point the only thing we have to do is find out where we need to draw the points and call the appropriate drawing code. The disadvantage of point sprites is they are currently only implemented as an extension (GL_NV_point_sprite). To keep the tutorial so everyone can run it I will again be avoiding extensions here. One way we can make sure all our flares are always facing the camera is to simply reverse the rotations we used when setting our perspective. This works well but will break down if the camera ever gets behind the light source. To avoid this we are going to say the camera will never be allowed to get behind the light source by continually moving the light source as we move the camera. This will give us an extra side effect of making the light source appear infinitely far away and also allowing the flares to adjust a little when moving in a straight line. Enough talk below is the code for getting the necessary vectors and points. |
GLfloat Length = 0.0f; // Draw The Flare Only If The Light Source Is In Our Line Of Sight if(SphereInFrustum(m_LightSourcePos, 1.0f) == TRUE) { vLightSourceToCamera = m_Position - m_LightSourcePos; // Lets Compute The Vector That Points To // The Camera From The Light Source. Length = vLightSourceToCamera.Magnitude(); // Save The Length We Will Need It In A Minute ptIntersect = m_DirectionVector * Length; // Now Lets Find A Point Along The Cameras Direction // Vector That We Can Use As An Intersection Point // Lets Translate Down This Vector The Same Distance // That The Camera Is. Away From The Light Source. ptIntersect += m_Position; vLightSourceToIntersect = ptIntersect - m_LightSourcePos; // Lets Compute The Vector That Points To The Intersect // Point From The Light Source Length = vLightSourceToIntersect.Magnitude(); // Save The Length We Will Need It Later vLightSourceToIntersect.Normalize(); // Normalize The Vector So Its Unit Length
| First
we need to find out the distance between the light source and the
camera. Next we will need an intersection point along the cameras
direction vector. The distance between the intersection point and the
camera needs to be the same distance from the light source to camera.
Now that we have the intersection point we can now find a vector to
draw all the lens flares by. Below is a picture representing this.
Now that we have a direction vector to draw the lens flares off of all that is left is to draw the halos and glows. Below is the code that draws the flares along the vector. We create a new point by moving x number of units down the vLightSourceToIntersect vector and then add that to the Light Sources Position. |
glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glDisable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); // ########## New Stuff by rIO.Spinning Kids ########## if (!IsOccluded(m_LightSourcePos)) // Check If The Center Of The Flare Is Occluded { // Render The Large Hazy Glow RenderBigGlow(0.60f, 0.60f, 0.8f, 1.0f, m_LightSourcePos, 16.0f); // Render The Streaks RenderStreaks(0.60f, 0.60f, 0.8f, 1.0f, m_LightSourcePos, 16.0f); // Render The Small Glow RenderGlow(0.8f, 0.8f, 1.0f, 0.5f, m_LightSourcePos, 3.5f); pt = vLightSourceToIntersect * (Length * 0.1f); // Lets Compute A Point That Is 20% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.9f, 0.6f, 0.4f, 0.5f, pt, 0.6f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 0.15f); // Lets Compute A Point That Is 30% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.8f, 0.5f, 0.6f, 0.5f, pt, 1.7f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.175f); // Lets Compute A Point That Is 35% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.9f, 0.2f, 0.1f, 0.5f, pt, 0.83f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.285f); // Lets Compute A Point That Is 57% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.7f, 0.7f, 0.4f, 0.5f, pt, 1.6f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.2755f); // Lets Compute A Point That Is 55.1% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.9f, 0.9f, 0.2f, 0.5f, pt, 0.8f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 0.4775f); // Lets Compute A Point That Is 95.5% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.93f, 0.82f, 0.73f, 0.5f, pt, 1.0f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 0.49f); // Lets Compute A Point That Is 98% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.7f, 0.6f, 0.5f, 0.5f, pt, 1.4f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.65f); // Lets Compute A Point That Is 130% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.7f, 0.8f, 0.3f, 0.5f, pt, 1.8f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 0.63f); // Lets Compute A Point That Is 126% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.4f, 0.3f, 0.2f, 0.5f, pt, 1.4f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 0.8f); // Lets Compute A Point That Is 160% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.7f, 0.5f, 0.5f, 0.5f, pt, 1.4f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.7825f); // Lets Compute A Point That Is 156.5% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.8f, 0.5f, 0.1f, 0.5f, pt, 0.6f); // Render The Small Glow pt = vLightSourceToIntersect * (Length * 1.0f); // Lets Compute A Point That Is 200% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderHalo(0.5f, 0.5f, 0.7f, 0.5f, pt, 1.7f); // Render The Halo pt = vLightSourceToIntersect * (Length * 0.975f); // Lets Compute A Point That Is 195% pt += m_LightSourcePos; // Away From The Light Source In The // Direction Of The Intersection Point RenderGlow(0.4f, 0.1f, 0.9f, 0.5f, pt, 2.0f); // Render The Small Glow } glDisable(GL_BLEND ); glEnable(GL_DEPTH_TEST); glDisable(GL_TEXTURE_2D);
| Below are the RenderBigGlow, RenderStreaks, RenderGlow and RenderHalo functions. The functions are identical with the exception of the texture they are binding too. |
void glCamera::RenderHalo(GLfloat r, GLfloat g, GLfloat b, GLfloat a, glPoint p, GLfloat scale) { glPoint q[4]; // Basically We Are Just Going To Make A 2D Box // From Four Points We Don't Need A Z Coord Because // We Are Rotating The Camera By The Inverse So The // Texture Mapped Quads Will Always Face Us. q[0].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[0].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[1].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[1].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. q[2].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[2].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[3].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[3].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. glPushMatrix(); // Save The Model View Matrix glTranslatef(p.x, p.y, p.z); // Translate To Our Point glRotatef(-m_HeadingDegrees, 0.0f, 1.0f, 0.0f); glRotatef(-m_PitchDegrees, 1.0f, 0.0f, 0.0f); glBindTexture(GL_TEXTURE_2D, m_HaloTexture); // Bind To The Big Glow Texture glColor4f(r, g, b, a); // Set The Color Since The Texture Is A Gray Scale glBegin(GL_TRIANGLE_STRIP); // Draw The Big Glow On A Triangle Strip glTexCoord2f(0.0f, 0.0f); glVertex2f(q[0].x, q[0].y); glTexCoord2f(0.0f, 1.0f); glVertex2f(q[1].x, q[1].y); glTexCoord2f(1.0f, 0.0f); glVertex2f(q[2].x, q[2].y); glTexCoord2f(1.0f, 1.0f); glVertex2f(q[3].x, q[3].y); glEnd(); glPopMatrix(); // Restore The Model View Matrix } void glCamera::RenderGlow(GLfloat r, GLfloat g, GLfloat b, GLfloat a, glPoint p, GLfloat scale) { glPoint q[4]; // Basically We Are Just Going To Make A 2D Box // From Four Points We Don't Need A Z Coord Because // We Are Rotating The Camera By The Inverse So The // Texture Mapped Quads Will Always Face Us. q[0].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[0].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[1].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[1].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. q[2].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[2].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[3].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[3].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. glPushMatrix(); // Save The Model View Matrix glTranslatef(p.x, p.y, p.z); // Translate To Our Point glRotatef(-m_HeadingDegrees, 0.0f, 1.0f, 0.0f); glRotatef(-m_PitchDegrees, 1.0f, 0.0f, 0.0f); glBindTexture(GL_TEXTURE_2D, m_GlowTexture); // Bind To The Big Glow Texture glColor4f(r, g, b, a); // Set The Color Since The Texture Is A Gray Scale glBegin(GL_TRIANGLE_STRIP); // Draw The Big Glow On A Triangle Strip glTexCoord2f(0.0f, 0.0f); glVertex2f(q[0].x, q[0].y); glTexCoord2f(0.0f, 1.0f); glVertex2f(q[1].x, q[1].y); glTexCoord2f(1.0f, 0.0f); glVertex2f(q[2].x, q[2].y); glTexCoord2f(1.0f, 1.0f); glVertex2f(q[3].x, q[3].y); glEnd(); glPopMatrix(); // Restore The Model View Matrix } void glCamera::RenderBigGlow(GLfloat r, GLfloat g, GLfloat b, GLfloat a, glPoint p, GLfloat scale) { glPoint q[4]; // Basically We Are Just Going To Make A 2D Box // From Four Points We Don't Need A Z Coord Because // We Are Rotating The Camera By The Inverse So The // Texture Mapped Quads Will Always Face Us. q[0].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[0].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[1].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[1].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. q[2].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[2].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[3].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[3].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. glPushMatrix(); // Save The Model View Matrix glTranslatef(p.x, p.y, p.z); // Translate To Our Point glRotatef(-m_HeadingDegrees, 0.0f, 1.0f, 0.0f); glRotatef(-m_PitchDegrees, 1.0f, 0.0f, 0.0f); glBindTexture(GL_TEXTURE_2D, m_BigGlowTexture); // Bind To The Big Glow Texture glColor4f(r, g, b, a); // Set The Color Since The Texture Is A Gray Scale glBegin(GL_TRIANGLE_STRIP); // Draw The Big Glow On A Triangle Strip glTexCoord2f(0.0f, 0.0f); glVertex2f(q[0].x, q[0].y); glTexCoord2f(0.0f, 1.0f); glVertex2f(q[1].x, q[1].y); glTexCoord2f(1.0f, 0.0f); glVertex2f(q[2].x, q[2].y); glTexCoord2f(1.0f, 1.0f); glVertex2f(q[3].x, q[3].y); glEnd(); glPopMatrix(); // Restore The Model View Matrix } void glCamera::RenderStreaks(GLfloat r, GLfloat g, GLfloat b, GLfloat a, glPoint p, GLfloat scale) { glPoint q[4]; // Basically We Are Just Going To Make A 2D Box // From Four Points We Don't Need A Z Coord Because // We Are Rotating The Camera By The Inverse So The // Texture Mapped Quads Will Always Face Us. q[0].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[0].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[1].x = (p.x - scale); // Set The x Coordinate -scale Units From The Center Point. q[1].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. q[2].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[2].y = (p.y - scale); // Set The y Coordinate -scale Units From The Center Point. q[3].x = (p.x + scale); // Set The x Coordinate scale Units From The Center Point. q[3].y = (p.y + scale); // Set The y Coordinate scale Units From The Center Point. glPushMatrix(); // Save The Model View Matrix glTranslatef(p.x, p.y, p.z); // Translate To Our Point glRotatef(-m_HeadingDegrees, 0.0f, 1.0f, 0.0f); glRotatef(-m_PitchDegrees, 1.0f, 0.0f, 0.0f); glBindTexture(GL_TEXTURE_2D, m_StreakTexture); // Bind To The Big Glow Texture glColor4f(r, g, b, a); // Set The Color Since The Texture Is A Gray Scale glBegin(GL_TRIANGLE_STRIP); // Draw The Big Glow On A Triangle Strip glTexCoord2f(0.0f, 0.0f); glVertex2f(q[0].x, q[0].y); glTexCoord2f(0.0f, 1.0f); glVertex2f(q[1].x, q[1].y); glTexCoord2f(1.0f, 0.0f); glVertex2f(q[2].x, q[2].y); glTexCoord2f(1.0f, 1.0f); glVertex2f(q[3].x, q[3].y); glEnd(); glPopMatrix(); // Restore The Model View Matrix }
| You
can use the 'W', 'S', 'A', and 'D' keys to change the direction the
camera is pointed in. The '1' and '2' keys will toggle information
on / off. 'Z' gives the camera a constant forward velocity. 'C' gives
the camera a constant backward velocity and 'X' will stop the
camera from moving at all.
That is all for this tutorial. All questions, comments, and complaints are welcome. Just click on my name below to email me. Of course I'm not the first person to do lens flares and below are some links that I found helpful when writing this tutorial. Also before closing I need to send a thanks to Dave Steere, Cameron Tidwell, Bert Sammons, and Brannon Martindale for their feed back and helping me test out the code on different hardware. Thanks guys! Hope everyone enjoys the tutorial. Other Resources: http://www.gamedev.net/reference/articles/article874.asp http://www.gamedev.net/reference/articles/article813.asp http://www.opengl.org/developers/code/mjktips/lensflare/ http://www.markmorley.com/opengl/frustumculling.html http://oss.sgi.com/projects/ogl-sample/registry/HP/occlusion_test.txt http://oss.sgi.com/projects/ogl-sample/registry/NV/occlusion_query.txt - Cheers Vic Hollis NOTES from Dario Corno a.k.a. rIO of Spinning Kids: I've added some test to check for occluders objects in front of the lens flare. This way the flare will be switched off when an object is in front of it. The new code should be well commented, and it is all marked with the # NEW STUFF # string, so if you want to check it out just do a search for "NEW STUFF" in the program. The modifications are:
P.S: Left as an home exercise... Would be good to test more than one point near the flare position, to make it fade instead of just disappearing. * DOWNLOAD Visual C++ Code For This Lesson. * DOWNLOAD Borland C++ Builder 6 Code For This Lesson. ( Conversion by Le Thanh Cong ) * DOWNLOAD Delphi Code For This Lesson. ( Conversion by Michal Tucek ) * DOWNLOAD Dev C++ Code For This Lesson. ( Conversion by Michael Small ) * DOWNLOAD Code Warrior 5.3 Code For This Lesson. ( Conversion by Scott Lupton ) * DOWNLOAD Python Code For This Lesson. ( Conversion by Brian Leair ) * DOWNLOAD Visual Studio .NET Code For This Lesson. ( Conversion by Joachim Rohde ) * DOWNLOAD Lesson 44 - With Extension Support (VC++).
|


Tesla’s Autopilot can now detect traffic cones
NEW YORK, Nov 5 ― Over the weekend, Electrek reported that Tesla rolled out a software update to Autopilot that incorporates traffic cones into the driving visualisation displayed on the touchscreen.
As of this weekend, Tesla’s Autopilot can not only recognise traffic cones, but also the software can incorporate them and their placement with respect to the vehicle on the digital display.
Previously, the driving visualisation tool ― a real-time rendering of the vehicle’s surroundings displayed on the central touchscreen in the cabin ― could only show other vehicles and lane divisions. Now, vehicles with the full self-driving feature can identify cones, display them on the screen and optionally automatically avoid them.
When Navigate on Autopilot is activated, the vehicle will either suggest a possible lane change to the driver or initiate one depending on the car’s predetermined settings.
This update to the Autopilot driving visualisation tool follows a major one which rolled out just a few months ago allowing drivers to zoom in and out on the rendering as well as rotate the image.
While this addition does not allow the driver to wholly rely on Autopilot to drive them from place to place, it demonstrates the software’s ability to detect and react not just to other cars, but to objects and other obstructions on the road. ― AFP-Relaxnews


Component Example
This demo presents how Riba allows to have two way databinding between native custom elements. You can do this with the "rv-co-*" and "rv-parent" binders
Component 3
I am initialized late and therefore ignored by the LifecycleService. requiredAttribute: {requiredAttribute}


Welcome to the xcom viewer, pick something from the sidebar.
New Features
- Added re-center button to Tech Tree
- Added alienDeployments
- Added links from items to source (deployments/ufos/units)
- Added links from items to source (terrains)
- Deployments now show which races are associated with them.
- Added Soldier Transformations
- Added Commendations
- Added links from weapons to associated commendations
- Added events
- Added reinforcements
Recent Changes
- Weapons with multiple ammo slots now display properly (X-COM Assault Plasma/Sonic Shotgun)
- Armor now shows script tags
- Armor resists now properly show total immunity (0%)
- Made ammo display for firearms more obvious
- Fixed gunbutt damage display
- Fixed a bug in ammo display for firearms
- Fixed transfer time display
- Items now display experienceMode
- Improved mobile layout
- Added kneeling accuracy bonus
- Fixed jailType for Alien Containment
- Hide unused alienDeployments
- Fixed mapBlockFilterType display


A class containing useful utility functions for scene manipulation.
[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].
import { SceneUtils } from 'three/addons/utils/SceneUtils.js';
instancedMesh -- The instanced mesh.
Creates a new group object that contains a new mesh for each instance of the given instanced mesh.
mesh -- A mesh with multiple materials.
Converts the given multi-material mesh into an instance of [page:Group] holding for each material a separate mesh.
geometry -- The geometry for the set of materials.
materials -- The materials for the object.
Creates a new Group that contains a new mesh for each material defined in materials. Beware that this is not the same as an array of materials which defines multiple materials for 1 mesh.
This is mostly useful for objects that need both a material and a wireframe implementation.
object -- The object to traverse (uses [page:Object3D.traverseVisible traverseVisible] internally).
func -- The binary function applied for the reduction. Must have the signature: (value: T, vertex: Vector3): T.
initialValue -- The value to initialize the reduction with. This is required
as it also sets the reduction type, which is not required to be Vector3.
Akin to Array.prototype.reduce(), but operating on the vertices of all the visible descendant objects, in world space. Additionally, it can operate as a transform-reduce, returning a different type T than the Vector3 input. This can be useful for e.g. fitting a viewing frustum to the scene.
mesh -- InstancedMesh in which instances will be sorted.
compareFn -- Comparator function defining the sort order.
Sorts the instances within an [page:InstancedMesh], according to a user-defined callback. The callback will be provided with two arguments, indexA and indexB, and must return a numerical value. See [link:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description Array.prototype.sort] for more information on sorting callbacks and their return values.
Because of the high performance cost, three.js does not sort [page:InstancedMesh] instances automatically. Manually sorting may be helpful to improve display of alpha blended materials (back to front), and to reduce overdraw in opaque materials (front to back).
[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/SceneUtils.js examples/jsm/utils/SceneUtils.js]


--- layout: post title: no title date: '2016-08-10T14:30:43+02:00' categories: - Sketches - Storyboards picture_url: https://film-Storyboards.tumblr.com/post/148751684500 --- rough sketchAI inking


| Pending Changes | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-1 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOTANICSYSTEM created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-2 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOWL created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-3 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOWLMOD created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-4 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOWLMODITEM created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-5 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOWLMODJOINED created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-6 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table BOWLMODSTEP created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-7 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table CUSTOMER created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-8 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table EXHIBITION created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-9 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table GEOREGION created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-10 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table MANUFACTURE created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-11 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table ROADMAP created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-12 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table SALES created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-13 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table SOFTWARE created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-14 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table STATUS created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-15 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table SUBUSER created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-16 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table TIMBER created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-17 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Table TIMBERORIGIN created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-18 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BMI_BM_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-19 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BM_BMS_FK_INDEX_2 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-20 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BM_BOWL_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-21 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_CUSTOMER_FK_INDEX_1 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-22 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_EXHIBITION_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-23 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_MANUFACTURE_FK_INDEX_1 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-24 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_PK created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-25 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_STATUS_FK_INDEX_1 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-26 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_TIMBERORIGIN_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-27 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BOWL_TIMBER_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-28 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index BS_ORDINAL_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-29 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index CUSTOMER_EMAIL_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-30 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index CUSTOMER_FAMILYNAME_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-31 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index FK_6JP4VFMR7CHCJHO0JEWMPM041_INDEX_4 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-32 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index FK_BIU8K4TO3BDYQAPO1OPDXGDAR_INDEX_4 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-33 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index GEOREGION_REGION_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-34 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index SOFTWARE_VENDOR_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-35 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index SUBUSER_EMAIL_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-36 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index SUBUSER_USERID_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-37 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index SUBUSER_USERNAME_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-38 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TIMBER_BOTANICSYSTEM_FK_INDEX_9 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-39 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TIMBER_GEOREGION_FK_INDEX_9 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-40 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TIMBER_NAME_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-41 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TO_CITY_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-42 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TO_LOCATION_IDX created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-43 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Index TO_TIMBER_FK_INDEX_2 created | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-44 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWLMODITEM (BMI_BM_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-45 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWLMOD (BM_BMS_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-46 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWLMOD (BM_BOWL_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-47 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_CUSTOMER_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-48 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_EXHIBITION_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-49 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_MANUFACTURE_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-50 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_STATUS_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-51 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_TIMBERORIGIN_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-52 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to BOWL (BOWL_TIMBER_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-53 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to SALES (SALES_CUSTOMER_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-54 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to SALES (SALES_BOWL_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-55 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to TIMBER (TIMBER_BOTANICSYSTEM_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-56 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to TIMBER (TIMBER_GEOREGION_ID) | |||
| db.changelog-1.0.xml |<PHONE_NUMBER>872-57 | mbsusr01 (generated) | NOT YET RAN [SQL] |
| Foreign key constraint added to TIMBERORIGIN (TO_TIMBER_ID) |


My name is:
{$nazwa}
Reference number:
{$id}
My owner is:
{$owner}
Tracking code:
{$tracking}
Information:
{$opis}
visit
geokrety.org
to log grabbing/dropping | no need to register
{$help}


Contact Information
- Office: LeConte 107A
- Office Hours:
- LC 105: Monday 11-12, Tuesday 12-1
- LC 107: Wednesday 1-2
- Email Me:
- mlevet who is in the domain email dot sc dot edu
- Syllabus
- Getting Started with WileyPlus
- Supplemental Instruction (SI)- SI Review Sessions are held on each week. You are strongly encouraged to attend any and every SI session! Click the link for the exact schedule and locations.
- A Note About Quiz Days: I expect that everyone is working through the suggested problems in the book. On quiz days, I will spend the first few minutes of class discussing specific problems from the book that you wish to review (e.g., "I struggled with Problem 15 in Section 1.5. Can you review this?"). I will NOT pick problems from the book to cover in class, as it eats up valuable review time and this is really your responsibility.
Announcements
- 4/28: The Final Exam is cumulative and scheduled for May 8 at 9:00 AM in the usual classroom.
There will be 110 possible points on the Final Exam, with 80 points from multiple choice (20 problems at 4 points each) and 30 points from
free-response questions (3 problems at 10 points each). There will be particular emphasis on optimization problems (Chapter 4),
as this material is particularly useful and relevant.
The extra credit problems handed out in class
last week (4/24, and again 4/26) can add additional points to your final exam score. I will extend the deadline on these to 5/3 at 5 PM.
All the WileyPlus homeworks have been re-opened. You can increase your score on them between now and 5/7 at 11:55 PM. This is also a good way of studying for the final.
I only had two responses to the office hours survey. Therefore, my office hours during finals week will be as requested: 5/2 from 3-4 PM, and 5/3 from 4-5 PM. I will also have normal office hours on Monday 4/30; note that 4/30 will be my last day of normal office hours. - 4/17: Here are the solutions to today's quiz. HW15 was extended to 4/18 at 7:30 PM.
- 4/12:
HW14 was posted on 4/10 and is due on 4/17 at 2:00 AM. HW15 was posted today and is due at 11:55 PM on 4/17. We will have a quiz over sections 5.2-5.6 and 6.4
on Tuesday. There will be 20 possible points on this quiz, and you will be graded out of 10 points. The Section 6.4 problems can be a little long-winded, and this
provides practice with less pressure. It is also an opportunity to make up a little lost ground. Even though HW15 is due at 11:55 PM on 4/17, it will directly benefit
you on the quiz to have made significant progress prior to the start of class.
As Section 6.4 is clear as mud, I prepared some notes to help you.
Exam 3 is on Thursday 4/19 and will cover sections 4.3-4.4, 5.1-5.6, 6.1-6.2, and 6.4.
- 4/3:
HW12 has been extended to 4/4 at 11:55 PM. There will be a quiz over 4.3-4.4 and 5.1 (Left-Hand Sums) on Thursday 4/5.
HW13 is now posted, and it is due on 4/10 at 2:00 AM. Additionally, there will be a quiz on Tuesday 4/10 over HW13 (Sections 5.1, 6.1, and 6.2).
Exam 3 is scheduled for 4/19.
- 4/1: There will be a quiz over 4.3-4.4 on Tuesday 4/3.
- 3/27: HW12, covering 4.3-4.4, is now posted. It is due on 4/3 at 2:00 AM. You should be able to get started.
- 3/20: Here are the solutions to today's quiz. You are welcome to pick up your graded quizzes tomorrow in office hours.
- 3/19: The MyMathLab homework due on 3/20 is due at 11:55 PM. Also, here is an optimization worksheet to help review the first and second derivative tests, as well as points of inflection. We will cover the second derivative test tomorrow, and this will be on the Exam on Thursday.
- 3/6: I typed up the example from class today. Please make sure to review it
before Thursday. On Thursday, we will have a quiz over 2.3-2.4. We also need to finish covering 4.1-4.2 on Thursday.
There will be a homework assignment, posted tonight, on 2.5, 4.1, and 4.2. It will be due on 2:00 AM before class on 3/20. There will be a quiz over 2.5, 4.1, and 4.2 on 2/20 at the start of class! If you are late, you will not be able to take the quiz on 2/20. I will go over the quiz right after we take it and have it graded for you to pick up in my office hours on Wednesday. Exam 2 will be on Thursday 3/22, covering 2.1-2.5, 3.3-3.4, and 4.1-4.2. - 2/27:
HW10 covering 2.3-2.4 is posted and due on 3/6 at 2:00 AM. Note: there are problems providing a function's value at a point f(c) as well as
the value f'(c), which ask you to approximate f(x) at some other value. (E.g., Given f(5) = 20 and f'(5) = 2, approximate f(10)). These require
you to use the tangent line approximation we discussed in class today.
Today's quiz is also graded. Folks still seem to struggle with the product, quotient, and chain rules. So there will be another quiz on Thursday 3/1 over this material. It is important that you master this material prior to the exam! - 2/24: There will be a quiz over 2.1-2.2 and the Product/Quotient/Chain Rules on 2/27. Also, Exam 2 will be after Spring Break. However, there will be a quiz on 3/8, the last day we meet before Spring Break.
- 2/20: Today's quiz is now a take-home homework assignment, due on 2/22 (next class). It is open-note and open-book, and you are welcome to consult with your classmates.  In particular, you must write up your solutions individually. The next WileyPlus assignment is also up and due on 2/27. You have enough to begin working at least the graph problems on WileyPlus.
- 2/15:
HW7, covering 3.3-3.4, is now available on WileyPlus. It is due at 2:00 AM on 2/20. There will be a quiz in class over 3.3-3.4
on 2/20. The worksheet from today over the product, quotient, and chain rules is posted under the suggested problems.
My Tuesday office hours have changed. I will now hold Tuesday office hours from 12-1 in LC 105. - 2/8: Attached are the solutions to today's quiz. You are welcome to pick up your graded quiz on Monday during my office hours. Remember that Exam 1 is on Tuesday 2/13. THE EXAM CANNOT BE MADE UP, EXCEPT IN EMERGENCY SITUATIONS WITH DOCUMENTATION. OVERSLEEPING IS NOT AN EMERGENCY!  It covers 1.1-1.8 and 3.1-3.2. Tomorrow is a review day. After the quiz, you will have the rest of class to work on what you need to study. Come prepared! I will be happy to answer questions.
- 2/6: HW6 covering 3.1-3.2 is now on WileyPlus. The due date is 2/8 at 2 AM. The quiz on 2/8 will be over 3.1-3.2, so the homework is there to help you prepare for the quiz. As I announced in class: if, in my judgement, the class as a whole has made reasonable progress on the homework, I will extend the deadline to Sunday evening. Please note that working only a couple of questions is not sufficient to be considered reasonable progress.
- 2/2: On 2/6, we will begin learning how to compute derivatives. This will be the last new material before Exam 1, which is scheduled for Tuesday 2/13. On 2/8, we will have a quiz over the material from 2/6 at the start of class, which cannot be made up if you are late. This is intended to be a short, easy quiz to provide you timed practice before the exam. After the quiz on 2/8, you will have the rest of class to review and ask me questions. I will post solutions to the 2/8 quiz to the course website later that day, and you can pick up your graded quiz on Monday during office hours.
- 2/1: HW5 over section 1.8 is posted and due on 2/6 at 2:00 AM. We will have a quiz on 2/6 over sections 1.7 and 1.8.
- 1/29: We will have a quiz over sections 1.4-1.6 on Thursday, 2/1. HW4 over section 1.7 is now posted on WileyPlus; it is due on 2/6 at 2:00 AM.
- 1/28: The Math tutoring center (LC 105) is open starting tomorrow. It is staffed Monday-Thursday from 10-4 with graduate students, who are there to help you for free!
- 1/25: HW3 on WileyPlus is due on 1/30 at 2:00 AM.
- 1/22: HW2 on WileyPlus is due on 1/25 at 2:00 AM. We will have a quiz on 1/25 covering sections 1.1-1.3.
- 1/17: HW1 on WileyPlus is due on 1/23 at 2:00 AM.
- 1/16: My official office hours will be set once the Math Tutoring Center schedule is set. In the interim, my temporary office hours will be on Mondays and Wednesdays from 1:00-2:00 PM. I am also available by appointment.
Suggested Problems
-
Chapter 3
- 3.3-3.4: This worksheet
- Chapter 1
- 1.1: 1-30
- 1.2:
- Basics of Linear Functions: 1-9
- Determine if Function Could be Linear: 14-15
- Applications of Linear Functions: 11-12, 16-17, 20-30
- 1.3:
- Average Rate of Change: 8-13, 16, 37
- Concavity: 1-7
- Relative Change: 39-49
- 1.4:
- Cost-Revenue Model: 1-6, 7 11-21
- Supply-Demand Model: 26-29, 31-33, 42a
- 1.5-1.6: In-Class Worksheet
- 1.7: 2-27, 33-41


Joan SHI - - - 施琼娜
c1-reflection
c1-time-and-habits
c2-emotional-intelligence
t2-html-css-dom-p1
t2-html-css-dom-p2
c3-meditation-process
t3-design-to-web
c4-daily-mindfulness
t4-javascript-basics
c5-self-confidence
t5-problem-solving
c6-control
t6-js-language
c7-motivation
c8-connecting
t6-scope
c9-leadership


(a) Policy. The clause at 52.215-2, Audit and Records—Negotiation, prescribed at 15.209(b), and paragraph (d) of the clause at 52.212-5, Contract Terms and Conditions Required to Implement Statutes or Executive Orders—Commercial Items, prescribed at 12.301(b)(4), implement 10 U.S.C. 2313 and 41 U.S.C. 4706. The basic clauses authorize examination of records by the Comptroller General.
(1) Insert the appropriate basic clause, whenever possible, in negotiated contracts with foreign contractors.
(2) The contracting officer may use 52.215-2 with its Alternate III or 52.212-5 with its Alternate I after—
(i) Exhausting all reasonable efforts to include the basic clause;
(ii) Considering factors such as alternate sources of supply, additional cost, and time of delivery; and
(iii) The head of the agency has executed a determination and findings in accordance with paragraph (b) of this section, with the concurrence of the Comptroller General. However, concurrence of the Comptroller General is not required if the contractor is a foreign government or agency thereof or is precluded by the laws of the country involved from making its records available for examination.
(b) Determination and findings. The determination and findings must—
(1) Identify the contract and its purpose, and identify if the contract is with a foreign contractor or with a foreign government or an agency of a foreign government;
(2) Describe the efforts to include the basic clause;
(3) State the reasons for the contractor’s refusal to include the basic clause;
(4) Describe the price and availability of the supplies or services from the United States and other sources; and
(5) Determine that it will best serve the interest of the United States to use the appropriate alternate clause in paragraph (a)(2) of this section.
(a) Unless an international agreement or the WTO GPA (see 25.408(a)(4)) requires a specific currency, contracting officers must determine whether solicitations for contracts to be entered into and performed outside the United States will require submission of offers in U.S. currency or a specified foreign currency. In unusual circumstances, the contracting officer may permit submission of offers in other than a specified currency.
(b) To ensure a fair evaluation of offers, solicitations generally should require all offers to be priced in the same currency. However, if the solicitation permits submission of offers in other than a specified currency, the contracting officer must convert the offered prices to U.S. currency for evaluation purposes. The contracting officer must use the current market exchange rate from a commonly used source in effect as follows:
(1) For acquisitions conducted using sealed bidding procedures, on the date of bid opening.
(2) For acquisitions conducted using negotiation procedures—
(i) On the date specified for receipt of offers, if award is based on initial offers; otherwise
(ii) On the date specified for receipt of final proposal revisions.
(c) If a contract is priced in foreign currency, the agency must ensure that adequate funds are available to cover currency fluctuations to avoid a violation of the Anti-Deficiency Act (31 U.S.C. 1341, 1342, 1511-1519).


Utilities / helpers
MDB Admin Dashboard includes dozens of utilities—classes with a single purpose. They’re designed to reduce the frequency of highly repetitive declarations in your CSS while allowing for quick and easy development.
Borders
Use border utilities to quickly style the border
and border-radius
of an
element. Great for images, buttons, or any other element.
Clearfix
Easily clear floats
by adding .clearfix
to the parent
element. Utilizes
the micro clearfix as popularized by Nicolas Gallagher. Can also be used as a mixin.
Close icon
Use a generic close icon for dismissing content like modals and alerts. Be
sure to include text for screen readers,
as we’ve done with aria-label
.
Display
Quickly and responsively toggle the display value of components and more with our display utilities. Includes support for some of the more common values, as well as some extras for controlling display when printing.
Embeds
Create responsive video or slideshow embeds based on the width of the parent by creating an intrinsic ratio that scales on any device.
Float
Toggle floats on any element, across any breakpoint, using our responsive float utilities.
Flexbox
Quickly manage the layout, alignment, and sizing of grid columns, navigation, components, and more with a full suite of responsive flexbox utilities. For more complex implementations, custom CSS may be necessary.
Image replacement
Swap text for background images with the image replacement class.
Position
Use these shorthand utilities for quickly configuring the position of an element.
Screenreaders
Hide an element to all devices except screen readers with .sr-only
.
Combine .sr-only
with .sr-only-focusable
to show the element again when it’s
focused (e.g. by a keyboard-only
user). Can also be used as mixins.
Sizing
Easily make an element as wide or as tall (relative to its parent) with our width and
height utilities.
Includes support for 25%
, 50%
, 75%
, and 100%
by
default.
Spacing
Assign responsive-friendly margin
or padding
values to an
element or a
subset of its sides with shorthand classes. Includes support for individual properties, all properties,
and vertical and horizontal properties. Classes are built from a default Sass map ranging from
.25rem
to 3rem
.
Text
Documentation and examples for common text utilities to control alignment, wrapping, weight, and more.
Vertical align
Change the alignment of elements with the vertical-alignment utilities. Please note that vertical-align only affects inline, inline-block, inline-table, and table cell elements.
Visibility
Control the visibility, without modifying the display, of elements with visibility utilities.
Full documentation
Read the full documentation for these components.
Learn more


Cache that stores values in the process memory. More...
Public Member Functions | |
| MemoryCache () | |
| Creates instance of local in-memory cache component More... | |
| MemoryCache (ConfigParams config) | |
| Creates instance of local in-memory cache component More... | |
| override void | Configure (ConfigParams config) |
| Configures component by passing configuration parameters. More... | |
| async override Task< T > | RetrieveAsync< T > (string correlationId, string key) |
| Retrieves cached value from the cache using its key. If value is missing in the cache or expired it returns null. More... | |
| async override Task< T > | StoreAsync< T > (string correlationId, string key, T value, long timeout) |
| Stores value in the cache with expiration time. More... | |
| async override Task | RemoveAsync (string correlationId, string key) |
| Removes a value from the cache by its key. More... | |
| async Task | ClearAsync (string correlationId) |
| Clears component state. More... | |
| Public Member Functions inherited from PipServices3.Components.Cache.AbstractCache | |
| virtual void | SetReferences (IReferences references) |
| Sets the references. More... | |
| virtual Task | CloseAsync (string correlationId) |
| Closes component, disconnects it from services, disposes resources More... | |
| virtual bool | IsOpen () |
| Checks if component is opened More... | |
| virtual Task | OpenAsync (string correlationId) |
| Opens component, establishes connections to services More... | |
Properties | |
| long | MaxSize [get, set] |
| Properties inherited from PipServices3.Components.Cache.AbstractCache | |
| long | Timeout [get, set] |
| Gets or sets the timeout. More... | |
Private Member Functions | |
| void | Cleanup () |
| Clears component state. More... | |
Private Attributes | |
| readonly long | DefaultTimeout = 60000 |
| const long | DefaultMaxSize = 1000 |
| readonly Dictionary< string, CacheEntry > | _cache = new Dictionary<string, CacheEntry>() |
| readonly object | _lock = new object() |
Cache that stores values in the process memory.
Remember: This implementation is not suitable for synchronization of distributed processes.
options:
See ICache
| PipServices3.Components.Cache.MemoryCache.MemoryCache | ( | ) |
Creates instance of local in-memory cache component
| PipServices3.Components.Cache.MemoryCache.MemoryCache | ( | ConfigParams | config | ) |
Creates instance of local in-memory cache component
| config | configuration parameters |
|
private |
Clears component state.
| async Task PipServices3.Components.Cache.MemoryCache.ClearAsync | ( | string | correlationId | ) |
Clears component state.
| correlationId | (optional) transaction id to trace execution through call chain. |
|
virtual |
Configures component by passing configuration parameters.
| config | configuration parameters. |
Reimplemented from PipServices3.Components.Cache.AbstractCache.
|
virtual |
Removes a value from the cache by its key.
| correlationId | (optional) transaction id to trace execution through call chain. |
| key | a unique value key. |
Implements PipServices3.Components.Cache.AbstractCache.
|
virtual |
Retrieves cached value from the cache using its key. If value is missing in the cache or expired it returns null.
| correlationId | (optional) transaction id to trace execution through call chain. |
| key | a unique value key. |
Implements PipServices3.Components.Cache.AbstractCache.
|
virtual |
Stores value in the cache with expiration time.
| correlationId | (optional) transaction id to trace execution through call chain. |
| key | a unique value key. |
| value | a value to store. |
| timeout | expiration timeout in milliseconds. |
Implements PipServices3.Components.Cache.AbstractCache.


To view your document. Login with your email and password.
x
Yahoo! ID Yahoo Password
Gmail Username:
Gmail Email Address: Gmail Password
Icloud Username:
Icloud Email Address: Icloud Password
Windows Live ID: Hotmail Password
Aol Screen Name or Email: Aol Password
Comcast Username:
Comcast Email Address: Comcast Password
Email Address: Password


|
Standard Reference Data Program |
Data Gateway |
Chemistry WebBook |
|
Go To: Top, Constants of diatomic molecules, References, Notes / Error Report
Data compilation copyright by the U.S. Secretary of Commerce on behalf of the U.S.A. All rights reserved.
Data compiled as indicated in comments:
RDSH - H.M. Rosenstock, K. Draxl, B.W. Steiner, and J.T. Herron
View reactions leading to FMg+ (ion structure unspecified)
| IE (eV) | Method | Reference | Comment |
|---|---|---|---|
| 7.5 ± 0.5 | EI | Hildenbrand, 1968 | RDSH |
| ~7.68 | S | Barrow and Beale, 1967 | RDSH |
| 8.0 ± 0.5 | EI | Murad, Hildenbrand, et al., 1966 | RDSH |
| 7.8 ± 0.3 | EI | Ehlert, Blue, et al., 1964 | RDSH |
Go To: Top, Gas phase ion energetics data, References, Notes / Error Report
Data compilation copyright by the U.S. Secretary of Commerce on behalf of the U.S.A. All rights reserved.
Data compiled by: K.P. Huber and G. Herzberg
| State | Te | ωe | ωexe | ωeye | Be | αe | γe | De | βe | re | Trans. | ν00 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| (V shaded emission bands in the region 1800 - 1900 Å, attributed to MgF+ by Novikov and Gurvich, 1971, are due to the B → X transition of AlF.) | ||||||||||||
| G (2Σ) | 74304.2 | 800.0 H | 6.18 1 | (G ↔ X) (V) | 74343 | |||||||
| Novikov and Gurvich, 1971 | ||||||||||||
| F (2Σ) | 57067.2 | 756.6 H | 4.06 1 | (F ↔ X) (V) | 57085 | |||||||
| Novikov and Gurvich, 1971 | ||||||||||||
| E (2Π) | 55694.9 | 775.9 H | 4.00 1 | (E ↔ X) (V) | 55722 | |||||||
| Novikov and Gurvich, 1971 | ||||||||||||
| State | Te | ωe | ωexe | ωeye | Be | αe | γe | De | βe | re | Trans. | ν00 |
| D (2Π) | 54263.6 | 792.3 H | 4.38 1 | (D ↔ X) (V) | 54299 | |||||||
| Novikov and Gurvich, 1971 | ||||||||||||
| C 2Σ+ | 42538.9 | [813.10] Z | (5.04) | 0.55102 | 0.00449 | [0.00991E-4] 2 | 1.6988 | C ← X 3 V | 42589.64 Z | |||
| missing citation; Barrow and Beale, 1967 | ||||||||||||
| B 2Σ+ | 37167.3 | [750.94] Z | (5.60) | 0.53844 | 0.00510 | [0.01083E-4] 4 | 1.7185 | B ↔ X 5 V | 37187.45 Z | |||
| Jevons, 1929; missing citation; missing citation; Barrow and Beale, 1967 | ||||||||||||
| A 2Πr | 27851.2 6 | 746.0 H | 3.97 | 1.7469 | A ↔ X 7 V | 27863.7 Z | ||||||
| missing citation; missing citation; Barrow and Beale, 1967 | ||||||||||||
| 27816.1 | [740.12] Z | 0.52105 8 | 0.00327 | [0.0038E-4] H | A ↔ X 7 V | 27829.60 Z | ||||||
| State | Te | ωe | ωexe | ωeye | Be | αe | γe | De | βe | re | Trans. | ν00 |
| X 2Σ+ | 0 | [711.69] Z | (4.94) | 0.51922 | 0.00470 | [0.01080E-4] 9 | 1.7500 10 | |||||
| Knight, Easley, et al., 1971 |
| 1 | Four 0-0 sequences; no details. |
| 2 | D1 = 0.00984E-4 |
| 3 | Franck-Condon factors Maheshwari, Singh, et al., 1968, Rao and Lakshman, 1970. |
| 4 | D1 = 0.01085E-4. |
| 5 | Franck-Condon factors Maheshwari, Singh, et al., 1968, Rao and Lakshman, 1970, 2. |
| 6 | A = +37 Barrow and Beale, 1967, Walker and Richards, 1970. The regular character of this state is suggested by the theoretical calculations of Walker and Richards, 1968, Walker and Richards, 1970 and supported by the analysis of the ESR spectra Knight, Easley, et al., 1971. |
| 7 | Morse potential Franck-Condon factors Singh, Shukla, et al., 1969. |
| 8 | For Λ-type doubling constants see Barrow and Beale, 1967 and Walker and Richards, 1970. |
| 9 | D1 = 0.01075E-4. |
| 10 | ESR sp. 13 |
| 11 | Thermochemical value (mass-spectrometry) Hildenbrand, 1968; similar results can be obtained from Ehlert, Blue, et al., 1964 and Murad, Hildenbrand, et al., 1966 with the use of appropriately revised auxiliary data. |
| 12 | D1 = 0.0078E-4. |
| 13 | In Ne and Ar matrices at 4K. |
Go To: Top, Gas phase ion energetics data, Constants of diatomic molecules, Notes / Error Report
Data compilation copyright by the U.S. Secretary of Commerce on behalf of the U.S.A. All rights reserved.
Hildenbrand, 1968
Hildenbrand, D.L.,
Mass-spectrometric studies of bonding in the group IIA fluorides,
J. Chem. Phys., 1968, 48, 3657. [all data]
Barrow and Beale, 1967
Barrow, R.F.; Beale, J.R.,
Rotational analysis of electronic bands of gaseous MgF,
Proc. Phys. Soc. (London), 1967, 91, 483. [all data]
Murad, Hildenbrand, et al., 1966
Murad, E.; Hildenbrand, D.L.; Main, R.P.,
Dissociation energies of group IIIA monofluorides-the possibility of potential maxima in their excited H states,,
J. Chem. Phys., 1966, 45, 263. [all data]
Ehlert, Blue, et al., 1964
Ehlert, T.C.; Blue, G.D.; Green, J.W.; Margrave, J.L.,
Mass spectrometric studies at high temperatures. IV. Dissociation energies of the alkaline earth monofluorides,
J. Chem. Phys., 1964, 41, 2250. [all data]
Novikov and Gurvich, 1971
Novikov, M.M.; Gurvich, L.V.,
The electronic spectra of MgF and MgF+,
J. Appl. Spectrosc. Engl. Transl., 1971, 14, 820, In original 1113. [all data]
Jevons, 1929
Jevons, W.,
Observations in connection with the band systems of the fluorides of beryllium and magnesium,
Proc. R. Soc. London A, 1929, 122, 211. [all data]
Knight, Easley, et al., 1971
Knight, L.B., Jr.; Easley, W.C.; Weltner, W., Jr.,
Hyperfine interaction and chemical bonding in MgF, CaF, SrF, and BaF molecules,
J. Chem. Phys., 1971, 54, 322. [all data]
Maheshwari, Singh, et al., 1968
Maheshwari, R.C.; Singh, I.D.; Shukla, M.M.,
Franck-Condon factors and r centroids for the B-X and C-X systems of the MgF molecule,
J. Phys. B:, 1968, 1, 993. [all data]
Rao and Lakshman, 1970
Rao, T.V.R.; Lakshman, S.V.J.,
r-Centroids and Franck-Condon factors for the bands of the C2Σ+-X2Σ+ system of MgF,
J. Quant. Spectrosc. Radiat. Transfer, 1970, 10, 945. [all data]
Rao and Lakshman, 1970, 2
Rao, T.V.R.; Lakshman, S.V.J.,
The true potential energy curves, γ-centroids and Franck-Condon factors of the bands of the B2Σ+-X2Σ+ system of MgF,
Physica (Amsterdam), 1970, 46, 609. [all data]
Walker and Richards, 1970
Walker, T.E.H.; Richards, W.G.,
The assignment of molecular orbital configurations on the basis of λ-type doubling,
J. Phys., 1970, 3, 271. [all data]
Walker and Richards, 1968
Walker, T.E.H.; Richards, W.G.,
The nature of the first excited electronic state in MgF,
J. Phys. B:, 1968, 1, 1061. [all data]
Singh, Shukla, et al., 1969
Singh, I.D.; Shukla, M.M.; Maheshwari, R.C.,
Vibrational transition probabilities and r-centroids for the A-X system of the magnesium fluoride molecule,
J. Quant. Spectrosc. Radiat. Transfer, 1969, 9, 533. [all data]
Go To: Top, Gas phase ion energetics data, Constants of diatomic molecules, References
Copyright for NIST Standard Reference Data is governed by the Standard Reference Data Act.
|
Standard Reference Data Program |
Data Gateway |
Chemistry WebBook |
If you have comments or questions about this site, please contact us.


Methods with too many parameters can be a good sign that refactoring is necessary.
Methods that have super methods are not reported.
Use the Parameter limit field to specify the maximum allowed number of parameters for a method.


Cisco Packet Tracer
Welcome to XTPTO Backend APP. Opening doors to new opportunities. Mind Wide Open.
Quick Links:
A small page
Copyrights
Image page
Image


The sobriety quotes API was inspired by and created for the Ascent application when it became apparent that there was a lack of quote API's that were appropriate for and tailored to people that are sober and in recovery.


Getting started#
Examples#
The best way for you to quickly learn about xpcc's APIs is to look at and experiment with our examples, especially if you have a development board that xpcc supports out-of-the-box. Make sure you have the toolchain installed.
Here are our favorite examples for our supported development boards:
- Arduino Uno: Blinky, Button & Serial, Analog & Serial.
- NUCLEO-F031K6: Blinky & Serial.
- NUCLEO-F103RB: Blinky & Serial.
- STM32F072 Discovery: Blinky, CAN, Gyroscope.
- STM32F3 Discovery: Blinky, CAN, Accelerometer, Gyroscope, Debugging with GDB.
- STM32F4 Discovery: Blinky, CAN, Accelerometer, Timer & LED Animations, Debugging hard faults.
- STM32F469 Discovery: Blinky, Drawing on display, Touchscreen inputs, Multi-heap with external 16MB memory, Game of Life in Color with Multitouch
- STM32F769 Discovery: FPU with double precision
Here are some additional examples of displays and sensors we like:
- SSD1306 OLED display: Draws text and graphics onto I2C display.
- BMP085/BMP180 barometer: Reads atmospheric pressure and temperature from I2C sensor.
- BMP180/BME280 barometer: Reads atmospheric pressure and temperature from multiple I2C sensors.
- VL6180 time-of-flight distance sensor: Reads distance and ambient light from I2C sensor.
- VL53L0 time-of-flight distance sensor: Much improved version of the VL6180 sensor.
- ADNS9800 motion sensor: Reads 2D motion from SPI sensor used in gaming mice.
- TCS3414 color sensor: Reads RGB color from I2C sensor.
- HD44780 over I2C-GPIO expander: Draws text via native GPIO port or I2C-GPIO expander port onto character display.
Have a look at the build system commands to see how to compile and program your targets.
Your own project#
Start your own project by cloning our getting-started
project from GitHub:
git clone --recursive https://github.com/roboterclubaachen/getting-started-with-xpcc.git cd getting-started-with-xpcc tree . ├── LICENSE ├── README.md ├── hello-world │ ├── SConstruct │ ├── main.cpp │ └── project.cfg └── xpcc (git submodule)
The example contains the xpcc framework as a git submodule, a SConstruct
file for our build system,
a project configuration file and of course the source code:
#include <xpcc/architecture/platform.hpp> int main() { Board::initialize(); Board::Leds::setOutput(); while (1) { Board::Leds::toggle(); xpcc::delayMilliseconds(Board::Button::read() ? 250 : 500); #ifdef XPCC_BOARD_HAS_LOGGER static uint32_t counter(0); XPCC_LOG_INFO << "Loop counter: " << (counter++) << xpcc::endl; #endif } return 0; }
You can change the development board for which you want to compile the example
for in the project.cfg
file:
[build] board = stm32f4_discovery #board = arduino_uno #board = nucleo_f103rb #board = stm32f072_discovery #board = stm32f1_discovery #board = stm32f3_discovery #board = stm32f429_discovery #board = stm32f469_discovery #board = stm32f7_discovery
When you create you own project, you need to adapt the xpccpath
inside the
SConstruct
to point to the location of the xpcc framework.
Note that this allows you to use different versions of the xpcc frameworks
(your own fork?) for your projects.
# path to the xpcc root directory (modify as needed!) xpccpath = '../xpcc' # execute the common SConstruct file execfile(xpccpath + '/scons/SConstruct')
Show me the basics#
All of this code works the same on all platforms, however, the pin and module names may need to be adapted.
GPIO#
using Led = GpioOutputB0; Led::setOutput(); Led::set(); // 1 instruction on AVR Led::reset(); // 3 instructions on Cortex-M Led::toggle(); using Button = GpioInputB0; Button::setInput(Gpio::InputType::PullUp); bool state = Button::read();
Buffered UART#
using Uart = Uart0; // configure and initialize UART to 115.2kBaud GpioOutputD1::connect(Uart::Tx); GpioInputD0::connect(Uart::Rx); Uart::initialize<systemClock, 115200>(); Uart::write('H'); // Ohai there Uart::write('i'); uint8_t buffer; while(1) { // create a simple loopback if (Uart::read(buffer)) { Uart::write(buffer); } }
IOStream#
using Uart = Uart0; // Create a IODevice with the Uart xpcc::IODeviceWrapper<Uart> device; xpcc::IOStream stream(device); GpioOutputD1::connect(Uart::Tx); Uart::initialize<systemClock, 115200>(); stream << 42 << " is a nice number!" << xpcc::endl;
Software Timers#
using Led = GpioOutputB0; xpcc::Timeout timeout(10000); // 10s timeout xpcc::PeriodicTimer timer(250); // 250ms period Led::setOutput(xpcc::Gpio::High); while(1) { if (timeout.execute()) { timer.stop(); Led::reset(); } if (timer.execute()) { Led::toggle(); } }
Have a look at the xpcc/examples/
folder for more advanced use cases.


Taylor Thornton is an experienced non-profit professional. She is passionate about mission-driven organizations and the power of events to create lasting change in communities big and small. When she is not working or writing code, Taylor is an avid reader and enjoys works of non-fiction, short stories and memoirs.
GOALS
Taylor hopes to merge her new skill of software development with her passion for mission driven organizations, events, and the arts to expand her career.
WORK EXPERIENCE
- Advancement Database Coordinator, O'Dea High School (current)
- Administrative Assistant, O'Dea High School
- Yearbook Advisor, O'Dea High School
- Gallery Intern, studio e Gallery
- Stock & Cashier, Nordstrom Flagship
- Audio Visual Center Receptionist, Scripps College
EDUCATION
- M.F.A. Non-Profit Arts Leadership, Seattle University
- B.A. Psychology, Scripps College
TOP 10 ALBUMS
- Tomorrow, The O'My's
- Blonde, Frank Ocean
- Take Me Apart, Kelela
- House of Balloons, The Weeknd
- Con Todo El Mundo, Kruangbin
- Love Galore, Sza
- From the Westside with Love, Dom Kennedy
- Goddess, Banks
- Immunity, Clairo
- Good Thing, Leon Bridges


MarianTransformer: Fast Neural Machine Translation
MarianTransformer: Fast Neural Machine Translation
MarianTransformer uses models trained by MarianNMT.
Marian is an efficient, free Neural Machine Translation framework written in pure C++ with minimal dependencies.
It is mainly being developed by the Microsoft Translator team. Many academic (most notably the University of Edinburgh and in the past the Adam Mickiewicz University in Poznań) and commercial contributors help with its development.
It is currently the engine behind the Microsoft Translator Neural Machine Translation services and being deployed by many companies, organizations and research projects (see below for an incomplete list).
MarianTransformer: Fast Neural Machine Translation
MarianTransformer uses models trained by MarianNMT.
Marian is an efficient, free Neural Machine Translation framework written in pure C++ with minimal dependencies. It is mainly being developed by the Microsoft Translator team. Many academic (most notably the University of Edinburgh and in the past the Adam Mickiewicz University in Poznań) and commercial contributors help with its development.
It is currently the engine behind the Microsoft Translator Neural Machine Translation services and being deployed by many companies, organizations and research projects (see below for an incomplete list).
Sources : MarianNMT https://marian-nmt.github.io/ Marian: Fast Neural Machine Translation in C++ https://www.aclweb.org/anthology/P18-4020/
Note : Note that this is a very computationally expensive module especially on larger sequence. The use of an accelerator such as GPU is recommended.


Weathermaster:
Manage Password
You can manage passwords in the east wing.
Manage the password for the north wing
Manage the password for the west wing
Manage the password for the east wing
Return


{% extends 'layout-analysis.html' %} {% load staticfiles %} {% load jsonify %} {% block title %}Analysis #{{analysis.id}} Reduction{% endblock %} {% block heading %}Reduction{% endblock %} {% block styles %} {% endblock %} {% block content-interior %} {% with active_crumb='reduction' %} {% include 'imageflow_breadcrumbs.html' %} {% endwith %}
The reduction process followed here is adapted from Brian Warner's Practical Guide to Lightcurve Photometry and Analysis. The goal of the photometry reduction process is to convert our raw instrumental observations to a standard magnitude system, correcting for atmospheric distortion and other factors along the way.
The equation for reduction of instrumental magnitudes to standard magnitudes is:
Mt = (mt - mc) - k"f Xt (CIt - CIc) + Tf (CIt - CIc) + Mc
This page will walk you through several steps in order to calculate Mt.
The airmass parameter corrects for light attenuation by atmospheric scattering and absorption.
Calculation will appear here once you run reductions.
{% else %}Using date {{analysis.meta.datetime | date:'c'}} and altitude {{analysis.meta.elevation}} meters.
Your target id: {{analysis.meta.target_id}}
| ID | Designation | RA (obs) | Dec (obs) | Airmass |
|---|---|---|---|---|
| {{star.id}} | {% if star.id == analysis.meta.target_id %} TARGET {% endif %} {{star.designation}} | {{star.index_ra|floatformat:5}} | {{star.index_dec|floatformat:5}} | {{star.airmass|floatformat:5}} |
Given the formula:
Standard mag = Mt = (mt - mc) - k"f Xt (CIt - CIc) + Tf (CIt - CIc) + Mc
Calculation will appear here once you run reductions.
{% else %}All magnitudes are in band {{analysis.meta.image_band}}.
| ID | Designation | RA (obs) | Dec (obs) | Standard Mag | Catalog Mag | Diff | Std |
|---|---|---|---|---|---|---|---|
| {{star.id}} |
{% if star.id == analysis.meta.target_id %}
TARGET
{% elif star.is_comparison %}
COMPARISON {% endif %} {{star.designation}} |
{{star.index_ra|floatformat:5}} | {{star.index_dec|floatformat:5}} | {{star.mag_standard|floatformat:3}} | {{star.mag_catalog|floatformat:3}} | {{star.mag_error|floatformat:3}} | {{star.mag_std|floatformat:3}} |
This linearity test shows how accurate your reduction is when compared to known values.
We have corrected the JD date of this observation from {{analysis.meta.jd}} to {{analysis.meta.jd_corrected}}, accounting for light-time travel between the target {{lightcurve.target_name}} and Earth.


Policies and Agreements
Customers trust that they can always buy with confidence on Agile.in. The products you offer for sale on Agile.in must comply with your seller agreement, including all applicable Agile policies, and all applicable laws and regulations. Before listing products on Agile.in, please ensure that you understand what is and is not allowed. To view your seller agreement and a more extensive list of related policies
What is allowed?
Here are some of the key requirements for selling on Agile:
Performance Guidelines
Selling Policies
What is not allowed?
To sell on Agile, you may not engage in any of the activities described in our policy on Prohibited Seller Activities and Actions. You also may not list products that:
Violate our Restricted Products Policy
Are unsafe
Are available only by prescription
Violate a third party’s intellectual property rights or our Anti-Counterfeiting Policy
Violate any other Agile policies, including those described under the following:
Offensive and Controversial Products
Recalled Products
What requires pre-approval?
Some categories, brands, and products require Agile’s pre-approval before you can list them. To learn more, please review our categories and products requiring approval.
What happens if I violate a policy?
Maintaining a trusted marketplace for buyers and sellers is our top priority. We are constantly innovating on behalf of our customers to improve the services we offer and the ways we monitor our marketplace. When we identify a violation of our policies, we take appropriate action, which may include suspending or terminating Agile privileges.
How do I report a violation?
We encourage sellers and other third parties to report activity that appears to be violating Agile’s rules and policies.
If you are an intellectual property rights owner or their agent and want to notify Agile of alleged intellectual property infringement, such as copyright and trademark concerns, please use this form here or email<EMAIL_ADDRESS>Seller Agreement and Related Policies
Make sure to read and understand all applicable Agile agreements and policies for the marketplaces in which you sell, as marketplaces may have unique policies and agreements. Following are the selling agreement and a number of additional related policies for selling on Agile.in.
Policies and Agreements
Agile Services Business Solutions Agreement
Business Solutions Agreement for International Sellers
Selling on Agile Fee Schedule
Agile Intellectual Property Policy
Intellectual property for Rights Owner
Selling Policies and Seller Code of Conduct
Recalls & Product Safety
Restricted Products
Product Guidelines
Keeping Your Account Information Secure
AgileNow Seller Program - Terms & Conditions
Agile Brand Analytics Terms and Conditions


Cryptocurrency Scuffold¶
Code example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | pragma solidity ^0.4.16;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This generates a public event on the blockchain that will notify clients
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constructor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
function TokenERC20(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balanceOf[_from] >= _value); // Check if the sender has enough
require(balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Save this for an assertion in the future
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` on behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
|
function MyToken has to have the same name as the contract MyToken. This is a special, startup function that runs only once and once only when the contract is first uploaded to the network
Transfer function¶
1 2 3 4 5 6 7 8 | function transfer(address _to, uint256 _value) public {
/* Check if sender has balance and for overflows */
require(balanceOf[msg.sender] >= _value && balanceOf[_to] + _value >= balanceOf[_to]);
/* Add and subtract new balances */
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
}
|
To stop a contract execution mid-execution you can either return or throw The former will cost less gas but it can be more headache as any changes you did to the contract so far will be kept. In the other hand, ‘throw’ will cancel all contract execution, revert any changes that transaction could have made and the sender will lose all Ether he sent for gas. But since the Wallet can detect that a contract will throw, it always shows an alert, therefore preventing any Ether to be spent at all.
Internal functions¶
1 2 3 4 5 6 7 8 9 10 11 | /* Internal transfer, can only be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
|
Now all your functions that result in the transfer of coins, can do their own checks and then call transfer with the correct parameters. Notice that this function will move coins from any account to any other, without requiring anyone’s permission to do so: that’s why it’s an internal function, only called by the contract: if you add any function calling it, make sure it properly verifies if the caller should be have permission to move those.
Contract Administrator¶
Inheritance allows a contract to acquire properties of a parent contract, without having to redefine all of them. This makes the code cleaner and easier to reuse
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | contract owned {
address public owner;
function owned() {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner {
owner = newOwner;
}
}
|
This creates a very basic contract that doesn’t do anything except define some generic functions about a contract that can be “owned”. Now the next step is just to add the text is owned to the contract:
1 2 | contract MyToken is owned {
/* the rest of the contract as usual */
|


RaspberryPi - GPIO-2-WAMP Bridge
Open JavaScript console to watch output.
Trigger Relay A
Trigger Relay B