runtime

In Java, is there any disadvantage to static methods on a class?

Lets assume that a rule (or rule of thumb, anyway), has been imposed in my coding environment that any method on a class that doesn't use, modify, or otherwise need any instance variables to do its work, be made static. Is there any inherent compile time, runtime, or any other disadvantage to doing this? (edited for further clarificati...

Creating/compling .net data class within an application

Is there a pattern, Xml structure, architecture technique we can use to create simple data holder class code that we can deserialise to/from and do that at runtime? We're in the early design stage of a .Net project and one of our goals is to make the resulting system extensible through configuration without needing a developer. We need ...

JAVA and how to execute user-code

Hello. I am building a tool which should do a diagnosis based on some values... It should be user extensible so hardcoding the conditions isnt a solution... Suppose that we have a blood test... example ... WBC , ALDO ... And i want the user to be able to write somehow scripts if (WBC.between(4,10) && ALDO.greater(5) || SOMETHINGELESE....

Trying to load a DLL with LoadLibrary and get R6034 "An application has made an attempt to load the C runtime library incorrectly"

I'm writing a wrapper program that loads Winamp input plugins. I've got it working well so far with quite a few plugins, but for some others, I get an error message at runtime when I attempt to call LoadLibrary on the plugin's DLL. (It seems to happen mostly with plugins that were included with Winamp.) A dialog appears and gives me t...

convincing C# compiler that execution will stop after a member returns

I don't think this is currently possible or if it's even a good idea, but it's something I was thinking about just now. I use MSTest for unit testing my C# project. In one of my tests, I do the following: MyClass instance; try { instance = getValue(); } catch (MyException ex) { Assert.Fail("Caught MyException"); } instance.d...

how to run/compile java code from JTextArea at Runtime? ----urgent!!! college project

I have a JInternalFrame painted with a BufferedImage and contained in the JDesktopPane of a JFrame.I also have a JTextArea where i want to write some java code (function) that takes the current JInternalFrame's painted BufferedImage as an input and after doing some manipulation on this input it returns another manipulated BufferedImage t...

How can create summary footer on runtime?

I use TcxGrid I have create fields on execution time because I have a pivot query and columns are variable I filled my grid like theese codes grdCevapDBTableView2.BeginUpdate; grdCevapDBTableView2.ClearItems; fillGridView(grdCevapDBTableView2,command); grdCevapDBTableView2.DataController.CreateAllItems; grdCevapDBTableView2.EndUpdate; ...

Spring.net - how to choose implementation of interface in runtime ?

Hi, in all examples of spring.net IoC i can see something like this: interface IClass; class ClassA : IClass; class ClassB : IClass, and then in config.xml file something like [object id="IClass" type="ClassB, Spring.Net.Test" /] but, i really need to do something like this: in config file there will be more implementations if i...

Is it possible to load an assembly targeting a different .NET runtime version in a new app domain?

Hello, I've an application that is based on .NET 2 runtime. I want to add a little bit of support for .NET 4 but don't want to (in the short term), convert the whole application (which is very large) to target .NET 4. I tried the 'obvious' approach of creating an application .config file, having this: <startup useLegacyV2RuntimeActiv...

javascript pausing consistently. How do I find what is causing it to pause?

I've got a fairly ajax heavy site and I'm trying to tune the performance. I have a function that runs between 20 & 200 times, depending on the user. I'm outputting the time the function takes to execute via console.time in firefox. The function takes about 4-6ms to complete. The strange thing is that on my larger test with 200 or ...

How to detect the existence of a class at runtime in .NET?

Is it possible in a .NET app (C#), to conditionally detect if a class is defined at runtime? Sample implementation - say you want to create a class object based on a configuration option? ...

Make instance of class in java at runtime

In my program I generate classes dynamically but when I try: String[] args = {"-d","D:\\path\\build\\classes","-s","D:\\path\\src","http://services.aonaware.com/DictService/DictService.asmx?WSDL"}; WsImport.doMain(args); URL url = new URL("file:D:/path/build/classes/com/aonaware/services/webservices/"); URLClassLoader urlClassLoader = n...

Creating Delphi Objects at runtime based on class type

Is it possible to create objects at runtime based on it's type by calling a method. What I am trying to achieve is var lForm1 : TForm; lForm2 : TForm; begin CreateObjects([lForm1, lForm2]); // After this call I have the variables initialized and I can use them. end; ...

Insert custom TypeConverter on a property at runtime, from inside a custom UITypeEditor

I've created a custom UITypeEditor. Can I possibly insert an attribute that also attaches a TypeConverter to my property from inside the UITypeEditor class? I've tried the following, but nothing happens, no matter how I twist and turn it: Attribute[] newAttributes = new Attribute[1]; newAttributes[0] = new TypeConverterAttribute(type...

Changing code at runtime

I have a pointer to a function (which i get from a vtable) and I want to edit the function by changing the assembler code (changing a few bytes) at runtime. I tried using memset and also tried assigning the new value directly (something like mPtr[0] = X, mPtr[1] = Y etc.) but I keep getting segmentation fault. How can I change the code?...

New to Android - Drawing a view at runtime

HI all, I'm just getting started with developing for Android. I'm looking to port one of my iPhone applications, but I'm kind of at a loss for how to draw a view at runtime (a view not declared in the XML). Basically, I want to draw a simple rectangle, but then be able to manipulate its frame after being drawn. Sorry if this is a real...

Runtime binding of XML Schema to Java code

Hi all, The situation is thus: I have an application which provides editing capabilities to XML an file. This file follows a certain Schema. The Schema belongs to a subset of Schemas which actually follow a line of evolution from one to another - so they are not so different from one another. The main difference between the schemas is...

Runtime.getRuntime.exec() problem with running Word document

Hello everybody! when I write in commandline in windows: C:\Program Files (x86)\Microsoft Office\Office12>winword.exe /mOpenPage c:\Navod ilo.doc It starts the word document with the macro /mOpenPage. I want to do the same thing from Java but its not going. String[] cmd = {"cmd","/c","c:\\Program Files (x86)\\Microsoft Office\\Off...

How to open word document with /m "Macro argument" from java/or command-line without to specifi winword.exe path

I want to do the next thing: String[] cmd = {"cmd","/c","c:\\Program Files (x86)\\Microsoft Office\\Office12\\WINWORD.exe","/mOpenPage","c:\\Navodilo.doc"}; Process proc = Runtime.getRuntime().exec(cmd); But, without to specify the winword.exe path but open the document with the macro... I read that there exist Auto Open...

Do fluent interfaces significantly impact runtime performance of a .NET application?

I'm currently occupying myself with implementing a fluent interface for an existing technology, which would allow code similar to the following snippet: using (var directory = Open.Directory(@"path\to\some\directory")) { using (var file = Open.File("foobar.html").In(directory)) { // ... } } In order to implement su...