Simple Guide to Ironpython GUI Creation and Debugging

Total Page:16

File Type:pdf, Size:1020Kb

Simple Guide to Ironpython GUI Creation and Debugging Simple Guide to IronPython GUI Creation and Debugging 1 © 2011 ANSYS, Inc. September 8, 2020 Outline – IronPython GUI Creation and Debugging Simple GUI Creation Example project showing creation of a basic GUI to perform an action in HFSS Debugging Troubleshooting scripts using Microsoft Visual Studio Shell 2 © 2011 ANSYS, Inc. September 8, 2020 IronPython Graphical User Interfaces A major advantage of IronPython is the ability to create modern GUI elements Scripts created can now be more intuitive and interactive to common users Creating a GUI can be simplified through the use of an Integrated Development Environment (IDE) This will serve as a simple guide to creating GUI for IronPython 3 © 2011 ANSYS, Inc. September 8, 2020 SharpDevelop IDE for GUI Creation Free open-source IDE for development on Microsoft’s .NET platform Download at - http://www.icsharpcode.net/opensource/sd/download/ SharpDevlop is an easy to use IDE that we will use only for the design and automatic code generation of simple graphical user interfaces Although this can be used for debugging, I would recommend using Visual Studio as discussed in the debugging section of this document 4 © 2011 ANSYS, Inc. September 8, 2020 Example Project We will create a simple GUI that takes a single text input from a user and based on this input, draws a box in HFSS 5 © 2011 ANSYS, Inc. September 8, 2020 Creating a New Solution Open SharpDevelop 4.1 and create a New Solution Choose: Categories → Python Templates → Windows Application Set name and location 6 © 2011 ANSYS, Inc. September 8, 2020 Blank Project Toggle between source code and form design 7 © 2011 ANSYS, Inc. September 8, 2020 Create GUI Properties Drag tools onto form to create GUI Highlight objects to view and modify properties 8 © 2011 ANSYS, Inc. September 8, 2020 Changing Properties Highlight the Label Object in the GUI Designer The properties will now be displayed in the Properties Windows Change the Text Property of lable1 to Box Size Notice the Name of this object is still referred to as label1, this is how the object will be referenced in the code, likely this should be changed to have a more meaningful name but for this example it will be left as default Change Text Property of Button1 to Draw Box Change Text Property of textBox1 to 1, this will be the default value entered into the text box The GUI should now appear as it is shown here 9 © 2011 ANSYS, Inc. September 8, 2020 Automatically Generated Code Press “Play” button to preview GUI Toggle between GUI designer and source code with tabs at bottom of window You can see the code that was automatically generated, reflecting the properties of each button, text box and label 10 © 2011 ANSYS, Inc. September 8, 2020 Create Event for Button Click Select Events Icon in Properties window while button1 is selected In form designer, double click on button to insert code for click event Function Code Generated by double clicking on button1 Action of Clicking button will call the function Button1Click 11 © 2011 ANSYS, Inc. September 8, 2020 Save code for Completed GUI Code for GUI is now completed The MainForm.py code can be copied and pasted into new .py file or File→Save As… If Save As is used, there is no need to save a resource file for the simple GUI, so press cancel when prompted For this example save file as GUI_Tutorial.py, we will use this file later to add functionality and make this GUI perform an action in HFSS We also have the option to write the additional code directly in SharpDevelop but I prefer to use either Visual Studio or a text editor 12 © 2011 ANSYS, Inc. September 8, 2020 Add Operations to Button Click Function • Function automatically generated in SharpDevelop does not do anything Button click will result in nothing happening • Lets add a simple function so that when the script is launched from within HFSS HFSS will display the GUI Read the value entered into the text box Draw a box in HFSS based on the text box entry when the button is pressed 13 © 2011 ANSYS, Inc. September 8, 2020 Edit Script Open script file saved from SharpDevelop, GUI_Tutorial.py Any text editor will work, but be mindful of how tabs and whitespaces are treated in different text editors. IronPython requires consistent indentation I use Visual Studio 2010 as an editor, just go to menu File → Open → File We need to add a few additional lines that were left out when the GUI_Tutorial.py file was saved from SharpDevelop 14 © 2011 ANSYS, Inc. September 8, 2020 Modify Code Code copied or saved from SharpDevelop will be missing two sections of code from the start and end of the .py file SharpDevelop creates 2 .py files for each project, a Program.py and Mainform.py, when we did a Save As we only saved the MainForm.py and did not include some code included Program.py. We must add this code to run our GUI from the single file that we saved. After GUI is created we will no longer be using SharpDevelop Add this code to the very start of GUI_Tutorial.py code (remove any indentation when copied and pasted) import clr clr.AddReference("System.Drawing") clr.AddReference("System.Windows.Forms") And this to the very end (remove any indentation when copied and pasted) Application.EnableVisualStyles() form = MainForm() Application.Run(form) The GUI will now launch if the GUI_Tutorial code is run from within HFSS 15 © 2011 ANSYS, Inc. September 8, 2020 Edit Script Under the Button1Click function We will enter code to draw a box Notice the Xsize, Ysize and Zsize have value of textBox1.Text with the “mm” string concatenated. When Button1 is clicked, the script will get the current active project and design and draw a box with the size specified in textbox1. 16 © 2011 ANSYS, Inc. September 8, 2020 Button 1 Copy and Paste Text for the function is placed here for your convenience to copy and paste into GUI_Tutorial.py under the function Button1Click. Make sure to correctly indent the pasted code to match what is shown on previous slide oProject = oDesktop.GetActiveProject() oDesign = oProject.GetActiveDesign() oEditor = oDesign.SetActiveEditor("3D Modeler") oEditor.CreateBox( { "NAME" : "BoxParameters", "XPosition": "0mm", "YPosition": "0mm", "ZPosition": "0mm", "Xsize": self._textBox1.Text + "mm", "Ysize": self._textBox1.Text + "mm", "Zsize": self._textBox1.Text + "mm" }, { "NAME": "Attributes", "Name": "Box1", "Flags": "", "Color": "(132 132 193)", "Transparency": 0, "PartCoordinateSystem": "Global", "UDMId": "", "MaterialValue" : "\"vacuum\"", "SolveInside": True } ) 17 © 2011 ANSYS, Inc. September 8, 2020 Translation of VBscript Command to IronPython Vbscript can easily be converted to IronPython The Vbscript command Set oProject = oDesktop.GetActiveProject() Would be changed to oProject = oDesktop.GetActiveProject() in IronPython Change Array( to [ and close with a ] instead of the ) Remove the line continuation symbols Change named arrays from "NAME:BoxParameters", to "NAME" : "BoxParameters", *See Desktop Scripting with IronPython by Vamsidhar Juvvigunta for more complete guide 18 © 2011 ANSYS, Inc. September 8, 2020 Create Box: IronPython vs. VBscript Commands Alternative dictionary syntax IronPython VBscript oEditor.CreateBox( oEditor.CreateBox Array("NAME:BoxParameters", _ { "XPosition:=", “0mm", "YPosition:=", _ "NAME" : "BoxParameters", “0mm", "ZPosition:=", "0mm", "XSize:=", “1mm", _ "XPosition" : "0mm", "YSize:=", “1mm", "ZSize:=", _ "YPosition" : "0mm", “1mm"), Array("NAME:Attributes", "Name:=", "Box1",_ "ZPosition" : "0mm", "Flags:=", "", "Color:=", _ "Xsize" : "1mm", "(132 132 193)", "Transparency:=", 0, _ "Ysize" : "1mm", "PartCoordinateSystem:=", _ "Zsize" : "1mm" "Global", "UDMId:=", "", "MaterialValue:=", "" & Chr(34) }, & "vacuum“ _ { & Chr(34) & "", "SolveInside:=", _ "NAME" : "Attributes", true) "Name" : "Box1", "Flags" : "", "Color" : "(132 132 193)", "Transparency" : 0, "PartCoordinateSystem": "Global", "UDMId" : "", "MaterialValue" : "\"vacuum\"", "SolveInside" : True } ) 19 © 2011 ANSYS, Inc. September 8, 2020 Running Script Open HFSS v14 Insert a blank project with a blank HFSS design In HFSS, menu Tools → Run Script Set File type to IronPython Script Files and browse and open to .py file saved 20 © 2011 ANSYS, Inc. September 8, 2020 Adding Script as an External Tool Creating an external tool for a script will eliminate the need to browse and find a script when it needs to be ran, instead it is located under the tool menu To Add an External Tool - Tools → External Tools… Enter GUI Tutorial under Menu Text: Enter path to GUI_Tutorial.py in the Command line Select Add 21 © 2011 ANSYS, Inc. September 8, 2020 Debugging IronPython For debugging I would recommend to use the Python Tools for Visual Studio 2010 and Microsoft Visual Studio 2010 Shell. Both tools can be freely downloaded http://pytools.codeplex.com/ http://www.microsoft.com/download/en/details.aspx?id=115 With these tools installed, you are ready to start debugging 22 © 2011 ANSYS, Inc. September 8, 2020 Steps to Debugging Set Environment Variable ANSOFT_SCRIPT_DEBUG = 1 Insert Breakpoint _ipybreak() Run script and attach the debugger Tools → Run Script, Debug 23 © 2011 ANSYS, Inc. September 8, 2020 Set Environment Variable • In order to debug a script triggered by a breakpoint you must set an environment variable • ANSOFT_SCRIPT_DEBUG = 1 24 © 2011 ANSYS, Inc. September 8, 2020 Insert BreakPoint • To start debugging, a breakpoint must be inserted into the script to trigger the debugger • If the script is being run from within the HFSS desktop, add the line _ipybreak() to your script at the point you wish to start debugging 25 © 2011 ANSYS, Inc. September 8, 2020 Run script and attach the debugger • From within HFSS, launch the script you wish to debug – Tools → Run Script • The user-defined breakpoint will trigger the message and give the option to Debug the script • Select Microsoft Visual Studio 2010 from the list of possible debuggers and select Yes to begin debugging – If this window does not appear, you may need to first launch Visual Studio and attach to process (hfss.exe) before hitting the Debug button 26 © 2011 ANSYS, Inc.
Recommended publications
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • Q# Introduction
    Introduction to Q# Q# (Q-sharp) is a domain-specific and open-sourced programming language, part of Microsoft's Quantum Development Kit (QDK), used for expressing quantum algorithms. It is to be used for writing subroutines that execute on an adjunct quantum processing unit (QPU), under the control of a classical host program and computer. Q# can be installed on Windows 10, OSX and Linux. The instructions to install Q# can be found in the online documentation here. If you prefer not to install Q# on your local computer, you can use one of the machines in CSE’s Virtual Lab found here. The Windows 10 machines already have .Net Core SDK, Visual Studio and VS Code installed to get your started, you should still install the Q# extension to get syntax- highlighting, code complete, etc. To get help with Q# and the QDK, feel free to ask questions on our messages board, come to office hours as posted on the calendar, or ask in stackoverflow. The Q# team is constantly monitoring any questions posted there with the "q#" tag. Writing Q# programs. Operations and functions are the basic unit of execution in Q#. They are roughly equivalent to a function in C or C++ or Python, or a static method in C# or Java. A Q# operation is a quantum subroutine. That is, it is a callable routine that contains quantum operations. A Q# function is a classical subroutine used within a quantum algorithm. It may contain classical code but no quantum operations. Specifically, functions may not allocate or borrow qubits, nor may they call operations.
    [Show full text]
  • Working with Ironpython and WPF
    Working with IronPython and WPF Douglas Blank Bryn Mawr College Programming Paradigms Spring 2010 With thanks to: http://www.ironpython.info/ http://devhawk.net/ IronPython Demo with WPF >>> import clr >>> clr.AddReference("PresentationFramework") >>> from System.Windows import * >>> window = Window() >>> window.Title = "Hello" >>> window.Show() >>> button = Controls.Button() >>> button.Content = "Push Me" >>> panel = Controls.StackPanel() >>> window.Content = panel >>> panel.Children.Add(button) 0 >>> app = System.Windows.Application() >>> app.Run(window) XAML Example: Main.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestApp" Width="640" Height="480"> <StackPanel> <Label>Iron Python and WPF</Label> <ListBox Grid.Column="0" x:Name="listbox1" > <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Path=title}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Window> IronPython + XAML import sys if 'win' in sys.platform: import pythoncom pythoncom.CoInitialize() import clr clr.AddReference("System.Xml") clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System.IO import StringReader from System.Xml import XmlReader from System.Windows.Markup import XamlReader, XamlWriter from System.Windows import Window, Application xaml = """<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="XamlReader Example" Width="300" Height="200"> <StackPanel Margin="5"> <Button
    [Show full text]
  • Visual Studio 2010 Tools for Sharepoint Development
    Visual Studio 2010 for SharePoint Open XML and Content Controls COLUMNS Toolbox Visual Studio 2010 Tools for User Interfaces, Podcasts, Object-Relational Mappings SharePoint Development and More Steve Fox page 44 Scott Mitchell page 9 CLR Inside Out Profi ling the .NET Garbage- Collected Heap Subramanian Ramaswamy & Vance Morrison page 13 Event Tracing Event Tracing for Windows Basic Instincts Collection and Array Initializers in Visual Basic 2010 Generating Documents from SharePoint Using Open XML Adrian Spotty Bowles page 20 Content Controls Data Points Eric White page 52 Data Validation with Silverlight 3 and the DataForm John Papa page 30 Cutting Edge Data Binding in ASP.NET AJAX 4.0 Dino Esposito page 36 Patterns in Practice Functional Programming Core Instrumentation Events in Windows 7, Part 2 for Everyday .NET Developers MSDN Magazine Dr. Insung Park & Alex Bendetov page 60 Jeremy Miller page 68 Service Station Building RESTful Clients THIS MONTH at msdn.microsoft.com/magazine: Jon Flanders page 76 CONTRACT-FIRST WEB SERVICES: Schema-Based Development Foundations with Windows Communication Foundation Routers in the Service Bus Christian Weyer & Buddihke de Silva Juval Lowy page 82 TEST RUN: Partial Anitrandom String Testing Concurrent Affairs James McCaffrey Four Ways to Use the Concurrency TEAM SYSTEM: Customizing Work Items Runtime in Your C++ Projects Rick Molloy page 90 OCTOBER Brian A. Randell USABILITY IN PRACTICE: Getting Inside Your Users’ Heads 2009 Charles B. Kreitzberg & Ambrose Little Vol 24 No 10 Vol OCTOBER 2009 VOL 24 NO 10 OCTOBER 2009 VOLUME 24 NUMBER 10 LUCINDA ROWLEY Director EDITORIAL: [email protected] HOWARD DIERKING Editor-in-Chief WEB SITE MICHAEL RICHTER Webmaster CONTRIBUTING EDITORS Don Box, Keith Brown, Dino Esposito, Juval Lowy, Dr.
    [Show full text]
  • Pyrevit Documentation Release 4.7.0-Beta
    pyRevit Documentation Release 4.7.0-beta eirannejad May 15, 2019 Getting Started 1 How To Use This Documents3 2 Create Your First Command5 3 Anatomy of a pyRevit Script 7 3.1 Script Metadata Variables........................................7 3.2 pyrevit.script Module...........................................9 3.3 Appendix A: Builtin Parameters Provided by pyRevit Engine..................... 12 3.4 Appendix B: System Category Names.................................. 13 4 Effective Output/Input 19 4.1 Clickable Element Links......................................... 19 4.2 Tables................................................... 20 4.3 Code Output............................................... 21 4.4 Progress bars............................................... 21 4.5 Standard Prompts............................................. 22 4.6 Standard Dialogs............................................. 26 4.7 Base Forms................................................ 35 4.8 Graphs.................................................. 37 5 Keyboard Shortcuts 45 5.1 Shift-Click: Alternate/Config Script................................... 45 5.2 Ctrl-Click: Debug Mode......................................... 45 5.3 Alt-Click: Show Script file in Explorer................................. 46 5.4 Ctrl-Shift-Alt-Click: Reload Engine................................... 46 5.5 Shift-Win-Click: pyRevit Button Context Menu............................. 46 6 Extensions and Commmands 47 6.1 Why do I need an Extension....................................... 47 6.2 Extensions...............................................
    [Show full text]
  • 2009 Door County Folk Festival Syllabus.Pdf
    30th Annual Door County Folk Festival Get Your Foot in the Door! Wednesday – Sunday, July 8 – 12, 2009 Sister Bay, Ephraim and Baileys Harbor, Wisconsin http://www.dcff.net/[email protected]/(773-463-2288) DCFF Home Dance Syllabus Advance Regular Discount Price On Paper $19.00 $22.00 OnCD $8.00 $11.00 2009 Door County Folk Festival (DCFF), Wisconsin 2009 Door County Folk Festival Schedule v11 (Subject to Change - Changes Marked with +) Get Your Foot in the Door! Wednesday - Sunday, July 8-12, 2009 - Sister Bay, Ephraim and Baileys Harbor, Wisconsin DCFF Home Phone: (773)-463-2288 or (773)-634-9381 [email protected] Wednesday Start End Where Event Who Afternoon 12:00pm SBVH Staff Arrives Staff & Volunteers 1:00pm SBVH Setup Begins Staff & Volunteers Evening 6:00pm SBVH Registration Begins Staff & Volunteers 6:30pm 9:00pm BHTH TCE Program - Session 1 - Grades K-5 Sanna Longden 8:00pm 1:00am SBVH 8th of July Party with Recorded Music Forrest Johnson & Other Regional Leaders 1:00am 2:30am SBVH Late Night Party Paul Collins & Company Thursday Start End Where Event Who Morning 9:00am SBVH Setup & Registration Continues Staff & Volunteers 9:00am 12:00pm BHTH TCE Program - Session 2 - Grades K-5 Sanna Longden 10:00am 11:45am SBVH Vintage American Round Dances Paul Collins Afternoon 11:45am 1:15pm Lunch Break 12:00pm 1:00pm SBVH Zumba Latin Dance Workout Session Diane Garvey 1:15pm 3:00pm SBVH Swing Dance - Lindy Hop Workshop Maureen Majeski: Lindy Hop 1:15pm 3:00pm BHTH Regional Greek Folk Dance Workshop Rick King, Dit Olshan, Paul Collins Rick: Vlaha
    [Show full text]
  • Mixed-Signal and Dsp Design Techniques
    MIXED-SIGNAL AND DSP DESIGN TECHNIQUES INTRODUCTION SECTION 1 SAMPLED DATA SYSTEMS SECTION 2 ADCs FOR DSP APPLICATIONS SECTION 3 DACs FOR DSP APPLICATIONS SECTION 4 FAST FOURIER TRANSFORMS SECTION 5 DIGITAL FILTERS SECTION 6 DSP HARDWARE SECTION 7 INTERFACING TO DSPs SECTION 8 DSP APPLICATIONS SECTION 9 HARDWARE DESIGN SECTION 10 TECHNIQUES INDEX ANALOG DEVICES TECHNICAL REFERENCE BOOKS PUBLISHED BY PRENTICE HALL Analog-Digital Conversion Handbook Digital Signal Processing Applications Using the ADSP-2100 Family (Volume 1:1992, Volume 2:1994) Digital Signal Processing in VLSI DSP Laboratory Experiments Using the ADSP-2101 ADSP-2100 Family User's Manual PUBLISHED BY ANALOG DEVICES Practical Design Techniques for Sensor Signal Conditioning Practical Design Techniques for Power and Thermal Management High Speed Design Techniques Practical Analog Design Techniques Linear Design Seminar ADSP-21000 Family Applications Handbook System Applications Guide Amplifier Applications Guide Nonlinear Circuits Handbook Transducer Interfacing Handbook Synchro & Resolver Conversion THE BEST OF Analog Dialogue, 1967-1991 HOW TO GET INFORMATION FROM ANALOG DEVICES Analog Devices publishes data sheets and a host of other technical literature supporting our products and technologies. Follow the instructions below for worldwide access to this information. FOR DATA SHEETS U.S.A. and Canada I Fax Retrieval. Telephone number 800-446-6212. Call this number and use a faxcode corresponding to the data sheet of your choice for a fax-on-demand through our automated AnalogFax™ system. Data sheets are available 7 days a week, 24 hours a day. Product/faxcode cross reference listings are available by calling the above number and following the prompts.
    [Show full text]
  • Developers Toolkit Quickstart Guide
    Developers Toolkit QuickStart Guide Generic steps for all projects: Create a new project Import the Kratos_3.dll .NET assembly The Newtonsoft.Json.dll is also required Refer to the sample projects for the following steps Create a FactSetOnDemand object from the Kratos_3.RunTimePlatform namespace Set-up configuration data Create FactSet calls to retrieve data .NET Languages .NET language (C++/CLI, C#, Visual Basic, Java) Example Open Visual Studio Create a new project of the appropriate language type Add a reference to the Kratos_3 dll Configure the build to the appropriate architecture (x86 if using the 32-bit dll or x64 if using the 64-bit dll) Create a new code file (Refer to the sample projects for the following steps) Import the Kratos_3.RunTimePlatform namespace Create a FactSetOnDemand object Set-up configuration data Create FactSet calls to retrieve data IronPython For IronPython Put the Kratos_3.dll NET assembly somewhere your program will be able to reference it. Make sure your dll architecture matches your IronPython architecture. If you installed the 32-bit IronPython, use the x86 Kratos_3 dll. If you installed the 64-bit version of IronPython, use the x64 dll. Make a new Python file Import the clr module. (The steps below can be viewed in the IronPython sample program) Use the clr reference to load the Kratos_3 dll Import the Kratos_#.RunTimePlatform namespace Create a FactSetOnDemand object Set-up the configuration data Create FactSet calls to retrieve data To run an IronPython project Open the windows command console (not the IronPython console) Type: “ipy <path to python program>” FactSet Research Systems Inc.
    [Show full text]
  • Programming with Windows Forms
    A P P E N D I X A ■ ■ ■ Programming with Windows Forms Since the release of the .NET platform (circa 2001), the base class libraries have included a particular API named Windows Forms, represented primarily by the System.Windows.Forms.dll assembly. The Windows Forms toolkit provides the types necessary to build desktop graphical user interfaces (GUIs), create custom controls, manage resources (e.g., string tables and icons), and perform other desktop- centric programming tasks. In addition, a separate API named GDI+ (represented by the System.Drawing.dll assembly) provides additional types that allow programmers to generate 2D graphics, interact with networked printers, and manipulate image data. The Windows Forms (and GDI+) APIs remain alive and well within the .NET 4.0 platform, and they will exist within the base class library for quite some time (arguably forever). However, Microsoft has shipped a brand new GUI toolkit called Windows Presentation Foundation (WPF) since the release of .NET 3.0. As you saw in Chapters 27-31, WPF provides a massive amount of horsepower that you can use to build bleeding-edge user interfaces, and it has become the preferred desktop API for today’s .NET graphical user interfaces. The point of this appendix, however, is to provide a tour of the traditional Windows Forms API. One reason it is helpful to understand the original programming model: you can find many existing Windows Forms applications out there that will need to be maintained for some time to come. Also, many desktop GUIs simply might not require the horsepower offered by WPF.
    [Show full text]
  • Dipartimento Di Informatica E Scienze Dell'informazione
    Dipartimento di Informatica e • • Scienze dell'Informazione ••• • High performance implementation of Python for CLI/.NET with JIT compiler generation for dynamic languages. by Antonio Cuni Theses Series DISI-TH-2010-05 DISI, Universit`adi Genova v. Dodecaneso 35, 16146 Genova, Italy http://www.disi.unige.it/ Universit`adegli Studi di Genova Dipartimento di Informatica e Scienze dell'Informazione Dottorato di Ricerca in Informatica Ph.D. Thesis in Computer Science High performance implementation of Python for CLI/.NET with JIT compiler generation for dynamic languages. by Antonio Cuni July, 2010 Dottorato di Ricerca in Informatica Dipartimento di Informatica e Scienze dell'Informazione Universit`adegli Studi di Genova DISI, Univ. di Genova via Dodecaneso 35 I-16146 Genova, Italy http://www.disi.unige.it/ Ph.D. Thesis in Computer Science (S.S.D. INF/01) Submitted by Antonio Cuni DISI, Univ. di Genova [email protected] Date of submission: July 2010 Title: High performance implementation of Python for CLI/.NET with JIT compiler generator for dynamic languages. Advisor: Davide Ancona DISI, Univ. di Genova [email protected] Ext. Reviewers: Michael Leuschel STUPS Group, University of D¨usseldorf [email protected] Martin von L¨owis Hasso-Plattner-Institut [email protected] Abstract Python is a highly flexible and open source scripting language which has significantly grown in popularity in the last few years. However, all the existing implementations prevent programmers from developing very efficient code. This thesis describes a new and more efficient implementation of the language, obtained by developing new techniques and adapting old ones which have not yet been applied to Python.
    [Show full text]
  • NET Hacking & In-Memory Malware
    .NET Hacking & In-Memory Malware Shawn Edwards Shawn Edwards Cyber Adversarial Engineer The MITRE Corporation Hacker Maker Learner Take stuff apart. Change it. Put Motivated by an incessant Devoted to a continuous effort it back together. desire to create and craft. of learning and sharing knowledge. Red teamer. Adversary Numerous personal and emulator. professional projects. B.S. in Computer Science. Adversary Emulation @ MITRE • Red teaming, but specific threat actors • Use open-source knowledge of their TTPs to emulate their behavior and operations • Ensures techniques are accurate to real world • ATT&CK (Adversarial Tactics Techniques and Common Knowledge) • Public wiki of real-world adversary TTPs, software, and groups • CALDERA • Modular Automated Adversary Emulation framework Adversary Emulation @ MITRE • ATT&CK • Adversarial Tactics Techniques and Common Knowledge • Public wiki of real-world adversary TTPs, software, and groups • Lets blue team and red team speak in the same language • CALDERA • Modular Automated Adversary Emulation framework • Adversary Mode: • AI-driven “red team in a box” • Atomic Mode: • Define Adversaries, give them abilities, run operations. Customize everything at will. In-Memory Malware • Is not new • Process Injection has been around for a long time • Typically thought of as advanced tradecraft; not really • Surged in popularity recently • Made easier by open-source or commercial red team tools • For this talk, only discuss Windows malware • When relevant, will include the ATT&CK Technique ID In-Memory
    [Show full text]
  • NET Framework
    .NET Framework #.net 1 1: .NET Framework 2 2 2 . 2 Compact Framework 2 3 Examples 3 C # Hello World 3 Visual Basic .NET Hello World 3 Hello World in F # 4 C ++ / CLI Hello World 4 PowerShell Hello World 4 Nemerle 4 Oxygene 4 Boo Hello World 5 Hello World in Python (IronPython) 5 IL 5 2: .NET 6 6 6 Examples 6 6 3: .NET JSON Newtonsoft.Json 7 7 Examples 7 JSON 7 JSON . 7 4: ADO.NET 8 8 8 Examples 8 SQL 8 - SQL 8 ADO.NET 9 . 10 5: ASP.NET ASP.NET MVC 11 11 Examples 11 11 6: C # SHA1 13 13 Examples 13 # SHA1 13 7: C # SHA1 14 14 Examples 14 # SHA1 14 # 14 8: CLR 15 Examples 15 15 9: DateTime 16 Examples 16 ParseExact 16 TryParse 17 TryParseExact 18 10: HTTP 19 Examples 19 HTTP (HttpListener) 19 HTTP (ASP.NET ) 21 11: HTTP 23 23 Examples 23 System.Net.HttpWebRequest GET 23 System.Net.WebClient GET 23 System.Net.HttpClient GET 24 System.Net.HttpWebRequest POST 24 System.Net.WebClient POST 24 System.Net.HttpClient POST 25 System.Net.Http.HttpClient HTTP 25 12: JIT 27 27 27 Examples 27 27 13: JSON 30 30 Examples 30 System.Web.Script.Serialization.JavaScriptSerializer 30 Json.NET 30 Json.NET 30 - Newtonsoft.Json 31 31 JsonSerializerSettings Json.NET 32 14: LINQ 33 33 33 39 39 ToArray() ToList() ? 39 Examples 39 () 40 () 40 40 OrderByDescending 40 41 41 41 41 () 41 42 42 LastOrDefault 42 SingleOrDefault 42 FirstOrDefault 43 43 44 SelectMany () 44 45 45 45 SequenceEqual 45 46 OfType 46 46 46 46 47 47 GroupBy 47 ToDictionary 48 49 ToArray 49 ToList 49 49 49 ElementAtOrDefault 50 SkipWhile 50 TakeWhile 50 DefaultIfEmpty 50 () 51 51 52 53 54 54 54 55 55 55 15: NuGet 57 57 Examples 57 NuGet 57 UI 58 58 58 59 59 59 (MyGet, Klondike ) 59 UI () Nuget 59 61 16: ReadOnlyCollections 62 62 ReadOnlyCollections ImmutableCollection 62 Examples 62 ReadOnlyCollection 62 62 LINQ 62 62 ReadOnlyCollection 62 : ReadOnlyCollection .
    [Show full text]