16 8143
Japcuh wrote: How do you write self modifying code in Java?
What do you mean by "modify?" A Java program can
extend itself by loading new classes on the fly, if
that suits your needs.
-- Er*********@sun .com ja****@gmail.co m (Japcuh) wrote in news:3a8cbb2e.0 407021131.55805 361
@posting.google .com: How do you write self modifying code in Java?
You may want to check out the Java code generation library cglib: http://cglib.sourceforge.net/
Best Regards
Kristian Larsen
On Sat, 03 Jul 2004 15:49:21 GMT, kjc <ks*****@elp.rr .com> wrote or
quoted : No, but this could be done in Smalltalk blind folded.
Japcuh wrote: How do you write self modifying code in Java?
Is it a problem that you sometimes do it accidentally?
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary. an************@ gmail.com (Andrew Chambers) wrote in message news:<f3******* *************** **@posting.goog le.com>... ja****@gmail.co m (Japcuh) wrote in news:3a8cbb2e.0 407021131.55805 361 @posting.google .com:
How do you write self modifying code in Java?
http://java.sun.com/developer/techni...leases/j2se15/
The metadata bit of this seems to suggest that in future releases of java, you'll be able to generate actual source code on the fly.
I think the metadata is for hints for documentation generation.
I could be wrong.
But I'd hate to work out a security system for Java if they allow the
code to modify itself. Dynamically extending classes is plenty.
kjc <ks*****@elp.rr .com> wrote in message news:<5A******* **********@fe1. texas.rr.com>.. . No, but this could be done in Smalltalk blind folded.
You can use Java Reflection which is Java's counterpart to Smalltalk's
perform: concatenate some strings to create an existing method name
and call that method. Or you can use the command pattern and add
commands as required to a list and execute them sequentially.
Cheers, Oliver
Japcuh wrote: How do you write self modifying code in Java?
Japcuh (Just Another Perl C Unix Hacker) http://www.catb.org/~esr/faq/hacker-howto.htm#what_is .0. ..0 000 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: qwweeeit |
last post by:
Hi all,
when I was young I programmed in an interpreted language that allowed
to modify itself.
Also Python can (writing and running a module, in-line):
fNew =open("newModule.py",'w')
lNew=
fNew.writelines(lNew)
fNew.close()
|
by: Joel Jose |
last post by:
agreed the 'mutation engine' by dark avenger was a real deadly
master-code piece..,
but then.. if one could create a self mutating code..in real
time then i think it would just b the most technical advancement of
this century!!!
just think...
instead of those nagging.. and more irritating than
helpfull death screen(error logs).. that windows shows every other
time.. if it could evolve itself to cope up with the error..
if the pe...
|
by: Ralf W. Grosse-Kunstleve |
last post by:
My initial proposal
(http://cci.lbl.gov/~rwgk/python/adopt_init_args_2005_07_02.html) didn't
exactly get a warm welcome...
And Now for Something Completely Different:
class autoinit(object):
def __init__(self, *args, **keyword_args):
self.__dict__.update(
|
by: Robin Becker |
last post by:
When young I was warned repeatedly by more knowledgeable folk that self
modifying code was dangerous.
Is the following idiom dangerous or unpythonic?
def func(a):
global func, data
data = somethingcomplexandcostly()
def func(a):
return simple(data,a)
|
by: AES |
last post by:
Can an HTML web page dynamically modify its own code?
(without resort to Java or any other non-HTML complexities)
That is, is there any provision in HTML such that a single
"Next" button on a main or index.html page will:
a) Change an image displayed on that page (say Picture_1.jpg)
to the next image in a sequence (say Picture_2.jpg), AND
| |
by: jon |
last post by:
I am a beginner C programmer, this is actually my first programming
lanugage, besides html, cgi, and javascript. I am looking for a way to
make an .exe file, or a copy of my own file. I have tried writing a
file, compling it, and reading it in a notepad, then writing a program
to write it again, but i have had no luck. I assure you i'm not trying
to create the next big virus, or worm, but only trying to expaned my
knowledge on what...
|
by: IUnknown |
last post by:
Ok, we are all aware of the situation where modifying the folder
structure (adding files, folders, deleting files, etc) will result in
ASP.NET triggering a recompilation/restart of the application.
In a nutshell, I understand how this can be considered desireable by
some, but I am not one of those people.
My situation is that we have a root site (hosted @ http://www.mydomain.com)
in the root application folder '/'.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |