| name | explain-diff-html |
|---|---|
| description | Use when the user asks for a rich explanation of a code change, diff, branch, or PR. Produces HTML output. |
Please make me a rich, interactive explanation of the specified code change.
It should have these sections:
| import Photos | |
| struct UnexpectedNilError: Error {} | |
| extension PHImageManager { | |
| func requestImage( | |
| for asset: PHAsset, | |
| targetSize: CGSize, | |
| contentMode: PHImageContentMode, | |
| options: PHImageRequestOptions? |
| function run(input, parameters) { | |
| const appNames = []; | |
| const skipAppNames = []; | |
| const verbose = true; | |
| const scriptName = 'close_notifications_applescript'; | |
| const CLEAR_ALL_ACTION = 'Clear All'; | |
| const CLEAR_ALL_ACTION_TOP = 'Clear'; | |
| const CLOSE_ACTION = 'Close'; |
Doing import std_msgs.msg.String or from std_msgs.msg import String imports a generated Python class.
The typesupport for the String type exists on a metaclass: String.__class__._TYPE_SUPPORT.
This value starts as None.
It later becomes a pycapsule (with no name) when someone calls String.__class__.__import_type_support__().
This is done in rclpy by check_for_type_support(msg_type).
It's called by the Node in create_...().
Afterwards inside C code the function rclpy_common_get_type_support(pymsg_type). blindly assumes _TYPE_SUPPORT is a pycapsule.
This optimizes a GLTF file that was exported by blender (or similar) by de-duplicating buffer views (i.e. chunks of bytes) that are equal and removing redundant accessors.
For example, 100 cubes of different scales/materials/rotations/etc should all end up using a single BufferGeometry in ThreeJS, which isn't the case with current GLTF exporters in Blender and parsers for ThreeJS.
In scenes with a lot of instancing, it can dramatically reduce total file size as well as render performance. In one test scene:
Before: 4.8MB file size, 832 THREE.Geometry instances across 832 THREE.Mesh objects
After: 661KB file size, 13 THREE.Geometry instances across 832 THREE.Mesh objects
| #![allow(non_snake_case)] | |
| #![allow(dead_code)] | |
| // port of: | |
| // Creating and Printing a TypeScript AST | |
| // https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#creating-and-printing-a-typescript-ast | |
| extern crate typescript_ts as ts; | |
| extern crate chakracore; | |
| use chakracore::context::ContextGuard; |
| # One liner | |
| wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
| # Explained | |
| wget \ | |
| --recursive \ # Download the whole site. | |
| --page-requisites \ # Get all assets/elements (CSS/JS/images). | |
| --adjust-extension \ # Save files with .html on the end. | |
| --span-hosts \ # Include necessary assets from offsite as well. | |
| --convert-links \ # Update links to still work in the static version. |
| height: 600 | |
| license: mit | |
| acknowledgement: Please add "Nadieh Bremer | Visual Cinnamon" to your credit when re-using this code, thank you! |