introspection

access to .swf API

Given a .swf file, is there a way to inspect the API provided? I have a FLASH .swf file on a web-page that plays .mp3 and I'd like to control playback through a Google Chrome extension but it seems I can't find documentation on their API. ...

Django get a model's fields

Hi All, Given a Django model, I'm trying to list all of it's fields. I've seen some examples of doing this using the _meta model attribute, but doesn't the underscore in front of meta indicate that the _meta attribute is a private attribute and shouldn't be accessed directly? ... Because, for example, the layout of _meta could change...

How can I walk the method call to an Action, Func, or Delegate in introspector for a custom rule?

I'm writing a custom rule to verify the constructor of any control type calls initialize component. But when I hit these 2 edge cases: public Form1(int? testInt,bool testBool,bool testBool2) : this(false) { Action init = ( ) => InitializeComponent( ); init(); } public Form1(int? testInt, bool testBoo...

Functional programming languages introspection

I'm sketching a design of something (machine learning of functions) that will preferably want a functional programming language, and also introspection, specifically the ability to examine the program's own code in some nicely tractable format, and preferably also the ability to get machine generated code compiled at runtime, and I'm won...

Can one access the template parameter outside of a template without a typedef?

A simple example: template<typename _X> // this template parameter should be usable outside! struct Small { typedef _X X; // this is tedious! X foo; }; template<typename SomeSmall> struct Big { typedef typename SomeSmall::X X; // want to use X here! SomeSmall bar; X toe; }; Is there a way to access the template paramet...

Is there a high-level profiling module for Python?

I want to profile my Python code. I am well-aware of cProfile, and I use it, but it's too low-level. (For example, there isn't even a straightforward way to catch the return value from the function you're profiling.) One of the things I would like to do: I want to take a function in my program and set it to be profiled on the fly while ...

Ruby method interception

I want to intercept method calls on a ruby-class and being able to do something before and after the actual execution of the method. I tried the following code, but get the error: MethodInterception.rb:16:in before_filter': (eval):2:inalias_method': undefined method say_hello' for classHomeWork' (NameError) from (eval):...

introspection - table name of an object managed by Hibernate (JavassistLazyInitializer)

I want to get through introspection the table name of an object managed by Hibernate (in lazy). my object contains "org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer" in the property handler. my object is of type "mypackage.myObjectDO_ _javassist_2 $ $" and does not contain the annotations that the class "mypackage.myObjectDO...

Invoke static method using Introspection in Flex

All, While this is similar to another post, that post (does not indicate how to perform this (if it can be done) without instantiating an object. Also, without success I have tried multiple variations on the theme of: class[method](arg) class[method].call(arg) method.apply(class, arg) I am new to Flex, but have used Reflection in bo...

Runtime introspection of linked SWC using ActionScript 3.0 + Flash/Flex

Wow, my first post on Stack Overflow. Have I "arrived"? Okay, this is an oddball. I'm trying to determine whether there might be some programmatic way to introspect the classes within a linked SWC at runtime. To give a little more background (maybe there's a completely different way to go about doing this), I'm considering a general fr...

What are methods of programmatically detecting many-to-many relationships in a RDMBS?

Hello stackoverflow, I'm currently busy making a Python ORM which gets all of its information from a RDBMS via introspection (I would go with XRecord if I was happy with it in other respects) — meaning, the end-user only tells which tables/views to look at, and the ORM does everything else automatically (if it makes you actually write s...

In Moose, how can I tell whether one object's class is a subclass of another object's class?

Suppose I have two objects $obj1 and $obj2 that are both instances of Moose classes. I want to find out which of the following applies: $obj1's class is the same as $obj2's; $obj1's class is a subclass of $obj2's; $obj1's class is a superclass of $obj2's; Neither object's class is a subclass of the other's. How can I do this? ...

Is it possible to determine which class a function is a method of?

For example, if I'm decorating a method like so def my_decorator(fn): # Do something based on the class that fn is a method of def decorated_fn(*args, **kwargs): fn(*args, **kwargs) return decorated_fn class MyClass(object): @my_decorator def my_method(self, param): print "foo" Is it possible i...

Viewing the code of a Python function

Let's say I'm working in the Python shell and I'm given a function f. How can I access the string containing its source code? (From the shell, not by manually opening the code file.) I want this to work even for lambda functions defined inside other functions. ...

Flash Builder 4 Web Service Introspection for dynamic wsdl location

In Flex 3, introspecting a web service resulted in a constructor that allowed the location of the web service to change at runtime. It appears that the Web Service introspection tool now only allows the single WSDL URI that was specified in the WS Wizard. It this the case or am I just missing something? Flex 3 introspected services wo...