Fork me on GitHub
Showing posts with label engineering. Show all posts
Showing posts with label engineering. Show all posts

Monday, January 18, 2010

Control Methods for ASP.NET AJAX

Page Methods

As of late several things have been calling my attention to get back into JavaScript, most especially in the area of AJAX. Through colleagues and friends I've been introduced to a lot of the popular standards right now, which all seemed to follow the patterns I expected, but there were some things that I payed extra homage to. Most notably, I really enjoy the concept of Page Methods. If you haven't used them yet, Page Methods allow you to define a static WebMethod in the class for an ASP.NET Page and expose them to client script. ScriptManager.EnablePageMethods adds the convenience of generating a proxy to access the method from client script with little hassle, though it turns out the property isn't needed to call the service, it only generates client script for you (probably based on reflection of the page, though I haven't checked into this yet). With some further reading (due to a nod from a colleague) I found Dave Ward's post on using jQuery to directly call ASP.NET page methods. All was well and good... until that curiosity kicked in.

Encapsulation

One of my favorite things about Page Methods is that it allows the logic for asynchronous calls to be grouped in the same body of code that it pertains to. Just as I define event handlers for oldschool postbacks in the page, I can also define the callbacks used by a page there. There are some other differences worth noting, such as a slimmer service model since no WSDL is necessary and only JSON is supported, which can arguably be considered a performance optimization, but ultimately (as an engineer) the encapsulation is what really draws me to this design.

Control Methods

After appreciating the value of being able to call a service whose definition is within the page, one thing that seems to be common is for people to try to do the same within a UserControl. It seems like a great idea to be able to implement reusable AJAX controls keeping the logic contained within the code it relates to. This is especially noteworthy when the asynchronous call is specific to the logic of the control; currently most controls use .asmx web services, which makes sense, especially if a web service will be reused, but all-in-all, seems a mite overboard for some particular control's one-off auto-complete list or the like and, additionally, it unnecessarily complicates organization and maintenance efforts. Unfortunately, as many others have commented, this feature is not supported for methods within a UserControl. When looking into how web services are provided in ASP.NET it seemed to be an unnecessary limitation; true .ascx extensions are, by default, handled by the HttpForbiddenHandler, but Page Method requests shouldn't be (and as research indicates, aren't) handled by PageHandlerFactory or the Page class; the methods are static and initializing the page's object model would defeat the purpose of using real web services instead of UpdatePanel (for those that are less familiar with the life-cycle of a page and why this would be less efficient, this is a good starting point). To me, this implied that the handling of these methods only required a static method marked with some attributes to exist within a class accessible by the web application; the rest was a matter of translating the request into the right calls.

Enter ScriptModule. ScriptModule is configured in Web.config for all ASP.NET AJAX projects. It seems to facilitate a few things, though I didn't look into much detail as my only concern was with the handling of Page Methods. As it turns out, the limitation is strictly superficial; ScriptModule explicitly checks that the current request is a Page before doing anything related to a REST query.

ScriptModule has a very simple process for handling Page Methods and the implementation details were really handled in classes and static methods that received relative paths and method names as string parameters. Perfect! I should be able to reuse the existing implementation after changing little of the request parsing... right? Wrong. Unfortunately all of the helper classes and methods are marked internal so there is no easy way to access the existing functionality. Alas, I really like the idea of encapsulating my control logic in my control class. It would probably be possible to rewrite the implementation, or more suitable for Microsoft to modify the module to handle a few more cases (they could actually modify a few things, like the convenience code generation and properties for Extenders), but for the time being I have settled on creating a solution that used the same implementation as Page Methods through Reflection.

Reflection

The downside to using reflection in this solution is that typical ASP.NET security models do not allow much reflection. Some trust levels provide limited reflection permission, but invoking internal members of an assembly is forbidden as a security measure in all of the default security levels short of Full Trust (which is not ideal for production environments). The other levels can be modified to support ReflectionPermission, but ultimately the rule is in place for a reason. That said I've created two methods to access Control Methods. One is an in-application ashx handler that would require the above-mentioned security modifications, but is rather simple to drop in. The other (recommended) option is an IHttpModule contained in a strong-named assembly registered in the Global Assembly Cache. By default, assemblies in the GAC are granted full trust, even in web applications, so the module can serve Control Methods without compromising the security of the web application.

Source

Since it seems like other people are interested in this as well, I've posted my implementation of Control Methods for ASP.NET AJAX to CodePlex under a BSD style license. It's not a priority of mine, but I do intend to further extend this to support the same functionality for Master Pages as well as trying to test interaction with various AJAX Server Controls (like AutoCompleteExtender). I have not tested standard ASP.NET authorization and security methods extensively yet either. Still, the design model is good, and maybe this will call some attention to the desire for this functionality to get some official support.

Monday, April 6, 2009

Retry Oriented Thread Synchronization

Somewhat recently at work I've been troubleshooting some concurrency edge cases involving deadlocks due to thread synchronization. In my experience, a lot of times this is the result of creating lock objects for separate collections or something of the sort. In most of the code only one collection/object is accessed at a time and the separate synchronization objects allow for less contention and more throughput. Excluding simple/obvious mistakes, the problem typically arises when different code paths require the objects in opposite order, sometimes becoming more difficult to trace when they involve events/handlers. Obviously on goal when locking is to lock the synchronization object for as little time as possible, but sometimes it's simply necessary to hold a lock while entering an event or callback.

One solution, which worked fine for us, was to get rid of one of the synchronization objects and use the same one for both collections. Ultimately it was all that was necessary for our solution, since we couldn't change the other code paths or unlock one of the synchronization roots, but it did inspire me to start trying to think of a better solution. I've been toying with an idea somewhat similar to the pattern used by TransactionScope, taking advantage of the using statement to allow syntax to stay simple (since the lock statement is so lightweight it would be ideal to keep the new solution quick and easy). I certainly haven't found the ideal solution just yet, and it's quite likely that there really is no ideal solution, but I've posted the new code and test application on CodePlex, hoping others in the community will see the potential advantages and help me improve on it, either with code or ideas. This also doesn't implement any synchronization techniques regarding Mutexes, Semaphores, or any other wait handle style synchronization, this is currently specific to using Monitor and may only serve to improve circumstances using traditional lock statements or Monitor directly.

The general concept behind usage in the current implementation is as follows:

using (LoopLock l = new LoopLock(ltp.Syncs))
{
//optional event, but here for testing
l.LockAttemptFailed += new LoopLockEventHandler(delegate(LoopLock sender, LoopLockEventArgs e)
{
if (e.Attempts > 200)
{
//sample of aborting if it takes to long to get a successful lock;
e.AbortLock();
}
});

l.AcquireLock();

Thread.Sleep(rnd.Next(5490) + 20);

}
The LoopLock constructor takes in a params array of all the synchronization objects (in the order they should be locked). The AcquireLock method only exists to allow attaching an event handler, which will be described in a moment. AcquireLock attempts to obtain a lock on each synchronization object one at a time. If it is unable to obtain any lock in 100ms (by default, though there is a constructor overload to provide the timeout period) it will proceed to unlock each of the successfully locked objects (in reverse order), fire the LockAttemptFailed event which provides the number of tries so far along with the option of aborting the process alltogether (which throws a LoopLockAbortedException). If all locks are acquired code will proceed and, when the code leaves the scope of the using statement, all locks are released (in the opposite order they were locked).

One thing I've already considered through the simple test application I've made is the possibility of adding support for prioritization based on retry counts, which could be useful, but since these are thread specific and this is supposed to be a lightweight class it may require the use of WeakReferences so I haven't gone through with it yet since I'm still working on finding other possibilities and it could wind up being a waste of effort. One problem mentioned above that this still doesn't solve is the event handler situation, where I lock a synchronization object important to me and then fire an event which can be attached to by arbitrary code; since I don't have control over both code-bases I can't see a means to provide any "let me get out of your way" logic, since we can't release the lock once synchronization-dependent code has already begun executing. I was thinking about the possibility of a delegate or delegate wrapper that carries a reference to the synchronization object would work for some occasions, but without some under-.NET's-hood voodoo it would still sacrifice syntax clarity/diversity, which I'm trying to avoid. It seems there will have to be a tradeoff somewhere in order to improve this model, and maybe using a single callback with a synchronization object reference instead of supporting a multicast delegate may be that answer, but for now I'm going to think on it more. I would really love any insight from those in the wilderness; I've certainly not been exposed to every method of using threads and synchronization and, while I'm pretty familiar with Monitor and other synchronization classes, there could still be something obvious I'm not privy too as well.

-TheXenocide

Tuesday, July 24, 2007

Chaos is not a Theory it's a Way of Life

Well it has been awhile hasn't it. I've not disappeared, life has just been a bit hectic lately. I've sort of been screwed over by a good friend/ex-roommate in ways that complicated my finances and my household responsibilities but I think I've finally got all that straightened out and beyond that my project at work deploys today! Yay!!! :p

Other than that I've been thinking bunches about my research and how I plan to accomplish certain core goals, though down the line my thoughts tapered to other fun ideas as well, some of which, I have found, are already on their way to being what I thought of as very cool useful concepts. Make some beautiful code merged love out of them and I think you'd be on to something, lol. I won't detail my hopes and dreams too much more as I've already divulged quite a bit of hopes while not delivering much on any of them right now, but here are the really neat, already existing, partial implementations of my dreams; I suggest any C# developer who's ever done any JavaScript, Ajax, ASP.NET or Windows Forms check these out, they are pretty cool:
  • Script# - an absolutely awesome freeware concept and implementation, a little incomplete as far as I'm concerned (though I'm always pretty rough on that stuff, constantly looking for low level features). This is an incredibly useful C# compiler that compiles to JavaScript code instead of IL; complete with object oriented definition, proxy object creation for Ajax support and a robust framework developed around it for ease of use and RAD.
  • Visual WebGui - WOW! I didn't believe my eyes, I so wanted to do something like this (still do want to do a lower level implementation :p) but this is a great package. In a nutshell this is Windows Forms development for web applications. If you're still reading this instead of that link I dunno if you caught how important that was ;) I'm talking visual design using the same interface driven Windows Forms designers you're used to only it allows client-side use of the application (windows, buttons, textboxes, the whole shebang) while the logic runs in the safety of the server.
Beyond that, I thought it necessary to give a shoutout to a project I've been using in some of my prototypes for my research project. Props to the Managed DriectShow project by Kristoffer Vinther. I've tried other managed wrappers and this one is definitely the best design for a managed library. It's not just a wrapper it's an object oriented implementation that follows .NET patterns and practices and provides a scalable and usable media interface for playback, streaming, buffering and recording of media files, streams and capture devices. I'd like a little more documentation for it but it's in the early stages and it runs very well.

I have so many things I want to say about so much that I've been reading and thinking, but if I unload now it will be a disorganized mess so again I creep into the shadows to sort the random data that swarms me, hopefully to return with understanding to use and share :)

Thursday, March 15, 2007

Wish List and "My Research Project" Unveiled

WARNING: This post is extra extra long (even for me), the top portion consists of recent wishes, and the bottom is a very detailed account of what I've been most interested in the past few years.

As of late I've been encountering more and more tools I wish I had and less and less time to make them myself :p.

As some people may have noticed, I've been interested in GForge a bit lately, and I thought it was kinda cool that they have a SOAP web services API, and there's obvious usefulness when you see that they have a Visual Studio plugin, but I've been thinking:

These guys are an open source group with an extensible project management, tracking and collaboration system that is familiar to many developers (based on SourceForge) and pretty easy to use. It includes things like Bug Tracking, CVS/SVN support, Status tracking, Wiki, Mail lists. All of these features are really neat and usable, but I think that open source developers should be supporting the project more because there's a lot of potential, but (as SourceForge found when it stopped supporting it's open source license model) not so many people are using it's developer oriented nature to their advantage. Here are some things I would really like to see for GForge's sake:
  • SharpDevelop, MonoDevelop, NetBeans IDE, and Eclipse integration.
    • Can integrate SVN systems already present with bugtracker and project status id's/links.
    • Support for associating projects with their forge space to allow internal IDE support for searching the project wiki, checking statuses, sending messages to project members, bug reporting.
    • All of these platforms can benefit greatly from a true collaboration suite; Visual Studio 2005 Team System is great for companies that can afford to do that, but the open source and free software developers need access to these powerful tools as well.
  • Even easier installation, currently the apt packages are pretty good and the dependency checking and such is ok, but you still have to have a lot of knowledge about how you're trying to use the system even before you've played with it. I went through several install attempts and even had some minor problems with the VM images.
  • It would be pretty cool to see some sort of hybrid of Joomla/Mambo and GForge to provide standard CMS options for project websites. This would be a really nice quick-start solution for any project and if it were coupled with some nice blogging software with tag feed support on a per-user basis it could even come pre-configured to aggregate all blog entries from all users working on the project based on a unique tag for that project I think that would be just about everything a development team needs :).
Other than GForge, I'm sure people are aware of my interest in the Mono project. Mono is developed and maintained by a bunch of great and bright people (who's blogs I strongly recommend reading :p) and they've been making great progress. Why mention them in my wish list? Because as great as everything is going, I'd love to see even more support. The project really has the potential to put out a great cross-platform implementation of the .NET Framework but their project is not realizing it's full potential because the people working on it already have their hands full. Plenty of people are out there are playing with mono, which is great, but lets see some mobile developers get their hands a little dirtier and start making more packages for mobile platforms. What about running Mono on Windows CE or more supported packages for ARM/MIPS/SHx flavors of linux? Why use .NET CF if your embedded device has more memory and more storage space when you can benefit from the full blown features of Mono? Not to say these things aren't being looked at, and not to say the people looking at them aren't capable of doing them, but why not give some of these guys a break so they can get even more of their official projects done (Goooo WinForms! :p).

Enough with the wishes, how about the results of my actions?!

I've yet to disclose a lot of details about my personal research project. This is mostly because many of the people who read this already know what they want to and because it's somewhat complicated to explain and I haven't had the time. Well fear not those who really want to know :p, here is the information you thirst for (I presume I'm speaking to myself here, lol):

The Project: I aim to design a multi-language pervasive distributed extensibility platform for generic extensibility using dynamic methods of communication and a strong service oriented architecture.

The Research: It is my opinion that mankind has been repeating their actions in a cycle where we strive to solve inconveniences. After we solve so many of them we realize that it's too complicated now and our latest inconvenience is the number of inconvenience fixes we apply, so we then work to integrate those pieces with one another so we can use less concrete items or actions to scratch those itches. After that we find new inconveniences and start over. I would like to see if it is feasible (and if so if it is reasonable) to create a standardized system that will provide applications with standard lines of communication and service registration, recognition and consumption that can be used either standalone or as a transparent distributed system. Ideally using this system should allow us to integrate already existing technologies with new technologies without having to change either so that we can stop reinventing the wheel (which we do in way more than one way).

The Reason: As technology has been evolving the rate at which new technologies comes out is speeding up tremendously. The ultimate goal with this is to make it so that any technology can, without any prior knowledge, access the data and features of any other technology (within the system) as though the features provided were natively available in the first place. All that should need to be done to add new devices and concepts is to define new known service types, implement new service consumers on various platforms and then make the new technology compatible by exposing it's resources via a service provider. This sounds like a lot, but really it's basically what we already do. Operating systems use drivers all the time, but if this is done right we can use all of these exposed features in a distributed system.

The Method: Plenty of madness, followed by using the extensibility platform (the research project) to design and implement a personal and household device integration and automation system. The goal is to make it so that you can change the temperature of the house or turn of your kids TV while you're driving in the car touching your dash mounted screen that's communicating using the network access exposed by the bluetooth connection your car has established with your phone while getting roadside directions from the GPS location server in your phone and playing music from your wife's laptop using WiFi in the kitchen. I know this seems like a lot, but when it's broken down into small pieces it's very easy to see how everything fits together.

The Pieces: Since there are really two projects here, the pieces will be categorized as either being part of the platform or the implementation.

Platform:
  • Extensibility Layer
    • Allows dynamic loading of extensions in a type-safe manner with an Extension Manager that can be configured with pluggable loaders, management, and security zones to allow isolation of trusted and untrusted or critical and non-critical extensibility. This is the core of the platform.
  • Communication Layer
    • Facilitates the transport of messages (commands, requests, updates, etc) using a pluggable architecture to allow communication through dynamically defined channels in an abstract manner to allow new communication channels to be added at any time and to allow all pieces of the system to communicate using these channels without any knowledge of how they work. The communication layer should be the only section of the application that is aware of any process instances and application boundaries and it should be responsible for the detection and usage of the most optimal means of communication between providers and consumers.
  • Distribution Layer
    • Automatically provides communication for Extension Manager/Extension Manager and Extension Manager/Extension Loader across application domain boundaries using the communication layer. This should be transparent; service registration, consumption and communication should occur using a static reference to the platform host which will either be a real platform host (Extension Manager) or a virtual host (a secured proxy loaded in a sandboxed application domain).
  • Configuration Layer
    • Establishes a secure standard model for configuration. This should support pluggable persistence mediums, atomic synchronization through the communication layer, and configurable zones that allow various portions of the application and it's extensions to be isolated and persisted where most applicable without requiring the extensions to be aware of the location of their configuration. The configuration layer is likely to maintain a hierarchical form in which application zones are responsible for managing configuration of their children including nested application zones. Utilization of existing configuration persistence mediums is encouraged.
    • It will be very important for there to be a rich, easy to use UI for configuration of the system as a whole, since it may actually be somewhat complicated to have various security zones communicating with one another on different machines. Also, pretty much every portion of the platform can be dynamically modified so any part of the platform must be completely configurable.
  • Secure Design
    • While this isn't actually an individual piece so much as a common theme it is important that all pieces of the system can be configured to be as secure or open as desired and continue all of their allowed functionality under those situations.
Each piece of the Platform will have to be implemented for each programming platform to be supported (ie: Java, .NET/Mono/.NET CF) but integration of some platforms may benefit more from initiatives to make languages compatible with common language structures similar to JRuby, Phalanger, IKVM, etc. SOAP, JSON and other service oriented platforms are the obvious choices for integrating the various language platforms, but I thought it would also be nice to facilitate native lines within virtual compatibility hosts (ie: host an IKVM in a .NET domain with a virtual host and then use IKVM-.NET stubs in conjunction with the native Java extensibility platform to facilitate faster translation to native communication methods using IKVM to proxy). One very important thing to make note of is that any extension can utilize the same underlying extensibility and communication frameworks to be just as extensible and distributed as the main application.

Implementation:
  • Currently Planned Host Applications:
    • Shell/Desktop Management Environment
      • pluggable environment defining many:
        • Environment providers (Windows, Linux, Mac, Windows CE, etc)
        • Input providers (keyboard, joystick, remote, voice command, etc)
      • Support for pluggable "Desktop Managers" to facilitate different styles of user front-end usage. A media desktop might simply expose available media, show visualizations and load semi-transparent widgets whereas somebody running the system on a touchscreen on their fridge may want something a little more home automation oriented. Either way, the fridge should technically be able to stream music while the media center turns your lights off, but the end user experience is more consistent with what they expect.
    • Service Daemon
      • A passive background application designed for desktop computers and servers that will load and run services in the background and allow individual platform compatible applications to serve and consume without capturing the entire environment.
    • HTTP Access Platform
      • Facilitates end-user service consumption through a web browser using pluggable widget/webpart style service consumers.
  • Media Distribution Services/Consumers
    • Generic service providers for exposing and streaming shared media resources (files, TV Capture output, proxied multi-cast streams, etc.).
    • Generic service consumers for accessing and playing back media
  • Common Device Services/Consumers
    • Service providers and consumers for such things as GPS/other bluetooth devices, Printers, Scanners, IR Ports, Cameras, Microphones, etc.
  • Automation Services/Consumers
    • Provides support for registering, recognizing and exposing non-computer devices that can be controlled or polled remotely (ie X-10 household automation, RF controllable vacuums/robots).
The implementation is very incomplete in it's definition because much of the engineering thus far has been focused on the platform, but the implementation definitely needs to be solid because it is what will be used as a reference to see the capabilities of the platform. Currently I've got some good work started on the extensibility and communication layers and I've been playing with the configuration layer a bit lately too, though only on the high-level side, not so much on dynamic persistence and whatnot yet. Also, I've got a precursor to the Environment/Desktop Management Application that demonstrates a windows environment provider and a desktop provider configuration dialog with multi-head support (using display devices exposed by the environment provider) as well as simple input provider demonstration. Next is loading desktop providers and associating them with individual/multiple contiguous displays.

Anyway, this post is even longer than my average of really really long, and I'm just about out of time, but I thought I'd also draw attention to the new location of this blog :) - I'll try to let everyone know what my intentions are with it soon enough :p.

-TheXenocide

Friday, March 9, 2007

Tracking Back and Moving Forward

bunnie’s blog » Blog Archive » Scritch scritch–huh?
First, thought I'd start the day off with a trackback to some unfortunate us politics that I wish would be different. Just follow the link, read the resources and formulate your own opinion, it's pretty obvious what it says.

Also, I've just recently seen "An Inconvenient Truth" the Al Gore global warming educational film. I feel that the film is a well put together, documented and scientifically backed cry for unity the likes of which is complicated by the greedy nature of our political system and it's "campaign contributions" (That's my own personal opinion, not directly expressed in the movie). This film clearly and truthfully (look up the data) indicates the insanely critical point we're at as a species and as members (the primary unbalancing ones at that) of a planetary ecosystem. I strongly suggest you watch it because I can't do as good a job as they do at stressing how important this is. Turns out scientists have had to sue to have their names removed from the report because their claims were censored and did not want to be considered supporters of the modified message. Also, Al Gore has owned share in the carbon offsetting business for quite some time. Sorry for the hasty statements.

beyond all that, in the Software Engineering and Development side of my brain I have been planning and planning more of the development of my research project and along the way I have stumbled upon several really really neat ideas for projects I'm sure other people will be interested in too. I only wish I had the time to work on them as well, but it seems I barely have enough time to work on my own commitments. This can also be assumed as a plea for somebody... anybody, to be my hero and organize these projects into being; I'm totally game for participating in the engineering process and things of that nature but I do not have enough time to be considered a significant help on actual implementation/coding. These projects, in the long run, can also be easily adapted into my infrastructure to make a distributed pervasive system who's usefulness will extend well into the era of grid and mesh computing (provided, of course, it is maintained and the same coding concepts apply :p). Enough beckoning, to the projects!

Hah! Tricked yah (not really, but there's a little bit of background information first :p)

If you haven't checked out IKVM.Net you should. It's a Java Virtual Machine that can dynamically interpret (JIT compile) and statically compile Java bytecode to .NET CIL (supporting both Mono and Microsoft's .NET Framework). I see this project as a tremendously important idea because it would bridge the gap of the oh so similar next generation programming languages and environments currently separated by a great chasm only vaguely crossable using J#. I haven't taken the opportunity to check into support for JRuby, Groovy, JACL or Jython but I do know that it is currently aimed at support for Java 1.4. Honestly I feel this project would get some tremendous headway if it were taken seriously and contributed to by the Java/Sun and Microsoft communities. There are other projects like Phalanger that do similar managed interoperability support and I love it, but Java is the one we really need guys. There's no reason for us to constantly be reinventing the wheel on different languages and platforms when we can just bridge them together in an efficient manner and let everyone use the language that will benefit them most without making it so nobody outside their little inner circle can use it. Anyway, this rant went a little long :p, my ideas:

I feel that IKVM could use help in the following areas:
-Migration to a J2SE 5 model
-Support for bridging the existing Java/Sun written runtime instead of the GNU Classpath (this is more of a political venture) since IKVM supports JNI this should work relatively well; in retrospect another option is to bridge the awt packages and native control libraries to .NET GDI+ (System.Drawing/System.Drawing.Drawing2D) and System.Windows.Forms base classes (System.Windows.Forms.Control). Note: it seems like this is further along then i remember, which is great, but it's still incomplete.
-Support for App.config settings to support local classpath definition for applications that don't use IKVM directly.
-Attributes to apply to .NET code (ie [IKVMPackage("something.whatever")]Something.Whatever) that would allow IKVM to better translate .NET code to Java calls and to allow things like making Java stubs of classes written in .NET that don't use a cli.* package so as to be able to replace existing Java packages with native .NET ones easily. Perhaps this should include other things like the ability to rename classes and interfaces (to support different naming standards, ie: [IKVMName("SomeInterface")]public interface ISomeInterface.
--I believe that the generated property accessors should also be more like standard Java bean definitions (void setProperty(type value); type getProperty()) instead of the standard CIL set_Property and get_Property.
--MulticastDelegates (events) should function more like Java events;
Thus C# event System.AppDomain.ProcessExit is the static Java function cli.System.AppDomain.add_ProcessExit().

This should translate to
cli.System.AppDomain.addProcessExitHandler(
new ProcessExitHandler() {
void ProcessExit(Object sender, EventArgs e) { /*blah*/ }
});
or a derivative that doesn't use an anonymous inner class.

I think this would be great especially since, with full swing support and JDK 1.5 support alongside better .NET support we could fully write .NET applications using things like NetBeans IDE and even potentially add debug support, hell maybe even J2EE. The reason I consider IKVM one of the best solutions to this is that a complete implementation for interoperability requires direct communicatioon/translation between virtual machines, not just service oriented architecture (as great and important as it is). After running some simple computational tests you find that running Java code that has been statically compiled to CIL runs tremendously faster in the Microsoft.NET and Mono CLRs than it does in Sun's own JVM. Unfortunately the complications of translating from one object base to another wind up slowing some things down a little bit (Like IComparable to Comparable conversion) but still IKVM runs much faster than I could ever imagine .NET running in the JVM. This would allow Java developers to leverage and take advantage of .NET benefits without losing the cross-platform (Mono) and language specific features they love.

Other than IKVM, another great project/standard to look at is JSON which is gaining popularity. There is currently a project to support JSON-RPC for .NET called Jayrock that is pretty full featured, but I had a great idea that would be a truly impressive and usefull .NET implementation of JSON-RPC. A JSON Serialization Formatter and JSON-RPC based remoting channel would be a much more applicable approach that would make JSON totally usable with .NET applications without having to modify any code (assuming they use App.config based remoting configuration).

If anybody were to create these projects I would certainly be able to leverage the technologies in my research which I aim to be able to run services, consumers, and even desktop environments on everything from ARM mobile processors to x64 breeds simply by using a very simple base extensibility framework that is currently .NET specific but I would love to bridge support to Java with. I've even considered using db4o databases with both (if they're still language compatible) the Java and .NET libraries as a means of providing a standard consistent persistence model that requires arbitrary conversion for the storage of objects. I haven't done a full architecture review on this though, so I'm not sure what part IKVM will play in relation to db4o (ie, running Java db4o with IKVM for Java apps and running .NET db4o with native .NET or using .NET db4o for both with IKVM stubs for Java and saving Java db4o for native JVM implementations).

I'm also desperately interested in information on how well Mono runs when compiled against Linux 2.4 and 2.6 for ARM/MIPS/SH processors, including how well Mono's WinForms run on it and if there are any Mono based "Compact Framework" builds. If there aren't any Compact Framework builds it's not really that big of a problem, but a windowing toolkit for mobile devices would be much appreciated :p.

Anyway, those are my ideas/requests/plans 8) people should learn to reply sometimes, lol.

-TheXenocide

Tuesday, March 6, 2007

24 Hour Idea Soup

The following is a brief recipe of disaster known as the information swirling about in this thin-walled cranium of mine. Today it'll be divided into sections since my interests and ideas are a little all over the place :p.

Voting Concerns


OMG! I have recently been made aware of the voting travesty that has been taking place in our country. I'll let you do your own research because I'm not a fan of pushing "Conspiracy Theory" agendas, but the voting process in our country is diluted by an insecure, closed door system where commercial funding and part representation may play a huge factor in the reliability of voting machines or counts in precincts. One site that you might look at for some background information is BlackBoxVoting.com though i strongly urge you to look at more points of view (please, please, please! don't ever sit on one resource and assume it to be true) there is a plethora of information out there and unfortunately, it is the responsibility of each of us to review this information in our own process and come to our own conclusions.

I do not tread lightly on the subject of voting, I've been a big fan and supporter of Democracy for some time now and to find that our system just plain isn't good enough truly frightens me. If our voting process doesn't represent who we are then what is it that truly makes us American? Over-stimulated economy? Corporately backed law-makers? Ego-centric America knows-best attitudes in world affairs that allow us to inject ourselves into any global politics without any true rhyme or reason? None of these things are American; if anything they go against the general premise of America, which was to keep everything fair and provide open opportunity to all.

Now complaining of course, will do nothing to solve the problem. We are to formulate ideas of solutions and act accordingly as good American citizens. It is this process that frequently gets overlooked as very rarely does anybody feel like they alone will make a difference. Well I'm here to share my idea for a solution with you and I would be very interested in your ideas for solutions as well. This is what our country is supposed to be about.

Personally, I propose that we establish (bare with me) an Open Source project designed, directed, written, managed, tested, reviewed and accepted by the American people. We have the technology to provide significantly more secure systems. I know it seems odd to propose openly publishing something that could be so severely exploited, but I feel that public review and analysis is the only way for us to establish the fact that we, the American people, are satisfied with our voting system. If we're not satisfied with our voting process we should be able to do something about it. I submit that we are perfectly capable of developing the necessary software, hardware, and processes all in an openly reviewable process that would consist of thorough secure design with full logging, secure data transfer, tamper/intrusion detection. I propose that we require more than one person to use a secure and uniquely identifiable data transfer medium in which all of the data distributed across multiple storage mediums cared for by separate people to transfer data from each polling machine to each tabulation machine. Furthermore, I submit that, since the entire design would be open to public review, the fabrication, installation, and maintenance of all voting related materials should be viewable on video by the American people all the time. If we can keep constant surveillance of the devices and know matter-of-factly that there is no way somebody has tampered with our votes then we can be reassured that we have the power to prevent a travesty like this from ever happening again. If anybody is supportive of this proposal please let me know so that we might begin to formulate a plan of action (As interested as I am in it, I'm pretty awful at this Government stuff, too much confusion legal terminology and enigmatic processes wind up leaving me a little lost on the official paperwork side).

Too Much to Do, Never Enough Time

As of late I've had such a diverse interest in topics and I've wanted to know more and more about these topics. My general interests have always been diverse, but typically in diversity you find a lack of specialization (the "Jack of All Trades" syndrome) and so I invest the majority of my time in Computer Science because I thoroughly enjoy engineering new systems and have always had a knack for it. Well I've been more and more interested about what happens when I'm sleeping (I wake up with a lot of answers, not knowing how I postulated them) and my subconscious processes. Along my travels studying said interest I've also stumbled upon several resources about "Lucid Dreaming" and now I'm starting to think... could this be a solution to my lack of thinking time? Might I begin to utilize this construct of my mind while my body rests to continue where I left off? I'm definitely interested in what people have to say on the topic, especially if they have had any experiences being lucid, though I consider myself too inexperienced to share more than the wikipedia entryI've found for lack of being able to verify the validity of information. At least with wikipedia they provide the necessary resources for you to verify the information yourselves.

AJAX with Java Made Easy

On the development note I noticed a neat NetBeans module DWR NetBeans plugin Seems to demonstrate a pretty easy to use AJAX model with Java; good to see active competition here. I'm wondering, has anybody done a compare and contrast against the Java and .NET AJAX implementations? Perhaps I'll find some time to look into it later.

I'm running low on time (I invested a little extra time in the voting segment because I feel it is absolutely essential we iron this out) so I'll have to cut things a little short, but there's enough here to mull over :).

Thanks and TTFN,

-TheXenocide

Wednesday, February 28, 2007

Extracurriculars

I figured another great place to start with this blogging thing is to introduce people to the other projects I'm working on/helping with as well as a couple places I'm frequently found online.

Excluding my research I am currently helping with the engineering and development of the following projects:

Project Link (website currently down) - This project was inspired a good friend of mine that goes by the name of Xemberad (some Furcadia nuts out there might recognize the name :p). The goal is to create a game engine/platform that we will use to re-create the fun and feel of The Legend of Zelda: A Link to the Past as an immersive MMOG. The project has been through some ups and downs but we're working on redesigning the architecture of the engine (we first started this project when we weren't quite as capable as we are now) and we're really excited about the ideas being mapped out.

XFighter (website coming soon) - If anybody has ever played M.U.G.E.N. you know how awesome and fun it is to be able to set up dream matches in a customizable 2d fighting engine. Well my beastly Athlon 64x2 with 2GB Dual Channel DDR and dual GeForce 7600GT cards was struggling to run it recently; based on the animation frame timing patterns (since sometimes it runs slow enough to see them) as well as how input processing seems to work and a minor hint from the process manager it seems M.U.G.E.N. is not only no longer (if ever) open source, but it seems to be a single threaded application with nested loops. Our goal is to make a much more modern 2d fighting engine that will be completely extensible (note the use of extensible instead of customizable, this application will be designed using provider style design patterns and dynamic extension loading in mind). We've got a lot of ideas but the project is still in it's early stages, keep your eye out for updates :p

with my ever apparent shortage of time these days that's all I can really invest my time in right now, but I have a tendency to troll around several IRC channels (some I visit most weekdays, others I drop in from time to time); if you're ever interested in discussing any ideas about the above projects or anything else for that matter drop by for a bit :). These are the channels I frequent:

Server: Americhat (irc.americhat.net)
Channel: #genscripts Link
#genscripts is my home on the internet, it's full of great thinkers and skilled coders of all shapes and sizes and they're just generally fun people too. There's a lot of mIRC development that occurs in there, but really there's everything from PHP developers to realtime concurrent systems developers and everybody brings something worthwhile to the table.

Server: DALNet (irc.dal.net)
Channel: #partyhouse Link
#partyhouse is the very first IRC channel I ever entered back in the mid-'90s and, while I've taken a few hiatuses from it I always go back when I get the chance. To enjoy chilling in #partyhouse I recommend you remain open minded and bring your sense of humor, it's not all developers but there's some intellect present if you need it :).

Server GIMPNet (irc.gimp.net)
Channel: #mono-winforms Link
#mono-winforms is home of the Mono Windows Forms team. These guys are working hard to make it so that rich UI applications written against the Microsoft-designed .NET Framework can be run on Linux and Mac operating systems without the stress of using third party toolkits. They're not done but they get my respect; if I had enough time to choose another project to contribute to, this would be it. Just trolling in the channel I have become a part of many intellectual and thought provoking conversations and I enjoy all of the people who spend time there.

That's all for today folks :p - if you have any interest in any of the projects I'm on let me know, either by commenting or by finding me in one of the IRC channels mentioned above. Help is always appreciated :)

-TheXenocide

Tuesday, February 27, 2007

Quick Thought

Being brief tonight because I still have work to do, but if anybody reads this and knows of a solution or is inspired (and has the time :p) to make a solution, please please please let me know. Basically I wish there was better support for XMI export and/or source generation for Visio 2003 UML Models because it's a cheaper program I can use at home (I'm not exactly rolling in cash) for projects. Searching around it seams Microsoft has written an Add-In for Visio, but it appears as though the features are a bit lackluster for real usage :'(.

Anyway, I must be off :*

<edit>
I've also been using SVN a lot lately (free and whatnot :p) and I was really impressed with #develop's TortoiseSVN integration but I wanted to see if I could do the same with Visual Studio (cheaper than relying on VSS or TFS). In the process I've stumbled on AnkhSVN which I haven't been able to test yet, but it seems like a perfect candidate and it is now a stable release. I'll try to post back with my experiences. I'd also like to take a look at GForge's project management capabilities; it seems really useful but I've had some difficulties getting it set up myself (more about GForge another time).

</edit>

-TheXenocide

Monday, February 26, 2007

I Am Xeno

Welcome creatures of the internet; this is the newfound home of TheXenocide. I had some spare time whilst waiting for someone to get back to me in the office and I decided that I would start a blog :).

Who? Online I go by TheXenocide; if my real name is ever of any pertinence simply bring it to my attention and we can work things out ;). I am a Software Engineer in the Mid-Atlantic region of the United States currently working full time and finishing my undergraduate course load part time. I've been tinkering with code since about 1992 when my stepfather introduced me to Basic, since that day my interest in computer science has never waned. Beyond all the professional crap though, I'm a generally fun loving, relaxed, easy to get along with guy who likes to hang out with friends, play video games, eat/cook good food, travel and most importantly learn. I've always said I never met a boring subject, just a boring teacher.

Why? To be honest, I'm not really sure; I've tried it before and wound up not liking the situation it put me in. Maybe I want people to see all the cool ideas I have, maybe I want to help software engineers and developers in the same ways other blogs have helped me, maybe I just need a place to vent. In reality it's probably some twisted cocktail of all of these and some whiskey sour from someplace in my subconscious.

What? This blog is my brain dump; you're liable to find anything from random events in my life to cool websites i stumble upon to generally useful software engineering concepts and the status of my personal projects.

When? Whenever; If you're that interested in keeping up with my posts I'd recomend some sort of RSS reader because I have absolutely no idea how often I will be posting.

... so... let's get started ;)

As of late, I've been working for a wonderful company that takes pretty good care of me. I'm really happy that I finally found a job that would take my experience seriously; Previously I've had several internships where the employers decided to treat me like some kid who didn't know anything; when I finally demonstrated my worth to them these companies saw nothing more than better slave labor and started asking more and more of me while treating me the same. Finally I'm free.

Outside of work I have also been working on a research project for some time. By some time, I wouldn't say my work is very close to complete, much of my time has been spent trying to plot and calculate the best ways to design my system and playing with features of various programming languages and platforms here and there to ensure my ideas are headed down the right path. The topic of my research is deeply connected with some of my theories on the recursive nature of existence and many repetitive occurrences in mankind's history. I'm sure there'll be more details later, but to give the topic as short and sweet as possible I'll be using a lot of big words :p--I am working on a "Multi-Language Pervasive Distributed Extensibility Platform" that I hope to use (and to see others use) to tackle many common compatibility problems engineers, developers and even users face today.

When I'm not attached to a computer (or rather, when I'm attached to less computers, seeing as how my PDA Phone is pretty much always by my side) I love watching Anime, Adult Swim cartoons, Comedy and most recently Heroes (AKA the greatest show on the planet!). I also enjoy reading, though I can rarely find time for it anymore, and I absolutely love (for some reason) driving around... Book-wise I enjoy Sci-Fi, Fantasy, and Non-Fiction (computer books sound a lot more boring then they really are :p), more specifically I absolutely love Orson Scott Card's work (did anybody notice "The Xenocide"/TheXenocide :p) and I'm not at all ashamed to say I also really enjoy the Harry Potter books by J.K. Rowling. I also spend a fair bit of time watching Discovery Channel's awesome science, math and physics shows and studying up on beginner String Theory, Quantum Mechanics and general Physics.

That's pretty much all of me (at least all of me that I could think of or rationalize placing in a single post) so, in closing, I'll leave you with some of my favorite quotes:

"What lies behind us and what lies before us are tiny matters compared to what lies within us" - Ralph Waldo Emerson

"Love is Like War - Easy to Start, but Hard to Stop" - Some Fortune Cookie a long time ago.

and some of my more recent media favorites:

Waking Life - great movie, a really fun approach to philosophy.

A Scanner Darkly - also a great movie, directed and co-written by the director/writer of Waking Life; it's a little jumpy and, in my opinion, not quite as good as Waking Life, but still worth watching.

What the BLEEP!?: Down the Rabbit Hole - Absolutely awesome introduction to quantum mechanics but truly just an interesting work. Take it with a grain of salt and anything that sparks your interest should be something you take the time to research a little yourself, don't just take the things said as fact, but rather immerse yourself in a creative thinking environment, otherwise you may miss the point.

With that I think I'll call it a day (especially since it's time to get back to work :p),

-TheXenocide