The book of inspiration

September 14, 2010

Biolab Disaster

Filed under: games — Tags: — zproxy @ 6:53 am

Dominic has created an awesome HTML5 demo based on concepts from Super Mario. There is an  editor “weltmeister”!

Via IndieGames.com

July 12, 2010

Write WebGL in C# with JSC

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

In the following gallery you will be shown just how easy it is to download JSC, install, create a WebGL application (see the original) and run it in your WebGL enabled browser.

Would you want to program your shaders in C# instead? It would look something like this once implemented:

Update: See GLSL overview

Update: See WebGL Awesomeness

More examples: Shadertoy and Collada tron tank

More examples: Chocolux and take screenshot from 3d and Cubepaint

More examples: Raycolor and more and some dancing frogs? and a whale?

Something simple:

-
Shortest WebGL example

More examples: Ethanol

Update: GLSL minifier, and a small c++ demo

Can we port XNA to WebGL?

Update: For debugging and see WPF OpenGL.

Update: Photoshop effects

Update: Can we have COLLADA within HTML?

See also:

February 22, 2010

JSC Ultra to reuse native source code

Filed under: jsc — Tags: , , , , , — zproxy @ 9:48 am

As advertised the developers will be able to seamlessly create flash sprites and java objects inside their javascript applications in C# via the jsc ultra offering. What if they could just drop some native source code and be able to reuse them in C#?

At the moment only the HTML web page is converted to DOM building code which looks like this under reflector.

In the future releases the native source codes could be parsed and placed in the correct location based on their namespace for their respective back-end compilers.

Seems like I will need source code parsers to pull it off. First step is to generate a stub. The next step would be to convert the native source to IL. If we go just for the first step, then one can surely benefit from some native language specific syntax constructs.

Update: The second pass would mean that the native back-end compiler does it’s job and jsc will go and decompile JVM or AVM to IL as jsc is not about compiling source to IL.

Then you could consume the AboutApplet.java  in your javascript code like this:

42 var Applet1 = new AboutApplet();

43

44 Applet1.Method1(“hello world”);

45

46 var Applet1Element = Applet1.AttachAppletToDocument();

47

48 Applet1Element.style.border = “1px solid red”;

This will create a red java applet in your browser.

The AboutApplet.java should could look something like this:

1 // PromotionWebApplication1.AboutApplet.dll

2 package PromotionWebApplication1;

3

4 import java.applet.Applet;

5 import java.awt.Component;

6 import java.awt.Container;

7 import java.awt.image.ImageObserver;

8 import java.awt.Panel;

9

10 public final class AboutApplet extends Applet implements ImageObserver

11 {

12

13

14 public AboutApplet()

15 {

16 super();

17 }

18

19

20 public final void Method1(String p)

21 {

22 }

23

24 }

Ch

Cool features ahead. Including HTML5 🙂 Including an actual installer!

jsc has now a twitter feed!

PS. What about .class, .jar, .swf, .swc? 🙂 I surely would like to pull media from online .swf files just to be able to recompile them into my own application.

Hey Compiler that flash game there has nice logo and sound, could you go ahead and make them accessible for me in the code? Thanks! 🙂

January 15, 2010

ReferenceWebSource

Filed under: jsc — Tags: — zproxy @ 4:13 pm

Good news! Your java application can now be compiled from source code on a web site. I am so excited:D

Disclaimer: This is a quick and dirty post.

by mxgraph

The new Pre-build event looks like this:

C:\util\jsc\bin\jsc.meta.exe ReferenceWebSource /ProjectFileName:”$(ProjectPath)”

Seriously, the other day I saw a blog post about how to make T4 download source code for you. At first I thought, thats just insane. It is a serious security liability. You will compile source code which you may have not written.

Update: I added the link. How long until the computer will automatically link to the posts by description? 😀 5 years?

jsc.meta now supports this new command ReferenceWebSource, which basically scans your project and downloads references source files from the internet, compiles them, merges them, adds some attributes and adds the new assembly to your project as a reference. This opens up a whole new group of possibilites.

The upper projects are supposed to be external projects written by other developers. Your project is the ReferencingWebSource project. As you can see there are multiple folders in that project suffixed with WebSource. Each of those which has a references.txt file is basically a list of source codes on the web. They can point either to .vb or .cs.

ACME.X.WebSource.references.txt:

http://jsc.svn.sourceforge.net/viewvc/jsc/examples/java/ReferencingWebSource/MySnippetProject/ACME/Class1.cs
http://jsc.svn.sourceforge.net/viewvc/jsc/examples/java/ReferencingWebSource/MySnippetProjectVB/Class1.vb

The source code could be generated by the web server on the fly. Talk about WSDL in C# 🙂 And after the downloaded code is compiled jsc.meta could apply any additional IL translation it wants to on it. It could go ahead and infer new types from existing code…

After you load your project you should do a build. This will invoke the pre build event and update the dynamic reference.

Here is an example of how I can use it in my project. Remember those Class1 types are downloaded via HTTP GET.

This feature is new and not fault tolerant. Oh and this windows forms project is also compiled to java.

Update: Future extension points:

  1. Reference source code in a zip or tar file.
  2. Reference assets within flash files
  3. Reference 3D objects within google warehouse.
  4. Reference HTML design documents
  5. Reference online wave files and compile them as inline components
  6. Reference windows forms textual design
  7. Reference game maker games for their assets
  8. Cache downloaded files for offline scenarios
  9. Check for forbidden API usage to increase security
  10. Reference HTML file with links to images and have them converted to embedded assets
  11. Reference UML diagrams and create components with (network) events?
  12. Reference XSD, XML, JSON to create serializeable DOM’s.
  13. Reference native classes. BCL assembly should be merged with the reference.
  14. Reference HTML DOM as IDL
  15. Reference static HTML file to inject dynamic code
  16. Merge current and sattelite assemblies and dump unused sattelite types to reduce code size.
  17. Reference open source .net projects and simplify by recompiling  them to be used with jsc

January 14, 2010

Flash runtime written in pure JavaScript

Filed under: tech — Tags: , — zproxy @ 9:46 am

Someone like Tobey has been ceazy enough to actually go and implement Flash Player in javascript. How crazy is that? It’s awesome for multitude of reasons!

Code:

  <body onload="new Gordon.Movie('trip.swf', {id: 'stage', width: 500, height: 400})">
    <div id="stage"></div>
  </body>

Example:

Gordon

Via Ajaxian

See also:

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”

September 1, 2009

Windows Forms inside Opera Widget

Filed under: jsc — Tags: , , , , — zproxy @ 1:57 pm

Opera SoftwareIf you are like me then you probably have had a look at the new opera 10 browser. I liked the widget API so much that I just had to make a widget of my own.

>> Open my Windows Forms javascript example as opera widget!

Widget1

Cool huh? Note that this widget will only show on your primary display if you are one of the multi display citizen. Note that this widget needs a right click to close.

You may see the following warning when opening my widget:

jsc.sourceforge.net

You are installing a file which can alter the way Opera behaves. Opera may become unstable or less secure as a result.

You should only download setup and widgets from sources you know and trust. Do you want to proceed?

jsc.sourceforge.net
You are installing a file which can alter the way Opera behaves. Opera may become unstable or less secure as a result.
You should only download setup and widgets from sources you know and trust. Do you want to proceed?

August 28, 2009

Windows Forms Everywhere

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

Some time ago I had this idea to support Windows Forms in javascript. Recently I have started on implementing a new feature for the jsc solution in form of a metacompiler. What does this mean? You will be able to create a Windows Forms Application without referencing any of the ScriptCoreLib libraries which in turn also means you will not be required to explicitly mark your classes with the ScriptAttribute. With future releases the support for Windows forms could be extended to flash and java which in turn enables rapid application development :).

Contact me if you are interested in this technology and would like to buy it for your company.

TwentyTenSimpleWindowsFormsApplication

TwentyTen is the codename for Visual Studio 2010. This is a project template for the beta version of TwentyTen.

jsc.png (96×96)Open this example in your browser.

Browse the source code for this example.

TwentyTenDesignTwentyTenCodeTwentyTenPostBuild

TwentyTenChromeTwentyTenDocument

TwentyTenDebug

OrcasSimpleWindowsFormsApplication

Orcas is the codename for Visual Studio 2008.

jsc.png (96×96)Open this example in your browser.

Browse the source code for this example.

OrcasDesign1OrcasDesign2OrcasPostBuild

OrcasChromeOrcasDocument

OrcasDebug

Project templates

NewTemplates

The two examples shown above are actually project templates for visual studio. The zip files should be copied to your template folder.

Example:

C:\Users\arvo\Documents\Visual Studio 2008\Templates\ProjectTemplates

In the future releases this could be automated by an installer.

What does the jsc.meta – the meta compiler for jsc do?

It will create the final glue to bind two object spaces together by automatically referencing the Base Class Library implementations within the set of ScriptCoreLib assemblies. The meta compiler could be used in the future to provide proxy services and alike to talk seamlessly over the network to the server or to a client side persistence service like SQLLite.

There are a few caveats:

  1. Long filename paths which include a space must be put inside quotes.
  2. You need to turn off the ‘optimize‘ feature in the release build in the project properties.
  3. You cannot use types which have no implementation in the ScriptCoreLib assembly. You should notify us if you want us to add specific support for you.
  4. Satellite assemblies referenced by your Simple Windows Forms Application project must at this time mark themselves with [assembly: Obfuscate(Feature = “script”)].
  5. You must use a post build event to instruct javascript translation. The first release build will take longer than the later incremental builds.
  6. The post build event is configured to not to run in debug build which enables you to run and debug your application within Visual Studio instead.
  7. In .net 4 you cannot define events at this time, due to the changes introduced in the generated IL. This will be resolved after .net 4 is released.
  8. In .net 4 you cannot use the lock keyword at this time, due to the changes introduced in the generated IL. This will be resolved after .net 4 is released. Supported when targeting  java in current version of .net.

PS2. The jsc compiler should be installed at c:\util\jsc\bin. If any of the examples have a relative reference to one of its assemblies and cannot find them you might want to edit their respective project files to reference by the absolute path instead.

Download jsc here. (Others already have!)

June 28, 2009

updated example: ExposedFunctions

Filed under: jsc — Tags: — zproxy @ 12:03 pm

Today I have extended the ExposedFunctions example. In our scenario we have written a javascript library in c# with jsc and we would like to consume some of its exposed functionality. We are going to edit our html file with Visual Studio inside the WebApplication1 subproject.

In the previous version the API consumer was only able to set text and index fields.

ExposedFunctions1

This time around the consumer is able to optionally specify mouse handlers and invoke GetString function on demand in javascript.

ExposedFunctions2

In this html file I have added two new buttons to consume the exposed API. The Example2 button will react on mouseover and mouseout events. Clicking on the data will invoke the onclick handler in which we will invoke the C# code to provide us some text to be displayed.

ExposedFunctions3

March 28, 2009

justinTV

Filed under: life — Tags: , , — zproxy @ 11:11 am

Guess what – you can watch TV online at justin.tv!

If you would like to only see only the video in your browser window, you can use this code:

javascript: void (function () { if (document.location.host != ‘www.justin.tv’) { document.location = ‘http://www.justin.tv&#8217;; return; } var e = document.getElementById(‘jtv_live_flash’); while (document.body.firstChild != null) document.body.removeChild(document.body.firstChild); document.body.appendChild(e); e.style.position = ‘absolute’; e.style.top = ‘0px’; e.style.left=’0px’; e.style.width=’100%’; e.style.height=’100%’})();

What does this code do? It removes all non video elements and maximizes the video.

You should create a new bookmark button.

properties

After creating such a button you can navigate to a video page from justin.tv and click that button.

video

I have tested this with two channels:

  1. http://www.justin.tv/affan2
  2. http://www.justin.tv/sneaky_assassin1

Oh, and those of you who watch Lost, visit http://bojabertv.blogspot.com/.

Update: To make your firefox window top most I suggest DeskPins.

DeskPins can be used to make any application topmost, that is, to keep it above all other windows. Just grab a pin from the DeskPins icon in the system notification area (a.k.a. taskbar tray) and click on any window. This functionality is identical to the “Always on Top” setting found in some programs. With DeskPins you can add this feature to any program!

February 12, 2009

JavaScript Games Portal Found

Filed under: life — Tags: , , — zproxy @ 6:46 am

There is finally a portal for JavaScript games. I will try to send some of mine to that portal 🙂 Good job Jacob!

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
  4. [source:svn]

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 20, 2008

AvalonWebApplication with PHP backend

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

I have created a new project template that demonstrates most of what jsc is capable of. Soon I will publish it on the sourceforge with a tutorial how to get started using it.

Long story short – Here is an application which demonstrates the following features all written in C#:

  1. PHP Backend
  2. JavaScript (WPF)
  3. ActionScript (WPF)
  4. Java Applet

Update: Moved the example to sourceforge and removed the querystring switch.

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.

August 5, 2008

Extend your ASP.NET with C# to JavaScript tutorial

Filed under: jsc — Tags: , , , — zproxy @ 9:37 am

I have added a new tutorial for those of you who would like to extend existing ASP.NET web sites with jsc compiler.

Read the tutorial over here.

Update: This tutorial is now a part of the google jsc site.

June 12, 2008

Jsc June Refresh 2

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

Some updates to the compiler and the framework: Download jsc here. (Others already have!)

Added two Java project templates.

Visit our google groups.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

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:

June 6, 2008

Jsc June Refresh

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

Some updates to the compiler and the framework: Download jsc here.

Most important update was fixing the virtual + override semantics for jsc:actionscript. It’ did not allow to combine multiple events for example.

Visit our google groups.

Tutorials to read when just starting with jsc:

This release contains the following Project Templates:

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

Writing code in VB.NET for flash looks like this:

March 16, 2008

javascript minesweeper remake

Filed under: jsc — Tags: , , , , — zproxy @ 11:23 am

You can now play the classic minesweeper game in your browser.



January 6, 2008

Example Gallery

Filed under: jsc — Tags: , , , — zproxy @ 3:17 pm
This is a collection of projects developed with jsc. They were coded in c# and translated to javascript with jsc. Click on the pictures to load the applications or on the names to open them in a new window. You might need to press refresh to come back to this index. Enoy! 🙂

    January 1, 2008

    tutorial: NatureBoyTestPad

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


    A tutorial how to create such an application can be found here.

    December 31, 2007

    Javascript Tycoon 2007

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

    Well, it is the end of the year and I wanted to get as much done as possible with the javascript tycoon. I managed to add some road construction tools 🙂

    Play it in your browser. Vote for it at tt forums. Look at the c# source code. Try jsc yourself.

    jsty3scr

    December 27, 2007

    try javascript tycoon within youOS

    Filed under: jsc — Tags: , , , , — zproxy @ 9:16 am

    You now can install javascript tycoon and javascript worm game inside youOS desktop.

    View javascript tycoon directly. Vote for it.

    View javascript tycoon as a youOS guest.

    View javascript worm game as a youOS guest.

    Ingame video:

    My developer page is not up to date, but it should list all applications I have prepared for youOS. If you like those applications, rate the, this way my developer avatar gets a higher ranking on the scoreboard page.

    If you just happen to want to play transport tycoon I would suggest you to visit openttd.org .
    If you’d like to create something similar then get jsc and start coding.

    Blog at WordPress.com.