473,774 Members | 2,275 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Self Modifying Code

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
Jul 17 '05
16 8144
Check out this package:

http://jakarta.apache.org/bcel/
"Japcuh" <ja****@gmail.c om> wrote in message
news:3a******** *************** ***@posting.goo gle.com...
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

Jul 17 '05 #11
ja****@gmail.co m (Japcuh) wrote in message news:<3a******* *************** ****@posting.go ogle.com>...
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


It's nowhere near as easy as it is in Perl.

If you look at JDBC you'll see that there's a call to Class.forName()
to load the driver class. That may be of use to you. It's sort of an
'import' on the fly.
Jul 17 '05 #12

"Japcuh" <ja****@gmail.c om> wrote in message
news:3a******** *************** ***@posting.goo gle.com...
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


Look up "Javassist" on google. Its what JBoss 4.0 uses to do dynamic aspect
weaving and dynamic remote proxy generation among other things. By the way,
for those who have used cglib, can you point toward some good online docs?
I have been unable to find any I found adequate. Javassist has pretty good
docs however.

l8r, Mike N. Christoff

Jul 17 '05 #13
ja****@gmail.co m wrote...
How do you write self modifying code in Java?


If it's truly self-modifying, good luck debugging it.
Jul 17 '05 #14
Entropy <en*****@domain .invalid> scribbled on the stall wall:
ja****@gmail.co m wrote...
How do you write self modifying code in Java?


If it's truly self-modifying, good luck debugging it.


the simple answer is "you can't"...self modifying code hasn't really been
feasible since the fortran 4 days...or maybe in C but that is still
platform dependent.

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Jul 17 '05 #15
no***@uber.usac hoice.net wrote...
Entropy <en*****@domain .invalid> scribbled on the stall wall:
ja****@gmail.co m wrote...
How do you write self modifying code in Java?


If it's truly self-modifying, good luck debugging it.


the simple answer is "you can't"...self modifying code hasn't really been
feasible since the fortran 4 days...or maybe in C but that is still
platform dependent.


I recall the capacity of LISP-like functional languages (ie, Scheme)
to dynamically generate new functions and apply them.

It was a long time ago when I sat in that class, however, and I've
never used such a language outside of the classroom.
Jul 17 '05 #16


Wiseguy wrote:
Entropy <en*****@domain .invalid> scribbled on the stall wall:
ja****@gmail. com wrote...
How do you write self modifying code in Java?


If it's truly self-modifying, good luck debugging it.

the simple answer is "you can't"...self modifying code hasn't really been
feasible since the fortran 4 days...or maybe in C but that is still
platform dependent.


Java "modifies itself" every time it loads a new class
definition. An important point is that the decision to load
a class is made at run time, not at a "link time."

A Java program can even generate an array of bytecodes
at run time, turn them into a class, and create objects of
that class; see defineClass() in java.lang.Class Loader.

--
Er*********@sun .com

Jul 17 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
8321
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()
2
4282
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...
18
2285
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(
13
2131
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)
12
4823
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
10
5155
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...
5
2640
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 '/'.
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
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...
0
10106
jinu1996
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...
1
10039
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,...
1
7463
isladogs
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...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.