Coordinate Transformations | |
| #define | AI_WORLD_TO_OBJECT 1 |
| World-to-object coordinate transformation. | |
| #define | AI_OBJECT_TO_WORLD 2 |
| Object-to-world coordinate transformation. | |
Wireframe Types | |
| #define | AI_WIREFRAME_TRIANGLES 0 |
| Tessellated triangles. | |
| #define | AI_WIREFRAME_POLYGONS 1 |
| Tessellated polygons. | |
| #define | AI_WIREFRAME_PATCHES 2 |
| Patches before subdivision. | |
Lighting Functions | |
| AI_API AtColor | AiOcclusion (const AtVector *N, const AtVector *Ng, AtShaderGlobals *sg, float mint, float maxt, float spread, float falloff, const AtSampler *sampler, AtVector *Nbent) |
| Returns the ambient occlusion at a shading point. More... | |
| AI_API AtColor | AiSelfOcclusion (const AtVector *N, const AtVector *Ng, AtShaderGlobals *sg, float mint, float maxt, float spread, float falloff, const AtSampler *sampler, AtVector *Nbent) |
| Returns the ambient occlusion at a shading point, only considering the same object. More... | |
| AI_API AtColor | AiDirectDiffuse (const AtVector *N, AtShaderGlobals *sg) |
| Returns the direct-lighting component of the irradiance at a shading point. More... | |
| AI_API AtColor | AiHairDirectDiffuseCache (const struct AtShaderGlobals *sg) |
| Return the direct irradiance interpolated from the hair diffuse cache. More... | |
| AtColor | AiIndirectDiffuse (const AtVector *N, AtShaderGlobals *sg, const AtRGB &weight) |
| Returns the indirect-lighting component of the irradiance at a shading point. More... | |
| AI_API void | AiReflect (const AtVector *I, const AtVector *N, AtVector *R) |
| Returns specular direction R from incident direction I and normal N. More... | |
| AI_API void | AiReflectSafe (const AtVector *I, const AtVector *N, const AtVector *Ng, AtVector *R) |
| Returns specular direction R from incident direction I and normal N. More... | |
| AI_API bool | AiRefract (const AtVector *I, const AtVector *N, AtVector *T, float n1, float n2) |
| Returns transmitted direction T from incident direction I and normal N. More... | |
| AI_API AI_CONST float | AiFresnelWeight (AtVector N, AtVector Rd, float Krn) |
| Computes Fresnel reflectance at an air-dielectric interface for given normal and viewing vectors. More... | |
| AI_API void | AiFresnelWeightRGB (const AtVector *N, const AtVector *Rd, const AtColor *Krn, AtColor *Kf) |
| Optimized version of AiFresnelWeight() for RGB reflectance. More... | |
| AI_API void | AiFaceForward (AtVector *N, AtVector I) |
| Make a normal vector face forward with respect to a given vector. More... | |
| AI_API void | AiBuildLocalFrameShirley (AtVector *u, AtVector *v, const AtVector *N) |
| Build an orthonormal basis aligned with vector N (Shirley's method). More... | |
| AI_API void | AiBuildLocalFramePolar (AtVector *u, AtVector *v, const AtVector *N) |
| Build an orthonormal basis aligned with vector N (polar method). More... | |
Utility Helper Types | |
| typedef float(* | AtFloatBumpEvaluator) (AtShaderGlobals *sg, void *data) |
| This function pointer points to float-based bump-mapping function for use by AiShaderGlobalsEvaluateBump(). More... | |
Utility Functions | |
| AI_API bool | AiShaderGlobalsGetTriangle (const AtShaderGlobals *sg, int key, AtPoint p[3]) |
| Get triangle vertices at a given motion key. More... | |
| AI_API bool | AiShaderGlobalsGetVertexNormals (const AtShaderGlobals *sg, int key, AtVector n[3]) |
| Get normal vectors for all triangle vertices. More... | |
| AI_API bool | AiShaderGlobalsGetVertexUVs (const AtShaderGlobals *sg, AtPoint2 uv[3]) |
| Get UV coordinates for all triangle vertices. More... | |
| AI_API AtUInt32 | AiShaderGlobalsGetPolygon (const AtShaderGlobals *sg, int key, AtPoint *p) |
| Get polygon vertices at a given motion key. More... | |
| AI_API void | AiShaderGlobalsGetPositionAtTime (const AtShaderGlobals *sg, float time, AtPoint *P, AtVector *N, AtVector *Ng, AtVector *Ns) |
| Reproject the shading point to a different time. More... | |
| AI_API AI_PURE AtPoint2 | AiShaderGlobalsGetPixelMotionVector (const AtShaderGlobals *sg, float time0, float time1) |
| Compute motion vector. More... | |
| AI_API AI_PURE AtBBox | AiShaderGlobalsGetBBoxLocal (const AtShaderGlobals *sg) |
| Get the object-space bounds of the current object. More... | |
| AI_API AI_PURE AtBBox | AiShaderGlobalsGetBBoxWorld (const AtShaderGlobals *sg) |
| Get the world-space bounds of the current object. More... | |
| AI_API AI_PURE AtVector | AiShaderGlobalsTransformNormal (const AtShaderGlobals *sg, AtVector N, int space) |
| AI_API AI_PURE AtPoint | AiShaderGlobalsTransformPoint (const AtShaderGlobals *sg, AtPoint P, int space) |
| AI_API AI_PURE AtVector | AiShaderGlobalsTransformVector (const AtShaderGlobals *sg, AtVector V, int space) |
| AI_API AI_DEPRECATED void | AiShaderGlobalsSetTraceSet (AtShaderGlobals *sg, const char *set, bool inclusive) |
| Takes a trace-set string and assigns it to the shader globals. More... | |
| AI_API void | AiShaderGlobalsSetTraceSetAtString (AtShaderGlobals *sg, const AtString set, bool inclusive) |
| void | AiShaderGlobalsSetTraceSet (AtShaderGlobals *sg, const AtString set, bool inclusive) |
| AI_API void | AiShaderGlobalsUnsetTraceSet (AtShaderGlobals *sg) |
| Resets the trace-set for this shader globals. More... | |
| AI_API void * | AiShaderGlobalsQuickAlloc (const AtShaderGlobals *sg, AtUInt32 size) |
| Allocates temporary memory for this ray-tree. More... | |
| AI_API AI_PURE AtVector | AiShaderGlobalsEvaluateBump (AtShaderGlobals *sg, AtFloatBumpEvaluator bump_func, void *data) |
| Computes and returns a normal based on the current shading point and the specified bump-function. More... | |
| AI_API bool | AiShaderGlobalsApplyOpacity (AtShaderGlobals *sg, AtRGB opacity) |
| Performs some optimizations given the current opacity and shader globals which allow for increased performance. More... | |
| AI_API AI_PURE float | AiShaderGlobalsEdgeLength (const AtShaderGlobals *sg) |
| Computes the maximum (for now) edge length of a given polygon. More... | |
| AI_API AI_PURE float | AiWireframe (const AtShaderGlobals *sg, float line_width, bool raster_space, int edge_type) |
| Computes wireframe shading for a mesh. More... | |
| AI_API AI_PURE bool | AiShaderGlobalsIsObjectMatte (const AtShaderGlobals *sg) |
| Retrieve the matte setting for the current object. More... | |
| void | AiFaceViewer (const AtShaderGlobals *sg, AtVector &n) |
| Make the surface normal face the viewer. More... | |
Camera Information | |
| AI_API AI_PURE float | AiCameraGetShutterStart () |
| Fetch camera shutter start. More... | |
| AI_API AI_PURE float | AiCameraGetShutterEnd () |
| Fetch camera shutter end. More... | |
| AI_API void | AiCameraToWorldMatrix (const AtNode *node, float time, AtMatrix out) |
| Computes camera to world matrix. More... | |
| AI_API void | AiWorldToCameraMatrix (const AtNode *node, float time, AtMatrix out) |
| Computes world to camera matrix. More... | |
| AI_API void | AiWorldToScreenMatrix (const AtNode *node, float time, AtMatrix out) |
| Computes world to screen matrix. More... | |
Environment Mappings | |
| AI_API void | AiMappingMirroredBall (const AtVector *dir, float *u, float *v) |
| Maps a world-space direction vector to texture coordinates (u,v) based on the mirrored-ball mapping. More... | |
| AI_API void | AiMappingAngularMap (const AtVector *dir, float *u, float *v) |
| Maps a world-space direction vector to texture coordinates (u,v) based on an angular mapping. More... | |
| AI_API void | AiMappingLatLong (const AtVector *dir, float *u, float *v) |
| Maps a world-space direction vector to texture coordinates (u,v) based on the Latitude/Longitude mapping. More... | |
| AI_API void | AiMappingCubicMap (const AtVector *dir, float *u, float *v) |
| Maps a world-space direction vector to texture coordnates (u,v) based on a cubic mapping. More... | |
Derivatives for Environment Mappings | |
| AI_API void | AiMappingMirroredBallDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
| Derivative version of AiMappingMirroredBall(). More... | |
| AI_API void | AiMappingAngularMapDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
| Derivative version of AiMappingAngularMap(). More... | |
| AI_API void | AiMappingLatLongDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
| Derivative version of AiMappingLatLong(). More... | |
| AI_API void | AiMappingCubicMapDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
| Derivative version of AiMappingCubicMap(). More... | |
| typedef float(* AtFloatBumpEvaluator) (AtShaderGlobals *sg, void *data) |
This function pointer points to float-based bump-mapping function for use by AiShaderGlobalsEvaluateBump().
This function would return the displacement height for the given shading context. This function would be called three times (on three different shading contexts). The returned displacements would be used to generate a triangle from which a normal is calculated.
| sg | the current shading context |
| data | user-defined data pointer |
| AI_API AtColor AiOcclusion | ( | const AtVector * | N, |
| const AtVector * | Ng, | ||
| AtShaderGlobals * | sg, | ||
| float | mint, | ||
| float | maxt, | ||
| float | spread, | ||
| float | falloff, | ||
| const AtSampler * | sampler, | ||
| AtVector * | Nbent | ||
| ) |
Returns the ambient occlusion at a shading point.
Computes an ambient occlusion lookup: fire a number of hemispherical rays, return the ratio of hits/rays and, optionally, also return the bent normal.
Note that if N is set to the mirror direction, you get reflection occlusion. In the extreme, if spread is set to 0, you get sharp mirror occlusion.
The geometric normal is used for detecting occlusion rays that penetrate into the surface, thus biasing the result.
| N | normal vector at the shading point | |
| Ng | geometric normal | |
| sg | the shader globals context where occlusion is evaluated | |
| mint | minimum ray distance | |
| maxt | maximum ray distance | |
| spread | angular spread around the normal vector N, in the range [0,1], where 1 maps to 90 degrees (the full hemisphere) | |
| falloff | exponential falloff rate for the occlusion along the ray distance | |
| sampler | a two-dimensional AtSampler object that holds the number of samples to take per evaluation | |
| [out] | Nbent | if non-NULL, the average direction to non-occluded areas, or bent normal, will be stored here |
| AI_API AtColor AiSelfOcclusion | ( | const AtVector * | N, |
| const AtVector * | Ng, | ||
| AtShaderGlobals * | sg, | ||
| float | mint, | ||
| float | maxt, | ||
| float | spread, | ||
| float | falloff, | ||
| const AtSampler * | sampler, | ||
| AtVector * | Nbent | ||
| ) |
Returns the ambient occlusion at a shading point, only considering the same object.
Computes an ambient occlusion lookup: fire a number of hemispherical rays, return the ratio of hits/rays and, optionally, also return the bent normal.
Note that if N is set to the mirror direction, you get reflection occlusion. In the extreme, if spread is set to 0, you get sharp mirror occlusion.
The geometric normal is used for detecting occlusion rays that penetrate into the surface, thus biasing the result.
| N | normal vector at the shading point | |
| Ng | geometric normal | |
| sg | the shader globals context where occlusion is evaluated | |
| mint | minimum ray distance | |
| maxt | maximum ray distance | |
| spread | angular spread around the normal vector N, in the range [0,1], where 1 maps to 90 degrees (the full hemisphere) | |
| falloff | exponential falloff rate for the occlusion along the ray distance | |
| sampler | a two-dimensional AtSampler object that holds the number of samples to take per evaluation | |
| [out] | Nbent | if non-NULL, the average direction to non-occluded areas, or bent normal, will be stored here |
| AI_API AtColor AiDirectDiffuse | ( | const AtVector * | N, |
| AtShaderGlobals * | sg | ||
| ) |
Returns the direct-lighting component of the irradiance at a shading point.
Computes the irradiance coming directly from all light sources in the scene, at shading point sg->P with normal N.
| N | normal vector that defines the hemisphere of incoming radiance |
| sg | shader globals context where irradiance is evaluated at |
| AI_API AtColor AiHairDirectDiffuseCache | ( | const struct AtShaderGlobals * | sg | ) |
Return the direct irradiance interpolated from the hair diffuse cache.
This function stores direct diffuse lighting at hair vertices (technically: segment end points). The cache is filled on-demand on the first lookup.
This cache should only be used indirectly for GI rays, so the error introduced by interpolating within a segment is hopefully not too great (for directly viewed rays there is little benefit to using the diffuse cache because the specular highlights require their own light loop anyway).
| sg | a shader globals context |
|
inline |
Returns the indirect-lighting component of the irradiance at a shading point.
Computes the indirect irradiance as an integral of the incident radiance over the hemisphere. The irradiance is computed at surface point sg->P.
This is usually called from shaders that need diffuse global illumination.
| N | normal vector that defines the hemisphere of incoming radiance |
| sg | shader globals context where irradiance is evaluated at |
| weight | RGB weight applied to the result and used for Russian roulette termination for more efficient rendering with high GI depth |
Returns specular direction R from incident direction I and normal N.
| I | incident direction | |
| N | surface normal | |
| [out] | R | outgoing mirror direction with respect to N |
| AI_API void AiReflectSafe | ( | const AtVector * | I, |
| const AtVector * | N, | ||
| const AtVector * | Ng, | ||
| AtVector * | R | ||
| ) |
Returns specular direction R from incident direction I and normal N.
This function should be used for Phong-smoothed meshes instead of AiReflect(). It makes sure the reflected vector doesn't penetrate below the geometric normal, which happens when the smooth (interpolated) normal points away from the viewing direction near silhouettes.
| I | incident direction | |
| N | surface normal | |
| Ng | surface normal | |
| [out] | R | outgoing mirror direction with respect to N |
Returns transmitted direction T from incident direction I and normal N.
| I | incident direction | |
| N | surface normal | |
| [out] | T | outgoing transmitted direction with respect to N |
| n1 | index of refraction (IOR) of the medium the incident ray travels in | |
| n2 | index of refraction (IOR) of the medium the transmitted ray travels in |
Computes Fresnel reflectance at an air-dielectric interface for given normal and viewing vectors.
Uses Schlick's cos^5 approximation.
| N | surface normal |
| V | incident viewing direction |
| Krn | reflectance at normal incidence, derived from the dielectric's IOR |
| AI_API void AiFresnelWeightRGB | ( | const AtVector * | N, |
| const AtVector * | V, | ||
| const AtColor * | Krn, | ||
| AtColor * | Kf | ||
| ) |
Optimized version of AiFresnelWeight() for RGB reflectance.
Using this function once avoids three calls to the scalar AiFresnelWeight(), saving a few CPU cycles.
| N | surface normal | |
| V | incident viewing direction | |
| Krn | reflectance at normal incidence, derived from the dielectric's IOR | |
| [out] | Kf | reflectance value, in [0,1]^3 |
Make a normal vector face forward with respect to a given vector.
Reverses vector N if needed, in order to make it face forward with respect to vector I.
| [in,out] | N | surface normal |
| I | incident direction |
Build an orthonormal basis aligned with vector N (Shirley's method).
This is Peter Shirley's method of building a local reference frame (U,V,W), where W = N. This method is discontinuous at the planes separating the spherical quadrants.
| [out] | U | normalized U basis vector |
| [out] | V | normalized V basis vector |
| N | normalized vector that will serve as our W basis vector (usually this is a surface normal) |
Build an orthonormal basis aligned with vector N (polar method).
Builds local reference frame (U,V,W), where W = N. Uses the parametric tangent vectors in polar coordinates. This is continuous all across the sphere but at the poles.
| [out] | U | normalized U basis vector |
| [out] | V | normalized V basis vector |
| N | normalized vector that will serve as our W basis vector (usually this is a surface normal) |
| AI_API bool AiShaderGlobalsGetTriangle | ( | const AtShaderGlobals * | sg, |
| int | key, | ||
| AtPoint | p[3] | ||
| ) |
Get triangle vertices at a given motion key.
Return object-space triangle vertices at this shading context, at a given motion key. It is up to the caller to transform the vertices to world-space as needed.
| sg | a shader globals context of type AI_CONTEXT_SURFACE | |
| key | motion key to get the triangle at (if -1, vertices are interpolated at sg->time ) | |
| [out] | p | output array of triangle vertices in object-space |
| AI_API bool AiShaderGlobalsGetVertexNormals | ( | const AtShaderGlobals * | sg, |
| int | key, | ||
| AtVector | n[3] | ||
| ) |
Get normal vectors for all triangle vertices.
| sg | a shader globals context of type AI_CONTEXT_SURFACE | |
| key | motion key to get the normals at (if -1, normals are interpolated at sg->time ) | |
| [out] | n | output array of triangle vertex normals |
| AI_API bool AiShaderGlobalsGetVertexUVs | ( | const AtShaderGlobals * | sg, |
| AtPoint2 | uv[3] | ||
| ) |
Get UV coordinates for all triangle vertices.
| sg | a shader globals context of type AI_CONTEXT_SURFACE | |
| [out] | uv | output array of UV coordinates |
| AI_API AtUInt32 AiShaderGlobalsGetPolygon | ( | const AtShaderGlobals * | sg, |
| int | key, | ||
| AtPoint * | p | ||
| ) |
Get polygon vertices at a given motion key.
Return object-space polygon vertices at this shading context, at a given motion key. It is up to the caller to transform the vertices to world-space as needed.
Usage example:
| sg | a shader globals context of type AI_CONTEXT_SURFACE | |
| key | motion key to get the polygon at (if -1, vertices are interpolated at sg->time ) | |
| [out] | p | if non-null, it will be filled with polygon vertices in object-space |
sg
| AI_API void AiShaderGlobalsGetPositionAtTime | ( | const AtShaderGlobals * | sg, |
| float | time, | ||
| AtPoint * | P, | ||
| AtVector * | N, | ||
| AtVector * | Ng, | ||
| AtVector * | Ns | ||
| ) |
Reproject the shading point to a different time.
The function will take in a shader globals and output a new position, smooth and geometric normal. Note that the normals are optional, if any of them is not needed, you may pass NULL
to avoid their calculation.
A typical use of this function is to reproject the shading point to time=0, so that the new point can be used to index into a user-created spatial data structure that was built at time=0 and thus has no support for motion-blur. For example, a static, octree-based irradiance cache.
| sg | a shader globals context of type AI_CONTEXT_SURFACE | |
| time | time at which sg->P will be reprojected | |
| [out] | P | reprojected sg->P (required) |
| [out] | N | reprojected sg->N (optional) |
| [out] | Ng | reprojected sg->Ng (optional) |
| [out] | Ns | reprojected sg->Ns (optional) |
| AI_API AI_PURE AtPoint2 AiShaderGlobalsGetPixelMotionVector | ( | const AtShaderGlobals * | sg, |
| float | time0, | ||
| float | time1 | ||
| ) |
Compute motion vector.
Measures the motion of the hit point in screen space during the given time interval. This can be used to implement screen space motion vector shaders.
| sg | shader globals for current hit point |
| time0 | time from which to start the vector |
| time1 | time at which to stop the vector |
| AI_API AI_PURE AtBBox AiShaderGlobalsGetBBoxLocal | ( | const AtShaderGlobals * | sg | ) |
Get the object-space bounds of the current object.
| sg | a shader globals context of type AI_CONTEXT_SURFACE |
| AI_API AI_PURE AtBBox AiShaderGlobalsGetBBoxWorld | ( | const AtShaderGlobals * | sg | ) |
Get the world-space bounds of the current object.
| sg | a shader globals context of type AI_CONTEXT_SURFACE |
| AI_API AI_DEPRECATED void AiShaderGlobalsSetTraceSet | ( | AtShaderGlobals * | sg, |
| const char * | set, | ||
| bool | inclusive | ||
| ) |
Takes a trace-set string and assigns it to the shader globals.
Any ray created on the basis of this shader globals, will use this trace-set.
| sg | shader globals context where the trace-set will be stored |
| set | the trace-set string |
| inclusive | indicates if the trace-set is to be treated as an inclusive set, as opposed to an exclusive one |
| AI_API void AiShaderGlobalsUnsetTraceSet | ( | AtShaderGlobals * | sg | ) |
Resets the trace-set for this shader globals.
Sets the trace-set to NULL which indicates that trace-sets are to be ignored. While the same behavior can be achieved by calling AiShaderGlobalsSetTraceSet() and either passing in a NULL, or passing the name of a trace-set that doesn't exist and setting inclusive
to false, it is both cleaner and more efficient to use this function instead.
| sg | shader globals context where the trace-set will be removed from |
| AI_API void* AiShaderGlobalsQuickAlloc | ( | const AtShaderGlobals * | sg, |
| AtUInt32 | size | ||
| ) |
Allocates temporary memory for this ray-tree.
This function returns a block of memory that will be accessible until the camera ray for this sample is done. The memory is allocated from an internal memory pool that is flushed after each sub-pixel sample. This is much faster than allocating memory via malloc()
or AiMalloc(). This can be useful to exchange data of type pointer or string within shader networks or across rays by using message passing.
| sg | non-NULL shader globals context for the point being shaded |
| size | number of bytes to allocate |
NULL
if either parameter was NULL
or 0 | AI_API AI_PURE AtVector AiShaderGlobalsEvaluateBump | ( | AtShaderGlobals * | sg, |
| AtFloatBumpEvaluator | bump_func, | ||
| void * | data | ||
| ) |
Computes and returns a normal based on the current shading point and the specified bump-function.
This function will compute and return a perturbed normal based on the specified shading point and bump-mapping function. This function will create three new shader-globals contexts surrounding the shading point, and call the supplied bump-mapping function with the three new displaced shading contexts. Given a particular shading context, the bump-mapping function should return its associated displacement value (a float). The new normal is calculated based on a forward differencing of the the values returned by this bump-mapping function.
This function itself will not modify the incoming AtShaderGlobals, but it is possible that the bump-mapping function itself, or those functions that it might call, will modify the incoming 'sg'.
| sg | shader globals context for the point whose perturbed normal is being computed |
| bump_func | a bump-mapping function which returns a float-based displacement amount. This function will be executed three times with three different shading point contexts. |
| data | an opaque user-pointer which is passed on to the bump-mapping function in order to help pass on state information. |
| AI_API bool AiShaderGlobalsApplyOpacity | ( | AtShaderGlobals * | sg, |
| AtRGB | opacity | ||
| ) |
Performs some optimizations given the current opacity and shader globals which allow for increased performance.
This function will compute an equivalent opacity to that given as the parameter. It will then set the sg->out_opacity value with the result of this computation.
The function will return a boolean result indicating whether or not the resulting opacity is totally transparent. If the value is true, the sg->out_opacity was set to AI_RGB_BLACK and the shader can perform an early exit since its result will not be visible.
| sg | shader globals context for the point whose opacity is being applied |
| opacity | opacity value upon which the optimizations are applied |
| AI_API AI_PURE float AiShaderGlobalsEdgeLength | ( | const AtShaderGlobals * | sg | ) |
Computes the maximum (for now) edge length of a given polygon.
This is currently used by the heatmap code in the utility
node.
| sg | shader globals context at the shading point |
sg
| AI_API AI_PURE float AiWireframe | ( | const AtShaderGlobals * | sg, |
| float | line_width, | ||
| bool | raster_space, | ||
| int | edge_type | ||
| ) |
Computes wireframe shading for a mesh.
Returns 0 when the current point is close to the triangle's edges and 1 otherwise. A fractional value may be returned in between for anti-aliasing purposes. This can be used to render the wireframe of a mesh.
| sg | shader globals context at the shading point |
| line_width | the size of the lines in either pixel-space or world-space |
| raster_space | if enabled, line_width works in pixel-space |
| edge_type | this value should be one of AI_WIREFRAME_* |
| AI_API AI_PURE bool AiShaderGlobalsIsObjectMatte | ( | const AtShaderGlobals * | sg | ) |
Retrieve the matte setting for the current object.
The matte setting when turned on will force the object to have an RGBA of zero. Surface shaders are not run when the object is both opaque and matte at the same time, and when it is not opaque the shaders will be run only to retrieve opacity for blending purposes.
|
inline |
Make the surface normal face the viewer.
Reverses vector sg->N if needed, in order to make it face forward with respect to viewing vector sg->Rd (not necessarily a camera ray).
| sg | the current shading context | |
| [out] | n | viewer-facing normal vector |
| AI_API AI_PURE float AiCameraGetShutterStart | ( | ) |
Fetch camera shutter start.
| AI_API AI_PURE float AiCameraGetShutterEnd | ( | ) |
Fetch camera shutter end.
This function correctly accounts for closed shutters and disabled motion blur.
Computes camera to world matrix.
Computes the matrix that transforms between camera space and world space. Camera space is defined such that +x is right, +y is up and looks down -z. This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
| node | camera node to get matrix from | |
| time | absolute time at which to calculate the matrix | |
| [out] | out | this matrix will be filled with the camera to world matrix for the requested time |
Computes world to camera matrix.
Computes the matrix that transforms between world space and camera space. Camera space is defined such that +x is right, +y is up and looks down -z. This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
| node | camera node to get matrix from | |
| time | absolute time at which to calculate the matrix | |
| [out] | out | this matrix will be filled with the world to camera matrix for the requested time |
Computes world to screen matrix.
Computes the matrix that transforms between world space and screen space. Screen space is defined such that +x is right, +y is up and looks down +z. After a homogenous transform and normalization by w, you will have x and y in [-1,+1] and z in [0,1] (which correspond to near and far clipping planes).
This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
| node | camera node to get matrix from | |
| time | absolute time at which to calculate the matrix | |
| [out] | out | this matrix will be filled with the world to screen matrix for the requested time |
| AI_API void AiMappingMirroredBall | ( | const AtVector * | dir, |
| float * | u, | ||
| float * | v | ||
| ) |
Maps a world-space direction vector to texture coordinates (u,v) based on the mirrored-ball mapping.
| dir | World-space direction vector | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| AI_API void AiMappingAngularMap | ( | const AtVector * | dir, |
| float * | u, | ||
| float * | v | ||
| ) |
Maps a world-space direction vector to texture coordinates (u,v) based on an angular mapping.
| dir | World-space direction vector | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| AI_API void AiMappingLatLong | ( | const AtVector * | dir, |
| float * | u, | ||
| float * | v | ||
| ) |
Maps a world-space direction vector to texture coordinates (u,v) based on the Latitude/Longitude mapping.
| dir | World-space direction vector | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| AI_API void AiMappingCubicMap | ( | const AtVector * | dir, |
| float * | u, | ||
| float * | v | ||
| ) |
Maps a world-space direction vector to texture coordnates (u,v) based on a cubic mapping.
The cubic environment map is composed of 6 faces and must have the following layout:
This is also known as the Vertical Cross Cube format.
| dir | World-space direction vector | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| AI_API void AiMappingMirroredBallDerivs | ( | const AtVector * | dir, |
| const AtVector * | dDdx, | ||
| const AtVector * | dDdy, | ||
| float * | u, | ||
| float * | v, | ||
| float * | dudx, | ||
| float * | dudy, | ||
| float * | dvdx, | ||
| float * | dvdy | ||
| ) |
Derivative version of AiMappingMirroredBall().
| dir | World-space direction vector | |
| dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
| dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| [out] | dudx | Pointer to location in which to write dudx |
| [out] | dudy | Pointer to location in which to write dudy |
| [out] | dvdx | Pointer to location in which to write dvdx |
| [out] | dvdy | Pointer to location in which to write dvdy |
| AI_API void AiMappingAngularMapDerivs | ( | const AtVector * | dir, |
| const AtVector * | dDdx, | ||
| const AtVector * | dDdy, | ||
| float * | u, | ||
| float * | v, | ||
| float * | dudx, | ||
| float * | dudy, | ||
| float * | dvdx, | ||
| float * | dvdy | ||
| ) |
Derivative version of AiMappingAngularMap().
| dir | World-space direction vector | |
| dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
| dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| [out] | dudx | Pointer to location in which to write dudx |
| [out] | dudy | Pointer to location in which to write dudy |
| [out] | dvdx | Pointer to location in which to write dvdx |
| [out] | dvdy | Pointer to location in which to write dvdy |
| AI_API void AiMappingLatLongDerivs | ( | const AtVector * | dir, |
| const AtVector * | dDdx, | ||
| const AtVector * | dDdy, | ||
| float * | u, | ||
| float * | v, | ||
| float * | dudx, | ||
| float * | dudy, | ||
| float * | dvdx, | ||
| float * | dvdy | ||
| ) |
Derivative version of AiMappingLatLong().
| dir | World-space direction vector | |
| dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
| dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| [out] | dudx | Pointer to location in which to write dudx |
| [out] | dudy | Pointer to location in which to write dudy |
| [out] | dvdx | Pointer to location in which to write dvdx |
| [out] | dvdy | Pointer to location in which to write dvdy |
| AI_API void AiMappingCubicMapDerivs | ( | const AtVector * | dir, |
| const AtVector * | dDdx, | ||
| const AtVector * | dDdy, | ||
| float * | u, | ||
| float * | v, | ||
| float * | dudx, | ||
| float * | dudy, | ||
| float * | dvdx, | ||
| float * | dvdy | ||
| ) |
Derivative version of AiMappingCubicMap().
| dir | World-space direction vector | |
| dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
| dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
| [out] | u | Pointer to location in which to write u |
| [out] | v | Pointer to location in which to write v |
| [out] | dudx | Pointer to location in which to write dudx |
| [out] | dudy | Pointer to location in which to write dudy |
| [out] | dvdx | Pointer to location in which to write dvdx |
| [out] | dvdy | Pointer to location in which to write dvdy |


--- title: fastdownload keywords: fastai sidebar: home_sidebar summary: "Easily download, verify, and extract archives" description: "Easily download, verify, and extract archives" nb_path: "index.ipynb" ---
If you have datasets or other archives that you want to make available to your users, and ensure they always have the latest versions and that they are downloaded correctly, fastdownload
can help.
Using pip:
pip install fastdownload
...or using conda:
conda install -c fastai fastdownload
The situation where you might want to use fastdownload
is where you have one or more URLs pointing at some archives you want to make available, and you want to ensure that your users download those archives correctly, have the latest version, and that it's as easy as possible for them to access the information in those archives.
Your user just calls a single method, FastDownload.get
, passing the URL required, and the URL will be downloaded and extracted to the directories you choose. The path to the extracted file is returned. If that URL has already been downloaded, then the cached archive or contents will be used automatically. However, if that size or hash of the archive is different to what it should be, then the user will be informed, and a new version will be downloaded.
In the future, you may want to update one or more of your archives. When you do so, fastdownload
will ensure your users have the latest version, by checking their downloaded archives against your updated file size and hash information.
For instance, fastai
uses fastdownload
to provide access to datasets for deep learning. fastai
users can download and extract them with a single command, using the return value to access the files. The files are automatically placed in appropriate subdirectories of a .fastai
folder in the user's homedir. If a dataset is updated, users are informed the next time they use the dataset, and the latest version is automatically downloaded and extracted for them.
When your users download an archive, fastdownload
will automatically save it to a directory, check if the size and hash matches, and extract the contents. Minimal usage for downloading and extracting is:
from fastdownload import FastDownload
d = FastDownload()
path = d.get('https://...')
After this, path
will contain the path where the extracted files are located. By default, archives are saved to {base}/archive
, and extracted to {base}/data
. {base}
defaults to ~/.fastdownload
. If there is more than one file or folder in the root of the downloaded archive, then a new folder is created in data
for the contents.
Instead of get
, use download
to download the URL without extracting it, or extract
to extract the URL without downloading it (assuming it's already been downloaded to the archive
directory). All of these methods accept a force
parameter which will download/extract the archive even if it's already present.
You can change any or all of the base
, archive
, and data
paths by passing them to FastDownload
:
d = FastDownload(base='~/.mypath', archive='downloaded', data='extracted')
You can remove the cached archive file and/or the extracted contents with rm
:
d.rm('https://...')
fastdownload
will add a file download_checks.py
to your Python module which contains file sizes and hashes for your archives. The file is located in the same directory as a module you choose, e.g.:
d = FastDownload(module=fastai.some_module)
Then use update
to create or update the size and hash for a URL:
d.update('https://...')
You will now find there is a file called download_checks.py
in the same directory where fastai.some_module
is located, which contains a Python dict with the URL, size, and hash for this file. If you've downloaded this file before to your archive
path then it will be used, instead of downloading a new copy. Use get(force=True)
first to download a new copy if even you have it in your archive.
If there is a file called config.ini
in your base
directory, then keys archive
and data
will be used as the default values for FastDownload
. The file should be in configparser format. Here's a sample config.ini
:
[DEFAULT]
archive = downloaded
data = extracted
If there is no ini file present, one will be automatically created for for you using the details you pass to FastDownload
.
You can add any additional key/value pairs to the config file that you want. When you call FastDownload.get
pass extract_key
to use a key other than data
for choosing a location to extract to.


Mobile-based trade and market information platforms empowering East Africa's women-led SMEs to trade legally, safely and profitably across borders
Our platform leverages the ubiquity of mobile phones and innovates on USSD and SMS technologies to enhance delivery channels of the information neccessary for East Africa's cross-norder traders.


Fill out the form to get recommended the best diet for your cat. The right amount is calculated and the program sends notification to your phone when when the cat has to eat.
The best and most natural way to diet your cat.
Subscribe to our newsletter


OBReadBalance1_Data_Balance
- Amount : OBReadBalance1_Data_Amount
- CreditDebitIndicator : OBCreditDebitCode_2
- DateTime : Date
Indicates the date (and time) of the balance.All dates in the JSON payloads are represented in ISO 8601 date-time format. All date-time fields in responses must include the timezone. An example is below: 2017-04-05T10:43:07+00:00
- Type : OBBalanceType1Code


Hi there! I'm an undergraduate senior at the University of Texas at Arlington studying computer science where I expect to graduate in May of 2019. My passion at the moment is web design, which is great because I spent a vast majority of my time working on my Senior Project which is using ReactJS! Check out what I'm doing for my Senior project and view any of my previous work experience at ExxonMobil and Fidelity Investments. Outside of the workplace, I enjoy playing the piano, learning the guitar, studying Catholicism, and keeping busy in my various organizations.
When my professor said that you better quit your side jobs, drop your other classes, and focus all of your attention on Senior Design, I laughed. I probably should not have. My Senior Design project is to work with a group of four other Computer Science students to go through the software lifecycle to create a complete web application in ReactJS. From the onset, I knew it would be a lot of work but as we began to prototype I quickly found out that we had around 50+ web pages to build in React. These pages detailed camp registration, user management such as creation, permissions, and login, hall management such as work orders, keys, and staff project work but the most interesting is the camps themselves. We have designed digital floor plans, drag and drop functionality for room assignments, and real-time invoicing wrapped in a beatuiful Material-UI Design. This project has been such an enlightening experience working with ReactJS and my team but most importantly it is the largest and most passionate project I have ever worked on.
After walking onto ExxonMobil's main campus in Spring, TX anyone would be agasp at the magnitude and beauty of it all. Here I was placed on a tremendous agile team that emphasized team development more than anything! After understanding the problem domain that my internship was shaped around, I developed a front-end website in ReactJS to monitor real-time jobs. This was super useful for the members on my team who used this information to help ExxonMobil's business side up and running with as few problems as possible. It definitely was not easy learning ReactJS by myself but after blood, sweat, and tears, I ended up making a pretty sweet application. Overall, it was an eye-opening experience to learn about web development, supply chain, and the upstream and downstream processes that ExxonMobil is involved in and I could not have asked for a better internship!
After learning the ropes as a Resident Assistant, I was promoted to Lead RA for Kalpana Chawla Hall. In this role, I was responsible for managing the other RAs and Office Assistants for the Hall. Additionally, I had extra responsibilities during our staff meetings, in coordinating hall wide events, and in handling extreme situations.
As my first internship, Fidelity Investments was a great stepping stone where I got to learn the Agile methodology and the life of a software engineer. I was introduced to Quality Assurance (QA) through Coded UI in testing Active Trader Pro, a trading platform meant for all traders built in C# WPF. My favorite part of the internship was working with a group of four other interns to pitch a Fidelity Mobile Wallet POC to the CIOs after winning at regionals!
When most cannot wait to leave their residence hall at the end of their freshman year, I decided to become a resident assistant for Kalpana Chawla Hall. In this influential position, I have made incredible and lasting friendships with both my residents, fellow RAs, and supervisors. Amongst the community building, programming, study hours, and day-in-day-out tasks, I fell in love with this job and the people that made it wortwhile. The RA job is not just a job, it is a lifestyle - I encourage all students to learn the life skills that RAs embody.
My first job was working in the family Oil and Gas business where I began to bring the company into the 21st century. After choosing the right technology for the company, I began to digitize their papers, create small WPF applications to assist in their daily tasks, and analyze their processes to improve on efficiency.
Creating a ReactJS web application to manage camp registration, user management, facility work orders, room keys, staff project work, facility floor plans, drag and drop room placement, and real-time invoicing all made possible by Material-UI.
Created a wait queue which one can be added to, view their estimated wait time, receive phone/email notifications, and remove themselves from. All users of the makerspace can view their individual jobs and their respective time remaining. It was a great achievement to work on this project because it was my first time working with PHP, servers, web hosting, and having an actual customer to develop for. Great Experience!
View ProjectUT Arlington's Summer Conferences employees needed a program to help their residents check in and update their Google Drive roster. This program will let the Conference Assistants search a resident by their room card, key code, or other fields and then check them in. It will then highlight their name off of the Google Drive roster so that all employees can view it.
View ProjectA platform for teachers to create, edit, give, and grade tests! Supports Multiple Choice, Matching, True/False, Show Your Work, Short Answer, and Essay questions. Once a test is created, it can be given online where cheating detection, live answer viewing, and internet usage monitoring is enabled. After the test has been taken, the test will grade itself while offering the teacher to take a finer look at AI graded questions
View Project


Biber is a BibTeX replacement for users of biblatex, written in Perl, with full Unicode support.
This package is known to build and work properly using an LFS-7.10 platform.
Download (HTTP): http://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/current/biblatex-biber.tar.gz
Download MD5 sum: md5sum 747c3c86eff58ccbc1b419357f665ebd
Download size: 816 KB
Estimated disk space required: 31 MB
Estimated build time: less than 0.1 SBU (0.83 SBU to run the tests)
The corresponding version of biblatex is a separate project - the tds
tarball is pre-packaged for untarring into the texmf-dist
directory. Download (HTTP):
http://sourceforge.net/projects/biblatex/files/biblatex-3.4/biblatex-3.4.tds.tgz
Download MD5 sum: 322d8f7aec957b2af4e7d3462d0c4818
Download size: 19 MB
autovivification-0.16 Business::ISBN-3.002 Business::ISMN-1.13 Business::ISSN-1.001 Class::Accessor-0.34 Data::Compare-1.25 Data::Dump-1.23 Data::Uniqid-0.12 Date::Simple-3.03 Encode::EUCJPASCII-0.03 Encode::HanExtra-0.23 Encode::JIS2K-0.03 File::Slurp-9999.19 IPC::Run3-0.048 Lingua::Translit-0.26 List::AllUtils-0.11 List::MoreUtils-0.416 Log::Log4perl-1.47 LWP::Protocol::https-6.06 Module-Build-0.4220 Regexp::Common-2016060801 Text::BibTeX-0.76 Text::Roman-3.5 Unicode::Collate-1.14 Unicode::LineBreak-2016.003 Unicode::Normalize-1.25 XML::LibXML::Simple-0.97 XML::LibXSLT-1.95 XML::Writer-0.625 and texlive-20160523b (or install-tl-unx)
File::Which-1.21 and Test::Differences-0.64 to run the testsuite
Although the tarball name is unversioned, it will untar to a correctly-versioned biblatex-biber-2.5 directory.
It is almost possible to install all missing dependencies automatically. Except, from perl-5.22.0 onwards, Module-Build-0.4220 is no longer part of the core perl distribution. And for Data::Uniqid-0.12 we have to patch it to skip over a test which always fails - that failing test will probably break the automatic install. To automatically install the remaining perl dependencies you will need to manually install those two modules first. You can then run perl ./Build.PL and when it prompts you, become the root user and run ./Build installdeps
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/biber
Install Biber by running the following commands:
perl ./Build.PL && ./Build
To test the results, enter: ./Build test - you will require the en_GB.UTF-8 and sv_SE.UTF-8 locales. Test 12 of t/sort-order.t will fail : for speed the tests use system locales instead of the default Unicode::Collation algorithm, and some minor details of the locales in OSX (where development takes place) differ from those in glibc
Now, as the root
user:
tar -xf ../biblatex-3.4.tds.tgz -C /opt/texlive/2016/texmf-dist && texhash && ./Build install
tar -xf biblatex-3.4.tds.tar.gz -C /opt/texlive/2016/texmf-dist: this installs the new biblatex files over those installed by texlive.
texhash : this updates the file hash tables (otherwise known as the file name database).
Last updated on 2016-08-31 10:57:05 -0700


Description: This project explores the direction of travel at a monthly level between cities in China.
You can choose to view migration towards or away from a city as well as a colourscheme which will help you uncover different patterns in the data.
Click on a city to see its connections, click on a blank space on the map to deselect your city. If no connections appear try changing directions of travel. Alternatively, it may be possible that no data is available.
Data exploratory controls:
Colour scale (millions): scale across all citiesIntensity measure shows the country-wide intensity of migration
0.1m
35m+
Colour scale (min-max): applied to individual citiesPeak measure that shows the progress of each city's migration between its lowest and its highest value.


public class MediastreamPlayerTracker
extends java.lang.Object
MediastreamPlayer
.| Constructor and Description |
|---|
MediastreamPlayerTracker(MediastreamPlayer player,
MediastreamPlayerConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
setCanPlayDate(java.util.Date canPlayDate) |
void |
startTrackPing()
Start track timer that sends player info each 30 seconds.
|
void |
stopTrackPing()
Stop track timer.
|
public MediastreamPlayerTracker(MediastreamPlayer player, MediastreamPlayerConfig config)
player
- The MediastreamPlayer
instance for get tracking info.config
- The MediastreamPlayerConfig
which contains video ID, type, accountID, customerID.public void setCanPlayDate(java.util.Date canPlayDate)
canPlayDate
- The date when the player is ready.public void startTrackPing()
public void stopTrackPing()


Module: Celluloid::ThreadPool
- Defined in:
- lib/celluloid/thread_pool.rb
Overview
Maintain a thread pool FOR SPEED!!
Class Attribute Summary (collapse)
-
+ (Object) max_idle
Returns the value of attribute max_idle.
Class Method Summary (collapse)
-
+ (Object) create
Create a new thread with an associated queue of procs to run.
-
+ (Object) get(&block)
Get a thread from the pool, running the given block.
-
+ (Object) put(thread)
Return a thread to the pool.
Class Attribute Details
+ (Object) max_idle
Returns the value of attribute max_idle
13 14 15 |
# File 'lib/celluloid/thread_pool.rb', line 13 def max_idle @max_idle end |
Class Method Details
+ (Object) create
Create a new thread with an associated queue of procs to run
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/celluloid/thread_pool.rb', line 41 def create queue = Queue.new thread = Thread.new do while proc = queue.pop begin proc.call rescue => ex Logger.crash("thread crashed", ex) end put thread end end thread[:queue] = queue thread end |
+ (Object) get(&block)
Get a thread from the pool, running the given block
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/celluloid/thread_pool.rb', line 16 def get(&block) @mutex.synchronize do if @pool.empty? thread = create else thread = @pool.shift end thread[:queue] << block thread end end |
+ (Object) put(thread)
Return a thread to the pool
30 31 32 33 34 35 36 37 38 |
# File 'lib/celluloid/thread_pool.rb', line 30 def put(thread) @mutex.synchronize do if @pool.size >= @max_idle thread[:queue] << nil else @pool << thread end end end |


Zendaya Says She ‘Still Loves Making Music’ Even Though She’s Been Focusing On Acting In Recent Years
by Nick MarkusIt’s been quite some time since Zendaya released any songs as she’s been focusing on her acting career in the last few years instead but that is not to say she doesn’t still love making music. The artist got candid about her career during an Allure interview – here’s what she had to say!
Zendaya mentioned that while she doesn’t really have much time left for music, she loves that she still gets to sing through acting.
The multi-talented star has not released any music since her 2016 Something New.
But despite this, she made it very clear that she still loves recording, making music and just singing in general.
‘I still love making music, and still get to do it through my acting a lot of times, and just being able to work on the finale song for Euphoria was fun,’ she shared with the world in her Allure profile that was released not too long ago.
She went on to argue that ‘There is a layer of personal life I think actors get that music artists do not. They have no character to hide behind, so they have to be really open. [As actors] we get a bit of a separation.’
In other words, she believes that singers struggle more with keeping their lives private than actors do.
Speaking of, she also discussed the same issue in relation to social media.
Fortunately, it really seems like Zendaya has managed to find a balance and that has allowed her to really show off her talents and individuality.
As you know, the multi-talented celeb acts on Euphoria and she’s been largely praised for her amazing portrayal of her character.
The fact that she also got to work on music through the show was definitely an added bonus!


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/universe.20shadows.20a.20local.20universe.html ---
In a file with only this:
universes u variables α β : Type*
I get this:
error: invalid universe declaration, 'u_1' shadows a local universe
Why?
This also annoys me but I just didn't bother to ask
What does Type*
do? Does it elaborate into introducing some hidden u
universe?
Yeah, it happened once too often for me: passed the annoyance threshold. :wink:
What does
Type*
do? Does it elaborate into introducing some hiddenu
universe?
It uses an implicit universe, as far as I understand it.
set.option annoyance_threshold 100
Solves it
I've kind of noticed that Lean's elaboration isn't hygenic... guessing that's by design though?
It's very powerful, but it does have some annoying corner cases in various places. I believe the idea is that as long as the kernel is safe and the core language is well-typed, elaboration and tactics can be less so.
By hygiene I mean in the macro sense. Racket works hard to preserve it. It might make encapsulation harder and increase the chance of breaking things downstream due to updates in libraries.
(warning, might be being imprecise in my language here, feel free to correct me)
I sometimes like to think of Lean as one big code generator. I tries by various means to produce kernel code for definitions and theorems. Elaboration is an advanced form of unification and uses definitional equality to try to convert terms into other terms. Tactics are like imperatively programming the code generation. Type class instance resolution is another code generation mechanism. All of these try to interpret what you want and produce some kernel code. But they are all imperfect and sometimes require fiddling to get what you want.
(Edit: Language is also imprecise, but the idea helps me comprehend it.)
Yeah, definitely. That's how I'm starting to sort of see it. Just wondering if some of the learning from languages like Scheme and Racket into theorem provers. Not experienced enough with Coq to know how they handle hygiene (if they do any identifier generation in their tactics/elaboration). :thinking_face:
Hygenic macros are a planned feature in the next version of lean
Oh nice!
Yeah thought it might just be an intermediate state of affairs. Hard to do everything at once.
As for the given error, basically this is because variables A B : Type*
desugars to
universe u_1 variable A : Type u_1 universe u_1 variable B : Type u_1
and universe shadowing is disallowed (for some reason...). This is a known bug, but it's unlikely to be addressed in the current version of lean
the workaround is to write variables (A : Type*) (B : Type*)
So I'm guessing universes u
does nothing to affect the issue?
no, it's unrelated
although I bet you can also get a name shadowing issue with only one variable
if it was universe u_1
Yeah, I discovered that, too. What is the difference from this?
variable α : Type* variable β : Type*
that desugars to
universe u_1 variable A : Type u_1 universe u_2 variable B : Type u_2
which is okay
In the future, is the intention to make those generated u_1
identifiers inaccessable?
the variable command in general is more than a little hackish
Ah. So, it's smart enough to create a fresh universe variable there.
inaccessible? Why?
I think "fresh" is more appropriate
In fact, they come up explicitly in proofs, although it's bad form to refer to autogenerated names
but the fact that they are literal names like u_1
and not some mystery private thing is important
Hah, I might be conflicting with an existing term by the use of 'inaccessable', but yeah, it seems like it could result in fragile code if you referred to those generated names.
But happy to be persuaded otherwise - I'm still new to Lean and might not fully understand.
Here's my first experience with variable name shadowing.
I'm not advocating explicit reference to generated names, just the opposite (that's what I mean by "bad form"). But I can believe that sometimes it is necessary to refer to an autogenerated name, maybe because the tactic that produced the name doesn't have enough configuration space to supply nice names.
What do you mean by 'configuration space'?
Some tactics have complicated logic for when they introduce new names, intro variables, etc, and it may not be easy to specify names at the top level so that after the tactic you know what you will get
Interesting! That seems like a tantilising design problem to solve! :simple_smile:
The lazy option (for the tactic writer) is not to bother with providing names to the tactic, so you get what you get, and then after the tactic you might need to refer to those auto names (if only to rename them)
I think that finish
has this problem, although it's not really designed for nonterminal use so it's not a big problem
Some tactics like injections
just take a big list of names at the start and pull from that pool whenever something is intro'd
@Brendan Zabarauskas see https://github.com/leanprover/lean/issues/1674 which, I believe, is one the main issue Lean 4 is meant to solve, and contains "Hygienic macro system" in the title. Lean 4 is currently worked on (but won't come soon).
Very cool! And understandable that it will take time - good to know it's coming though.
Wow, I like the ideas in that issue! @Patrick Massot do you remember asking about tikzcd notation for commutative diagrams in lean? That might become a true option then! I like it (-;
Indeed I was thinking about this when I mentioned tikz-cd syntax
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
"""A TF-IDF workflow (term frequency - inverse document frequency).
For an explanation of the TF-IDF algorithm see the following link:
http://en.wikipedia.org/wiki/Tf-idf
"""
from __future__ import absolute_import
import argparse
import glob
import math
import re
import apache_beam as beam
from apache_beam.io import ReadFromText
from apache_beam.io import WriteToText
from apache_beam.pvalue import AsSingleton
from apache_beam.utils.pipeline_options import PipelineOptions
from apache_beam.utils.pipeline_options import SetupOptions
[docs]def read_documents(pipeline, uris):
"""Read the documents at the provided uris and returns (uri, line) pairs."""
pcolls = []
for uri in uris:
pcolls.append(
pipeline
| 'Read: %s' % uri >> ReadFromText(uri)
| 'WithKey: %s' % uri >> beam.Map(lambda v, uri: (uri, v), uri))
return pcolls | 'FlattenReadPColls' >> beam.Flatten()
[docs]class TfIdf(beam.PTransform):
"""A transform containing a basic TF-IDF pipeline.
The input consists of KV objects where the key is the document's URI and
the value is a piece of the document's content.
The output is mapping from terms to scores for each document URI.
"""
[docs] def expand(self, uri_to_content):
# Compute the total number of documents, and prepare a singleton
# PCollection to use as side input.
total_documents = (
uri_to_content
| 'GetUris 1' >> beam.Keys()
| 'GetUniqueUris' >> beam.RemoveDuplicates()
| 'CountUris' >> beam.combiners.Count.Globally())
# Create a collection of pairs mapping a URI to each of the words
# in the document associated with that that URI.
def split_into_words((uri, line)):
return [(uri, w.lower()) for w in re.findall(r'[A-Za-z\']+', line)]
uri_to_words = (
uri_to_content
| 'SplitWords' >> beam.FlatMap(split_into_words))
# Compute a mapping from each word to the total number of documents
# in which it appears.
word_to_doc_count = (
uri_to_words
| 'GetUniqueWordsPerDoc' >> beam.RemoveDuplicates()
| 'GetWords' >> beam.Values()
| 'CountDocsPerWord' >> beam.combiners.Count.PerElement())
# Compute a mapping from each URI to the total number of words in the
# document associated with that URI.
uri_to_word_total = (
uri_to_words
| 'GetUris 2' >> beam.Keys()
| 'CountWordsInDoc' >> beam.combiners.Count.PerElement())
# Count, for each (URI, word) pair, the number of occurrences of that word
# in the document associated with the URI.
uri_and_word_to_count = (
uri_to_words
| 'CountWord-DocPairs' >> beam.combiners.Count.PerElement())
# Adjust the above collection to a mapping from (URI, word) pairs to counts
# into an isomorphic mapping from URI to (word, count) pairs, to prepare
# for a join by the URI key.
uri_to_word_and_count = (
uri_and_word_to_count
| 'ShiftKeys' >> beam.Map(
lambda ((uri, word), count): (uri, (word, count))))
# Perform a CoGroupByKey (a sort of pre-join) on the prepared
# uri_to_word_total and uri_to_word_and_count tagged by 'word totals' and
# 'word counts' strings. This yields a mapping from URI to a dictionary
# that maps the above mentioned tag strings to an iterable containing the
# word total for that URI and word and count respectively.
#
# A diagram (in which '[]' just means 'iterable'):
#
# URI: {'word totals': [count], # Total words within this URI's document.
# 'word counts': [(word, count), # Counts of specific words
# (word, count), # within this URI's document.
# ... ]}
uri_to_word_and_count_and_total = (
{'word totals': uri_to_word_total, 'word counts': uri_to_word_and_count}
| 'CoGroupByUri' >> beam.CoGroupByKey())
# Compute a mapping from each word to a (URI, term frequency) pair for each
# URI. A word's term frequency for a document is simply the number of times
# that word occurs in the document divided by the total number of words in
# the document.
def compute_term_frequency((uri, count_and_total)):
word_and_count = count_and_total['word counts']
# We have an iterable for one element that we want extracted.
[word_total] = count_and_total['word totals']
for word, count in word_and_count:
yield word, (uri, float(count) / word_total)
word_to_uri_and_tf = (
uri_to_word_and_count_and_total
| 'ComputeTermFrequencies' >> beam.FlatMap(compute_term_frequency))
# Compute a mapping from each word to its document frequency.
# A word's document frequency in a corpus is the number of
# documents in which the word appears divided by the total
# number of documents in the corpus.
#
# This calculation uses a side input, a Dataflow-computed auxiliary value
# presented to each invocation of our MapFn lambda. The second argument to
# the lambda (called total---note that we are unpacking the first argument)
# receives the value we listed after the lambda in Map(). Additional side
# inputs (and ordinary Python values, too) can be provided to MapFns and
# DoFns in this way.
word_to_df = (
word_to_doc_count
| 'ComputeDocFrequencies' >> beam.Map(
lambda (word, count), total: (word, float(count) / total),
AsSingleton(total_documents)))
# Join the term frequency and document frequency collections,
# each keyed on the word.
word_to_uri_and_tf_and_df = (
{'tf': word_to_uri_and_tf, 'df': word_to_df}
| 'CoGroupWordsByTf-df' >> beam.CoGroupByKey())
# Compute a mapping from each word to a (URI, TF-IDF) score for each URI.
# There are a variety of definitions of TF-IDF
# ("term frequency - inverse document frequency") score; here we use a
# basic version that is the term frequency divided by the log of the
# document frequency.
def compute_tf_idf((word, tf_and_df)):
[docf] = tf_and_df['df']
for uri, tf in tf_and_df['tf']:
yield word, (uri, tf * math.log(1 / docf))
word_to_uri_and_tfidf = (
word_to_uri_and_tf_and_df
| 'ComputeTf-idf' >> beam.FlatMap(compute_tf_idf))
return word_to_uri_and_tfidf
[docs]def run(argv=None):
"""Main entry point; defines and runs the tfidf pipeline."""
parser = argparse.ArgumentParser()
parser.add_argument('--uris',
required=True,
help='URIs to process.')
parser.add_argument('--output',
required=True,
help='Output file to write results to.')
known_args, pipeline_args = parser.parse_known_args(argv)
# We use the save_main_session option because one or more DoFn's in this
# workflow rely on global context (e.g., a module imported at module level).
pipeline_options = PipelineOptions(pipeline_args)
pipeline_options.view_as(SetupOptions).save_main_session = True
p = beam.Pipeline(options=pipeline_options)
# Read documents specified by the uris command line option.
pcoll = read_documents(p, glob.glob(known_args.uris))
# Compute TF-IDF information for each word.
output = pcoll | TfIdf()
# Write the output using a "Write" transform that has side effects.
# pylint: disable=expression-not-assigned
output | 'write' >> WriteToText(known_args.output)
# Execute the pipeline and wait until it is completed.
p.run().wait_until_finish()
if __name__ == '__main__':
run()


Bitcoin currency exchanges work in a manner similar to banks. One first deposits amounts
of money in the currencies supported by the exchange, to his own account in the exchange,
uses these balances to trade with other users of the exchange and then withdraws that money.
Unlike over-the-counter transactions, there is no risk of losing money due to people not
fulfilling their part of the deal, as long as the exchange itself does not
commit fraud or withhold money.
fixed rate trading exchanges
The trading price is fixed. You do not need to wait for a matching order. Those exchanges normally do not hold fiat.
Some examples:
Using this trading exchanges you can can place buy and sell orders with limit or market price.
Some examples:
Another list of exchanges with reviews is availabe here: [ buy bitcoin worldwide ]


Reflection enables Java code to discover information about the fields, methods and constructors of loaded classes, and to use reflected fields, methods, and constructors to operate on their underlying counterparts, within security restrictions. The API accommodates applications that need access to either the public members of a target object (based on its runtime class) or the members declared by a given class. It also allows programs to suppress default reflective access control.


{% load static %}
I am currently a third year student at SVNIT, Surat pursuing Integrated Master of Science in Applied Mathematics.
Resume
Integrated Master of Science in Applied Mathematics (2019 - present)
CGPA : 9.56/10
Higher Secondary Examination, CBSE (2017-2018)
96.2%
Secondary School Examination, CBSE (2015-2016)
CGPA : 10/10
Proficient in: Python (Data Visualisation, Data Analysis), MATLAB, LATEX, C/C++, MS-Excel, SQL, Streamlit, HTML, CSS
Familiar with: NLP, Deep Learning, Java, Javascript, Django, Git
Hindi (Native or bilingual proficiency), English (Full Professional Proficiency)


...the story so far:
(Previous Versions)JoatU beta.pdf
mockups linked together Password: jo@tu
Database models: please contact a joatu staff member.
1) Sync databases so that the profiles are the same on both django and wordpress a) Take WP form model and convert to django 2) Geocoding of users 3) Community Voting System, i.e. User Reputation system
| Project Co-ordinator | |
|---|---|
| Jamie Klinger |<EMAIL_ADDRESS>|
| Senoir Python Developer | |
| Zach White |<EMAIL_ADDRESS>|
| Assistant Co-ordinator, Front-end Developer | |
| Mike DeBello |<EMAIL_ADDRESS>|


|
GeneDive
|
Public Member Functions | |
| __construct ($exceptions=null) | |
| __destruct () | |
| isHTML ($isHtml=true) | |
| isSMTP () | |
| isMail () | |
| isSendmail () | |
| isQmail () | |
| addAddress ($address, $name='') | |
| addCC ($address, $name='') | |
| addBCC ($address, $name='') | |
| addReplyTo ($address, $name='') | |
| setFrom ($address, $name='', $auto=true) | |
| getLastMessageID () | |
| punyencodeAddress ($address) | |
| send () | |
| preSend () | |
| postSend () | |
| getSMTPInstance () | |
| setSMTPInstance (SMTP $smtp) | |
| smtpConnect ($options=null) | |
| smtpClose () | |
| setLanguage ($langcode='en', $lang_path='') | |
| getTranslations () | |
| addrAppend ($type, $addr) | |
| addrFormat ($addr) | |
| wrapText ($message, $length, $qp_mode=false) | |
| utf8CharBoundary ($encodedText, $maxLength) | |
| setWordWrap () | |
| createHeader () | |
| getMailMIME () | |
| getSentMIMEMessage () | |
| createBody () | |
| headerLine ($name, $value) | |
| textLine ($value) | |
| addAttachment ($path, $name='', $encoding='base64', $type='', $disposition='attachment') | |
| getAttachments () | |
| encodeString ($str, $encoding='base64') | |
| encodeHeader ($str, $position='text') | |
| hasMultiBytes ($str) | |
| has8bitChars ($text) | |
| base64EncodeWrapMB ($str, $linebreak=null) | |
| encodeQP ($string) | |
| encodeQ ($str, $position='text') | |
| addStringAttachment ( $string, $filename, $encoding='base64', $type='', $disposition='attachment') | |
| addEmbeddedImage ($path, $cid, $name='', $encoding='base64', $type='', $disposition='inline') | |
| addStringEmbeddedImage ( $string, $cid, $name='', $encoding='base64', $type='', $disposition='inline') | |
| inlineImageExists () | |
| attachmentExists () | |
| alternativeExists () | |
| clearQueuedAddresses ($kind) | |
| clearAddresses () | |
| clearCCs () | |
| clearBCCs () | |
| clearReplyTos () | |
| clearAllRecipients () | |
| clearAttachments () | |
| clearCustomHeaders () | |
| isError () | |
| addCustomHeader ($name, $value=null) | |
| getCustomHeaders () | |
| msgHTML ($message, $basedir='', $advanced=false) | |
| html2text ($html, $advanced=false) | |
| set ($name, $value='') | |
| secureHeader ($str) | |
| sign ($cert_filename, $key_filename, $key_pass, $extracerts_filename='') | |
| DKIM_QP ($txt) | |
| DKIM_Sign ($signHeader) | |
| DKIM_HeaderC ($signHeader) | |
| DKIM_BodyC ($body) | |
| DKIM_Add ($headers_line, $subject, $body) | |
| getToAddresses () | |
| getCcAddresses () | |
| getBccAddresses () | |
| getReplyToAddresses () | |
| getAllRecipientAddresses () | |
| getOAuth () | |
| setOAuth (OAuth $oauth) | |
Static Public Member Functions | |
| static | parseAddresses ($addrstr, $useimap=true) |
| static | validateAddress ($address, $patternselect=null) |
| static | idnSupported () |
| static | rfcDate () |
| static | isValidHost ($host) |
| static | _mime_types ($ext='') |
| static | filenameToType ($filename) |
| static | mb_pathinfo ($path, $options=null) |
| static | normalizeBreaks ($text, $breaktype=null) |
| static | getLE () |
| static | hasLineLongerThanMax ($str) |
Public Attributes | |
| $Priority = null | |
| $CharSet = 'iso-8859-1' | |
| $ContentType = 'text/plain' | |
| $Encoding = '8bit' | |
| $ErrorInfo = '' | |
| $From = 'root@localhost' | |
| $FromName = 'Root User' | |
| $Sender = '' | |
| $Subject = '' | |
| $Body = '' | |
| $AltBody = '' | |
| $Ical = '' | |
| $WordWrap = 0 | |
| $Mailer = 'mail' | |
| $Sendmail = '/usr/sbin/sendmail' | |
| $UseSendmailOptions = true | |
| $ConfirmReadingTo = '' | |
| $Hostname = '' | |
| $MessageID = '' | |
| $MessageDate = '' | |
| $Host = 'localhost' | |
| $Port = 25 | |
| $Helo = '' | |
| $SMTPSecure = '' | |
| $SMTPAutoTLS = true | |
| $SMTPAuth = false | |
| $SMTPOptions = [] | |
| $Username = '' | |
| $Password = '' | |
| $AuthType = '' | |
| $Timeout = 300 | |
| $SMTPDebug = 0 | |
| $Debugoutput = 'echo' | |
| $SMTPKeepAlive = false | |
| $SingleTo = false | |
| $do_verp = false | |
| $AllowEmpty = false | |
| $DKIM_selector = '' | |
| $DKIM_identity = '' | |
| $DKIM_passphrase = '' | |
| $DKIM_domain = '' | |
| $DKIM_private = '' | |
| $DKIM_private_string = '' | |
| $action_function = '' | |
| $XMailer = '' | |
| const | VERSION = '6.0.1' |
| const | STOP_MESSAGE = 0 |
| const | STOP_CONTINUE = 1 |
| const | STOP_CRITICAL = 2 |
| const | MAX_LINE_LENGTH = 998 |
| const | STD_LINE_LENGTH = 76 |
Static Public Attributes | |
| static | $validator = 'php' |
Protected Member Functions | |
| edebug ($str) | |
| addOrEnqueueAnAddress ($kind, $address, $name) | |
| addAnAddress ($kind, $address, $name='') | |
| sendmailSend ($header, $body) | |
| mailSend ($header, $body) | |
| smtpSend ($header, $body) | |
| generateId () | |
| getBoundary ($boundary, $charSet, $contentType, $encoding) | |
| endBoundary ($boundary) | |
| setMessageType () | |
| attachAll ($disposition_type, $boundary) | |
| encodeFile ($path, $encoding='base64') | |
| cidExists ($cid) | |
| setError ($msg) | |
| serverHostname () | |
| lang ($key) | |
| doCallback ($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra) | |
Static Protected Member Functions | |
| static | isShellSafe ($string) |
| static | setLE ($le) |
Protected Attributes | |
| $MIMEBody = '' | |
| $MIMEHeader = '' | |
| $mailHeader = '' | |
| $oauth = null | |
| $SingleToArray = [] | |
| $smtp = null | |
| $to = [] | |
| $cc = [] | |
| $bcc = [] | |
| $ReplyTo = [] | |
| $all_recipients = [] | |
| $RecipientsQueue = [] | |
| $ReplyToQueue = [] | |
| $attachment = [] | |
| $CustomHeader = [] | |
| $lastMessageID = '' | |
| $message_type = '' | |
| $boundary = [] | |
| $language = [] | |
| $error_count = 0 | |
| $sign_cert_file = '' | |
| $sign_key_file = '' | |
| $sign_extracerts_file = '' | |
| $sign_key_pass = '' | |
| $exceptions = false | |
| $uniqueid = '' | |
Static Protected Attributes | |
| static | $LE = "\r\n" |
PHPMailer - PHP email creation and transport class.
| PHPMailer\PHPMailer\PHPMailer::__construct | ( | $exceptions = null | ) |
Constructor.
| bool | $exceptions | Should we throw external exceptions? |
| PHPMailer\PHPMailer\PHPMailer::__destruct | ( | ) |
Destructor.
|
static |
Get the MIME type for a file extension.
| string | $ext | File extension |
| PHPMailer\PHPMailer\PHPMailer::addAddress | ( | $address, | |
$name = '' |
|||
| ) |
Add a "To" address.
| string | $address | The email address to send to |
| string | $name |
|
protected |
Add an address to one of the recipient arrays or to the ReplyTo array. Addresses that have been added already return false, but do not throw exceptions.
| string | $kind | One of 'to', 'cc', 'bcc', or 'ReplyTo' |
| string | $address | The email address to send, resp. to reply to |
| string | $name |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::addAttachment | ( | $path, | |
$name = '' , |
|||
$encoding = 'base64' , |
|||
$type = '' , |
|||
$disposition = 'attachment' |
|||
| ) |
Add an attachment from a path on the filesystem. Never use a user-supplied path to a file! Returns false if the file could not be found or read.
| string | $path | Path to the attachment |
| string | $name | Overrides the attachment name |
| string | $encoding | File encoding (see $Encoding) |
| string | $type | File extension (MIME) type |
| string | $disposition | Disposition to use |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::addBCC | ( | $address, | |
$name = '' |
|||
| ) |
Add a "BCC" address.
| string | $address | The email address to send to |
| string | $name |
| PHPMailer\PHPMailer\PHPMailer::addCC | ( | $address, | |
$name = '' |
|||
| ) |
Add a "CC" address.
| string | $address | The email address to send to |
| string | $name |
| PHPMailer\PHPMailer\PHPMailer::addCustomHeader | ( | $name, | |
$value = null |
|||
| ) |
Add a custom header. $name value can be overloaded to contain both header name and value (name:value).
| string | $name | Custom header name |
| string | null | $value | Header value |
| PHPMailer\PHPMailer\PHPMailer::addEmbeddedImage | ( | $path, | |
| $cid, | |||
$name = '' , |
|||
$encoding = 'base64' , |
|||
$type = '' , |
|||
$disposition = 'inline' |
|||
| ) |
Add an embedded (inline) attachment from a file. This can include images, sounds, and just about any other document type. These differ from 'regular' attachments in that they are intended to be displayed inline with the message, not just attached for download. This is used in HTML messages that embed the images the HTML refers to using the $cid value. Never use a user-supplied path to a file!
| string | $path | Path to the attachment |
| string | $cid | Content ID of the attachment; Use this to reference the content when using an embedded image in HTML |
| string | $name | Overrides the attachment name |
| string | $encoding | File encoding (see $Encoding) |
| string | $type | File MIME type |
| string | $disposition | Disposition to use |
|
protected |
Add an address to one of the recipient arrays or to the ReplyTo array. Because PHPMailer can't validate addresses with an IDN without knowing the PHPMailer::$CharSet (that can still be modified after calling this function), addition of such addresses is delayed until send(). Addresses that have been added already return false, but do not throw exceptions.
| string | $kind | One of 'to', 'cc', 'bcc', or 'ReplyTo' |
| string | $address | The email address to send, resp. to reply to |
| string | $name |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::addrAppend | ( | $type, | |
| $addr | |||
| ) |
| PHPMailer\PHPMailer\PHPMailer::addReplyTo | ( | $address, | |
$name = '' |
|||
| ) |
Add a "Reply-To" address.
| string | $address | The email address to reply to |
| string | $name |
| PHPMailer\PHPMailer\PHPMailer::addrFormat | ( | $addr | ) |
Format an address for use in a message header.
| array | $addr | A 2-element indexed array, element 0 containing an address, element 1 containing a name like ['joe@e', 'Joe User'] xamp le.co m |
| PHPMailer\PHPMailer\PHPMailer::addStringAttachment | ( | $string, | |
| $filename, | |||
$encoding = 'base64' , |
|||
$type = '' , |
|||
$disposition = 'attachment' |
|||
| ) |
Add a string or binary attachment (non-filesystem). This method can be used to attach ascii or binary data, such as a BLOB record from a database.
| string | $string | String attachment data |
| string | $filename | Name of the attachment |
| string | $encoding | File encoding (see $Encoding) |
| string | $type | File extension (MIME) type |
| string | $disposition | Disposition to use |
| PHPMailer\PHPMailer\PHPMailer::addStringEmbeddedImage | ( | $string, | |
| $cid, | |||
$name = '' , |
|||
$encoding = 'base64' , |
|||
$type = '' , |
|||
$disposition = 'inline' |
|||
| ) |
Add an embedded stringified attachment. This can include images, sounds, and just about any other document type. Be sure to set the $type to an image type for images: JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'.
| string | $string | The attachment binary data |
| string | $cid | Content ID of the attachment; Use this to reference the content when using an embedded image in HTML |
| string | $name | |
| string | $encoding | File encoding (see $Encoding) |
| string | $type | MIME type |
| string | $disposition | Disposition to use |
| PHPMailer\PHPMailer\PHPMailer::alternativeExists | ( | ) |
Check if this message has an alternative body set.
|
protected |
Attach all file, string, and binary attachments to the message. Returns an empty string on failure.
| string | $disposition_type | |
| string | $boundary |
| PHPMailer\PHPMailer\PHPMailer::attachmentExists | ( | ) |
Check if an attachment (non-inline) is present.
| PHPMailer\PHPMailer\PHPMailer::base64EncodeWrapMB | ( | $str, | |
$linebreak = null |
|||
| ) |
Encode and wrap long multibyte strings for mail headers without breaking lines within a character. Adapted from a function by paravoid.
| string | $str | multi-byte text to wrap encode |
| string | $linebreak | string to use as linefeed/end-of-line |
|
protected |
Check if an embedded attachment is present with this cid.
| string | $cid |
| PHPMailer\PHPMailer\PHPMailer::clearAddresses | ( | ) |
Clear all To recipients.
| PHPMailer\PHPMailer\PHPMailer::clearAllRecipients | ( | ) |
Clear all recipient types.
| PHPMailer\PHPMailer\PHPMailer::clearAttachments | ( | ) |
Clear all filesystem, string, and binary attachments.
| PHPMailer\PHPMailer\PHPMailer::clearBCCs | ( | ) |
Clear all BCC recipients.
| PHPMailer\PHPMailer\PHPMailer::clearCCs | ( | ) |
Clear all CC recipients.
| PHPMailer\PHPMailer\PHPMailer::clearCustomHeaders | ( | ) |
Clear all custom headers.
| PHPMailer\PHPMailer\PHPMailer::clearQueuedAddresses | ( | $kind | ) |
Clear queued addresses of given kind.
| string | $kind | 'to', 'cc', or 'bcc' |
| PHPMailer\PHPMailer\PHPMailer::clearReplyTos | ( | ) |
Clear all ReplyTo recipients.
| PHPMailer\PHPMailer\PHPMailer::createBody | ( | ) |
Assemble the message body. Returns an empty string on failure.
| Exception |
| PHPMailer\PHPMailer\PHPMailer::createHeader | ( | ) |
Assemble message headers.
| PHPMailer\PHPMailer\PHPMailer::DKIM_Add | ( | $headers_line, | |
| $subject, | |||
| $body | |||
| ) |
Create the DKIM header and body in a new message header.
| string | $headers_line | Header lines |
| string | $subject | Subject |
| string | $body | Body |
| PHPMailer\PHPMailer\PHPMailer::DKIM_BodyC | ( | $body | ) |
Generate a DKIM canonicalization body. Uses the 'simple' algorithm from RFC6376 section 3.4.3.
| string | $body | Message Body |
| PHPMailer\PHPMailer\PHPMailer::DKIM_HeaderC | ( | $signHeader | ) |
Generate a DKIM canonicalization header. Uses the 'relaxed' algorithm from RFC6376 section 3.4.2.
| string | $signHeader | Header |
| PHPMailer\PHPMailer\PHPMailer::DKIM_QP | ( | $txt | ) |
Quoted-Printable-encode a DKIM header.
| string | $txt |
| PHPMailer\PHPMailer\PHPMailer::DKIM_Sign | ( | $signHeader | ) |
Generate a DKIM signature.
| string | $signHeader |
| Exception |
|
protected |
Perform a callback.
| bool | $isSent | |
| array | $to | |
| array | $cc | |
| array | $bcc | |
| string | $subject | |
| string | $body | |
| string | $from | |
| array | $extra |
|
protected |
Output debugging info via user-defined method. Only generates output if SMTP debug output is enabled (
| string | $str |
|
protected |
Encode a file attachment in requested format. Returns an empty string on failure.
| string | $path | The full path to the file |
| string | $encoding | The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::encodeHeader | ( | $str, | |
$position = 'text' |
|||
| ) |
Encode a header value (not including its label) optimally. Picks shortest of Q, B, or none. Result includes folding if needed. See RFC822 definitions for phrase, comment and text positions.
| string | $str | The header value to encode |
| string | $position | What context the string will be used in |
| PHPMailer\PHPMailer\PHPMailer::encodeQ | ( | $str, | |
$position = 'text' |
|||
| ) |
Encode a string using Q encoding.
| string | $str | the text to encode |
| string | $position | Where the text is going to be used, see the RFC for what that means |
| PHPMailer\PHPMailer\PHPMailer::encodeQP | ( | $string | ) |
Encode a string in quoted-printable format. According to RFC2045 section 6.7.
| string | $string | The text to encode |
| PHPMailer\PHPMailer\PHPMailer::encodeString | ( | $str, | |
$encoding = 'base64' |
|||
| ) |
Encode a string in requested format. Returns an empty string on failure.
| string | $str | The text to encode |
| string | $encoding | The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable |
|
protected |
Return the end of a message boundary.
| string | $boundary |
|
static |
Map a file name to a MIME type. Defaults to 'application/octet-stream', i.e.. arbitrary binary data.
| string | $filename | A file name or full path, does not need to exist as a file |
|
protected |
Create a unique ID to use for boundaries.
| PHPMailer\PHPMailer\PHPMailer::getAllRecipientAddresses | ( | ) |
Allows for public read access to 'all_recipients' property. Before the send() call, queued addresses (i.e. with IDN) are not yet included.
| PHPMailer\PHPMailer\PHPMailer::getAttachments | ( | ) |
Return the array of attachments.
| PHPMailer\PHPMailer\PHPMailer::getBccAddresses | ( | ) |
Allows for public read access to 'bcc' property. Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
protected |
Return the start of a message boundary.
| string | $boundary | |
| string | $charSet | |
| string | $contentType | |
| string | $encoding |
| PHPMailer\PHPMailer\PHPMailer::getCcAddresses | ( | ) |
Allows for public read access to 'cc' property. Before the send() call, queued addresses (i.e. with IDN) are not yet included.
| PHPMailer\PHPMailer\PHPMailer::getCustomHeaders | ( | ) |
Returns all custom headers.
| PHPMailer\PHPMailer\PHPMailer::getLastMessageID | ( | ) |
Return the Message-ID header of the last email. Technically this is the value from the last time the headers were created, but it's also the message ID of the last sent message except in pathological cases.
|
static |
Return the current line break format string.
| PHPMailer\PHPMailer\PHPMailer::getMailMIME | ( | ) |
Get the message MIME type headers.
| PHPMailer\PHPMailer\PHPMailer::getReplyToAddresses | ( | ) |
Allows for public read access to 'ReplyTo' property. Before the send() call, queued addresses (i.e. with IDN) are not yet included.
| PHPMailer\PHPMailer\PHPMailer::getSentMIMEMessage | ( | ) |
Returns the whole MIME message. Includes complete headers and body. Only valid post preSend().
| PHPMailer\PHPMailer\PHPMailer::getSMTPInstance | ( | ) |
| PHPMailer\PHPMailer\PHPMailer::getToAddresses | ( | ) |
Allows for public read access to 'to' property. Before the send() call, queued addresses (i.e. with IDN) are not yet included.
| PHPMailer\PHPMailer\PHPMailer::getTranslations | ( | ) |
Get the array of strings for the current language.
| PHPMailer\PHPMailer\PHPMailer::has8bitChars | ( | $text | ) |
Does a string contain any 8-bit chars (in any charset)?
| string | $text |
|
static |
Detect if a string contains a line longer than the maximum line length allowed by RFC 2822 section 2.1.1.
| string | $str |
| PHPMailer\PHPMailer\PHPMailer::hasMultiBytes | ( | $str | ) |
Check if a string contains multi-byte characters.
| string | $str | multi-byte text to wrap encode |
| PHPMailer\PHPMailer\PHPMailer::headerLine | ( | $name, | |
| $value | |||
| ) |
Format a header line.
| string | $name | |
| string | int | $value |
| PHPMailer\PHPMailer\PHPMailer::html2text | ( | $html, | |
$advanced = false |
|||
| ) |
Convert an HTML string into plain text. This is used by msgHTML(). Note - older versions of this function used a bundled advanced converter which was removed for license reasons in #232. Example usage:
| string | $html | The HTML text to convert |
| bool | callable | $advanced | Any boolean value to use the internal converter, or provide your own callable for custom conversion |
|
static |
Tells whether IDNs (Internationalized Domain Names) are supported or not. This requires the intl
and mbstring
PHP extensions.
true
if required functions for IDN support are present | PHPMailer\PHPMailer\PHPMailer::inlineImageExists | ( | ) |
Check if an inline attachment is present.
| PHPMailer\PHPMailer\PHPMailer::isError | ( | ) |
Check if an error occurred.
| PHPMailer\PHPMailer\PHPMailer::isHTML | ( | $isHtml = true | ) |
Sets message type to HTML or plain.
| bool | $isHtml | True for HTML mode |
| PHPMailer\PHPMailer\PHPMailer::isMail | ( | ) |
Send messages using PHP's mail() function.
| PHPMailer\PHPMailer\PHPMailer::isQmail | ( | ) |
Send messages using qmail.
| PHPMailer\PHPMailer\PHPMailer::isSendmail | ( | ) |
Send messages using $Sendmail.
|
staticprotected |
Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters. Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
| string | $string | The string to be validated |
| PHPMailer\PHPMailer\PHPMailer::isSMTP | ( | ) |
Send messages using SMTP.
|
static |
Validate whether a string contains a valid value to use as a hostname or IP address. IPv6 addresses must include [], e.g. [::1]
, not just ::1
.
| string | $host | The host name or IP address to check |
|
protected |
Get an error message in the current language.
| string | $key |
|
protected |
Send mail using the PHP mail() function.
| string | $header | The message headers |
| string | $body | The message body |
| Exception |
|
static |
Multi-byte-safe pathinfo replacement. Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe.
| string | $path | A filename or path, does not need to exist as a file |
| int | string | $options | Either a PATHINFO_* constant, or a string name to return only the specified piece |
| PHPMailer\PHPMailer\PHPMailer::msgHTML | ( | $message, | |
$basedir = '' , |
|||
$advanced = false |
|||
| ) |
Create a message body from an HTML string. Automatically inlines images and creates a plain-text version by converting the HTML, overwriting any existing values in Body and AltBody. Do not source $message content from user input! $basedir is prepended when handling relative URLs, e.g.
and must not be empty will look for an image file in $basedir/images/a.png and convert it to inline. If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) Converts data-uri images into embedded attachments. If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
| string | $message | HTML message string |
| string | $basedir | Absolute path to a base directory to prepend to relative paths to images |
| bool | callable | $advanced | Whether to use the internal HTML to text converter or your own custom converter |
|
static |
Normalize line breaks in a string. Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. Defaults to CRLF (for message bodies) and preserves consecutive breaks.
| string | $text | |
| string | $breaktype | What kind of line break to use; defaults to static::$LE |
|
static |
Parse and validate a string containing one or more RFC822-style comma-separated email addresses of the form "display name <address>" into an array of name/address pairs. Uses the imap_rfc822_parse_adrlist function if the IMAP extension is available. Note that quotes in the name part are removed.
| string | $addrstr | The address list string |
| bool | $useimap | Whether to use the IMAP extension to parse the list |
| PHPMailer\PHPMailer\PHPMailer::postSend | ( | ) |
| PHPMailer\PHPMailer\PHPMailer::preSend | ( | ) |
| PHPMailer\PHPMailer\PHPMailer::punyencodeAddress | ( | $address | ) |
Converts IDN in given email address to its ASCII form, also known as punycode, if possible. Important: Address must be passed in same encoding as currently set in PHPMailer::$CharSet. This function silently returns unmodified address if:
| string | $address | The email address to convert |
|
static |
Return an RFC 822 formatted date.
| PHPMailer\PHPMailer\PHPMailer::secureHeader | ( | $str | ) |
Strip newlines to prevent header injection.
| string | $str |
| PHPMailer\PHPMailer\PHPMailer::send | ( | ) |
Create a message and send it. Uses the sending method specified by $Mailer.
| Exception |
|
protected |
Send mail using the $Sendmail program.
| string | $header | The message headers |
| string | $body | The message body |
| Exception |
|
protected |
Get the server hostname. Returns 'localhost.localdomain' if unknown.
| PHPMailer\PHPMailer\PHPMailer::set | ( | $name, | |
$value = '' |
|||
| ) |
Set or reset instance properties. You should avoid this function - it's more verbose, less efficient, more error-prone and harder to debug than setting properties directly. Usage Example: `$mail->set('SMTPSecure', 'tls');` is the same as: `$mail->SMTPSecure = 'tls';`.
| string | $name | The property name to set |
| mixed | $value | The value to set the property to |
|
protected |
Add an error message to the error container.
| string | $msg |
| PHPMailer\PHPMailer\PHPMailer::setFrom | ( | $address, | |
$name = '' , |
|||
$auto = true |
|||
| ) |
Set the From and FromName properties.
| string | $address | |
| string | $name | |
| bool | $auto | Whether to also set the Sender address, defaults to true |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::setLanguage | ( | $langcode = 'en' , |
|
$lang_path = '' |
|||
| ) |
Set the language for error messages. Returns false if it cannot load the language file. The default language is English.
| string | $langcode | ISO 639-1 2-character language code (e.g. French is "fr") |
| string | $lang_path | Path to the language file directory, with trailing separator (slash) |
|
staticprotected |
Set the line break format string, e.g. "\r\n".
| string | $le |
|
protected |
Set the message type. PHPMailer only supports some preset message types, not arbitrary MIME structures.
| PHPMailer\PHPMailer\PHPMailer::setOAuth | ( | OAuth | $oauth | ) |
| PHPMailer\PHPMailer\PHPMailer::setSMTPInstance | ( | SMTP | $smtp | ) |
| PHPMailer\PHPMailer\PHPMailer::setWordWrap | ( | ) |
Apply word wrapping to the message body. Wraps the message body to the number of chars set in the WordWrap property. You should only do this to plain-text bodies as wrapping HTML tags may break them. This is called automatically by createBody(), so you don't need to call it yourself.
| PHPMailer\PHPMailer\PHPMailer::sign | ( | $cert_filename, | |
| $key_filename, | |||
| $key_pass, | |||
$extracerts_filename = '' |
|||
| ) |
Set the public and private key files and password for S/MIME signing.
| string | $cert_filename | |
| string | $key_filename | |
| string | $key_pass | Password for private key |
| string | $extracerts_filename | Optional path to chain certificate |
| PHPMailer\PHPMailer\PHPMailer::smtpClose | ( | ) |
Close the active SMTP session if one exists.
| PHPMailer\PHPMailer\PHPMailer::smtpConnect | ( | $options = null | ) |
|
protected |
Send mail via SMTP. Returns false if there is a bad MAIL FROM, RCPT, or DATA input.
| string | $header | The message headers |
| string | $body | The message body |
| Exception |
| PHPMailer\PHPMailer\PHPMailer::textLine | ( | $value | ) |
Return a formatted mail line.
| string | $value |
| PHPMailer\PHPMailer\PHPMailer::utf8CharBoundary | ( | $encodedText, | |
| $maxLength | |||
| ) |
Find the last character boundary prior to $maxLength in a utf-8 quoted-printable encoded string. Original written by Colin Brown.
| string | $encodedText | utf-8 QP text |
| int | $maxLength | Find the last character boundary prior to this length |
|
static |
Check that a string looks like an email address. Validation patterns supported:
auto
Pick best pattern automatically;pcre8
Use the squiloople.com pattern, requires PCRE > 8.0;pcre
Use old PCRE implementation;php
Use PHP built-in FILTER_VALIDATE_EMAIL;html5
Use the pattern given by the HTML5 spec for 'email' type form input elements.noregex
Don't use a regex: super fast, really dumb. Alternatively you may pass in a callable to inject your own validator, for example:You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
| string | $address | The email address to check |
| string | callable | $patternselect | Which pattern to use |
| PHPMailer\PHPMailer\PHPMailer::wrapText | ( | $message, | |
| $length, | |||
$qp_mode = false |
|||
| ) |
Word-wrap message. For use with mailers that do not automatically perform wrapping and for quoted-printable encoded messages. Original written by philippe.
| string | $message | The message to wrap |
| int | $length | The line length to wrap to |
| bool | $qp_mode | Whether to run in Quoted-Printable mode |
| PHPMailer\PHPMailer\PHPMailer::$action_function = '' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$AllowEmpty = false |
| PHPMailer\PHPMailer\PHPMailer::$AltBody = '' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$AuthType = '' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$Body = '' |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$CharSet = 'iso-8859-1' |
| PHPMailer\PHPMailer\PHPMailer::$ConfirmReadingTo = '' |
| PHPMailer\PHPMailer\PHPMailer::$ContentType = 'text/plain' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$Debugoutput = 'echo' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_domain = '' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_identity = '' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_passphrase = '' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_private = '' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_private_string = '' |
| PHPMailer\PHPMailer\PHPMailer::$DKIM_selector = '' |
| PHPMailer\PHPMailer\PHPMailer::$do_verp = false |
| PHPMailer\PHPMailer\PHPMailer::$Encoding = '8bit' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$ErrorInfo = '' |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$From = 'root@localhost' |
| PHPMailer\PHPMailer\PHPMailer::$FromName = 'Root User' |
| PHPMailer\PHPMailer\PHPMailer::$Helo = '' |
| PHPMailer\PHPMailer\PHPMailer::$Host = 'localhost' |
| PHPMailer\PHPMailer\PHPMailer::$Hostname = '' |
| PHPMailer\PHPMailer\PHPMailer::$Ical = '' |
|
protected |
|
protected |
|
staticprotected |
| PHPMailer\PHPMailer\PHPMailer::$Mailer = 'mail' |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$MessageDate = '' |
| PHPMailer\PHPMailer\PHPMailer::$MessageID = '' |
|
protected |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$Password = '' |
| PHPMailer\PHPMailer\PHPMailer::$Port = 25 |
| PHPMailer\PHPMailer\PHPMailer::$Priority = null |
|
protected |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$Sender = '' |
| PHPMailer\PHPMailer\PHPMailer::$Sendmail = '/usr/sbin/sendmail' |
|
protected |
|
protected |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$SingleTo = false |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$SMTPAuth = false |
| PHPMailer\PHPMailer\PHPMailer::$SMTPAutoTLS = true |
| PHPMailer\PHPMailer\PHPMailer::$SMTPDebug = 0 |
| PHPMailer\PHPMailer\PHPMailer::$SMTPKeepAlive = false |
| PHPMailer\PHPMailer\PHPMailer::$SMTPOptions = [] |
| PHPMailer\PHPMailer\PHPMailer::$SMTPSecure = '' |
| PHPMailer\PHPMailer\PHPMailer::$Subject = '' |
| PHPMailer\PHPMailer\PHPMailer::$Timeout = 300 |
|
protected |
|
protected |
| PHPMailer\PHPMailer\PHPMailer::$Username = '' |
| PHPMailer\PHPMailer\PHPMailer::$UseSendmailOptions = true |
|
static |
| PHPMailer\PHPMailer\PHPMailer::$WordWrap = 0 |
| PHPMailer\PHPMailer\PHPMailer::$XMailer = '' |
| const PHPMailer\PHPMailer\PHPMailer::MAX_LINE_LENGTH = 998 |
| const PHPMailer\PHPMailer\PHPMailer::STD_LINE_LENGTH = 76 |
| const PHPMailer\PHPMailer\PHPMailer::STOP_CONTINUE = 1 |
| const PHPMailer\PHPMailer\PHPMailer::STOP_CRITICAL = 2 |
| const PHPMailer\PHPMailer\PHPMailer::STOP_MESSAGE = 0 |
| const PHPMailer\PHPMailer\PHPMailer::VERSION = '6.0.1' |