Automatic generation of a presentation from code based on analysis of an intermediate version of the code

A device analyzes program code to generate an intermediate version of the program code. When analyzing the program code, the device applies first rules for mapping portions of the program code to different portions of the intermediate version of the program code. The device generates the intermediate version of the program code that the different portions of the intermediate version of the program code mapped from the portions of the program code. The device applies, to the intermediate version of the program code, second rules for determining first portions of the intermediate version of the program code to keep together and second portions of the intermediate version of the program code to keep separate in a presentation to be generated from the program code, and generates the presentation from the program code based on applying the second rules to the intermediate version of the program code.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1Bare diagrams of an overview of an example implementation described herein;

FIG. 2is a diagram of an example environment in which systems and/or methods, described herein, may be implemented;

FIG. 3is a diagram of example components of one or more devices ofFIG. 2;

FIGS. 4A-4Eare diagrams of an example implementation for automatically creating a presentation based on code;

FIGS. 5A-5Fare diagrams of another example implementation for automatically creating a presentation based on code;

FIGS. 6A-6Eare diagrams of still another example implementation for automatically creating a presentation based on code;

FIGS. 7A-7Dare diagrams of an example implementation for executing code directly in a presentation; and

FIG. 8is a flow chart of an example process for automatically generating a presentation from code.

DETAILED DESCRIPTION

A device, such as a computer, may be used to receive or create code (e.g., programming code, raw code, or the like). The code may be used to perform tasks related to aforementioned disciplines. In some instances, a developer of the code may be required to present features of the code to an audience of one or more people. In one example, the developer may utilize the device to display the code to the audience and/or to execute the code for the audience. In such an example, however, it may be challenging for the audience to read and understand complicated syntax of the code, and to keep the audience focused on the features of the code. In another example, the developer may utilize the device to insert portions of the code within a presentation (e.g., via presentation software). The presentation may keep the audience focused, and may be easier to read and understand than the displayed code. However, it is a tedious and time consuming process to insert portions of the code within the presentation.

Systems and/or methods, described herein, may automatically generate a presentation based on code, and may enable the code to be executed and/or modified via the presentation. The systems and/or methods may utilize the code structure, annotations for the code, and/or other information associated with the code to automatically create the presentation. The systems and/or methods may determine (e.g., based on the code) slide titles, bullets, animation, how to partition the code, or the like for the presentation. The presentation may be utilized for performing a code review or for presenting to an audience of people.

FIGS. 1A and 1Bare diagrams of an overview of an example implementation100described herein. Example implementation100may be performed by a device, such as a computer.

With reference toFIG. 1A, the device may receive code or may create the code, and may display the code in a code view. The code may map to visual elements (e.g., titles, headers, text, code sections, or the like). In some implementations, the device may utilize the mapping to the visual elements to automatically create an intermediate version of the code, and may display the intermediate version of the code in an intermediate code view, as further shown inFIG. 1A. In such implementations, the device may establish links between portions of the code (e.g., the visual elements), and may utilize the links to facilitate other uses of the code in the intermediate code view or the presentation view (shown inFIG. 1B). The intermediate code view and/or the presentation view may include a formatted document that includes the visual elements of the code, artifacts associated with execution of the code (or code sections), as well as artifacts associated with creating the intermediate code view. The code may be converted into the formatted document so that the formatted document may be shared with others for teaching or demonstration, to generate readable, external documentation of the code, or the like.

In some implementations, the device may analyze the intermediate version of the code based on rules for creating a presentation, and may automatically create a presentation for the code, or a portion of the code, based on the analysis of the intermediate version of the code. As shown inFIG. 1B, the device may display the presentation in a presentation view. The code and/or the intermediate version of the code may map to visual elements (e.g., titles, headers, text, code sections, or the like). In some implementations, the device may utilize the mapping to the visual elements to automatically create the presentation for the code, and may display the presentation for the code in the presentation view. In such implementations, the device may establish links between the visual elements, and may utilize the links to facilitate other uses of the code in the presentation view. As further shown inFIG. 1B, a title (e.g., “Graphs and Matrices”) of the intermediate version of the code may be mapped to and utilized as a title for a slide of the presentation. An image (e.g., a geodesic dome) output by the code may be mapped to and utilized as an image for the slide of the presentation, and copyright information (e.g., “©2015 The MathWorks, Inc.”) may be generated in the slide of the presentation.

In some implementations, the device may automatically create the presentation for the code directly from the code and/or directly from the intermediate version of the code. In some implementations, the device may automatically create the intermediate version of the code directly from the code. In some implementations, the device may automatically create the intermediate version of the code based on the code, and then may automatically create the presentation for the code based on the intermediate version of the code. In some implementations, the device may automatically create the code from the intermediate version of the code, may automatically create the code from the presentation for the code, may automatically create the intermediate version of the code from the presentation for the code, or the like. In some implementations, the device may automatically create a published version of the code directly from the code and/or directly from the intermediate version of the code.

In some implementations, the device may receive a modification to the code via the code view, the intermediate view, and/or the presentation view, and may update the other views based on the received modification. For example, the device may modify the presentation for the code based on the modification to the code, and may display the modified presentation for the code in the presentation view. In this way, the content of the code view, the intermediate view, and the presentation view may be linked.

Systems and/or methods, described herein, may automatically generate a presentation based on code, and may enable the code to be executed and/or modified via the presentation. The systems and/or methods may reduce the time and effort required to generate a presentation based on code, and may provide a presentation about the code that is easy to read and understand. Enabling a portion of the code to be executed and/or modified via the presentation may aid in code development because it may allow a developer to focus on a small targeted portion of the code at a time.

FIG. 2is a diagram of an example environment200in which systems and/or methods, described herein, may be implemented. As shown inFIG. 2, environment200may include a client device210, which may include a TCE220. Furthermore, environment200may include a server device230, which may include TCE220, and a network240. Devices of environment200may interconnect via wired connections, wireless connections, or a combination of wired and wireless connections.

Client device210may include a device capable of receiving, generating, storing, processing, executing, and/or providing information, such as information associated with code. For example, client device210may include a computing device, such as a desktop computer, a laptop computer, a tablet computer, a handheld computer, a server, a mobile phone (e.g., a smart phone, a radiotelephone, or the like), or a similar device. In some implementations, client device210may receive information from and/or provide information to server device230.

Client device210may host TCE220. Functions described herein as being performed by TCE220may be performed by client device210and execution of TCE220by client device210. TCE220may include any hardware-based component or a combination of hardware and software-based components that provides a computing environment that allows tasks to be performed (e.g., by users) related to disciplines, such as, but not limited to, mathematics, science, engineering, medicine, and business. TCE220may include a text-based environment (e.g., MATLAB™ software; OCTAVE™; PYTHON™; COMSOL™ Script; MATRIXx™ from NATIONAL INSTRUMENTS™; MATHEMATICA™ from WOLFRAM RESEARCH, INC.™; MATHCAD™ from MATHSOFT ENGINEERING & EDUCATION INC.™; MAPLE™ from MAPLESOFT™; EXTEND™ from IMAGINE THAT INC.™; SCILAB™ from THE FRENCH INSTITUTION FOR RESEARCH IN COMPUTER SCIENCE AND CONTROL (INRIA)™; VIRTUOSO™ from CADENCE™; MODELICA™ or DYMOLA™ from DYNASIM™; etc.); a graphically-based environment (e.g., SIMULINK® software, STATEFLOW® software, SIMEVENTS® software, SIMSCAPE™ software, etc., by THE MATHWORKS, Inc.™; VISSIM™ by VISUAL SOLUTIONS™; LAB VIEW® by NATIONAL INSTRUMENTS™; DYMOLA™ by DYNASIM™; SOFTWIRE™ by MEASUREMENT COMPUTING™; WIT™ by DALSA CORECO™; VEE PRO™ or SYSTEMVUE™ by AGILENT™; VISION PROGRAM MANAGER™ from PPT VISION™; KHOROS™ from KHORAL RESEARCH™; GEDAE™ by GEDAE, Inc.™; SCICOS™ from (INRIA)™; VIRTUOSO™ from CADENCE™; RATIONAL ROSE™ from IBM™; RHAPSODY™ or TAU™ from TELELOGIC™; PTOLEMY™ from the UNIVERSITY OF CALIFORNIA AT BERKELEY™; aspects of a Unified Modeling Language (UML) or SysML environment; etc.); or another type of environment, such as a hybrid environment that includes one or more of the above-referenced text-based environments and one or more of the above-referenced graphically-based environments.

For example, TCE220may provide mathematical functions and/or graphical tools (e.g., for creating plots, surfaces, images, volumetric representations, or the like). In some implementations, TCE220may provide these functions and/or tools using toolboxes (e.g., toolboxes for signal processing, image processing, data plotting, parallel processing, or the like). In some implementations, TCE220may provide these functions as block sets or in another way, such as via a library, a local or remote database (e.g., a database operating in a computing cloud), remote procedure calls (“RPCs”), an application programming interface (“API”), or the like.

TCE220may include a modeling system that may be used in the creation of a functional model and that may enable generation of executable code based on the model. For example, TCE220may include a graphical modeling tool or application that provides a user interface for a numerical computing environment. Additionally, or alternatively, TCE220may include a graphical modeling tool and/or application that provides a user interface for modeling and simulating (e.g., by executing a model) a dynamic system (e.g., based on differential equations, difference equations, discrete events, discrete states, or the like). Execution of a model to simulate a system may also be referred to as simulating a model. The model may further include static relations (e.g., algebraic relations, stochastic relations, inequalities, or the like).

Server device230may include one or more devices capable of receiving, generating, storing, processing, and/or providing information, such as information associated with code. For example, server device230may include a computing device, such as a server, a desktop computer, a laptop computer, a tablet computer, or a similar device. In some implementations, server device230may host TCE220. In some implementations, client device210may be used to access one or more TCEs220running on one or more server devices230. For example, multiple server devices230may be used to execute code (e.g., serially or in parallel), and may provide respective results of executing the code to client device210.

In some implementations, client device210and server device230may be owned by different entities. For example, an end user may own client device210, and a third party may own server device230. In some implementations, server device230may include a device operating in a cloud computing environment. In this way, front-end applications (e.g., a user interface) may be separated from back-end applications (e.g., code execution). Additionally, or alternatively, server device230may perform one, more, or all operations described elsewhere herein as being performed by client device210.

Network240may include one or more wired and/or wireless networks. For example, network240may include a cellular network, a public land mobile network (PLMN), a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), a telephone network (e.g., the Public Switched Telephone Network (PSTN)), an ad hoc network, an intranet, the Internet, a fiber optic-based network, a private network, a cloud computing network, and/or a combination of these or other types of networks.

Bus310may include a component that permits communication among the components of device300. Processor320is implemented in hardware, firmware, or a combination of hardware and software. Processor320may include a processor (e.g., a central processing unit (CPU), a graphics processing unit (GPU), an accelerated processing unit (APU), or the like), a microprocessor, and/or any processing component (e.g., a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), or the like) that interprets and/or executes instructions, and/or that is designed to implement one or more computing tasks. In some implementations, processor320may include multiple processor cores for parallel computing. Memory330may include a random access memory (RAM), a read only memory (ROM), and/or another type of dynamic or static storage device (e.g., a flash memory, a magnetic memory, an optical memory, or the like) that stores information and/or instructions for use by processor320.

Input component350may include a component that permits device300to receive information, such as via user input (e.g., a touch screen display, a keyboard, a keypad, a mouse, a button, a switch, a microphone, or the like). Additionally, or alternatively, input component350may include a sensor for sensing information (e.g., a global positioning system (GPS) component, an accelerometer, a gyroscope, an actuator, or the like). Output component360may include a component that provides output information from device300(e.g., a display, a speaker, one or more light-emitting diodes (LEDs), or the like).

FIGS. 4A-4Eare diagrams of an example implementation400for automatically creating a presentation based on code. The operations described in connection withFIGS. 4A-4Eare described as being performed by client device210. In some implementations, the operations described in connection withFIGS. 4A-4Emay be performed by another device or a group of devices separate from or including client device210, such as server device230.

Assume that client device210receives code from a storage device (e.g., memory330and/or storage component340,FIG. 3). In some implementations, the code may be stored in a data structure associated with client device210, and client device210may receive the code by accessing the data structure. Further, assume that client device210utilizes TCE220to display the code in a code view410, as shown inFIG. 4A. In example implementation400, assume that the code relates to a relationship between graphs and matrices.

Client device210may convert the code displayed in code view410into an intermediate version of the code, and may display the intermediate version of the code in an intermediate code view415, as further shown inFIG. 4A. In some implementations, client device210may evaluate the code such that the evaluation may encompass multiple commands for generating intermediate code view415, where the commands may partition a multi-line statement and/or may be evaluated in a distinct workspace. Client device210may utilize the code, and data resulting from the evaluation of the code, as a basis of a document object model. The document object model may represent information in a tree structure and may allow access to information represented by the document object model using particular languages (e.g., languages with object oriented features, such as JavaScript). The tree structure may enable traversing back and forth between the document object model and the code and/or data resulting from the evaluation of the code. In some implementations, a Simple API for XML (SAX) may be used in place of the document object model.

In some implementations, a user of client device210may select a desired format for the intermediate version of the code. For example, the user may choose to convert the code and data resulting from the code into an HTML document, an XML document, a LaTeX document, a PDF document, or the like. Client device210may utilize templates (e.g., XSL templates) to transform the document object model into the user-selected format. The templates may provide general forms that are applied to the document object model so that the intermediate version of the code adheres to the user-selected format.

The intermediate version of the code may include a document that includes visual elements of the code, portions of the code, comments in the code, output of the code (e.g., an image420, such as a geodesic dome), or the like. In some implementations, the code may include characters or symbols (e.g., associated with text) indicating that the text represents comments in the code. In some implementations, client device210may execute the code to generate outputs of the code, which may be used in the intermediate version of the code. In some implementations, client device210may mark each section of the intermediate version of the code as code, comments, output, or the like.

In some implementations, client device210may display a menu that provides an item for creating the intermediate version of the code, an item for creating a presentation based on the code, or the like. Assume that client device210receives a selection of a menu item for creating a presentation based on the code. In some implementations, client device210, based on the selection, may display options for creating the presentation (e.g., based on all of the code, a selected portion of the code, selected portions of the code, or the like). If client device210receives a selection of an option for creating the presentation, client device210may display options for output formats of the presentation (e.g., PowerPoint®, CustomShow, Prezi®, SlideShark™, or the like). Further, assume that client device210receives a selection of an output format.

Client device210may analyze the intermediate version of the code based on one or more rules for creating a presentation, and may automatically create a title slide of a presentation for the code (or a portion of the code), based on the analysis of the intermediate version of the code. As shown inFIG. 4B, client device210may display the title slide of the presentation in a presentation view430. In some implementations, the presentation may be exported or converted into a format compatible with presentation software, such as PowerPoint®, CustomShow, Prezi®, SlideShark™, Adobe Acrobat®, or the like. As further shown inFIG. 4B, client device210may display intermediate code view415and image420. Client device210may utilize a title (e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view415) as a title for the title slide of the presentation. Client device210may utilize image420as an image for the title slide of the presentation, and may generate copyright information (e.g., “©2015 The MathWorks, Inc.”) in the title slide of the presentation based on information (e.g., company information, publication information, a copyright symbol, or the like) provided in intermediate code view415.

In some implementations, client device210may take dynamic elements associated with execution of the code (e.g., transitions that a figure goes through during a loop in the code), and may create an image and/or a movie that can be embedded into the presentation. In such implementations, client device210may be maintain states for various stages of execution of the code, and such states may be assembled into an image, a data structure, a movie, or the like, for use in the intermediate version of the code.

In some implementations, the architecture for creating the intermediate version of the code and the presentation may include a static template and a dynamic template for outputs. The static template may controls things that do not change, such as corporate presentation styles, copyright notices, corporate names, or the like. The dynamic template may controls things that do change, such as titles, code contents, summaries, plots and other images, or the like.

As shown inFIG. 4C, client device210may automatically create additional slides435for the presentation based on the intermediate version of the code, and may display additional slides435in presentation view430. Since the intermediate version of the code (e.g., in intermediate code view415) includes a single title (e.g., “Graphs and Matrices”), and does not include sub-titles or headers, client device210may utilize the single title as titles for the additional slides of the presentation, as indicated by reference number440inFIG. 4C.

Now assume that intermediate code view415includes information associated with visualizing surface data of a penny, as shown inFIG. 4D. Client device210may automatically create slide content445for a presentation based on the intermediate version of the code (e.g., in intermediate code view415), and may display the slide in presentation view430. Client device210may utilize a header (e.g., “Drawing a Contour Plot”) of the intermediate version of the code (e.g., in intermediate code view415) as a title for the slide of the presentation, as indicated by reference number450inFIG. 4D. Client device210may display text (e.g., “Draw a contour plot with15copper colored contour lines”) of the intermediate version of the code in the slide of the presentation, as indicated by reference number455inFIG. 4D. Client device210may display actual code (e.g., “load penny.mat . . . ”) of the intermediate version of the code in the slide of the presentation, as indicated by reference number460inFIG. 4D. Client device210may display an output (e.g., an image of a penny) generated by the actual code (e.g., “load penny.mat . . . ”) in the slide of the presentation, as indicated by reference number465inFIG. 4D. In this way, portions of the intermediate version of the code can be linked to a particular slide of the presentation.

As shown inFIG. 4E, the presentation generated by client device210may be displayed in a presentation window470. Presentation window470may include thumbnails of the slides of the presentation and a larger size version of a slide selected from the thumbnails. Presentation window470may include a presentation mode option that, when selected, causes client device210to display the presentation in a full screen mode. In some implementations, code displayed in the presentation of presentation window470may be executed by client device210, and may be edited via presentation window470and/or code view410(e.g., shown inFIG. 4A).

As indicated above,FIGS. 4A-4Eare provided merely as an example. Other examples are possible and may differ from what was described with regard toFIGS. 4A-4E.

FIGS. 5A-5Fare diagrams of another example implementation500for automatically creating a presentation based on code. The operations described in connection withFIGS. 5A-5Fare described as being performed by client device210. In some implementations, the operations described in connection withFIGS. 5A-5Fmay be performed by another device or a group of devices separate from or including client device210, such as server device230.

Assume that client device210receives code from a storage device (e.g., memory330and/or storage component340,FIG. 3). In some implementations, the code may be stored in a data structure associated with client device210, and client device210may receive the code by accessing the data structure. Further, assume that client device210utilizes TCE220to display the code, as shown inFIG. 5A. In example implementation500, assume that the code relates to a relationship between graphs and matrices, and that the code is displayed in a code view510.

Client device210may convert the code displayed in code view510into an intermediate version of the code, and may display the intermediate version of the code in an intermediate code view515, as further shown inFIG. 5A. The intermediate version of the code may include a document that includes the code, comments in the code, output of the code (e.g., an image520, such as a geodesic dome), or the like. For example, the intermediate version of the code may include a title525(e.g., “Graphs and Matrices”), a first description section530(e.g., “This example shows an application of sparse matrices . . . ”), a first code section535(e.g., “% Define the variables . . . ”), a second description section540(e.g., “A graph can be represented by . . . ”), a second code section545(e.g., “% Define a matrix A . . . ”), or the like.

Client device210may analyze the intermediate version of the code (e.g., provided in intermediate code view515) based on rules for creating a presentation, and may automatically create a presentation for the code (or a portion of the code), based on the analysis of the intermediate version of the code. For example, client device210may create a presentation that includes the slides depicted inFIGS. 5B-5F.

As shown inFIG. 5B, client device210may create a title slide550of the presentation, and may display title slide550of the presentation. As further shown inFIG. 5B, client device210may utilize title525(e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view515) as a title for title slide550. Client device210may utilize image520as an image for title slide550of the presentation, and may provide other information (e.g., “By The Company, Inc.”) in title slide550of the presentation based on information (e.g., company information, publication information, a copyright symbol, or the like) provided in intermediate code view515.

As shown inFIG. 5C, client device210may create a first slide555of the presentation, and may display first slide of the presentation. As further shown inFIG. 5C, client device210may utilize title525(e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view515) as a title for first slide555. Client device210may utilize first description section530(e.g., “This example shows an application of sparse matrices . . . ”) of the intermediate version of the code (e.g., in intermediate code view515) as text for first slide555. Client device210may provide paragraphs of first description section530as bullets in first slide555, and may automatically size the text and/or space the bullets to fit first slide555, based on a number of words and/or paragraphs in first description section530.

As shown inFIG. 5D, client device210may create a second slide560of the presentation, and may display second slide560of the presentation. As further shown inFIG. 5D, client device210may utilize title525(e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view515) as a title for second slide560. Client device210may utilize first code section535(e.g., “% Define the variables . . . ”) of the intermediate version of the code (e.g., in intermediate code view515) as text for second slide560. Client device210may separate blocks of code of first code section535with whitespace in second slide560, and may provide outputs of first code section535(e.g., image520) in second slide560.

As shown inFIG. 5E, client device210may create a third slide565of the presentation, and may display third slide565of the presentation. As further shown inFIG. 5E, client device210may utilize title525(e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view515) as a title for third slide565. Client device210may utilize second description section540(e.g., “A graph can be represented by . . . ”) of the intermediate version of the code (e.g., in intermediate code view515) as text for third slide565. Client device210may provide paragraphs of second description section540as bullets in third slide565, and may automatically size the text and/or space the bullets to fit third slide565, based on a number of words and/or paragraphs in second description section540. As further shown inFIG. 5E, client device210may utilize second code section545(e.g., “% Define a matrix A . . . ”) of the intermediate version of the code (e.g., in intermediate code view515) as additional text for third slide565. Client device210may separate blocks of code of second code section545with whitespace in third slide565.

As shown inFIG. 5F, client device210may create a fourth slide570of the presentation, and may display fourth slide570of the presentation. As further shown inFIG. 5F, client device210may utilize title525(e.g., “Graphs and Matrices”) of the intermediate version of the code (e.g., in intermediate code view515) as a title for fourth slide570. Client device210may utilize a code section575(e.g., “% Draw a picture showing the adjacency matrix . . . ”) of the intermediate version of the code as text for fourth slide570. Client device210may provide, in fourth slide570, outputs of code section575(e.g., an adjacency matrix580) to the right of code section575, to the left of code section575, above code section575, or below code section575(e.g., depending on the size of code section575).

As indicated above,FIGS. 5A-5Fare provided merely as an example. Other examples are possible and may differ from what was described with regard toFIGS. 5A-5F.

FIGS. 6A-6Eare diagrams of still another example implementation600for automatically creating a presentation based on code. The operations described in connection withFIGS. 6A-6Eare described as being performed by client device210. In some implementations, the operations described in connection withFIGS. 6A-6Emay be performed by another device or a group of devices separate from or including client device210, such as server device230.

Assume that client device210receives code from a storage device (e.g., memory330and/or storage component340,FIG. 3). In some implementations, the code may be stored in a data structure associated with client device210, and client device210may receive the code by accessing the data structure. Further, assume that client device210utilizes TCE220to display the code, as shown inFIG. 6A. In example implementation600, assume that the code relates to techniques to visualize surface data of a penny, and that the code is displayed in a code view610.

Client device210may convert the code displayed in code view610into an intermediate version of the code, and may display the intermediate version of the code in an intermediate code view615, as further shown inFIG. 6A. The intermediate version of the code may include a document that includes the code, comments in the code, output of the code (e.g., a contour plot620, a pseudocolor plot625, and a surface plot630), or the like. For example, the intermediate version of the code may include a title635(e.g., “Viewing a Penny”), a main description section640(e.g., “This example shows four techniques . . . ”), a first header645(e.g., “Drawing a Contour Plot”), a first description section650(e.g., “Draw a contour plot . . . ”), a first code section655(e.g., “load penny.mat . . . ”), a second header660(e.g., “Drawing a Pseudocolor Plot”), a second description section665(e.g., “Draw a pseudocolor plot . . . ”), a second code section670(e.g., “pcolor(P) . . . ”), or the like.

Client device210may analyze the intermediate version of the code (e.g., provided in intermediate code view615) based on rules for creating a presentation, and may automatically create a presentation for the code (or a portion of the code), based on the analysis of the intermediate version of the code. For example, client device210may create a presentation that includes the slides depicted inFIGS. 6B-6E.

As shown inFIG. 6B, client device210may create a title slide675of the presentation, and may display title slide675of the presentation. As further shown inFIG. 6B, client device210may utilize title635(e.g., “Viewing a Penny”) of the intermediate version of the code (e.g., in intermediate code view615) as a title for title slide675. Client device210may utilize surface plot630as an image for title slide675of the presentation, and may provide other information (e.g., “By The Company, Inc.”) in title slide675of the presentation based on information (e.g., company information, publication information, a copyright symbol, or the like) provided in intermediate code view615.

As shown inFIG. 6C, client device210may create a first slide680of the presentation, and may display first slide680of the presentation. As further shown inFIG. 6C, client device210may utilize title635(e.g., “Viewing a Penny”) of the intermediate version of the code (e.g., in intermediate code view615) as a title for first slide680. Client device210may utilize main description section640(e.g., “This example shows four techniques . . . ”) of the intermediate version of the code (e.g., in intermediate code view615) as text for first slide680. Client device210may automatically size and/or fit the text of main description section640to fit first slide680, based on a number of words and/or paragraphs in main description section640.

As shown inFIG. 6D, client device210may create a second slide685of the presentation, and may display second slide685of the presentation. As further shown inFIG. 6D, client device210may utilize first header645(e.g., “Drawing a Contour Plot”) of the intermediate version of the code (e.g., in intermediate code view615) as a title for second slide685. Client device210may utilize first description section650(e.g., “Draw a contour plot . . . ”) of the intermediate version of the code (e.g., in intermediate code view615) as text for second slide685. Client device210may automatically size and/or fit the text of first description section650to fit second slide685, based on a number of words and/or paragraphs in first description section650. As further shown inFIG. 6D, client device210may utilize first code section655(e.g., “load penny.mat . . . ”) of the intermediate version of the code (e.g., in intermediate code view615) as additional text for second slide685. Client device210may provide output of first code section655(e.g., contour plot620of the penny) in second slide685.

As shown inFIG. 6E, client device210may create a third slide690of the presentation, and may display third slide690of the presentation. As further shown inFIG. 6E, client device210may utilize second header660(e.g., “Drawing a Pseudocolor Plot”) of the intermediate version of the code (e.g., in intermediate code view615) as a title for third slide690. Client device210may utilize second description section665(e.g., “Draw a pseudocolor plot . . . ”) of the intermediate version of the code (e.g., in intermediate code view615) as text for third slide690. Client device210may automatically size and/or fit the text of second description section665to fit third slide690, based on a number of words and/or paragraphs in second description section665. As further shown inFIG. 6E, client device210may utilize second code section670(e.g., “pcolor(P) . . . ”) of the intermediate version of the code (e.g., in intermediate code view615) as additional text for third slide690. Client device210may provide output of second code section670(e.g., pseudocolor plot625of the penny) in third slide690. As further shown inFIG. 6E, client device210may provide a selection mechanism695(e.g., a button, a link, a menu, or the like) that, when selected, causes client device210to rerun or regenerate the presentation shown inFIGS. 6B-6E.

As indicated above,FIGS. 6A-6Eare provided merely as an example. Other examples are possible and may differ from what was described with regard toFIGS. 6A-6E.

FIGS. 7A-7Dare diagrams of an example implementation700for executing code directly in a presentation. The operations described in connection withFIGS. 7A-7Dare described as being performed by client device210. In some implementations, the operations described in connection withFIGS. 7A-7Dmay be performed by another device or a group of devices separate from or including client device210, such as server device230.

In example implementation700, assume that client device210automatically creates a presentation, depicted inFIGS. 7A-7D, based on code received by client device210. Further, assume that the presentation demonstrates how code may be executed directly in a presentation. As shown inFIG. 7A, assume that that client device210utilizes TCE220to display a first slide705of the presentation, and that first slide705includes code710. In example implementation700, assume that code710includes an example of vertically concatenating two matrices (e.g., matrix A and matrix B) into a third matrix (e.g., matrix C). As further shown inFIG. 7A, first slide705may include a selection mechanism715(e.g., a button, a link, a menu item, or the like) that, when selected, causes client device210to execute code710.

As shown in a slide720ofFIG. 7B, when selection mechanism715is selected, client device210may execute a first line of code710(e.g., A=ones(2, 5)*6), as indicated by reference number725. Client device210may generate a result730based on the execution of the first line of code710. Result730may include a two-by-five matrix (e.g., matrix A) of sixes, as further shown inFIG. 7B.

As shown in a slide735ofFIG. 7C, client device210may then execute a second line of code710(e.g., B=rand(3, 5)), as indicated by reference number740. Client device210may generate a result745based on the execution of the second line of code710. Result745may include a three-by-five matrix (e.g., matrix B) of random values, as further shown inFIG. 7C.

As shown in a slide750ofFIG. 7D, client device210may then execute a third line of code710(e.g., C=[A; B]), as indicated by reference number755. Client device210may generate a result760based on the execution of the third line of code710. Result760may include a five-by-five matrix (e.g., matrix C) that is a vertical concatenation of matrix A and matrix B, as further shown inFIG. 7D.

In some implementations, the operations described in connection withFIGS. 7A-7Dmay be executed by presentation software (e.g., PowerPoint®, CustomShow, Prezi®, SlideShark™, or the like). For example, code710may be executed by the presentation software while the presentation is being executed by the presentation software. In such implementations, the presentation software may interface with TCE220(e.g., where code710is executable), and TCE220may provide results of the execution of code710back to the presentation software.

In some implementations, client device210may create animations via the presentation software. For example, client device210may create animations for code710, and code710may include several outputs. In such an example, the animation may display one output of code710at a time, as shown inFIGS. 7A-7D. In another example, client device210may utilize the presentation software to progressively display portions of a slide. In still another example, client device210may create animations for code710, and code710may include a single output that changes state over time. In such an example, client device210may utilize the presentation software to create a movie that shows how the single output changes state over time. The movie may be broken down into frames and the frames may be tied to code710.

As indicated above,FIGS. 7A-7Dare provided merely as an example. Other examples are possible and may differ from what was described with regard toFIGS. 7A-7D.

FIG. 8is a flow chart of an example process800for automatically generating a presentation from code. In some implementations, one or more process blocks ofFIG. 8may be performed by client device210. In some implementations, one or more process blocks ofFIG. 8may be performed by another device or a group of devices separate from or including client device210, such as server device230.

As shown inFIG. 8, process800may include receiving code created with a technical computing environment (block810). For example, client device210may create and/or receive code. In some implementations, client device210may receive the code from a storage device (e.g., memory330and/or storage component340,FIG. 3). In some implementations, client device210(e.g., TCE220) may receive the code based on a user creating the code. For example, a user may cause client device210to create or open a user interface. One or more lines of code may be added to the user interface to create the code. For example, in some implementations, client device210may receive a command, from the user, that indicates that a line of code is to be added to the user interface. Client device210may receive the command based on, for example, detecting a selection of a particular menu item, entry of a particular textual or audible input from the user, and/or entry of some other predetermined input that indicates a desire to add a line of code to the user interface.

As further shown inFIG. 8, process800may include creating an intermediate version of the code based on the code (block820). For example, client device210may create an intermediate version of the code based on the code, comments in the code, output of the code, or the like. In some implementations, as described above in connection withFIG. 4A, client device210may convert the code displayed in code view410into an intermediate version of the code, and may display the intermediate version of the code in intermediate code view415. The intermediate version of the code may include a document that includes the code, comments in the code, output of the code (e.g., image420, such as a geodesic dome), or the like. The code may be converted into a formatted document so that the formatted document may be shared with others for teaching or demonstration, to generate readable, external documentation of the code, or the like. In some implementations, the code may include characters or symbols (e.g., associated with text) indicating that the text represents comments in the code. In some implementations, client device210may execute the code to generate outputs of the code, which may be used in the intermediate version of the code.

In some implementations, client device210may create the intermediate version of the code, from the code, based on rules for mapping the code to different portions of the intermediate version of the code. In some implementations, the rules for mapping the code to different portions of the intermediate version of the code may include a rule identifying a title, or a heading, in the code, and mapping the title or the heading to a title portion of the intermediate version of the code. In some implementations, the rules for mapping the code to different portions of the intermediate version of the code may include a rule identifying copyright information (if present) in the code, and mapping the copyright information to a copyright portion of the intermediate version of the code.

In some implementations, the rules for mapping the code to different portions of the intermediate version of the code may include a rule identifying a code section in the code, and mapping the code section to a corresponding portion of the intermediate version of the code. In some implementations, the rules for mapping the code to different portions of the intermediate version of the code may include a rule identifying a text section in the code, and mapping the text section to a corresponding portion of the intermediate version of the code. In some implementations, the rules for mapping the code to different portions of the intermediate version of the code may include a rule identifying an output of the code, and mapping the output to a corresponding portion of the intermediate version of the code.

In some implementations, the different portions of intermediate version of the code may provide a mapping of the code to the intermediate version of the code. In some implementations, the different portions of the intermediate version of the code can be assembled to form an intermediate view or document, as shown and described above in connection with one or more ofFIGS. 1A, 1B, 4A-4D, 5A, and 6A, and/or a presentation view or document, as shown and described above in connection with one or more ofFIGS. 1B, 4B-4E, 5B-5F, 6B-6E, and 7A-7D.

As further shown inFIG. 8, process800may include analyzing the intermediate version of the code based on rules for creating a presentation (block830). For example, client device210may analyze the intermediate version of the code based on rules for creating a presentation. In some implementations, client device210may not create the intermediate version of the code, and may analyze the code directly based on rules for creating a presentation. In some implementations, client device210may receive the rules for creating a presentation from a storage device (e.g., memory330and/or storage component340,FIG. 3). In some implementations, client device210(e.g., TCE220) may enable a user to configure the rules for creating the presentation, create the rules, or the like. For example, a user may cause client device210to create or open a user interface that displays the rules for creating a presentation. One or more rules may be configured by the user via the user interface. In some implementations, the rules for creating a presentation may be different for different types of code or based on a purpose of the code.

In some implementations, the rules for creating a presentation may include rules for creating a title slide of the presentation. In some implementations, the rules for creating the title slide of the presentation may include a rule utilizing a title, or a first heading, of the intermediate version of the code as a title for the title slide. In some implementations, the rules for creating the title slide may include a rule for utilizing copyright information (if present) of the intermediate version of the code in a portion of the title slide (e.g., a lower right hand corner, a lower left corner, or the like).

In some implementations, the rules for creating the title slide may include a rule for utilizing an output (e.g., an image, a figure, or the like) of the intermediate version of the code in a portion of the title slide. For example, a most relevant output (e.g., a most relevant figure) of the intermediate version of the code may be provided in a portion of the title slide. In such an example, client device210may identify the outputs of the intermediate version of the code, may rank the identified outputs based on a number of occurrences of the identified outputs, and may select a highest ranked identified output as the most relevant output. In another example, client device210may provide a first output (e.g., a first figure) of the intermediate version of the code in a portion of the title slide. In still another example, client device210may provide one or more outputs (e.g., figures), generated by execution of the code, in a portion of the title slide.

In some implementations, the rules for creating a presentation may include a rule for creating titles of subsequent slides of the presentation based on the intermediate version of the code. For example, if the intermediate version of the code includes a title and does not include headers, client device210may utilize the title of the intermediate version of the code as the titles of the subsequent slides. In another example, if a section of the intermediate version of the code includes a header, client device210may utilize the header as a title of one of the subsequent slides. In still another example, if the intermediate version of the code does not include titles or headers, client device210may utilize a first sentence of a section of the intermediate version of the code as a title of one of the subsequent slides.

In some implementations, the rules for creating a presentation may include a rule for spacing of text in the subsequent slides of the presentation based on the intermediate version of the code. For example, if the intermediate version of the code includes a single paragraph, client device210may provide the single paragraph in one of the subsequent slides. In such an example, client device210may automatically size the text and/or spacing of the single paragraph in the subsequent slide based on a number of words in the single paragraph, available space in the subsequent slide, or the like. In another example, if the intermediate version of the code includes multiple paragraphs, client device210may provide the multiple paragraphs as bullets in one or more of the subsequent slides. In such an example, client device210may automatically size the text and/or spacing of each of the multiple paragraphs in the subsequent slide(s) based on a number of words in each paragraph, available space in the subsequent slide(s), or the like.

In some implementations, the rules for creating a presentation may include rules for formatting the subsequent slides of the presentation based on the intermediate version of the code. In some implementations, the rules for formatting the subsequent slides may include a rule for displaying paragraphs of the intermediate version of the code. For example, if the intermediate version of the code includes multiple paragraphs, client device210may sequentially provide the multiple paragraphs in the subsequent slides. In such an example, client device210may sequentially display the multiple paragraphs, via the subsequent slides, when the presentation is executed as a slide show. In some implementations, the rules for formatting the subsequent slides may include a rule for displaying text and code of the intermediate version of the code. For example, if text and related code of the intermediate version of the code can fit on one subsequent slide, client device210may provide the text before the related code in the subsequent slide. In some implementations, the rules for formatting the subsequent slides may include a rule for displaying code and outputs of the intermediate version of the code. For example, if code of the intermediate version of the code generates an output, client device210may provide the generated output with the code in a subsequent slide. In some implementations, the rules for formatting the subsequent slides may include a rule for displaying multiple code portions of the intermediate version of the code. For example, if the intermediate version of the code includes multiple code portions, client device210may sequentially provide the multiple code portions in the subsequent slides. In such an example, client device210may sequentially display the multiple code portions, via the subsequent slides, when the presentation is executed as a slide show.

In some implementations, the rules for formatting the subsequent slides may include a rule for displaying a header, text, code, and output of the intermediate version of the code. For example, if the intermediate version of the code includes a header, text (e.g., a paragraph), code, and output of the code, client device210may size the header, the text, the code, and the output to fit on one of the subsequent slides. If client device210determines that the header, the text, the code, and the output cannot fit on one of the subsequent slides, client device210may provide the header and the text on one of the subsequent slides and may provide the header, the code, and the output on another one of the subsequent slides. If client device210determines that code cannot fit on one of the subsequent slides, client device210may partition the code into code portions, and may provide the code portions, and outputs generated by the code portions, on multiple subsequent slides. If client device210determines that text cannot fit on one of the subsequent slides, client device210may partition the text into text portions, may provide the text portions on multiple subsequent slides, and may add an indication (e.g., “continued”) in the titles of the subsequent slides.

In some implementations, the rules for formatting the subsequent slides may include a rule for altering a portion of the code of the intermediate version of the code. For example, the rule for altering the portion of the code may cause client device210to change only the size of the portion of the code (e.g., except for comments in the portion of the code, which client device210may automatically wrap). In another example, the rule for altering the portion of the code may cause client device210to enlarge the portion of the code as much as possible to fit on a subsequent slide. In some implementations, the rules for formatting the subsequent slides may include a rule for altering outputs of the intermediate version of the code. For example, the rule for altering outputs of the intermediate version of the code may cause client device210to automatically size the outputs to fit in any portion of the subsequent slides (e.g., above text, below text, to the left of text, or to the right of text). In some implementations, the rules for formatting the subsequent slides may include a rule for altering text of the intermediate version of the code. For example, the rule for altering text of the intermediate version of the code may cause client device210to wrap the text, if needed, to fit outputs (e.g., images), code, or the like on a subsequent slide. In another example, the rule for altering text of the intermediate version of the code may cause client device210to limit a reduction in a size of the text (e.g., size to a particular font size so that the text may be read) and to break one slide into two slides if necessary to limit the reduction in size.

As further shown inFIG. 8, process800may include creating a presentation for the code or a portion of the code based on the analysis (block840). For example, client device210may automatically create a presentation for the code (or a portion of the code) based on the analysis of the intermediate version of the code. In some implementations, as described above in connection withFIG. 5A, client device210may analyze the intermediate version of the code (e.g., provided in intermediate code view515) based on rules for creating a presentation, and may automatically create a presentation for the code (or a portion of the code), based on the analysis of the intermediate version of the code. In some implementations, client device210may create a presentation that includes the slides depicted inFIGS. 5B-5F.

As further shown inFIG. 8, process800may include linking the presentation slides to appropriate portions of the code and displaying and/or storing the presentation (block850). For example, client device210may link the slides of the presentation to appropriate portions of the code. In some implementations, client device210may utilize a data structure for linking the slides of the presentation to the appropriate portions of the code. For example, the data structure may include a code field with entries that identify different lines of code and a slide field with entries that identify slides of the presentation that correspond to the entries provided in the code field.

In some implementations, client device210may provide the presentation for display and/or may store the presentation. In some implementations, client device210may store the presentation in a memory (e.g., main memory330and/or storage component340ofFIG. 3) associated with client device210. In some implementations, client device210may display the presentation in a user interface that includes the code and/or the intermediate version of the code. For example, the presentation may be provided in a first window (e.g., a presentation window) of TCE220, the code may be provided in a second window (e.g., a code window) of TCE220, and/or the intermediate version of the code may be provided in a third window (e.g., a publication window) of TCE220. In some implementations, client device210may export or convert the presentation into a format compatible with presentation software (e.g., PowerPoint®, CustomShow, Prezi®, SlideShark™, or the like).

As further shown inFIG. 8, process800may include receiving a modification to the code (block860). For example, client device210may receive a modification to the code. In some implementations, the modification to the code may include a modification to one or more lines of the code. In some implementations, client device210may receive the modification to the code via the presentation (e.g., via a presentation window containing the presentation and provided by TCE220). For example, a user may cause client device210to create or open the presentation window. One or more lines of the code may be modified via the presentation window. For example, in some implementations, client device210may receive a command, from the user, that indicates that a line of code is to be modified in the presentation window. Client device210may receive the command based on, for example, detecting a selection of a particular menu item, entry of a particular textual or audible input from the user, and/or entry of some other predetermined input that indicates a desire to modify a line of code in the presentation window.

In some implementations, client device210may receive the modification to the code via the intermediate version of the code (e.g., via a publication window containing the intermediate version of the code and provided by TCE220). For example, a user may cause client device210to create or open the publication window. One or more lines of the code may be modified via the publication window. For example, in some implementations, client device210may receive a command, from the user, that indicates that a line of code is to be modified in the publication window. Client device210may receive the command based on, for example, detecting a selection of a particular menu item, entry of a particular textual or audible input from the user, and/or entry of some other predetermined input that indicates a desire to modify a line of code in the publication window.

In some implementations, client device210may receive the modification to the code via a code window containing the code and provided by TCE220. For example, a user may cause client device210to create or open the code window. One or more lines of the code may be modified via the code window. For example, in some implementations, client device210may receive a command, from the user, that indicates that a line of code is to be modified in the code window. Client device210may receive the command based on, for example, detecting a selection of a particular menu item, entry of a particular textual or audible input from the user, and/or entry of some other predetermined input that indicates a desire to modify a line of code in the code window.

As further shown inFIG. 8, process800may include modifying the presentation for the code based on the modification to the code (block870). For example, client device210may modify the presentation for the code based on the modification to the code. In some implementations, client device210may modify title(s), text, formatting, code, output(s) provided on the slides of the presentation based on the modification to the code and/or the rules for creating a presentation (described above). For example, if the modification to the code changes an image output by the code, and provided in a slide of the presentation, client device210may provide the changed image in the slide of the presentation. In another example, if the modification to the code includes adding new lines of code, to particular code provided in a slide of the presentation, client device210may resize the particular code so that the particular code fits in the slide.

As further shown inFIG. 8, process800may include displaying and/or storing the modified presentation for the code (block880). For example, client device210may provide the modified presentation for display and/or may store the modified presentation. In some implementations, client device210may store the modified presentation in a memory (e.g., main memory330and/or storage component340ofFIG. 3) associated with client device210. In some implementations, client device210may display the modified presentation in a user interface that includes the code and/or the intermediate version of the code. For example, the modified presentation may be provided in a first window (e.g., a presentation window) of TCE220, the code may be provided in a second window (e.g., a code window) of TCE220, and/or the intermediate version of the code may be provided in a third window (e.g., a publication window) of TCE220. In some implementations, client device210may export or convert the modified presentation into a format compatible with presentation software.

AlthoughFIG. 8shows example blocks of process800, in some implementations, process800may include additional blocks, fewer blocks, different blocks, or differently arranged blocks than those depicted inFIG. 8. Additionally, or alternatively, two or more of the blocks of process800may be performed in parallel.

Systems and/or methods, described herein, may automatically generate a presentation based on code, and may enable the code to be executed and/or modified via the presentation. The systems and/or methods may utilize the code structure, annotations for the code, and/or other information associated with the code to create the presentation. The systems and/or methods may determine (e.g., based on the code) slide titles, bullets, animation, how to partition the code, or the like for the presentation. The presentation may be utilized for performing a code review or for presenting to an audience of people.

Code (sometimes referred to herein as program code) is to be broadly interpreted to include text-based code that may not require further processing to execute (e.g., C++ code, Hardware Description Language (HDL) code, very-high-speed integrated circuits (VHSIC) HDL (VHDL) code, Verilog code, Java code, another type of hardware and/or software based code that may be compiled and/or synthesized, or the like), binary code that may be executed (e.g., executable files that may be directly executed by an operating system, bitstream files that may be used to configure an FPGA, Java byte code, object files combined together with linker directives, source code, makefiles, or the like), text files that may be executed in conjunction with other executables (e.g., PYTHON™ text files, OCTAVE™ files, a collection of dynamic-link library (DLL) files with text-based combining, configuration information that connects pre-compiled modules, an extensible markup language (XML) file describing module linkage, or the like), source code (e.g., readable by a human), machine code (e.g., readable by a machine), or the like. In some implementations, code may include different combinations of the above-identified classes of code (e.g., text-based code, binary code, text files, source code, machine code, or the like). Additionally, or alternatively, code may include code generated using a dynamically-typed programming language (e.g., the M language, a MATLAB® language, a MATLAB-compatible language, a MATLAB-like language, or the like) that may be used to express problems and/or solutions using mathematical notations. Additionally, or alternatively, code may be of any type, such as a function, a script, an object, or the like.