Posts

Showing posts with the label silverlight

Updated Dynamic Languages in Silverlight Page

Silverlight is the Microsoft browser plugin that, amongst other things, allows you to run Python and Ruby in the browser with full access to the browser DOM. This is all through the magic of the Dynamic Language Runtime. With either Silverlight or Moonlight installed, the simplest DLR-based application can be contained in a single HTML file:     <script src="http://gestalt.ironruby.net/dlr-latest.js" type="text/javascript"> </script>     <script type="text/ruby"> window.alert "Ruby in the browser!" </script>     <script type="text/python"> window.Alert("Python works too!") </script> The introduction page on the silverlight.net site has now been updated. Dynamic Languages in Silverlight Writing Silverlight applications in Ruby, Python, and other DLR-based languages only requires a local web server, a text editor, and a browser which supports Silverlight on Windows or Mac OS ,...

Python in the Browser, IronPython in Visual Studio 2010 and Other PyCon Talks

PyCon 2010 was great fun, and included several talks on or including IronPython. Python in the Browser This is Jimmy Schementi's write-up of his talk on using Python in the Browser, with links to the video and slides: You, the Python developer, use Python because you want to, but in the browser you use JavaScript because you think you have to. With IronPython you can write browser code in Python. I’ll only begin to answer "what can the browser bring to Python?" and "what can Python bring to the browser?" in this short overview; examples will be very simple (with the exception of a few flashy ones) to make sure you can get started immediately. IronPython Tooling The video of Dino Veihland's talk on the new integration of IronPython with Visual Studio 2010. The integration, which works standalone with the Visual Studio extensibility shell or integrated into VS 2010, is alpha quality - but has lots of nice features for IronPython development. It includes...

A Good Mix 34: Silverlight Logging, WPF and NotifyIcon, more Python and Ruby and pickling Python books

Another collection of IronPython and DLR related articles from around the web. A fine way to end 2009. SLog: Silverlight Logging A nascent project to Port Log(4|5)J from Java to C# with the goal of usefulness in Silverlight, especially for IronPython. A WPF Picture Viewer NotifyIcon to use from IronPython  Two Japanese blog entries, both by sasakima-nao. As with previous entries the code examples are very readable. The first is a simple WPF picture viewer (nice penguins) and the second shows how to create a NotifyIcon and ContextMenu in the taskbar (with Windows Forms classes). Python-Ruby (and a little bit of soap) This blog entry is in Russian, but I think there are enough code examples for it to be useful for those of us who don't speak Russian. As I've mentioned before the promise of the Dynamic Language Runtime is that dynamic languages can interoperate and share libraries. This is exactly what this blog entry shows: using the Ruby soap/wsdlDriver from Python. ...

A Good Mix 33: Embedding Python and Ruby, Profiling IronPython, News on JScript, ctypes and DeviantArt

More IronPython and DLR related projects, articles and news from around the web. Embedded IronRuby and IronPython in Silverlight with Multiple Source Files A  nice example of embedding both IronPython and IronRuby in a single C# project. As an added bonus the project is a Silverlight project so you can add both Python and Ruby scripting to applications that run in the browser. slimtune: A free profiling and performance tuning tool for .NET applications IronPython 2.6 has useful new hooks for profiling and debugging IronPython code. Unfortunately most 'standard' .NET tools don't know how to use these, and if you attempt to profile IronPython code (particularly in an embedded environment) you have to work hard to get useful information about performance of your Python code. It's nice to see a new (and open source) tool that is designed to work with IronPython: SlimTune is a free profiler and performance analysis/tuning tool for .NET based applications, including C#...

PythonSilverScripting: Silverlight apps in the browser with Python

Tarn Barford is an Australian blogger and programmer who uses IronPython. He's created a Google App Engine site for experimenting with IronPython in the browser (through Silverlight). PythonSilverScripting: Scripting Python Silverlight Applications PythonSilverScripting lowers the barriers to building Silverlight applications so anyone from high school kids to seasoned programmers can have fun writing Silverlight applications in Python from within a browser! Below is a simple script that creates a Silverlight application, sets the background blue and adds a TextBlock element with the text "Hello World". He's also blogged about the new site, including his future plans for it: Creating Silverlight apps in the browser PythonSilverScripting is based on crazy idea I have that it should be possible to make Silverlight applications in Python on the web. No tools, no SDKs.. just a browser (and obviously the Silverlight browser plug-in). I've played around a bit w...

Gestalt 1.0 and the Gestalt Widget Pack

Gestalt is a project by Mix Online to use Silverlight and the Dynamic Language Runtime to allow you to script web pages with Python or Ruby instead of with Javascript. The Gestalt Project DLR.js is a library released by a collaborative effort between the Dynamic Language Runtime team and MIX Online Labs. This JavaScript library allows you to write Ruby, Python & XAML code in your (X)HTML pages. It enables you to build richer and more powerful web applications by marrying the benefits of expressive languages, modern compilers, AJAX & RIAs with the write » save » refresh development model of the web.  Gestalt has reached a significant milestone with the release of version 1.0 and a widget pack. It has matured to the point where you can do really crazy things like run Rails *in your browser*. Probably not specifically useful, but it shows what it is capable of: Introducing Gestalt 1.0 and the Gestalt Widget Pack A few months ago, we released Gestalt beta as a MIX Online ...

Cheminformatics Tutorial Using Python and Silverlight

Try Python is an online interactive Python tutorial using IronPython and Silverlight. The source code is available and open source and the tutorial material is written in a subset of the ReStructured Text markup. Noel Baoilleach has taken this a step further by creating his own version, including the Webel library library and a tutorial on using it with interactive examples. Cheminformatics Tutorial using Python and Silverlight Try Python with Cheminformatics Tutorial Recently I introduced Webel, a Python cheminformatics module that runs entirely on web services. One of the advantages of such a module is that it can be used in places where it is difficult to install a traditional cheminformatics toolkit. Like in your browser. After some little work, I present Try Python...with Cheminformatics. This adds Webel as well as a short tutorial that introduces many of its features. With a few more tutorials that cover SMILES, InChI and so on in more detail, this could be useful for t...

Databinding and WCF Services with IronPython 2.6

One of the important new features in IronPython 2.6 is the __clrtype__ metaclass.The __clrtype__ metaclass allows you to create a real .NET class that backs your Python classes. This is important because there are many .NET features that * require * a real .NET class: which includes databinding and implementing WCF services (Windows Communication Foundation). The problem with __clrtype__ is that it requires dealing with low level details; namely building the class yourself from IL bytecode. Harry Pierson and Shri Borde have been working on a library ( clrtype.py ) to make this simpler. Lukáš Čenovský has looked at this before but hit limitations with what clrtype made possible. In three new blog entries he demonstrates how to use __clrtype__ with databinding in WPF and Silverlight and to implement WCF services. INotifyPropertyChanged and databinding in IronPython WPF   INotifyPropertyChanged is important interface for building WPF or Silverlight applications using M-V-...

Embedding IronPython in Silverlight - Importing

Jimmy Schementi is the Microsoft program manager for the integration of dynamic languages (IronPython and IronRuby) and the Silverlight browser plugin. As well as dynamic languages, Silverlight applications can be written in .NET languages like C# and VB.NET - and these languages can embed IronPython. Although embedding IronPython in a C# Silverlight application is initially straightforward (although a bit more verbose than embedding using the normal .NET framework / Mono as the ScriptRuntime needs to be configured), it gets painful fast. This is especially true when the Python code you execute needs to import anything, which has basically been broken on Silverlight for quite some time. In his latest blog entry Jimmy looks at how embedding from Silverlight has got simpler recently, and also at fixing the import problems. Embedding IronPython in Silverlight - Importing I’ve heard plenty of times on the IronPython Mailing List that embedding IronPython in Silverlight is easy at fi...

A Good Mix 30: Visual Studio 2010, DevDays, Detecting 64 bit, Silverlight and Django

More IronPython and DLR related projects, articles and news from around the web. IronPython in Visual Studio 2010 Screenshot of syntax highlighting  Visual Studio 2010 doesn't come with IronPython support out of the box, but it does have extensive APIs for writing your own extensions. Jeff Hardy has taken up the challenge and has written a set of IronPython extensions for Visual Studio 2010 with syntax highlighting, regions etc. The project has binaries available : " Just double click the .vsix file to install. " StackOverflow DevDays Cambridge Review Diary of a schwag hag Cambridge Stack Overflow Dev Days At the end of October I attended the StackOverflow DevDays in Cambridge UK and spoke on Python and IronPython. I demonstrated .NET integration with IronPython by creating a simple Windows Forms application at the interactive interpreter. This was followed by going through Peter Norvig's Python Spell Checker as an example of concise Python code. Thanks to Ne...

Improvements to Try Python: File I/O

Try Python is an online Python tutorial that has an interactive interpreter running in the browser through the magic of Silverlight and IronPython. Try Python presents the Python tutorial, with executable code examples for you to try out. However, because Silverlight is a sandboxed browser plugin, with no access to the local filesystem, the parts of the tutorial that do file I/O didn't work. I've fixed that by reimplementing the file type (and swapping out the builtin file type and open function) in pure Python using local browser storage to store files. You can now create files from the interpreter and read them back in in exactly the same way you do in standard Python on the desktop. This pure Python implementation of file also has other potential uses, for example unit testing filesystem access. Testable file Type and File I/O in Try Python A few weeks ago I announced Try Python, a Python tutorial with interactive interpreter that runs in the browser using IronP...

Try Python: Interactive Python Tutorial with Silverlight (and rst2xaml)

Silverlight is the Microsoft browser plugin runs on the Mac and Windows and in Safari, IE and Firefox browsers. As an added bonus it also supports IronPython , making it an ideal tool to build an interactive Python tutorial with. Try Python is an open source project that takes the official Python tutorial and puts it alongside an interactive Python interpreter running in the browser. All of the code examples have a button to execute them in the interpreter, or you can just follow the tutorial trying out the examples yourself. Try Python: Interactive Python Tutorial in the Browser Try Python Page on the Silverlight.net Community Site Try Python Announcement with Screenshots Try Python Google Code Project Page with Source Repository The Mono team are working on an implementation of Silverlight for Linux called Moonlight . The version capable of running IronPython code is Moonlight 2, but unfortunately the preview release can't yet run Try Python. Hopefully that will be fixed...

Gestalt and Python and Ruby in HTML Script Tags

Gestalt is a project that uses Silverlight to allow the browser to be scripted with Python and Ruby in exactly the same way as you script it with Javascript - using the HTML <script> tag. Jimmy Schementi has been working on the dynamic languages Silverlight integration, as outlined in his back to just text paper. He has begun the work he describes there and it is almost feature complete. It is all publicly accessible in a github repository ( download zip-file ). You can see it in action in some great examples of what is possible with gestalt (very pretty) in the samples that Jimmy has ported over: Gestalt-port pretty demos Jimmy is also looking for feedback on the code: Python and Ruby in HTML script-tags If you find any bugs, please report them on MY FORK's Issues tab (I wanted to use GitHub's issue tracking a little ... eventually I'll move them over to CodePlex when it gets checked in): http://github.com/jschementi/ironruby/issues I'd like feedba...

A Good Mix 22: Win a book, Mandlebrot Performance, Double clicking in Silverlight and more...

Another collection of blog entries and articles related to IronPython and the Dynamic Language Runtime. Win a book on IronPython or F# Allan Juhl Petersen has a competition running until 29th September where you can win a book on IronPython (and a good book it is too ) or F#: I have created 7 questions, in different programming languages such as C#, F#, Ironpython, C++, Java and of course the well known and liked true or false . The questions are designed to give a number of points, where the maximum number of points given can be read in the text of the assignment. The rules are simple, the one with the highest score on points, will win. Points will be given for correctness and effort. An assignment might give 6 point, but if not entirely correct, it will be given some points for effort. The winner gets Office 2007 Student version and gets to choose between two books ? Foundations of F# or IronPython in Action - and the runner-up gets the one that the winner did not choose. Compa...

Dynamic Languages – Back to "Just Text" with Silverlight

Silverlight is the Microsoft cross platform browser plugin that lets you execute Python code (or Ruby) in the browser. When the dynamic languages integration was first announced one of the big advantages that was touted was that it was all " just text ". Like normal Python development your source files were just text files that you could edit, refresh the browser and then see the changes. When the final version of Silverlight 2 finally came out this had changed slightly. Naturally the source files are still just text but they have to be packaged in a zip file called a "xap" file. The xap contains the Python sources and assemblies and the Silverlight IronPython integration automatically executes the application once Silverlight has loaded the xap. The development process is still straightforward as a development server called Chiron will automatically package the xap file on the fly. You run this locally, and it runs fine under Mono on the Mac or on Linux if you are...

The Further Adventures of IronPython in Turkey

Ibrahim Kivanc is a Turkish blogger and programmer who has been having fun with IronPython and Silverlight. We've covered some of his exploits previously . He's created a new website to promote IronPython in Turkey, but it won't make much sense unless you can read Turkish. ironpythonntr.com Fortunately for those of us who can't read Turkish, Ibrahim is intending to translate his articles into English. He says: I'm in a progress with IronPython for a year. Last year I made presantitons with Microsoft Student Partner program and INETA program in Turkey about Ipy.In my blog I wrote more than 20 articles about IronPython in Turkish, most of them about IronPython with Silverlight working together in my blog . As soon as possible I will also translate my articles to English for foreign people. I translated AgDLR and Chiron in Turkish. Now many Turkish people easily develop Silverlight app with IronPython. This year I will make more presentation and promote IronPython in ...

A Good Mix 19: Reflection, the Silverlight Toolkit, Dynamic JSON, libraries, builds and more

A collection of blog entries and articles on IronPython and the Dynamic Language Runtime from the last few weeks. Speed Test: Reflection vs IronPython Randall Sutton was using reflection to apply rules to an object when he realised he could do it with IronPython, but he was worried about performance. He wrote a quick test to compare the performance and was surprised by the results. The first run was very expensive for IronPython, but from there on in IronPython was much faster than C#. Without expending any effort actually working it out, my guess is that because IronPython uses reflection so heavily it caches the reflection lookups - and it is this caching that is giving it the performance benefit. Reflection on .NET is not fast, by any stretch of the imagination, and improving the performance of reflection would make a big difference to speeding up DLR languages. The Silverlight Toolkit and the Dynamic Language Console The Silverlight Toolkit is an open source project by Microsoft ...

IronPython and Silverlight in Turkish

A Turkish blogger named Ibrahim Kivanc, a Microsoft student partner, has posted a series of blog entries showing off some really cool things with IronPython and Silverlight. Unfortunately (for me) the blog is in Turkish, but several of the entries have code to download. I'm listing the entries here in the order he posted them: IronPython Silverlight MultiScaleImage One of the coolest things about Silverlight is its deep zoom technology that allows web applications to zoom in and pan across large, multi-resolution images. This functionality is accessed through the MultiScaleImage class. This blog entry has XAML and IronPython code for using the MultiScaleImage from IronPython. Türkçe Chiron Chiron is the tool for developing Silverlight applications with dynamic languages. It is a server that packages apps on the fly and enables you to develop on your local filesystem: edit the Python, refresh the browser and see you changes immediately. IronPython Silverlight Animasyonlar (animati...

A Good Mix 18: Amazon S3, Professional IronPython, Silverlight Spy, Loading Data from CSV Files and Sharepoint

A collection of projects, articles and blog entries on IronPython from the last few weeks. Lit S3 Commander 1.0 Lits3 is " a library written in C# that provides comprehensive and straightforward access to Amazon S3 for .NET developers ". The commander is a command line interface to LitS3, written in IronPython by Atif Aziz , and it just had a 1.0 release. Professional IronPython by John Paul Meuller This is a book by John Wiley due out on 20th April 2010. I can't find any other references to it on the net other than this Amazon.co.uk page, but it's been up for a while. Paperback: 504 pages Publisher: John Wiley & Sons (20 April 2010) ISBN-10: 0470548592 ISBN-13: 978-0470548592 I've not crossed paths with John Paul Meuller in the IronPython community, but it seems he's written quite a few technical books . Silverlight Spy with DLR Integration Silverlight Spy is a tool for doing runtime inspection of Silverlight applications: "Use the built...

Scripting the browser with Python - Gestalt

Gestalt is a new project by Microsoft MIX labs that uses Silverlight to allow you to use Python and Ruby to script the browser in the same way that you use Javascript. It is open source and has a home on codeplex: Gestalt codeplex site Gestalt.js is a library released by MIX Online Labs that allows you to write Ruby, Python & XAML code in your (X)HTML pages. It enables you to build richer and more powerful web applications by marrying the benefits of expressive languages, modern compilers, AJAX & RIAs with the write » save » refresh development model of the web. Gestalt is a way of building more powerful web applications without changing the way you work. Learn more Gestalt is built on IronRuby and IronPython for Silverlight This CodePlex project makes available the sample and source code for Gestalt. Gestalt is still young but Steve Gilham has been trying out the beta: Gestalt -- first experiences The Python-in-the-page concept for Mix's Gestalt is great -- but as a beta...