The book of inspiration

October 28, 2009

C# to HLSL

Filed under: tech — Tags: , — zproxy @ 8:55 am

Jim has found a C# to HLSL compiler. Do you still think code is not data? :)

ThumbBl thumbB = new ThumbBl(canvas) {
  Background = Brushes.Blue, LeftTop = new PointBl(0,0), CanDrag = true
};
label.Effect.Custom = (input, uv) => {
  /*L1*/ PointBl p = label.RenderTransform.Inverse.
   Transform(thumbB.CenterPosition - label.LeftTop);
  /*L2*/ PointBl q = uv * label.Size;
  /*L3*/ DoubleBl d = (p - q).Length;
  /*L4*/ d = 1 - (d / 500).Min(1);
  /*L5*/ ColorBl clr = (d).Lerp(Colors.Black, Colors.Blue);
  /*L6*/ return ColorBl.FromScRgb
    ((input[uv].ScA).Min((1 - (d * d)).Max(.4)), clr.ScRGB);
};

October 22, 2009

‘MS.Win32.Penimc.UnsafeNativeMethods’ threw an exception

Filed under: tech — Tags: , , — zproxy @ 11:30 am

Yesterday I installed Visual Studio 2010 beta 2. All good.

Today I tried to run a WPF application. Crash!

Unhandled Exception: System.TypeInitializationException: The type initializer for ‘MS.Win32.Penimc.UnsafeNativeMethods’ threw an exception. —> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {14D4CBD9-7490-4F25-BAA6-1C5E22F6B1E3} failed due to the fo
llowing error: 80040154.
at MS.Win32.Penimc.UnsafeNativeMethods..cctor()


I needed to consult google to learn how to actually file a bug to microsoft. Oh and connect site does NOT work with Google Chrome.

Update: After a few days I created this forum thread.

This is by no means the first issue I have encountered with WPF. Previously I have seen WPF to become unresponsive just like the rendered is not there. I had to reboot to overcome that.

WPF is great, but it kind of fails once too much!

Update: Notified Jason about the issue.

Update: The fix looks like this at the time:

C:\Windows\Microsoft.NET\Framework\v3.0\WPF>regsvr32 PenIMC.dll

October 1, 2009

jsc is awesome

Filed under: jsc — Tags: , , , , , — zproxy @ 7:40 am

Now that I got your attention:

There is a new release for jsc with two new screencasts. This time around you are able to omit [Script] attribute and ditch the tools/build.bat. The jsc solution now includes  the jsc.meta compiler which will talk to the other compilers for you.

I am also experimenting with pre compilers. For example the Forms example makes use of TextualUserControl and TextComponent. Without getting too technical they generate a new assembly and add the reference to your csproj file. This opens up some really interesting possibilities. I will talk more about this in future posts.

Future pre compilers in jsc solution could include automatic stub generators for java jar files and for flash swf and swc files.

Open javascript version.

Open actionscript version.

Open javascript version.

Open java version:

demobutton.png

PS. Video parameters “&w=800&fmt=18″

January 7, 2009

InteractiveOrdering via Avalon

Filed under: jsc — Tags: , , , — zproxy @ 8:25 am

Today I released another example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell.

In this application you are being aided in a comparison process and as a result you will get a preference list.

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript version Via Coral Cache

Othe r posts in this series:

  1. WPF subset powered by Flash and DHTML
  2. WPF subset powered by Flash and DHTML Part 2
  3. AvalonExampleGallery

November 5, 2008

Avalon FreeCell

Filed under: jsc — Tags: , , , , , , , , , , — zproxy @ 7:41 pm

The next game powered by jsc has been released. This game works on .net, on javascript and on flash player.

The game is also available at Newgrounds over here and at WidgetBox.

Use Internet Explorer to open the Windows Presentation Foundation (XBAP) version.

Use Internet Explorer or Safari to open the JavaScript version.

The sourcecode is at google code.

October 26, 2008

AvalonExampleGallery Carousel

Filed under: jsc — Tags: , , , , , — zproxy @ 4:34 pm

AvalonGalleryExample project demonstrates how jsc compiler can be used in software development.

The entire project was written in c# and here are it’s versions for the web:

PHP + JavaScript Version – renders a static view for the user and uses javascript to gain interactivity.

XBAP Version – runs as a .net application via ClickOnce
Flash Version – runs as a flash application
JavaScript Version – runs as javascript application

October 25, 2008

AvalonExampleGallery via jsc:php

Filed under: jsc — Tags: , , , , — zproxy @ 6:53 pm

Years ago sourceforge.net did not provide support for php5 – until now. The next release for jsc will finally include a php project template.

For now you can have a look at the example show below, where the php will generate a correct html view of the application and the javascript will make it interactive. Nice huh?

Known bugs: There seems to be some issues with IE7 tho…

October 22, 2008

jsc October Refresh

Filed under: jsc — Tags: , , , , , , — zproxy @ 8:24 pm

Some updates to the compiler and the framework.

Download jsc here. (Others already have!) Older releases are here.

Visit our google groups and the google site.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAvalonApplicationWPF Application, C# to JavaScript, C# to ActionScript

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# to JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site
OrcasJavaConsoleApplication – C# to Java as Console Application
OrcasNativeJavaConsoleApplication – C# to Java as Console Application with JNI bindings

Have a look at some old screencasts:

Have a look at the Avalon Gallery, note that it is actually a WPF Application.






September 30, 2008

WPF subset powered by Flash and DHTML Part 2

Filed under: jsc — Tags: , , , , , , — zproxy @ 12:41 pm

Today I released another example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell.

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript Preloader version Via Coral Cache
  4. JavaScript ClickOnce version
  5. JavaScript version

The javascript version has been tested with the following browsers:

  • FireFox 3.0.1
  • IE 7.0.6
  • Safari 3.1.2

You can look at the published files here or you can look at the source code here and here.

Other posts in this series:

  1. WPF subset powered by Flash and DHTML

September 4, 2008

jsc september 2008 refresh

Filed under: jsc — Tags: , , , , , , , — zproxy @ 7:04 am

Some updates to the compiler and the framework.

Download jsc here. (Others already have!)

Added a WPF template.

Visit our google groups and the google site.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

OrcasAvalonApplication – WPF Application, C# to JavaScript, C# to ActionScript

OrcasAppletApplication – C# to Java Applet
OrcasFlashApplication – C# to ActionScript
OrcasScriptApplication – C# to JavaScript
OrcasVisualBasicFlashApplication – VB.NET to ActionScript
OrcasVisualBasicScriptApplication – VB.NET to JavaScript
OrcasWebApplication – C# to JavaScript as Microsoft Web Application
OrcasWebSite – C# to JavaScript as Microsoft ASP.NET Web Site
OrcasJavaConsoleApplication – C# to Java as Console Application
OrcasNativeJavaConsoleApplication – C# to Java as Console Application with JNI bindings. (missing)

Have a look at some old screencasts:

FlashAvalonQueryExample

This is a WPF application based on the new OrcasAvalonApplication template. In debug mode jsc is not invoked and you can develop and debug the application as a regular one yet in release mode, the jsc is invoked at the post build event effectivly creating a javascript and an actionscript version for you. This example uses LINQ. See it in SVN here.

What does this example do? Based on a list of flickr images and a filter that defines a part of the image to be matched it returns a list of images and loads them over the network.

While developing with jsc, one must keep in mind the limits as only a minimum featureset is supported.

August 16, 2008

WPF subset powered by Flash and DHTML

Filed under: jsc — Tags: , , , , , , — zproxy @ 9:43 pm

Today I released an example project which demonstrates that you could develop an application for WPF but have it running as XBAP and additionally on flash player and javascript enabled browsers aswell. Isn’t this more like WPF Everywhere :) ?

  1. XBAP version (IE)
  2. ActionScript version
  3. JavaScript Preloader version
  4. JavaScript ClickOnce version
  5. JavaScript version

The javascript version has been tested with the following browsers:

  • FireFox 3.0.1
  • IE 7.0.6
  • Safari 3.1.2

You can look at the published files here or you can look at the source code here and here.

Some currently by ScriptCoreLib.Avalon library supported features are:

  1. Canvas
  2. TextBox
  3. Rectangle
  4. Image
  5. Cursor.None
  6. DispatcherTimer

Neat huh?

Update: Chris is working on silverlayout – wpf inside as3.

The Shocking Blue Green Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 74 other followers