This class implements a 3D multi-mesh object. More...
#include <CMultiMesh.h>
Public Member Functions | |
| cMultiMesh () | |
| Constructor of cMultiMesh. More... | |
| virtual | ~cMultiMesh () |
| Destructor of cMultiMesh. More... | |
| virtual void | setEnabled (bool a_enabled, const bool a_affectChildren=false) |
| This method enables or disables this object. When an object is disabled, both haptic and graphic rendering no longer occur. More... | |
| virtual cMultiMesh * | copy (const bool a_duplicateMaterialData=false, const bool a_duplicateTextureData=false, const bool a_duplicateMeshData=false, const bool a_buildCollisionDetector=true) |
| This method creates a copy of itself. More... | |
| virtual void | setHapticEnabled (const bool a_hapticEnabled, const bool a_affectChildren=false) |
| This method enables or disables haptic perception of this object, optionally propagating the change to children. More... | |
| virtual void | setStiffness (const double a_stiffness, const bool a_affectChildren=false) |
| This method sets the haptic stiffness of the object, optionally recursively affecting children. More... | |
| virtual void | setFriction (double a_staticFriction, double a_dynamicFriction, const bool a_affectChildren=false) |
| This method sets the static and dynamic friction properties (polygonal models only), optionally recursively affecting children. More... | |
| virtual void | setShowEnabled (const bool a_show, const bool a_affectChildren=false) |
| This method enables or disables the graphic display of this object, optionally propagating the change to children. More... | |
| virtual void | setWireMode (const bool a_showWireMode, const bool a_affectChildren=true) |
| This method returns whether wireframe rendering is enabled. More... | |
| virtual void | setUseCulling (const bool a_useCulling, const bool a_affectChildren=true) |
| Enable or disabling face-culling, optionally propagating the operation to my children. More... | |
| virtual void | setUseTransparency (const bool a_useTransparency, const bool a_affectChildren=false) |
| This method enables or disables transparency. More... | |
| virtual void | setTransparencyLevel (const float a_level, const bool a_applyToVertices=false, const bool a_applyToTextures=false, const bool a_affectChildren=false) |
| This method sets the transparency level of the object. More... | |
| virtual void | setUseDisplayList (const bool a_useDisplayList, const bool a_affectChildren=false) |
| This method enabled or disables the use of a display list for rendering, optionally propagating the operation to its children. More... | |
| virtual void | markForUpdate (const bool a_affectChildren=false) |
| This method invalidates any existing display lists, optionally propagating the operation to its children. More... | |
| virtual void | setUseMaterial (const bool a_useMaterial, const bool a_affectChildren=true) |
| This method enables or disables the use of material properties, optionally propagating the operation to its children. More... | |
| virtual void | setMaterial (cMaterialPtr a_material, const bool a_affectChildren=false) |
| This method sets the material properties of this object, optionally propagating the operation to its children. More... | |
| virtual void | setMaterial (cMaterial &a_material, const bool a_affectChildren=false) |
| This method setd the material properties of this object, optionally propagating the operation to its children. More... | |
| virtual void | backupMaterialColors (const bool a_affectChildren=false) |
| This method creates a backup of the material colors of this object, optionally propagating the operation to its children. More... | |
| virtual void | restoreMaterialColors (const bool a_affectChildren=false) |
| This method restores the material color properties of this object from a previous backup, optionally propagating the operation to its children. More... | |
| virtual void | setUseTexture (const bool a_useTexture, const bool a_affectChildren=true) |
| This method enables or disables the use of texture-mapping, optionally propagating the operation to its children. More... | |
| virtual void | setTexture (cTexture1dPtr, const bool a_affectChildren=false) |
| This method sets a texture to this object, optionally propagating the operation to its children. More... | |
| virtual void | setShaderProgram (cShaderProgramPtr a_shaderProgram, const bool a_affectChildren=false) |
| Set shader program. More... | |
| virtual void | setShowBoundaryBox (const bool a_showBoundaryBox, const bool a_affectChildren=false) |
| This method enables or disabled the graphic display of the boundary box for this object, optionally propagating the change to its children. More... | |
| virtual void | deleteCollisionDetector (const bool a_affectChildren=false) |
| This method deletes any existing collision detector. More... | |
| virtual bool | computeCollisionDetection (const cVector3d &a_segmentPointA, const cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
| This method computes any collision between a segment and this object. More... | |
| virtual void | setShowCollisionDetector (const bool a_showCollisionDetector, const bool a_affectChildren=false) |
| This method enables or disables the display of the collision detector, optionally propagating the change to its children. More... | |
| virtual void | setCollisionDetectorProperties (unsigned int a_displayDepth, cColorf &a_color, const bool a_affectChildren=false) |
| This method sets the collision detector graphic display properties. More... | |
| virtual void | createBruteForceCollisionDetector () |
| Set up a brute force collision detector for this mesh and (optionally) for its children. More... | |
| virtual void | createAABBCollisionDetector (const double a_radius) |
| Set up an AABB collision detector for this mesh. More... | |
| virtual cVector3d | computeInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions) |
| Computer haptic interaction. More... | |
| cMesh * | newMesh () |
| This method creates a new mesh primitive. More... | |
| bool | addMesh (cMesh *a_mesh) |
| This method adds an existing mesh primitives to list of meshes. More... | |
| bool | removeMesh (cMesh *a_mesh) |
| This method removes a mesh primitive from the list of meshes. More... | |
| bool | removeAllMesh () |
| This method removes all mesh primitives. More... | |
| bool | deleteMesh (cMesh *a_mesh) |
| This method deletes a mesh primitive from the list of meshes. More... | |
| bool | deleteAllMeshes () |
| This method deletes all meshes. More... | |
| int | getNumMeshes () |
| This method retrieves the number of meshes that compose this multi-mesh object. More... | |
| cMesh * | getMesh (unsigned int a_index) |
| This method returns a pointer to a mesh primitive by passing its index number. More... | |
| void | convertToSingleMesh (cMesh *a_mesh) |
| This method converts this multimesh into a single mesh object. More... | |
| bool | getVertex (const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_vertexIndex) |
| This method returns the index number and mesh of a specific vertex that is part of this multi-mesh. More... | |
| cVector3d | getVertexPos (unsigned int a_index) |
| This method returns the position data of specific vertex. More... | |
| unsigned int | getNumVertices () const |
| This method returns the the number of stored vertices. More... | |
| virtual void | setUseVertexColors (const bool a_useColors, const bool a_affectChildren=true) |
| This method enables or disables the use of per-vertex colors, optionally propagating the operation to its children. More... | |
| void | setVertexColor (const cColorf &a_color) |
| This method sets the color of each vertex. More... | |
| bool | getTriangle (const unsigned int a_index, cMesh *&a_mesh, unsigned int &a_triangleIndex) |
| This method returns the index number and mesh of a specific triangle that is part of this multi-mesh. More... | |
| unsigned int | getNumTriangles () const |
| This method returns the the number of stored triangles. More... | |
| void | clear () |
| This method clears all triangles and vertices of multi-mesh. More... | |
| void | setShowTriangles (const bool a_showTriangles) |
| This method enables or disables the rendering of triangles. More... | |
| void | computeAllEdges (double a_angleThresholdDeg=40.0) |
| This method creates a list of edges by providing a threshold angle in degrees. More... | |
| void | clearAllEdges () |
| This method clears all edges. More... | |
| void | setShowEdges (const bool a_showEdges) |
| This method enables or disables the rendering of edges. More... | |
| void | setEdgeProperties (const double a_width, const cColorf &a_color) |
| This method sets the graphic properties for edge-rendering. More... | |
| void | setEdgeLineWidth (const double a_width) |
| This method sets the line width of all edges. More... | |
| void | setShowNormals (const bool &a_showNormals) |
| This method enables or disables the rendering of vertex normals. More... | |
| void | setNormalsProperties (const double a_length, const cColorf &a_color) |
| This method sets the graphic properties for normal-rendering. More... | |
| void | setNormalsLength (const double a_length) |
| This method set the length of normals for display purposes. More... | |
| void | computeAllNormals () |
| This method computes all triangle normals. More... | |
| void | reverseAllNormals () |
| This method reverses all normals on this model. More... | |
| void | computeBTN () |
| This method computes the normal matrix vectors for all triangles. More... | |
| void | setShowTangents (const bool a_showTangents) |
| This method enables or disables the rendering of tangents and bi-tangents. More... | |
| virtual bool | loadFromFile (std::string a_filename) |
| This method loads a 3D object from a file. More... | |
| virtual bool | saveToFile (std::string a_filename) |
| This method saves 3D object to a file. More... | |
| virtual void | scale (const double &a_scaleFactor, const bool a_affectChildren=true) |
| This method scales this object by a_scaleFactor (uniform scale). More... | |
| void | scaleXYZ (const double a_scaleX, const double a_scaleY, const double a_scaleZ) |
| This method scales this object by using different factors along X,Y and Z axes. More... | |
| Public Member Functions inherited from chai3d::cGenericObject | |
| cGenericObject () | |
| Constructor of cGenericObject. More... | |
| virtual | ~cGenericObject () |
| Destructor of cGenericObject. More... | |
| bool | getEnabled () const |
| This method returns true if the object is enabled, false otherwise. More... | |
| virtual void | setLocalPos (const cVector3d &a_localPos) |
| This method sets the local position of this object. More... | |
| void | setLocalPos (const double a_x=0.0, const double a_y=0.0, const double a_z=0.0) |
| This method sets the local position of this object. More... | |
| cVector3d | getLocalPos () const |
| This method returns the local position of this object. More... | |
| cVector3d | getGlobalPos () const |
| This method returns the global position of this object. More... | |
| virtual void | setLocalRot (const cMatrix3d &a_localRot) |
| This method sets the local rotation matrix for this object. More... | |
| cMatrix3d | getLocalRot () const |
| This method returns the local rotation matrix of this object. More... | |
| cMatrix3d | getGlobalRot () const |
| This method returns the global rotation matrix of this object. More... | |
| void | setLocalTransform (const cTransform &a_transform) |
| This method returns the local position and rotation matrix by passing a transformation matrix. More... | |
| cTransform | getLocalTransform () |
| This method returns the local position and rotation matrix in a transformation matrix. More... | |
| cTransform | getGlobalTransform () |
| This method returns the global position and rotation matrix in a transformation matrix. More... | |
| void | translate (const cVector3d &a_translation) |
| This method translates this object by a specified offset. More... | |
| void | translate (const double a_x, const double a_y, const double a_z=0.0) |
| This method translates this object by a specified offset. More... | |
| void | rotateAboutLocalAxisRad (const cVector3d &a_axis, const double a_angleRad) |
| This method rotates this object around a local axis. Angle magnitude is defined in radians. More... | |
| void | rotateAboutLocalAxisDeg (const cVector3d &a_axis, const double a_angleDeg) |
| This method rotates this object around a local axis. Angle magnitude is defined in degrees. More... | |
| void | rotateAboutLocalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad) |
| This method rotates this object around a local axis. Angle magnitude is defined in radians. More... | |
| void | rotateAboutLocalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg) |
| This method rotates this object around a local axis. Angle magnitude is defined in degrees. More... | |
| void | rotateAboutGlobalAxisRad (const cVector3d &a_axis, const double a_angleRad) |
| This method rotates this object around a global axis. Angle magnitude is defined in radians. More... | |
| void | rotateAboutGlobalAxisDeg (const cVector3d &a_axis, const double a_angleDeg) |
| This method rotates this object around a global axis. Angle magnitude is defined in degrees. More... | |
| void | rotateAboutGlobalAxisRad (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleRad) |
| This method rotate this object around a local axis. Angle magnitude is defined in radians. More... | |
| void | rotateAboutGlobalAxisDeg (const double a_axisX, const double a_axisY, const double a_axisZ, const double a_angleDeg) |
| This method rotates this object around a local axis. Angle magnitude is defined in degrees. More... | |
| void | rotateExtrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder) |
| This method rotates this object using fixed Euler representation. Angles are defined in radians. More... | |
| void | rotateExtrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder) |
| This method rotates this object using fixed Euler representation. Angles are defined in radians. More... | |
| void | rotateIntrinsicEulerAnglesRad (const double &a_angleRad1, const double &a_angleRad2, const double &a_angleRad3, const cEulerOrder a_eulerOrder) |
| This method rotates this object using co-moving Euler representation. Angles are defined in radians. More... | |
| void | rotateIntrinsicEulerAnglesDeg (const double &a_angleDeg1, const double &a_angleDeg2, const double &a_angleDeg3, const cEulerOrder a_eulerOrder) |
| This method rotates this object using co-moving Euler representation. Angles are defined in radians. More... | |
| virtual void | computeGlobalPositions (const bool a_frameOnly=true, const cVector3d &a_globalPos=cVector3d(0.0, 0.0, 0.0), const cMatrix3d &a_globalRot=cIdentity3d()) |
| This method computes the global position and rotation of this object and its children. More... | |
| void | computeGlobalPositionsFromRoot (const bool a_frameOnly=true) |
| This method computes the global position and rotation of current object only. More... | |
| bool | addEffect (cGenericEffect *a_effect) |
| This method adds a haptic effect to this object. More... | |
| bool | removeEffect (cGenericEffect *a_effect) |
| This method removes a haptic effect from this object. More... | |
| void | deleteAllEffects () |
| This method removes all haptic effects. More... | |
| bool | createEffectMagnetic () |
| This method creates a magnetic haptic effect. More... | |
| bool | deleteEffectMagnetic () |
| This method deletes any current magnetic haptic effect. More... | |
| bool | createEffectStickSlip () |
| This method creates a stick-and-slip haptic effect. More... | |
| bool | deleteEffectStickSlip () |
| This method delete any current stick-and-slip haptic effect. More... | |
| bool | createEffectSurface () |
| This method creates a surface haptic effect. More... | |
| bool | deleteEffectSurface () |
| This method deletes any current surface haptic effect. More... | |
| bool | createEffectVibration () |
| This method creates a vibration haptic effect. More... | |
| bool | deleteEffectVibration () |
| This method deletes any current vibration haptic effect. More... | |
| bool | createEffectViscosity () |
| This method creates a viscous haptic effect. More... | |
| bool | deleteEffectViscosity () |
| This method deletes any current viscous haptic effect. More... | |
| bool | getHapticEnabled () const |
| This method returns the haptic status of object (true means it can be felt when visible). More... | |
| bool | getShowEnabled () const |
| This method returns the display status of object (true means it's visible). More... | |
| bool | getWireMode () const |
| This method returns whether wireframe rendering is enabled. More... | |
| bool | getUseCulling () const |
| This method returns true if face-culling is enabled, false otherwise. More... | |
| bool | getUseTransparency () const |
| This method returns true if transparency is enabled, false otherwise. More... | |
| bool | getUseDisplayList () const |
| This method returns true if a display list is activated, false otherwise. More... | |
| bool | getUseVertexColors () const |
| This method returns true is per-vertex color properties are enabled, false otherwise. More... | |
| bool | getUseMaterial () const |
| This method returns true is material properties are enabled, false otherwise. More... | |
| bool | getUseTexture () const |
| This method returns true if texture-mapping is enabled, false otherwise. More... | |
| virtual cShaderProgramPtr | getShaderProgram () |
| This method returns a pointer to the current shader program. More... | |
| bool | getShowBoundaryBox () const |
| This method returns true if the boundary box is being displayed, false otherwise. More... | |
| cVector3d | getBoundaryMin () const |
| This method returns the minimum point of this object's boundary box. More... | |
| cVector3d | getBoundaryMax () const |
| This method returns the maximum point of this object's boundary box. More... | |
| cVector3d | getBoundaryCenter () const |
| This method computes and returns the center of this object's boundary box. More... | |
| bool | getBoundaryBoxEmpty () |
| This method returns true, if the boundary box is empty, otherwise false. More... | |
| virtual void | computeBoundaryBox (const bool a_includeChildren=true) |
| This method computes this object's boundary box, optionally forcing it to bound child objects. More... | |
| virtual void | setShowFrame (const bool a_showFrame, const bool a_affectChildren=false) |
| This method enables or disables the graphic display of the reference frame arrows for this object, optionally propagating the change to its children. More... | |
| bool | getShowFrame (void) const |
| This method returns true if the display of the reference frame is enabled, false otherwise. More... | |
| virtual void | setFrameSize (const double a_size=1.0, const bool a_affectChildren=false) |
| This method sets the size of the rendered reference frame, optionally propagating the change to its children. More... | |
| double | getFrameSize () const |
| This method returns the size of the graphical reference frame. More... | |
| void | setCollisionDetector (cGenericCollision *a_collisionDetector) |
| This method sets a collision detector to this current object. More... | |
| cGenericCollision * | getCollisionDetector () const |
| This method returns a pointer to this object's current collision detector. More... | |
| bool | getShowCollisionDetector () |
| This method returns true if the collision detector is being displayed graphically, false otherwise. More... | |
| void | setParent (cGenericObject *a_parent) |
| This method sets the parent of this object. More... | |
| cGenericObject * | getParent () const |
| This method returns the parent of this object. More... | |
| void | setOwner (cGenericObject *a_owner) |
| This method sets a link to an object that owns this object. This could be a super parent for instance. More... | |
| cGenericObject * | getOwner () |
| This method returns the owner of this object. More... | |
| cGenericObject * | getChild (const unsigned int a_index) const |
| This method returns a selected child from the list of children. More... | |
| bool | addChild (cGenericObject *a_object) |
| This method add an object to the list of children. More... | |
| bool | removeChild (cGenericObject *a_object) |
| This method removes an object from the list of children, without deleting it. More... | |
| bool | removeFromGraph () |
| This method removes this object from its parent's list of children. More... | |
| bool | deleteChild (cGenericObject *a_object) |
| This method removes an object from its list of children and deletes it. More... | |
| void | clearAllChildren () |
| This method clears all objects from its list of children, without deleting them. More... | |
| void | deleteAllChildren () |
| This method clears and delete all objects from its list of children. More... | |
| unsigned int | getNumChildren () |
| This method returns the number of children from its list of children. More... | |
| unsigned int | getNumDescendants (bool a_includeCurrentObject=false) |
| This method returns the total number of descendants, optionally including this object. More... | |
| void | setGhostEnabled (bool a_ghostEnabled) |
| This method enables or disables this object to be a ghost node. More... | |
| bool | getGhostEnabled () |
| This method returns truee if this object is a ghost node. More... | |
| virtual void | renderSceneGraph (cRenderOptions &a_options) |
| This method renders the entire scene graph, starting from this object. More... | |
| virtual void | adjustCollisionSegment (cVector3d &a_segmentPointA, cVector3d &a_segmentPointAadjusted) |
| This method adjusts the collision segment to handle objects in motion. More... | |
| Public Member Functions inherited from chai3d::cGenericType | |
| cGenericType () | |
| Constructor of cGenericType. More... | |
| virtual | ~cGenericType () |
| Destructor of cGenericType. More... | |
Public Attributes | |
| std::vector< cMesh * > * | m_meshes |
| Array of meshes. More... | |
| Public Attributes inherited from chai3d::cGenericObject | |
| std::string | m_name |
| Name of current object (filename). More... | |
| cMaterialPtr | m_material |
| Material property. More... | |
| cTexture1dPtr | m_texture |
| Texture property. More... | |
| cNormalMapPtr | m_normalMap |
| Normal map property. More... | |
| int | m_userTag |
| An arbitrary tag, not used by CHAI3D. More... | |
| void * | m_userData |
| An arbitrary data pointer, not used by CHAI3D. More... | |
| std::string | m_userName |
| Name of current object, not used by CHAI3D. More... | |
| cGenericObject * | m_userExternalObject |
| A link to an external cGenericObject object, not used by CHAI3D. More... | |
| cVector3d | m_interactionPoint |
| Projection of the most recent haptic point (tool) onto the surface of the virtual object. More... | |
| cVector3d | m_interactionNormal |
| Surface normal at the current interaction point. More... | |
| bool | m_interactionInside |
| Was the last tool (haptic point) located inside the object? More... | |
Protected Member Functions | |
| virtual void | render (cRenderOptions &a_options) |
| This method renders this object graphically using OpenGL. More... | |
| virtual void | updateGlobalPositions (const bool a_frameOnly) |
| This method update the global position information about this object. More... | |
| virtual void | updateBoundaryBox () |
| This method updates the boundary box of this object. More... | |
| void | copyMultiMeshProperties (cMultiMesh *a_obj, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector) |
| This method copies all properties of this multi-mesh object to another. More... | |
| Protected Member Functions inherited from chai3d::cGenericObject | |
| virtual void | scaleObject (const double &a_scaleFactor) |
| This method scales the size of this object with given scale factor. More... | |
| virtual void | computeLocalInteraction (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN) |
| This method updates the geometric relationship between the tool and the current object. More... | |
| virtual cVector3d | computeOtherInteractions (const cVector3d &a_toolPos, const cVector3d &a_toolVel, const unsigned int a_IDN, cInteractionRecorder &a_interactions) |
| This method computes any additional interactions between the object and the tools. More... | |
| virtual bool | computeOtherCollisionDetection (cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
| This method computes any additional collisions other than the ones computed by the default collision detector. More... | |
| void | copyGenericObjectProperties (cGenericObject *a_objDest, const bool a_duplicateMaterialData, const bool a_duplicateTextureData, const bool a_duplicateMeshData, const bool a_buildCollisionDetector) |
| This method copies all properties of the current generic object to another. More... | |
Additional Inherited Members | |
| Static Public Attributes inherited from chai3d::cGenericObject | |
| static cColorf | s_boundaryBoxColor |
| Color of the boundary box. More... | |
| Protected Attributes inherited from chai3d::cGenericObject | |
| cGenericObject * | m_parent |
| Parent object. More... | |
| cGenericObject * | m_owner |
| std::vector< cGenericObject * > | m_children |
| List of children. More... | |
| cVector3d | m_localPos |
| The position of this object in my parent's reference frame. More... | |
| cVector3d | m_globalPos |
| The position of this object in the world's reference frame. More... | |
| cMatrix3d | m_localRot |
| The rotation matrix that rotates my reference frame into my parent's reference frame. More... | |
| cMatrix3d | m_globalRot |
| The rotation matrix that rotates my reference frame into the world's reference frame. More... | |
| cVector3d | m_prevGlobalPos |
| Previous position since last haptic computation. More... | |
| cMatrix3d | m_prevGlobalRot |
| Previous rotation since last haptic computation. More... | |
| cVector3d | m_boundaryBoxMin |
| Minimum position of boundary box. More... | |
| cVector3d | m_boundaryBoxMax |
| Maximum position of boundary box. More... | |
| bool | m_boundaryBoxEmpty |
| If true, then the boundary box does not include any object. More... | |
| double | m_frameSize |
| Size of graphical representation of frame (X-Y-Z). More... | |
| double | m_frameThicknessScale |
| Pen thickness of graphical representation of frame (X-Y-Z). More... | |
| bool | m_enabled |
| If true, the object may be rendered graphically and haptically. More... | |
| bool | m_showEnabled |
| If true, this object is rendered. More... | |
| bool | m_hapticEnabled |
| If true, this object can be felt. More... | |
| bool | m_ghostEnabled |
| If true, object is enabled as ghost. More... | |
| bool | m_showFrame |
| If true, this object's reference frame is rendered as a set of arrows. More... | |
| bool | m_showBoundaryBox |
| If true, this object's boundary box is displayed as a set of lines. More... | |
| bool | m_showCollisionDetector |
| If true, the collision detector is displayed (if available) at this node. More... | |
| bool | m_useTextureMapping |
| Should texture mapping be used? More... | |
| bool | m_useMaterialProperty |
| Should material properties be used? More... | |
| bool | m_useVertexColors |
| Should per-vertex colors be used? More... | |
| bool | m_useDisplayList |
| Should we use a display list to render this mesh? More... | |
| cDisplayList | m_displayList |
| Basic display list for current object. More... | |
| int | m_triangleMode |
| The polygon rendering mode (GL_FILL or GL_LINE). More... | |
| bool | m_useTransparency |
| bool | m_cullingEnabled |
| cShaderProgramPtr | m_shaderProgram |
| Shader program. More... | |
| cTransform | m_frameGL |
| OpenGL matrix describing my position and orientation transformation. More... | |
| cGenericCollision * | m_collisionDetector |
| The collision detector used to test for contact with this object. More... | |
| std::vector< cGenericEffect * > | m_effects |
| List of haptic effects programmed for this object. More... | |
| Static Protected Attributes inherited from chai3d::cGenericObject | |
| static cMaterialPtr | s_defaultMaterial = nullptr |
| Default material property. More... | |
This class implements a collection of cMesh objects. Each cMesh object includes one material and texture properties with a set of vertices and triangles. cMultiMesh allows the user to build more complicated polygonal objects composed of sets of triangles that share digfferent materials.
| chai3d::cMultiMesh::cMultiMesh | ( | ) |
Constructor of cMultiMesh.
|
virtual |
Destructor of cMultiMesh.
|
virtual |
This method enables or disables this object.
When an object is disabled, haptic and graphic rendering are no longer performed through the scenegraph and the object is simply ignored. Other operations however will still be active.
Enabling or disabling an object will not affect child objects, unless explicitly specified.
| a_enabled | If true then object is enabled, false otherwise. |
| a_affectChildren | If true, then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method creates a copy of itself.
| a_duplicateMaterialData | If true, material (if available) is duplicated, otherwise it is shared. |
| a_duplicateTextureData | If true, texture data (if available) is duplicated, otherwise it is shared. |
| a_duplicateMeshData | If true, mesh data (if available) is duplicated, otherwise it is shared. |
| a_buildCollisionDetector | If true, collision detector (if available) is duplicated, otherwise it is shared. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables the object to be felt haptically.
If argument a_affectChildren
is set to true then all children are updated with the new value.
| a_hapticEnabled | If true then the object can be touched when visible. |
| a_affectChildren | If true then all children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method sets the haptic stiffness for this object, optionally recursively affecting children.
| a_stiffness | The stiffness to apply to this object. |
| a_affectChildren | If true, then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method sets the static and dynamic friction properties for this object, optionally recursively affecting children.
| a_staticFriction | The static friction to apply to this object. |
| a_dynamicFriction | The dynamic friction to apply to this object. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method graphically shows or hides this object, optionally recursively affecting children.
| a_show | If true then object is visible. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables wireframe rendering, optionally propagating the operation to children.
| a_showWireMode | If true then wireframe mode is used. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables back face culling.
Rendering in OpenGL is much faster with culling enabled.
| a_useCulling | If true then back faces are culled. |
| a_affectChildren | If true then then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method specifies whether transparency is enabled. If transparency is enabled then make sure that multi-pass rendering is enabled too. For more information, see class cCamera.
| a_useTransparency | If true then transparency is enabled. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method sets the alpha value to all components of the object, optionally propagating the operation to children.
Using the 'apply to textures' option causes the actual texture alpha values to be over-written in my texture, if it exists.
| a_level | Level of transparency ranging from 0.0 to 1.0. |
| a_applyToVertices | If true, then apply changes to vertex colors. |
| a_applyToTextures | If true, then apply changes to texture. |
| a_affectChildren | If true, then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables the use of display lists for mesh rendering. Display lists significantly speed up rendering for large meshes, but it means that any changes that are made on the object (e.g changing vertex positions) will not take effect until you invalidate the existing display list by calling markForUpdate().
| a_useDisplayList | If true then a display list is created (cMesh). |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method invalidates any existing display lists. You should call this on if you're using display lists and you modify mesh options, vertex positions, etc.
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables the use of material properties.
| a_useMaterial | If true then material properties are used for rendering. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method copies all material properties defined in a_material
to the material structure of this object.
Note that this does not affect whether material rendering is enabled; it sets the material that will be rendered if material rendering is enabled. Call method setUseMaterial() to enable or disable material rendering.
| a_material | The material to apply to this object. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method copies all material properties defined in a_material
to the material structure of this object.
Note that this does not affect whether material rendering is enabled; it sets the material that will be rendered if material rendering is enabled. Call method setUseMaterial() to enable or disable material rendering.
| a_material | The material to apply to this object |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method creates a backup of the material color properties of this object, optionally recursively affecting children.
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method restores material color properties for this object, optionally recursively affecting children.
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables texture-mapping, optionally recursively affecting children.
| a_useTexture | If true then texture mapping is used. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method sets the current texture for this mesh, optionally recursively affecting children.
Note that this does not affect whether texturing is enabled; it sets the texture that will be rendered if texturing is enabled. Call method setUseTexture() to enable or disable texturing.
| a_texture | The texture to apply to this object. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method assigns a shader program to this object.
If a_affectChildren
is set to true then all children are assigned with the shader program.
| a_shaderProgram | Shader program to be assigned to object. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables the graphic representation of the boundary box of this object.
If a_affectChildren
is set to true then all children are updated with the new value.
| a_showBoundaryBox | If true boundary box is displayed. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method deletes any existing collision detector and sets the current collision detector to null.
It's fine for an object to have a null collision detector (that's the default for a new object, in fact), it just means that no collisions will be found.
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method determines whether a given segment intersects this object or any of its descendants.
The segment is described by a start point a_segmentPointA
and end point a_segmentPointB
.
All detected collisions are reported in the collision recorder passed by argument a_recorder
.
Specifications about the type of collisions reported are specified by argument a_settings
.
| a_segmentPointA | Start point of segment. |
| a_segmentPointB | End point of segment. |
| a_recorder | Recorder which stores all collision events. |
| a_settings | Collision settings information. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method enables or disables graphic representation of the collision detector at this node.
If argument a_affectChildren
is set to true then all children are updated with the new value.
| a_showCollisionDetector | If true then display collision detector graphically. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method sets the rendering properties of the the graphic representation of the collision detector.
If argument a_affectChildren
is set to true then all children are updated with the new values.
| a_color | Color used to render collision detector. |
| a_displayDepth | Indicated which depth of collision tree needs to be displayed (see cGenericCollision). |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
|
virtual |
This method builds a brute Force collision detector for this mesh.
|
virtual |
This method builds an AABB collision detector for this mesh.
| a_radius | Bounding radius. |
|
virtual |
This method descends through child objects to compute interactions for all cGenericEffect classes defined for each object.
| a_toolPos | Current position of tool. |
| a_toolVel | Current position of tool. |
| a_IDN | Identification number of the force algorithm. |
| a_interactions | List of recorded interactions. |
Reimplemented from chai3d::cGenericObject.
| cMesh * chai3d::cMultiMesh::newMesh | ( | ) |
This method creates a new mesh and adds it to the list of meshes.
| bool chai3d::cMultiMesh::addMesh | ( | cMesh * | a_mesh | ) |
This method adds an existing mesh primitives to list of meshes
| bool chai3d::cMultiMesh::removeMesh | ( | cMesh * | a_mesh | ) |
This method removes a mesh primitive from the list of meshes.
| a_mesh | Mesh to remove. |
| bool chai3d::cMultiMesh::removeAllMesh | ( | ) |
This method removes all mesh primitives.
| bool chai3d::cMultiMesh::deleteMesh | ( | cMesh * | a_mesh | ) |
This method deletes a mesh primitive from the list of meshes.
| a_mesh | Mesh to delete. |
| bool chai3d::cMultiMesh::deleteAllMeshes | ( | ) |
This method deletes all meshes.
| int chai3d::cMultiMesh::getNumMeshes | ( | ) |
This method retrieves the number of meshes that compose this multi-mesh object.
| cMesh * chai3d::cMultiMesh::getMesh | ( | unsigned int | a_index | ) |
This method returns a pointer to a mesh primitive by passing its index number.
| a_index | Index number of mesh. |
| void chai3d::cMultiMesh::convertToSingleMesh | ( | cMesh * | a_mesh | ) |
This method converts this multimesh into a single mesh object. Material and texture properties are not copied.
| bool chai3d::cMultiMesh::getVertex | ( | const unsigned int | a_index, |
| cMesh *& | a_mesh, | ||
| unsigned int & | a_vertexIndex | ||
| ) |
This method returns the index number and mesh of a specific vertex that is part of this multi-mesh.
| a_index | Index number of the requested vertex. |
| a_mesh | Pointer to the mesh containing the selected vertex. |
| a_vertexIndex | Index number of the specified vertex inside the mesh vertex array. |
| cVector3d chai3d::cMultiMesh::getVertexPos | ( | unsigned int | a_index | ) |
This method returns the position data of specific vertex.
| a_index | Index of the requested vertex. |
| unsigned int chai3d::cMultiMesh::getNumVertices | ( | ) | const |
This method returns the the number of stored vertices.
|
virtual |
This method enables or disables the use of per-vertex color information of when rendering the mesh.
| a_useColors | If true then then vertex color information is applied. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
| void chai3d::cMultiMesh::setVertexColor | ( | const cColorf & | a_color | ) |
This method sets the color of each vertex.
| a_color | New color to be applied to each vertex. |
| bool chai3d::cMultiMesh::getTriangle | ( | const unsigned int | a_index, |
| cMesh *& | a_mesh, | ||
| unsigned int & | a_triangleIndex | ||
| ) |
This method returns the index number and mesh of a specific triangle that is part of this multi-mesh.
| a_index | Index number of the requested triangle. |
| a_mesh | Pointer to the mesh containing the selected triangle. |
| a_triangleIndex | Index number of the specified triangle inside the mesh triangle array. |
| unsigned int chai3d::cMultiMesh::getNumTriangles | ( | ) | const |
This method returns the the number of stored triangles.
| void chai3d::cMultiMesh::clear | ( | ) |
This method clears all triangles and vertices of multi-mesh.
| void chai3d::cMultiMesh::setShowTriangles | ( | const bool | a_showTriangles | ) |
This method enables or disables the rendering of triangles.
| a_showTriangles | If true then triangles are rendered, false otherwise. |
| void chai3d::cMultiMesh::computeAllEdges | ( | double | a_angleThresholdDeg = 40.0 | ) |
This method creates a list of edges by providing a threshold angle in degrees. All triangles for which the angle between their respective surface normals are greater than the select angle threshold are added to the list of edges.
| a_angleThresholdDeg | Threshold angle in degrees. |
| void chai3d::cMultiMesh::clearAllEdges | ( | ) |
This method clears all edges.
| void chai3d::cMultiMesh::setShowEdges | ( | const bool | a_showEdges | ) |
This method enables or disables the rendering of edges.
| a_showEdges | If true then edges are rendered, false otherwise. |
| void chai3d::cMultiMesh::setEdgeProperties | ( | const double | a_width, |
| const cColorf & | a_color | ||
| ) |
This method sets the graphic properties for edge-rendering. Options passed by argument include the width of the edges and their color.
| a_width | Width of edge lines. |
| a_color | Color of edge lines. |
| void chai3d::cMultiMesh::setEdgeLineWidth | ( | const double | a_width | ) |
This method sets the line width of all edges.
| a_width | Width of edge lines. |
| void chai3d::cMultiMesh::setShowNormals | ( | const bool & | a_showNormals | ) |
This method enables or disables the rendering of vertex normals.
| a_showNormals | If true then normal vectors are rendered graphically, false otherwise. |
| void chai3d::cMultiMesh::setNormalsProperties | ( | const double | a_length, |
| const cColorf & | a_color | ||
| ) |
This method defines the way normals are graphically rendered.
| a_length | Length of normals. |
| a_color | Color of normals. |
| void chai3d::cMultiMesh::setNormalsLength | ( | const double | a_length | ) |
This method set the length of normals for display purposes.
| a_length | Length of normals. |
| void chai3d::cMultiMesh::computeAllNormals | ( | ) |
This method computes all triangle normals.
| void chai3d::cMultiMesh::reverseAllNormals | ( | ) |
This method reverses the normal for every vertex on this model. Useful for models that started with inverted faces and thus gave inward-pointing normals.
| void chai3d::cMultiMesh::computeBTN | ( | ) |
This method computes the normal matrix vectors for all triangles.
| void chai3d::cMultiMesh::setShowTangents | ( | const bool | a_showTangents | ) |
This method enables or disables the rendering of tangents and bi-tangents.
| a_showTangents | Display mode. |
|
virtual |
This method loads a 3D mesh file.
CHAI3D currently supports .obj, .3ds, and .stl files.
| a_filename | Filename of 3D model. |
|
virtual |
This method saves a mesh object to file.
CHAI3D currently supports .obj, .3ds, and .stl files.
| a_filename | Filename of 3D model. |
|
virtual |
This method performs a uniform scale on the object, optionally including children.
| a_scaleFactor | Scale factor. |
| a_affectChildren | If true then children are updated too. |
Reimplemented from chai3d::cGenericObject.
| void chai3d::cMultiMesh::scaleXYZ | ( | const double | a_scaleX, |
| const double | a_scaleY, | ||
| const double | a_scaleZ | ||
| ) |
This method scales this mesh by using different scale factors along X, Y, and Z axes.
| a_scaleX | Scale factor along X axis. |
| a_scaleY | Scale factor along Y axis. |
| a_scaleZ | Scale factor along Z axis. |
|
protectedvirtual |
This message renders this multi-mesh using OpenGL.
| a_options | Rendering options. |
Reimplemented from chai3d::cGenericObject.
|
protectedvirtual |
This method computes the global position of all vertices.
| a_frameOnly | If false, then the global position of all vertices is computed. |
Reimplemented from chai3d::cGenericObject.
|
protectedvirtual |
This method compute the axis-aligned boundary box that encloses all triangles in this mesh.
Reimplemented from chai3d::cGenericObject.
|
protected |
This method copies all properties of this multi-mesh to another.
| a_obj | Destination object where properties are copied to. |
| a_duplicateMaterialData | If true, material (if available) is duplicated, otherwise it is shared. |
| a_duplicateTextureData | If true, texture data (if available) is duplicated, otherwise it is shared. |
| a_duplicateMeshData | If true, mesh data (if available) is duplicated, otherwise it is shared. |
| a_buildCollisionDetector | If true, collision detector (if available) is duplicated, otherwise it is shared. |
| std::vector<cMesh*>* chai3d::cMultiMesh::m_meshes |


Subscribe
Cancel any time!
First Name
Last Name
Email
Password
Card Number
Expiration
/
CVC
Subscription Details
Plan Details
Plan:
Plan Costs
Billing Period:
Monthly Cost:
Prorated Discount:
Total Due Today:
Subscribe Now →


B. Housing for Teachers--Repealed
§§356D-81 to 356D-90 REPEALED. L 2006, c 180, §35.
Cross References
For similar provisions, see §§302A-832 to 302A-835.


Perfect
Make your wedding day the Perfect day.
Venues
Pictures
Flowers
Food
Clothing
Music
Invitations
Hannah Strong
Flowers by Rose
Chapel on the Hill
Gina's Catering Co.
DJ Dave
Karli's Bridal


Edit payment information
Edit payment information
Error! An error ocurred saving your card.
Error! Invalid or missing name.
Error! Invalid or missing card number.
Error! Invalid or missing CVC number.
Error! Invalid or missing expiration month.
Error! Invalid or missing expiration year.
Success! The billing profile has been created.
Error! An error occurred updating your information.


| Created: | 6/27/2020 7:03:19 AM |
| Modified: | 6/27/2020 7:03:19 AM |
| Project: | |
| Advanced: |
| Attribute |
|
Public serial id |
|
Details:
|
|
Public varchar(255) code |
|
Details:
|
|
Public varchar(255) description |
|
Details:
|
|
Public varchar(255) created_by |
|
Details:
|
|
Public varchar(255) updated_by |
|
Details:
|
|
Public timestamp with time zone(0) created_at |
|
Details:
|
|
Public timestamp with time zone(0) updated_at |
|
Details:
|
|
Public timestamp with time zone(0) start_date |
|
Details:
|
|
Public timestamp with time zone(0) end_date |
|
Details:
|
| Operation | ||
|
Public increase_decrease_line_numbers_pkey( id: serial, |
||
|
Details:
<<PK>>
|
| Element | Source Role | Target Role |
|
«table» increase_decrease_line_number_versions Table «FK» |
Name: increase_decrease_line_number_versions_incre... |
Name: increase_decrease_line_numbers_pkey |
|
Details:
|
| Tag | Value |
| Owner | public |
|
Details:
|
| Property | Value |
| isFinalSpecialization: | 0 |


Send your CV and cover letter to us at<EMAIL_ADDRESS>* Working: Part Time / Full Time
* Salary : No bar for deserving candidate.
* Education: Bachelor level running
What to include in you resume?
- Github / bitbucket / stackoverflow urls of your previously done projects (if you have) and your past experiences.


--- title: "codewar-1" ---
灵感来源：https://www.codewars.com/kata/simple-fun-number-183-direction-in-grid/javascript


--- title: Interviewing front-end engineer excerpt: 'Great general advice on job interviews, and specifically for a front-end engineer from Nicholas Zakas at Yahoo!: http://tinyurl.com/ycb2bj2' date: '2010-02-13 17:00:57 +0100' date_gmt: '2010-02-13 15:00:57 +0100' categories: - Webdev tags: - tweets - web - design - development ---
Great general advice on job interviews, and specifically for a front-end engineer from Nicholas Zakas at Yahoo!: http://tinyurl.com/ycb2bj2


hosting
Where can host QuickWiki?
Well, really, anywhere you want. This very page you are on now is hosted over IPFS for example.
All platforms that have been tested and confirmed working:
- IPFS
- Amazon S3
- self-hosted nginx
- Github Pages
- Anywhere where you can manage to upload a directory of HTML files


PIN:
You should make this a hidden field in a production system.
It is not hidden here for demonstration purposes.


CSS Pseudo-elements is a new proposal by Adobe to the W3C that allows multiple "before" and "after" pseudo-elements to be generated by a single element. This is a very long link!
Multiple pseudo-elements cover use cases collected on css-tricks.com.
This is a prototype JavaScript implementation to give you a feel for how the code will look like and behave. Please keep in mind that this is just experimental stuff and treat it accordingly.


--- title: Dropdowns overview category: dropdowns description: Description of dropdown lists and why they are handy. ---


Have self-confidence. Be punctual, it shows you are earnest about it.
Life is relationships.
Try to enrich every relationship with love. Don’t put reciprocity, expectations in place.
Seek love which is God. Seek freedom (psychological freedom from expectations, from seeking advantage) so you can discover that love.
Love is unity in diversity. If diversity is real, there is no love.
In non-duality the truth is one but appears as many. Differences but not divisions. We are all one in essence but different in appearance.
You are able to overlook the outward differences because you focus on the inner source which is the same in all living beings.
In dualistic ethics there is no scope for forgiveness. How can you forgive real evil? Rama, Krishna, Buddha, Christ were teaching non-dualistic ethics, forgiving your enemies.


This is a PyTorch implementation of the paper Accessing Higher-level Representations in Sequential Transformers with Feedback Memory.
Normal transformers process tokens in parallel. Each transformer layer pays attention to the outputs of the previous layer. Feedback transformer pays attention to the output of all layers in previous steps. So this adds recurrence, and we need to process token-by-token. This slows down the training significantly (about 5X - 10X depending on the sequence length). However, when predicting Feedback Transformer is faster because you can predict the next token if you cache the memory vectors.
In order to speed up the training, the paper discusses starting with a short sequence length and gradually increasing it. They also discuss using a pretrained parallel transformer as the starting point.
The original feedback transformer doesn’t keep the outputs of all layers. Instead it keeps weighted sum of the output of all layers. This reduces the memory used for caching during prediction. The first half of this file implements this.
The updated feedback transformer shares weights $W^l_k$ and $W^l_v$ used to calculate keys and values among the layers. We then calculate the keys and values for each step only once and keep them cached. The second half of this file implements this. We implemented a custom PyTorch function to improve performance.
Here’s the training code and a notebook for training a feedback transformer on Tiny Shakespeare dataset.
43import math
44from typing import Optional
45
46import torch
47from torch import nn
48
49from labml_helpers.module import Module
50from labml_nn.transformers.feed_forward import FeedForward
51from labml_nn.transformers.mha import PrepareForMultiHeadAttention
52from labml_nn.utils import clone_module_list
This module computes recurrent attention similar to attention from original transformers paper.
55class FeedbackAttention(Module):
d_model
is the number of features in the transformerdropout_prob
is the attention dropout probabilityis_kv_precomputed
is whether key, value tensors are already calculated66 def __init__(self, heads: int, d_model: int, dropout_prob: float = 0.1, *,
67 is_kv_precomputed: bool = False):
75 super().__init__()
Number of features per head
78 self.d_k = d_model // heads
80 self.heads = heads
These transform the query
multi-headed attention.
83 self.query = PrepareForMultiHeadAttention(d_model, heads, self.d_k, bias=False)
These transform the key
and value
for multi-headed attention.
85 if not is_kv_precomputed:
86 self.key = PrepareForMultiHeadAttention(d_model, heads, self.d_k, bias=False)
87 self.value = PrepareForMultiHeadAttention(d_model, heads, self.d_k, bias=True)
Keys and values are already calculated
89 else:
90 self.key = None
91 self.value = None
Output layer
94 self.output = nn.Linear(d_model, d_model)
Dropout
96 self.dropout = nn.Dropout(dropout_prob)
Scaling factor before the softmax
98 self.scale = 1 / math.sqrt(self.d_k)
Softmax for attention along the time dimension of key
101 self.softmax = nn.Softmax(dim=0)
Number of relative positions
104 self.P = 2 ** 12
Relative positional embeddings for key relative to the query.
107 self.key_pos_embeddings = nn.Parameter(torch.zeros((self.P, heads, self.d_k)), requires_grad=True)
Relative positional embedding bias for key relative to the query.
109 self.key_pos_bias = nn.Parameter(torch.zeros((self.P, heads)), requires_grad=True)
Positional embeddings for the query is independent of the position of the query
111 self.query_pos_bias = nn.Parameter(torch.zeros((heads, self.d_k)), requires_grad=True)
We store attentions so that it can be used for logging, or other computations if needed
114 self.attn = None
We use relative positional encodings for attention, similar to relative multi-head attention form Transformer-XL paper.
Attention from current step’s query to key in step $j$ (relative to current step) is,
where $Q, K_j$, are linear transformations of original embeddings $X^q, X^k_j$ and $U^Q, U^K_j$ are linear transformations of positional encodings $P_q, P_j$.
We replace term $\color{lightgreen}{D}$ with $S_j$.
116 def get_scores(self, query: torch.Tensor, key: torch.Tensor):
$U^K_j$
144 key_pos_emb = self.key_pos_embeddings[-key.shape[0]:]
$U^Q$
146 query_pos_bias = self.query_pos_bias[None, :, :]
$S_j$
148 key_pos_bias = self.key_pos_bias[-key.shape[0]:]
$\underset{\color{lightgreen}{A}}{Q^\top K_j} + \underset{\color{lightgreen}{C}}{{U^Q}^\top K_j}$
151 ac = torch.einsum('bhd,jbhd->jbh', query + query_pos_bias, key)
$\underset{\color{lightgreen}{B}}{Q^\top U^K_j} + \underset{\color{lightgreen}{D}}{S_j}$
153 bd = torch.einsum('bhd,jhd->jbh', query, key_pos_emb) + key_pos_bias[:, None, :]
$A_j$
156 return ac + bd
query
has shape [batch_size, d_model]
key
and value
has shape [seq_len, batch_size, d_model]
158 def forward(self, *,
159 query: torch.Tensor,
160 key: torch.Tensor,
161 value: torch.Tensor):
Prepare query
, key
and value
for attention computation
key
and value
will then have shape [seq_len, batch_size, heads, d_k]
and query
will have shape [batch_size, heads, d_k]
170 query = self.query(query)
171 if self.key:
172 key = self.key(key)
173 if self.value:
174 value = self.value(value)
Compute attention scores.
Results in a tensor of shape [seq_len, batch_size, heads]
178 scores = self.get_scores(query, key)
Scale scores $\frac{1}{\sqrt{d_k}}$
181 scores *= self.scale
Softmax
184 attn = self.softmax(scores)
Apply dropout
187 attn = self.dropout(attn)
Multiply by the values
190 x = torch.einsum("jbh,jbhd->bhd", attn, value)
Concatenate multiple heads
193 x = x.reshape(x.shape[0], -1)
Output layer
196 return self.output(x)
This implements a single transformer layer in the feedback transformer.
199class FeedbackTransformerLayer(Module):
d_model
is the number of features in the transformerattn
is the feedback attention modulefeed_forward
is the position-wise feed forward layerdropout_prob
is the dropout probability for dropout layers after attention and feed-forward206 def __init__(self, *,
207 d_model: int,
208 attn: FeedbackAttention,
209 feed_forward: FeedForward,
210 dropout_prob: float):
217 super().__init__()
Transformer size $d_{model}$
219 self.size = d_model
221 self.attn = attn
222 self.feed_forward = feed_forward
223 self.dropout = nn.Dropout(dropout_prob)
Normalization layers
226 self.norm_self_attn = nn.LayerNorm([d_model])
227 self.norm_ff = nn.LayerNorm([d_model])
229 def forward(self, *,
230 x: torch.Tensor,
231 key: Optional[torch.Tensor],
232 value: Optional[torch.Tensor]):
If there is memory
234 if key is not None:
Normalize the vectors before doing self attention
236 z = self.norm_self_attn(x)
Run through self attention, i.e. keys and values are from self
238 self_attn = self.attn(query=z, key=key, value=value)
Add the self attention results
240 x = x + self.dropout(self_attn)
Normalize for feed-forward
243 z = self.norm_ff(x)
Pass through the feed-forward network
245 ff = self.feed_forward(z)
Add the feed-forward results back
247 x = x + self.dropout(ff)
250 return x
253class FeedbackTransformer(Module):
layer
is the feedback transformer layer, which we clone for each layern_layers
is the number of layers in the transformer258 def __init__(self, layer: FeedbackTransformerLayer, n_layers: int):
264 super().__init__()
Make copies of the transformer layer
266 self.layers = clone_module_list(layer, n_layers)
Final normalization layer
268 self.norm = nn.LayerNorm([layer.size])
Memory vectors are computed as a weighted sum of representations of each layer. This is the weights parameter for that.
271 self.weights = nn.Parameter(torch.ones(n_layers + 1), requires_grad=True)
Softmax for weights before taking the weighted sum
273 self.softmax = nn.Softmax(0)
x_seq
is the input with shape [seq_len, batch_size, d_model]
275 def forward(self, x_seq: torch.Tensor):
Split the input to a list along the sequence axis
281 x_seq = torch.unbind(x_seq, dim=0)
List to store the outputs
283 res = []
List to store the memory vectors
285 mem = []
For each input step
287 for x in x_seq:
List to store layer outputs
289 layer_outputs = [x]
If there is memory, stack them into a vector
292 mem_tensor = torch.stack(mem) if mem else None
Run through each layer
295 for layer in self.layers:
Get layer output
297 x = layer(x=x, key=mem_tensor, value=mem_tensor)
Append them to the list of layer outputs
299 layer_outputs.append(x)
Stack the layer outputs to a tensor
302 layer_outputs = torch.stack(layer_outputs)
Calculate the memory vector as a weighted sum of layer outputs
304 mem.append(torch.einsum('lbd,l->bd', layer_outputs, self.softmax(self.weights)))
Append the output to results
306 res.append(x)
Stack the output tensors
309 res = torch.stack(res)
Normalize the output
311 return self.norm(res)
We implement a custom function instead of appending to a python list
and then doing torch.stack
.
This greatly improves the performance over calling torch.stack
at
each step along the sequence.
Everytime torch.stack
is called, it creates a new tensor, while
this method and the accompanying class Stack
share memory for each step.
318class StackFunction(torch.autograd.Function):
ctx
is the context of the function (which lets us cache stuff)memory
is the shared memory tensor where we stack and store the values of each step (keys & values)memory_grad
is the shared memory tensor to store and accumulate gradients of each steplast
is the last value stackedn
is the number of steps (i.e. size of the stack)This returns the stacked tensor for steps upto n
.
330 @staticmethod
331 def forward(ctx, memory, memory_grad, last, n):
Cache accumulated gradients
343 ctx._mem_grad = memory_grad
Cache the size of the stack
345 ctx._n = n
Return the stack
347 return memory[:n + 1]
grad_output
is the gradient with respect to the output of about forward
functionThis accumulates the gradients in the shared memory tensor and return the
gradients with respect to the last
result in the stack.
349 @staticmethod
350 def backward(ctx, grad_output):
Get the current size of the stack
358 n = ctx._n
Get the accumulated gradients
360 memory_grad = ctx._mem_grad
Add the gradients
362 memory_grad[:n + 1] += grad_output
Return the gradients w.r.t to last value in the stack
364 return None, None, memory_grad[n], None
367class Stack:
max_len
is the maximum size of the stack374 def __init__(self, max_len: int):
378 self.max_len = max_len
379 self.memory = None
380 self.memory_grad = None
381 self.last = None
382 self.n = -1
383 self.last_get_n = -1
n
is the size of the stackvalue
is the tensor that needs to be added to the stack385 def append(self, n: int, value: torch.Tensor):
You need to get (use) the stack after adding a value. Otherwise this implementation fails
393 assert n == 0 or self.last_get_n == n - 1, f"{n}, {self.last_get_n}"
Do this without gradients
396 with torch.no_grad():
Initialize the shared memory tensor to keep the stack
398 if self.memory is None or self.memory.shape[1:] != value.shape:
This should only happen when the stack is empty
400 assert n == 0
Create a tensor for the stack
402 self.memory = value.new_zeros(self.max_len, *value.shape, requires_grad=False)
Create a tensor to accumulate the gradients
404 self.memory_grad = value.new_zeros(self.memory.shape, requires_grad=False)
The memory is already initialized but we are resetting the stack.
This could have been another function like reset
, but
we found this easier to use.
409 elif n == 0:
Reset accumulated gradients
411 self.memory_grad.fill_(0.)
Set the value in the correct position of the stack
414 self.memory.data[n] = value.detach()
Keep track of the stack (for debugging)
416 self.n = n
Keep track of the last value added to the stack.
We need this to be passed on to StackFunction
in order
to get the gradients propagated backwards.
421 self.last = value
Returns the stack
423 def get(self):
Keep track of the size of the stack when it was used.
This is used for a sanity check in append
.
430 self.last_get_n = self.n
Take it all through StackFunction
so that StackFunction.backwards
is called by PyTorch during backpropagation.
433 return StackFunction.apply(self.memory, self.memory_grad, self.last, self.n)
To release memory
435 def free(self):
440 self.memory = None
441 self.memory_grad = None
442 self.last = None
This is the updated feedback transformer module that caches the keys and values.
445class FeedbackTransformerKV(Module):
layer
is the feedback transformer layer, which we clone for each layern_layers
is the number of layers in the transformerd_model
is the number of features in the transformer452 def __init__(self, layer: FeedbackTransformerLayer, n_layers: int, d_model: int, heads: int):
460 super().__init__()
Make copies of the transformer layer
462 self.layers = clone_module_list(layer, n_layers)
Final normalization layer
464 self.norm = nn.LayerNorm([layer.size])
Memory vectors are computed as a weighted sum of representations of each layer. This is the weights parameter for that.
467 self.weights = nn.Parameter(torch.ones(n_layers + 1), requires_grad=True)
Softmax for weights before taking the weighted sum
469 self.softmax = nn.Softmax(0)
Number of features in a head
472 d_k = d_model // heads
Module to transform embeddings (memory) to get keys
474 self.key = PrepareForMultiHeadAttention(d_model, heads, d_k, bias=False)
Module to transform embeddings (memory) to get keys
476 self.value = PrepareForMultiHeadAttention(d_model, heads, d_k, bias=False)
Memory for stacked keys
479 self.mem_key = Stack(512)
Memory for stacked values
481 self.mem_value = Stack(512)
x_seq
is the input with shape [seq_len, batch_size, d_model]
483 def forward(self, x_seq: torch.Tensor):
Split the input to a list along the sequence axis
489 x_seq = torch.unbind(x_seq, dim=0)
List to store the outputs
491 res = []
For each input step
493 for step, x in enumerate(x_seq):
List to store layer outputs
495 layer_outputs = [x]
Stack of keys and values
498 key_tensor = None
499 value_tensor = None
Get the keys and values tensors if we are beyond the initial step
501 if step > 0:
502 key_tensor = self.mem_key.get()
503 value_tensor = self.mem_value.get()
Run through each layer
506 for layer in self.layers:
Get layer output
508 x = layer(x=x, key=key_tensor, value=value_tensor)
Append them to the list of layer outputs
510 layer_outputs.append(x)
Stack the layer outputs to a tensor
513 layer_outputs = torch.stack(layer_outputs)
Calculate the memory vector as a weighted sum of layer outputs
515 mem = torch.einsum('lbd,l->bd', layer_outputs, self.softmax(self.weights))
Calculate the keys from memory and add it to the stack
517 self.mem_key.append(step, self.key(mem))
Calculate the values from memory and add it to the stack
519 self.mem_value.append(step, self.value(mem))
Append the output to results
521 res.append(x)
Stack the output tensors
524 res = torch.stack(res)
Normalize the output
526 return self.norm(res)
528 def free(self):
529 self.mem_key.free()
530 self.mem_value.free()


IoTiscool-API => Ready to start ... click on Start!
Clear Logs
This is a simple demo of the IoTiscool-dev, connected to a IoTiscool-API server.
Fake data are created from this demo and sent to an MQTT Broker thru IoTiscool-API server, that reply data received from the broker directly to the client.


The "scene" is actually just a big blob of JSON.
Regretfully most existing tutorials on JSON are targetted at programmers. However, some of this content could be helpful.


Who was Prince Philip’s mother Princess Alice Of Battenberg?
Prince Philip – Duke of Edinburgh and husband to Queen Elizabeth II – is a character, to say the least.
Which could explain why he’s the nation’s fifth favourite royal, above Prince Charles, Meghan Markle and Camilla, Duchess of Cornwall.
Prince Philip might be known for his off-the-cuff quips and one-liners, but he has a fascinating history, starting with his intriguing mother, who features in Netflix’s newly released third season of The Crown.
She’s played in the series by actress Jane Lapotaire, but who was Princess Alice in real life? Here’s what you need to know about her.
Who was Prince Philip’s mother, Princess Alice of Battenberg?
Princess Alice of Battenberg was born on 25 February 1885 at Windsor Castle.
She is a great-granddaughter of Queen Victoria, which is how Queen Elizabeth II and Prince Philip are distantly related (being second cousins once removed).
She was born congenitally deaf and grew up as a Hessian princess.
Advertisement Advertisement
In 1903, Alice married Prince Andrew of Greece and Denmark, living with her new husband in Greece until their forced exile in 1917 due to Andrew’s involvement in the Greco-Turkish war.
After their exile, the family of seven – including Prince Andrew, Princess Alice, Prince Philip and his four older sisters – briefly settled in Paris, before Philip was sent to live in England and his mother was diagnosed with schizophrenia.
Princess Alice was committed to a Swiss sanatorium in 1930, becoming a patient of Sigmund Freud.
Princess Alice was reported as having an extreme religious conversion around this time, believing she was getting divine messages.
Freud was said to have blamed ‘sexual frustration’ for her condition and recommended x-raying her ovaries to kill off her libido.
She stayed at the sanatorium for two years before leaving to live back in Greece, devoted to her religion.
She had a peaceful existence there until World War 2.
When the Nazis occupied Greece, Alice risked her life by hiding a Jewish family in her home, using her deafness to avoid having to ask questions.
After World War II, Princess Alice opened a convent called the Christian Sisterhood of Martha and Mary, dedicated to helping the sick and vulnerable in Greece.
When did Princess Alice of Battenberg die?
She moved back to England in 1967, living at Buckingham Palace until her death in 1969.
Her cause of death wasn’t reported, but she was thought to be increasingly frail in her later years.
Advertisement Advertisement
When will her character appear in The Crown season 3?
Episode four of the new season, titled ‘Bubakins’ after the Princess’ nickname for Philip, looks at the later years of Princess Alice’s life.
It shows her just before she died, when she came to be a nun living in Buckingham Palace.
Season 3 of The Crown is streaming now on Netflix UK.


€
9
/mo.
A great start.
Perfect for individuals.
{% extends "/templates/base.html" %} {% block styles %} {{ super() }} {% endblock %} {% block main %}
€
9
/mo.
A great start.
Perfect for individuals.
€ 99 /mo.
Kick your social media game into overdrive.
Great for professionals.
€ 999 /mo.
Dominate social media.
Fully integrate Fanlens into your tools and
work-flow.


static bool HttpResponse::setCache ( bool $cache )
Whether it should be attempted to cache the entity. This will result in necessary caching headers and checks of clients If-Modified-Since and If-None-Match headers. If one of those headers matches a 304 Not Modified status code will be issued. Note: If you're using sessions, be sure that you set session.cache_limiter to something more appropriate than "no-cache"!
Returns TRUE on success or FALSE on failure.


The story
I got a new game on Steam and got set to downloading it.
For some reason, Steam and Windows have decided that it's better to save some electricity and put my computer to sleep, rather than finish my game.
Today I discovered that instead of playing my game I have to wait for it to finish downloading.
This will be the last time.
Context
I wrote a post about sleep. Basically, sleep is a middle ground between saving power (by turning off components) and staying ready to work in short notice (by keeping RAM alive).
Some programs can tell Windows "I'm doing something, don't sleep now.". This can be your media player playing a movie, or your BitTorrent client downloading something.
These "requests" can be shown using powercfg -requests
(as admin). This is an example of my Steam client behaving and asking Windows to keep awake:
C:\Windows\system32>powercfg -requests
DISPLAY:
None.
SYSTEM:
[PROCESS] \Device\HarddiskVolume2\Program Files (x86)\Steam\Steam.exe
AWAYMODE:
None.
EXECUTION:
None.
PERFBOOST:
None.
The Solution
What I want to do is write a PowerShell script that does this request from Windows, waits for the user and then terminates. I wanted this as a PS script because it means there is no compilation involved, so people that can't code can see what's going on and run it without installing weird stuff on their system.
The API I found for this is SetThreadExecutionState, which can be used like this.
I had my work practically done by Stefan Stranger in SuspendPowerPlan.ps1, to which I added a "main" behaviour like here that defaults to running the method doing nothing.
# ---------------------------------------------------
# Script: C:\Users\stefstr\Documents\GitHub\PowerShell\Examples\SuspendPowerPlan.ps1
# Version: 0.1
# Author: Stefan Stranger
# Date: 07/05/2014 15:01:57
# Description: Helper Function to Suspend Power Plan when running PowerShell scripts
# Comments:
# Disclamer: This Sample Code is provided for the purpose of illustration only and is not intended to be used in a production environment.
# ---------------------------------------------------
<#
.Synopsis
Function to suspend your current Power Plan settings when running a PowerShell script.
.DESCRIPTION
Function to suspend your current Power Plan settings when running a PowerShell script.
Scenario: When downloading files using Robocopy from PowerShell you don't want your
laptop to go into sleep mode.
.EXAMPLE
Suspend-PowerPlan -script c:\scripts\mylongrunningscript.ps1
Run mylongrunningscript with sleep idle timeout prevented
.EXAMPLE
Suspend-Powerplan -script c:\scripts\mylongrunningscript.ps1 -option Display -Verbose
Run mylongrunningscript with Display idle timeout prevented and verbose messages
.LINK
http://www.microsofttranslator.com/bv.aspx?from=ru&to=en&a=http%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fen-US%2F1f4754cb-37bf-4e1d-a59f-ec0f1aaf9d1c%2Fsetthreadexecutionstate-powershell%3FThread%3A1f4754cb-37bf-4e1d-a59f-ec0f1aaf9d1c%3DMicrosoft.Forums.Data.Models.Discussion%26ThreadViewModel%3A1f4754cb-37bf-4e1d-a59f-ec0f1aaf9d1c%3DMicrosoft.Forums.CachedViewModels.ThreadPageViewModel%26forum%3Dscrlangru
#>
function Suspend-Powerplan
{
[CmdletBinding()]
[Alias()]
[OutputType([int])]
Param
(
# Param1 help description
[Parameter(Mandatory=$true,
Position=0)]
$script,
[ValidateSet("Away","Display","System")]
[string]$option
)
$code=@'
[DllImport("kernel32.dll", CharSet = CharSet.Auto,SetLastError = true)]
public static extern void SetThreadExecutionState(uint esFlags);
'@
$ste = Add-Type -memberDefinition $code -name System -namespace Win32 -passThru
$ES_CONTINUOUS = [uint32]"0x80000000" #Requests that the other EXECUTION_STATE flags set remain in effect until SetThreadExecutionState is called again with the ES_CONTINUOUS flag set and one of the other EXECUTION_STATE flags cleared.
$ES_AWAYMODE_REQUIRED = [uint32]"0x00000040" #Requests Away Mode to be enabled.
$ES_DISPLAY_REQUIRED = [uint32]"0x00000002" #Requests display availability (display idle timeout is prevented).
$ES_SYSTEM_REQUIRED = [uint32]"0x00000001" #Requests system availability (sleep idle timeout is prevented).
Switch ($option)
{
"Away" {$setting = $ES_AWAYMODE_REQUIRED}
"Display" {$setting = $ES_DISPLAY_REQUIRED}
"System" {$setting = $ES_SYSTEM_REQUIRED}
Default {$setting = $ES_SYSTEM_REQUIRED}
}
Write-Verbose "Power Plan suspended with option: $option"
$ste::SetThreadExecutionState($ES_CONTINUOUS -bor $setting)
#do something
Write-Verbose "Executing $script"
&$script
Write-Verbose "Power Plan suspension ended"
$ste::SetThreadExecutionState($ES_CONTINUOUS)
}
# __main__
if (MyInvocation.InvocationName -ne '.') {
Suspend-Powerplan {Read-Host 'press enter to terminate'}
}
When taking another look in powercfg -requests
after running the script, we can see it in action:
C:\Windows\system32>powercfg -requests
DISPLAY:
None.
SYSTEM:
[PROCESS] \Device\HarddiskVolume2\Program Files (x86)\Steam\Steam.exe
[PROCESS] \Device\HarddiskVolume2\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
AWAYMODE:
None.
EXECUTION:
None.
PERFBOOST:
None.
Let me know if it works / breaks!


Ideal for a family vacation as well as a romantic getaway, Almora is among the key winter destinations of Uttarakhand. The winter sunshine pouring through thin mountain air, coupled with the colonial architecture, adds to the charm of this traditional, old town. You can also head to Almora for a White Christmas.
Things to do: Local sightseeing, shopping, backpacking, and temple hopping


Wiremock host
A simple chrome extension for Wiremock, created by Mark Winteringham
Twitter: @2bittester
Website: www.mwtestconsultancy.co.uk
Based upon the super awesome tool, Wiremock, that can be found at http://wiremock.org


Toggle navigation
Daniel Cuevas
About
Research
Curriculum Vitae
Contact
2017
Metabolic model and data-driven exploration linking genotypes to phentoypes
2016
From DNA to FBA: how to build your own genome-scale metabolic model
2015
Phenotyping diverse bacteria for metabolic network reconstruction
2013
High-throughput phenotype profiling for bacterial flux-balance model optimization
2013
Measuring growth quality of bacteria using phenotypic microarrays
2010
Real-time metagenomics analysis


Last updated: 2022-11-19
Checks: 7 0
Knit directory: myTidyTuesday/
This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20210907)
was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version cf94478. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish
or
wflow_git_commit
). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rhistory
Ignored: .Rproj.user/
Ignored: data/.Rhistory
Ignored: data/2022_11_01.png
Ignored: data/2022_11_18.png
Ignored: data/CNHI_Excel_Chart.xlsx
Ignored: data/Chicago.rds
Ignored: data/CommunityTreemap.jpeg
Ignored: data/Community_Roles.jpeg
Ignored: data/ELL.zip
Ignored: data/FM_service_contour_current.zip
Ignored: data/SeriesReport-20220414171148_6c3b18.xlsx
Ignored: data/Weekly_Chicago_IL_Regular_Reformulated_Retail_Gasoline_Prices.csv
Ignored: data/YammerDigitalDataScienceMembership.xlsx
Ignored: data/YammerMemberPage.rds
Ignored: data/YammerMembers.rds
Ignored: data/application_id.feather
Ignored: data/df.rds
Ignored: data/fit_cohesion.rds
Ignored: data/fit_grammar.rds
Ignored: data/fit_phraseology.rds
Ignored: data/fit_syntax.rds
Ignored: data/fit_vocabulary.rds
Ignored: data/grainstocks.rds
Ignored: data/hike_data.rds
Ignored: data/lm_res.rds
Ignored: data/raw_contour.feather
Ignored: data/raw_weather.RData
Ignored: data/sample_submission.csv
Ignored: data/submission.csv
Ignored: data/test.csv
Ignored: data/train.csv
Ignored: data/us_states.rds
Ignored: data/us_states_hexgrid.geojson
Ignored: data/weatherstats_toronto_daily.csv
Untracked files:
Untracked: analysis/2022_09_01_kaggle_tabular_playground.qmd
Untracked: code/YammerReach.R
Untracked: code/autokeras.R
Untracked: code/chicago.R
Untracked: code/glmnet_test.R
Untracked: code/googleCompute.R
Untracked: code/work list batch targets.R
Untracked: environment.yml
Untracked: report.html
Unstaged changes:
Modified: analysis/2021_01_19_tidy_tuesday.Rmd
Modified: analysis/2021_03_24_tidy_tuesday.Rmd
Deleted: analysis/2021_04_20.Rmd
Deleted: analysis/2022_02_11_tabular_playground.Rmd
Deleted: analysis/2022_04_18.qmd
Modified: analysis/EnglishLanguageLearning.Rmd
Modified: analysis/Survival.Rmd
Modified: analysis/_site.yml
Modified: code/_common.R
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/index.Rmd
) and HTML
(docs/index.html
) files. If you’ve configured a remote Git
repository (see ?wflow_git_remote
), click on the hyperlinks
in the table below to view the files as they were in that past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| html | 1554d03 | opus1993 | 2022-11-02 | Build site. |
| html | 4cf6d44 | opus1993 | 2022-11-02 | Build site. |
| html | 7ade547 | opus1993 | 2022-10-15 | Build site. |
| Rmd | dfea296 | opus1993 | 2022-10-15 | add Kaggle ESL essays |
| html | 8f06b8c | opus1993 | 2022-08-03 | Build site. |
| Rmd | 67ac42a | opus1993 | 2022-08-03 | remove functions DT table |
| html | 1259ff4 | opus1993 | 2022-08-02 | Build site. |
| Rmd | c126c0e | opus1993 | 2022-08-01 | add GT images |
| html | 02177ed | opus1993 | 2022-07-28 | Build site. |
| Rmd | a41e7b6 | opus1993 | 2022-07-28 | add functions table |
| html | 5ec52aa | opus1993 | 2022-07-13 | Build site. |
| html | f05cefe | opus1993 | 2022-07-13 | Build site. |
| html | 7461753 | opus1993 | 2022-05-20 | Build site. |
| html | ba7462e | opus1993 | 2022-05-17 | Build site. |
| html | e1a143b | opus1993 | 2022-05-17 | Build site. |
| html | a1b352f | opus1993 | 2022-05-05 | Build site. |
| Rmd | cf98be5 | opus1993 | 2022-05-05 | suppressPackageStartupMessages |
| html | 5a92f92 | opus1993 | 2022-05-05 | Build site. |
| Rmd | 955d604 | opus1993 | 2022-05-05 | use the new knitr chunk options |
| html | 5dd04dc | opus1993 | 2022-05-05 | Build site. |
| html | 3a408b8 | opus1993 | 2022-05-05 | Build site. |
| html | 16131be | opus1993 | 2022-04-18 | Build site. |
| html | fbcf261 | opus1993 | 2022-04-18 | Build site. |
| html | ad69435 | opus1993 | 2022-03-16 | Build site. |
| html | 0482608 | opus1993 | 2022-02-23 | Build site. |
| html | 3eaf158 | opus1993 | 2022-01-30 | Build site. |
| html | 0c747e4 | opus1993 | 2022-01-21 | Build site. |
| html | d34f65a | opus1993 | 2022-01-21 | Build site. |
| html | bea94a9 | opus1993 | 2021-12-26 | Build site. |
| html | aa65a6b | opus1993 | 2021-12-26 | Build site. |
| Rmd | 77899ce | opus1993 | 2021-12-26 | workflowr::wflow_publish("analysis/index.Rmd") |
| html | 485e867 | opus1993 | 2021-10-13 | Build site. |
| html | 2f3df0c | opus1993 | 2021-10-12 | Build site. |
| html | af49f93 | opus1993 | 2021-10-11 | Build site. |
| html | 247b166 | opus1993 | 2021-10-11 | Build site. |
| html | f1512b0 | opus1993 | 2021-10-11 | Build site. |
| html | 136ec1e | opus1993 | 2021-10-11 | Build site. |
| html | bb5ce05 | opus1993 | 2021-10-10 | Build site. |
| html | 08f0537 | opus1993 | 2021-10-07 | Build site. |
| html | c7b8f57 | opus1993 | 2021-10-07 | Build site. |
| html | f0ffa32 | opus1993 | 2021-10-05 | Build site. |
| html | ee45e18 | opus1993 | 2021-10-03 | Build site. |
| html | e98eb4d | opus1993 | 2021-10-03 | Build site. |
| html | eb3845f | opus1993 | 2021-09-29 | Build site. |
| html | ab8fce2 | opus1993 | 2021-09-29 | Build site. |
| html | 2c36a6b | opus1993 | 2021-09-29 | Build site. |
| html | b0574f9 | opus1993 | 2021-09-24 | Build site. |
| html | 9c9fdd6 | opus1993 | 2021-09-24 | Build site. |
| html | f0fc268 | opus1993 | 2021-09-24 | Build site. |
| html | 5e082c4 | opus1993 | 2021-09-24 | Build site. |
| html | 0ecadb5 | opus1993 | 2021-09-24 | Build site. |
| html | e5aa5e8 | opus1993 | 2021-09-24 | Build site. |
| html | 3f10250 | opus1993 | 2021-09-24 | Build site. |
| html | f9b2ded | opus1993 | 2021-09-24 | Build site. |
| html | d76b4a3 | opus1993 | 2021-09-22 | Build site. |
| html | 5601352 | opus1993 | 2021-09-21 | Build site. |
| html | 8bb65fc | opus1993 | 2021-09-21 | Build site. |
| html | 49f517e | opus1993 | 2021-09-21 | Build site. |
| html | 73513af | opus1993 | 2021-09-21 | Build site. |
| html | 4f22206 | opus1993 | 2021-09-17 | Build site. |
| html | c5f914b | opus1993 | 2021-09-15 | Build site. |
| html | 913adef | opus1993 | 2021-09-15 | Build site. |
| html | 4217d68 | opus1993 | 2021-09-14 | Build site. |
| html | d1ba72e | opus1993 | 2021-09-14 | Build site. |
| html | 8b8b885 | opus1993 | 2021-09-13 | Build site. |
| html | 13c0644 | opus1993 | 2021-09-13 | Build site. |
| html | 007f564 | opus1993 | 2021-09-11 | Build site. |
| html | e669f86 | opus1993 | 2021-09-09 | Build site. |
| html | 18fc4aa | opus1993 | 2021-09-09 | Build site. |
| html | 744582e | opus1993 | 2021-09-09 | Build site. |
| html | c9d8d5e | opus1993 | 2021-09-09 | Build site. |
| html | 7d4eb3f | opus1993 | 2021-09-08 | Build site. |
| html | 6a78362 | opus1993 | 2021-09-08 | Build site. |
| html | 4ff694a | opus1993 | 2021-09-08 | Build site. |
| html | 04bdaa7 | opus1993 | 2021-09-08 | Build site. |
| html | 1be6dc2 | opus1993 | 2021-09-08 | Build site. |
| html | aaf3aaa | opus1993 | 2021-09-08 | Build site. |
| Rmd | 480a38d | opus1993 | 2021-09-08 | fix hyperlink to sort properly |
| html | e9216f1 | opus1993 | 2021-09-08 | Build site. |
| html | 1e65696 | opus1993 | 2021-09-08 | Build site. |
| Rmd | 6948c3b | opus1993 | 2021-09-08 | sort packages and set column widths |
| html | e7f2b76 | opus1993 | 2021-09-08 | Build site. |
| html | b8fc516 | opus1993 | 2021-09-08 | Build site. |
| html | 1476352 | opus1993 | 2021-09-07 | Build site. |
| Rmd | b3a9f94 | opus1993 | 2021-09-07 | wflow_publish("analysis/index.Rmd") |
| Rmd | f1bb186 | opus1993 | 2021-09-07 | Start workflowr project. |
Welcome. Most of the activity that I post here is related to the rfordatascience #TidyTuesday weekly social data project. The exercises are certainly not finished products. They demonstrate what could be accomplished in an hour or two after-hours, often from datasets that can be found out in the “wild.” In many cases I’ve used these to explore packages with new features and functions and to facilitate conversations with others in the community via Twitter and Slack.
suppressPackageStartupMessages({
library(purrr)
library(dplyr)
library(knitr)
library(kableExtra)
library(stringr)
})
articles <- tibble(file = dir(path = "analysis")) %>%
filter(str_detect(file, "\\.Rmd")) %>%
filter(!file %in% c("_site.yml", "about.Rmd", "index.Rmd", "license.Rmd", "rsconnect"))
title_f <- function(file) {
lines <- readLines(paste0("analysis/", file),
warn = FALSE
)
lines[grepl("^title:", lines)]
}
date_f <- function(file) {
lines <- readLines(paste0("analysis/", file),
warn = FALSE
)
lines[grepl("^date:", lines)]
}
library_f <- function(file) {
lines <- readLines(paste0("analysis/", file),
warn = FALSE
)
lines[grepl("^library", lines)]
}
articlesTable <- articles %>%
mutate(title = map_chr(file,~ title_f(.))) %>%
mutate(dateline = map_chr(file, ~ date_f(.))) %>%
mutate(libraries = map(file, ~ library_f(.))) %>%
tidyr::unnest_longer(col = libraries) %>%
mutate(title = str_sub(title,
start = 9L,
end = str_length(title) - 1L)) %>%
mutate(dateline = str_sub(dateline,
start = 8L,
end = str_length(dateline) - 1L)) %>%
mutate(libraries = str_squish(str_sub(libraries,
start = str_locate(libraries, "\\(")[,1] + 1,
end = str_locate(libraries, "\\)")[,1] - 1 ))) %>%
filter(!libraries %in% c("tidyverse","tidytuesdayR","lubridate","here","hrbrthemes", "tweetrmd", "grumanlib")) %>%
arrange(desc(lubridate::mdy(dateline)),
libraries) %>%
tidyr::nest(package = libraries) %>%
mutate(link = stringr::str_remove(file,".Rmd")) %>%
mutate(link = paste0("https://opus1993.github.io/myTidyTuesday/",link,".html"))
articlesTable %>%
mutate(title = text_spec(title,
format = "html",
link = link)) %>%
select(-file, -link) %>%
knitr::kable("html",
escape = FALSE,
col.names = c("Title","Date","Packages")) %>%
kable_styling(bootstrap_options = c("hover", "condensed"),
full_width = TRUE,
fixed_thead = TRUE) %>%
column_spec(1:3,width = c("10em","10em","60em"))
| Title | Date | Packages |
|---|---|---|
| Public Radio Stations | November 18, 2022 | sf , tigris |
| Horror Movies | November 1, 2022 | ggdist , ggimage, rtweet |
| Kaggle Feedback Prize - English Language Learning | October 15, 2022 | brulee , text2vec , textrecipes, tidymodels , tidytext |
| European Flights | July 13, 2022 | geofacet , patchwork |
| Survival Analysis | June 3, 2022 | broom , splines , survival , survminer |
| Create a Crisp Topographic Map in R | May 20, 2022 | elevatr, giscoR , marmap , sf , terra |
| Eurovision Grand Finale Rankings | May 17, 2022 | cowplot |
| Supreme Court Pictogram | April 18, 2022 | ggimage, ggiraph, rvest |
| R Package Vignette Counts | March 14, 2022 | poissonreg, tidymodels, treemapify |
| Plotting NHL Stats | February 23, 2022 | cowplot, hockeyR, sportyR |
| Board Games | January 28, 2022 | finetune , SHAPforxgboost, textrecipes , tidymodels , tidytext , vip |
| Chocolate bar ratings | January 17, 2022 | poissonreg , textrecipes, tidymodels , tidytext |
| GeomTextPath | December 26, 2021 | geomtextpath , palmerpenguins |
| National Bureau of Economic Research working papers | September 30, 2021 | extrafont , finetune , ggraph , igraph , patchwork , textrecipes, themis , tidygraph , tidylo , tidymodels , tidytext , treemapify |
| Billboard Top 100 | September 15, 2021 | ggtext , tidymodels |
| FreddieMac House Prices | September 13, 2021 | geofacet , gganimate |
| Sliced Season 1 Finale: SBA Loan Defaults | August 17, 2021 | bestNormalize, catboost , discrim , embed , finetune , ggforce , ggthemes , probably , themis , tidymodels , treemapify , treesnip |
| Sliced Austin Home Value Classification | August 10, 2021 | baguette , finetune , patchwork , textrecipes, themis , tidylo , tidymodels , tidytext , vip |
| Sliced Pet Shelter Adoptions | August 3, 2021 | baguette , DALEXtra , finetune , textrecipes, themis , tidylo , tidymodels , tidytext , vip |
| Sliced Baseball Home Runs | July 27, 2021 | baguette , DALEXtra , finetune , themis , tidymodels, vip |
| Sliced Spotify Track Popularity | July 20, 2021 | baguette , corrr , DALEXtra , finetune , SHAPforxgboost, textrecipes , themis , tidymodels , vip |
| Sliced Bank Account Churn | July 13, 2021 | baguette , catboost , finetune , themis , tidymodels, treesnip |
| Sliced NYC Airbnb | June 29, 2021 | baguette , catboost , finetune , rlang , stacks , textrecipes, themis , tidymodels , tidytext , treesnip |
| Sliced Australia Weather | June 22, 2021 | finetune , patchwork , stacks , textrecipes, themis , tidycensus , tidymodels , treesnip |
| US Broadband Access | May 5, 2021 | patchwork , sf , tidycensus |
| US Post Offices | April 13, 2021 | finetune , gganimate , ggthemes , historydata, textrecipes, themis , tidymodels |
| UN Votes | March 24, 2021 | countrycode, embed , extrafont , tidymodels |
| Video Games and Sliced | March 16, 2021 | systemfonts, tidymodels |
| Animating a geographic introduction | March 7, 2021 | gganimate, ggtext , glue |
| SuperBowl Commercials | March 2, 2021 | tidymodels |
| Kenya Census | January 19, 2021 | cartogram , rKenyaCensus, sf , spdep , systemfonts , waffle |
| Tate Art Collection | January 12, 2021 | countrycode, textrecipes, tidymodels , tidytext , treemapify , vip |
| USDA NASS Stocks to Use | January 7, 2021 | ggrepel, Quandl , rnassqs |
| Chicago Traffic Injuries | January 5, 2021 | baguette , RSocrata , themis , tidymodels |
| Toronto Homeless Shelters | December 1, 2020 | tidymodels, treemap |
| Washington State Trails | November 27, 2020 | fontawesome, ggridges , gt , htmltools , rvest |
| US Poverty | November 11, 2020 | cartogram , sf , tidycensus, tigris , tmap |
| Historical Phone Usage | November 10, 2020 | ggrepel, ggtext , naniar , scales , visdat , WDI |
| Canadian Wind Turbines | October 27, 2020 | cowplot , ggtext , kableExtra , naniar , osmdata , rnaturalearth, sf , stringr , visdat |
| Beer Awards | October 20, 2020 | broom , cowplot , geofacet , ggwordcloud, kableExtra , purrr , tidylo , tidytext |
| Datasaurus | October 14, 2020 | broom , gridExtra , purrr , tidymodels |
| Corn Production | October 9, 2020 | blscrapeR, httr , readxl , rnassqs |
| NCAA Womens Tournament | October 7, 2020 | splines , tidymodels |
| Hops | September 24, 2020 | blscrapeR, paletteer, rnassqs |
| Kids Spending | September 22, 2020 | broom , geojsonio, ggtext , rgeos , showtext |
| Himalayan Climbers | September 22, 2020 | ebbr , gt , themis , tidymodels |
| Friends | September 8, 2020 | ggbump , ggdist , glue , ragg , showtext, tidylo , tidytext |
| The Last Airbender | August 11, 2020 | scales , showtext , textfeatures, textrecipes , themis , tidylo , tidymodels , tidytext , tvthemes , vip |
| Astronaut Missions | July 15, 2020 | baguette , tidymodels |
| Coffee | July 7, 2020 | ggraph , ggridges, igraph , tidytext, widyr |
| Animal Crossing Sentiment Analysis | May 5, 2020 | stm , textrecipes, tidymodels , tidyr , tidytext , vip |
| GDPR Fines | April 21, 2020 | ggbeeswarm , ggtext , rnaturalearth, rvest , sf , tidymodels |
| Tour De France | April 7, 2020 | broom , ggtext , paletteer, patchwork, rvest , survival |
| Beer Production | March 31, 2020 | GGally , gganimate , gghighlight , maps , sf , shinymetrics, tidymetrics , tidymodels , transformr |
| Brain Injury | March 24, 2020 | gganimate , gifski , tidymodels, vip |
| The Office for Tidy Tuesday | March 17, 2020 | tidymodels, tidytext , vip |
| College Tuition and Diversity | March 10, 2020 | tidymodels |
| NFL attendance | February 4, 2020 | tidymodels |
| Student Debt | November 26, 2019 | cowplot , dygraphs , forcats , gghighlight, ggiraph , ggrepel , stats , stringr , viridis |
I have attempted to make notes of my sources for code and content. Please be sure to reach out, acknowledge, and cite their contributions directly.
sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] stringr_1.4.1 kableExtra_1.3.4 knitr_1.40 dplyr_1.0.10
[5] purrr_0.3.5 workflowr_1.7.0
loaded via a namespace (and not attached):
[1] styler_1.8.0 tidyselect_1.2.0 xfun_0.34 bslib_0.4.1
[5] colorspace_2.0-3 vctrs_0.5.0 generics_0.1.3 viridisLite_0.4.1
[9] htmltools_0.5.3 yaml_2.3.6 utf8_1.2.2 rlang_1.0.6
[13] R.oo_1.25.0 jquerylib_0.1.4 later_1.3.0 pillar_1.8.1
[17] withr_2.5.0 glue_1.6.2 DBI_1.1.3 R.utils_2.12.1
[21] lifecycle_1.0.3 R.cache_0.16.0 munsell_0.5.0 rvest_1.0.3
[25] R.methodsS3_1.8.2 evaluate_0.18 callr_3.7.3 fastmap_1.1.0
[29] httpuv_1.6.6 ps_1.7.2 fansi_1.0.3 Rcpp_1.0.9
[33] promises_<IP_ADDRESS> scales_1.2.1 cachem_1.0.6 webshot_0.5.4
[37] jsonlite_1.8.3 systemfonts_1.0.4 fs_1.5.2 digest_0.6.30
[41] stringi_1.7.8 processx_3.8.0 getPass_0.2-2 rprojroot_2.0.3
[45] cli_3.4.1 tools_4.2.2 magrittr_2.0.3 sass_0.4.2
[49] tibble_3.1.8 tidyr_1.2.1 whisker_0.4 pkgconfig_2.0.3
[53] ellipsis_0.3.2 xml2_1.3.3 timechange_0.1.1 lubridate_1.9.0
[57] svglite_2.1.0 assertthat_0.2.1 rmarkdown_2.17 httr_1.4.4
[61] rstudioapi_0.14 R6_2.5.1 git2r_0.30.1 compiler_4.2.2


La_Casa_de_Papel
A group of very peculiar robbers have assaulted the Factory of Moneda and Timbre to carry out the most perfect robbery in the history of Spain and taking home 2,400 million euros.


-
Longevinex
Avoid all medications and drugs. Including: aspirin, Advil, Tylenol, etc.
Drugs to treat Alzheimer's do not work. Avoid them all.
For best results, take at a later time than Vitamin C.
Longevinex.com - (866) – 405-4000 – $37 (1 box), $120 (4 boxes)
For: Sleep, memory loss, rheumatoid arthritis, osteo-arthritis, cancer, energy, diabetes. Yes. I'm serious. Everyone I know who has tried it has shown improvement in those conditions and 90%-100% pain loss.


Total Followers: 23,004
Dark Mode
@nathanf
1987
FOLLOWERS
12 Today
@nathanf
1044
FOLLOWERS
99 Today
@reaknathanf
11k
FOLLOWERS
1099 Today
Nathan F.
8239
SUBSCRIBERS
144 Today
Page Views
87
3%
Likes
52
2%
Likes
5462
2257%
Profile Views
52K
1375%
Retweets
117
303%
Likes
507
553%
Likes
107
19%
Total Views
1407
12%


⚡ BitGlitter is an experimental piece of software that lets you embed files and directories into high performance barcodes. Store, host, and transfer data in places where it was previously not possible. It was built using Python and Javascript with a multitude of different libraries.
If you are looking for a solid software developer, I am looking for work! Hopefully this project is a good indicator of my abilities. Contact me at<EMAIL_ADDRESS>and heres my Github page to check out my other projects.


Click 'Start Watch Acceleration' button below to start watch acceleration.
Click 'Start Watch Heading' button below to start watch heading using your device's compass.
Click 'Get Connection Type' button below to know the connection type.
Click 'Get Device Info' button below to get the device information.
Click 'Get Current Position' button below to know where you are.
Click the buttons below to explore globalization.
Click the button below to open the inAppBrowser which will close after 10 seconds.
Click 'Record Sound' or 'Record Sound Externally' button below to start recording your voice.
Click the buttons below to check notifications.
Persist your information using Cordova Web Storage API.


Q.4 What is the next number in the sequence? 1 ,11, 21, 1211, 111221 ,312211,_________
A)
131232211
B)
13112221
C)
312212
D)
31112212


Class: RecursiveMutex
- Inherits:
-
Mutex
- Object
- Mutex
- RecursiveMutex
- Defined in:
- thread-0.2.2/lib/thread/recursive_mutex.rb
Overview
A recursive mutex lets you lock in various threads recursively, allowing you to do multiple locks one inside another.
You really shouldn't use this, but in some cases it makes your life easier.
Instance Method Summary collapse
-
#initialize ⇒ RecursiveMutex
constructor
A new instance of RecursiveMutex.
-
#lock ⇒ Object
Lock the mutex.
-
#unlock ⇒ Object
Unlock the mutex.
Constructor Details
#initialize ⇒ RecursiveMutex
Returns a new instance of RecursiveMutex
18 19 20 21 22 23 |
# File 'thread-0.2.2/lib/thread/recursive_mutex.rb', line 18 def initialize @threads_lock = Mutex.new @threads = Hash.new { |h, k| h[k] = 0 } super end |
Instance Method Details
#lock ⇒ Object
Lock the mutex.
26 27 28 |
# File 'thread-0.2.2/lib/thread/recursive_mutex.rb', line 26 def lock super if @threads_lock.synchronize{ (@threads[Thread.current] += 1) == 1 } end |